diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..e6805c3
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..2a6673c
--- /dev/null
+++ b/.project
@@ -0,0 +1,53 @@
+
+
+ Minecraft Client
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
+
+ libraries
+ 2
+ $%7BPARENT-1-PROJECT_LOC%7D/libraries
+
+
+
+
+ -2486028203069162932
+
+ 9
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-src
+
+
+
+ -2486028203069162931
+
+ 9
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-jars
+
+
+
+ -2486028203069162930
+
+ 9
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-source
+
+
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..fb58fda
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,14 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabledorg.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/Client.launch b/Client.launch
new file mode 100644
index 0000000..b4ae3ed
--- /dev/null
+++ b/Client.launch
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/net/minecraft/client/MinecraftApplet.class b/bin/net/minecraft/client/MinecraftApplet.class
new file mode 100644
index 0000000..f6e5e58
Binary files /dev/null and b/bin/net/minecraft/client/MinecraftApplet.class differ
diff --git a/bin/net/minecraft/isom/IsomPreviewApplet.class b/bin/net/minecraft/isom/IsomPreviewApplet.class
new file mode 100644
index 0000000..0ef6fec
Binary files /dev/null and b/bin/net/minecraft/isom/IsomPreviewApplet.class differ
diff --git a/bin/net/minecraft/src/AxisAlignedBB.class b/bin/net/minecraft/src/AxisAlignedBB.class
new file mode 100644
index 0000000..d783f9a
Binary files /dev/null and b/bin/net/minecraft/src/AxisAlignedBB.class differ
diff --git a/bin/net/minecraft/src/Block.class b/bin/net/minecraft/src/Block.class
new file mode 100644
index 0000000..309a608
Binary files /dev/null and b/bin/net/minecraft/src/Block.class differ
diff --git a/bin/net/minecraft/src/BlockBookshelf.class b/bin/net/minecraft/src/BlockBookshelf.class
new file mode 100644
index 0000000..f5dc9f1
Binary files /dev/null and b/bin/net/minecraft/src/BlockBookshelf.class differ
diff --git a/bin/net/minecraft/src/BlockBreakable.class b/bin/net/minecraft/src/BlockBreakable.class
new file mode 100644
index 0000000..98f1cc1
Binary files /dev/null and b/bin/net/minecraft/src/BlockBreakable.class differ
diff --git a/bin/net/minecraft/src/BlockChest.class b/bin/net/minecraft/src/BlockChest.class
new file mode 100644
index 0000000..28e1004
Binary files /dev/null and b/bin/net/minecraft/src/BlockChest.class differ
diff --git a/bin/net/minecraft/src/BlockContainer.class b/bin/net/minecraft/src/BlockContainer.class
new file mode 100644
index 0000000..75b6697
Binary files /dev/null and b/bin/net/minecraft/src/BlockContainer.class differ
diff --git a/bin/net/minecraft/src/BlockCrops.class b/bin/net/minecraft/src/BlockCrops.class
new file mode 100644
index 0000000..2ffa0a2
Binary files /dev/null and b/bin/net/minecraft/src/BlockCrops.class differ
diff --git a/bin/net/minecraft/src/BlockDirt.class b/bin/net/minecraft/src/BlockDirt.class
new file mode 100644
index 0000000..f03defd
Binary files /dev/null and b/bin/net/minecraft/src/BlockDirt.class differ
diff --git a/bin/net/minecraft/src/BlockDoor.class b/bin/net/minecraft/src/BlockDoor.class
new file mode 100644
index 0000000..98ca75a
Binary files /dev/null and b/bin/net/minecraft/src/BlockDoor.class differ
diff --git a/bin/net/minecraft/src/BlockFarmland.class b/bin/net/minecraft/src/BlockFarmland.class
new file mode 100644
index 0000000..8bfec8c
Binary files /dev/null and b/bin/net/minecraft/src/BlockFarmland.class differ
diff --git a/bin/net/minecraft/src/BlockFire.class b/bin/net/minecraft/src/BlockFire.class
new file mode 100644
index 0000000..38f7cfc
Binary files /dev/null and b/bin/net/minecraft/src/BlockFire.class differ
diff --git a/bin/net/minecraft/src/BlockFlower.class b/bin/net/minecraft/src/BlockFlower.class
new file mode 100644
index 0000000..3fcebcb
Binary files /dev/null and b/bin/net/minecraft/src/BlockFlower.class differ
diff --git a/bin/net/minecraft/src/BlockFlowing.class b/bin/net/minecraft/src/BlockFlowing.class
new file mode 100644
index 0000000..9659500
Binary files /dev/null and b/bin/net/minecraft/src/BlockFlowing.class differ
diff --git a/bin/net/minecraft/src/BlockFluid.class b/bin/net/minecraft/src/BlockFluid.class
new file mode 100644
index 0000000..f43dc51
Binary files /dev/null and b/bin/net/minecraft/src/BlockFluid.class differ
diff --git a/bin/net/minecraft/src/BlockFurnace.class b/bin/net/minecraft/src/BlockFurnace.class
new file mode 100644
index 0000000..68b3c49
Binary files /dev/null and b/bin/net/minecraft/src/BlockFurnace.class differ
diff --git a/bin/net/minecraft/src/BlockGears.class b/bin/net/minecraft/src/BlockGears.class
new file mode 100644
index 0000000..c7e392f
Binary files /dev/null and b/bin/net/minecraft/src/BlockGears.class differ
diff --git a/bin/net/minecraft/src/BlockGlass.class b/bin/net/minecraft/src/BlockGlass.class
new file mode 100644
index 0000000..557ab65
Binary files /dev/null and b/bin/net/minecraft/src/BlockGlass.class differ
diff --git a/bin/net/minecraft/src/BlockGrass.class b/bin/net/minecraft/src/BlockGrass.class
new file mode 100644
index 0000000..9580f1f
Binary files /dev/null and b/bin/net/minecraft/src/BlockGrass.class differ
diff --git a/bin/net/minecraft/src/BlockGravel.class b/bin/net/minecraft/src/BlockGravel.class
new file mode 100644
index 0000000..fdec277
Binary files /dev/null and b/bin/net/minecraft/src/BlockGravel.class differ
diff --git a/bin/net/minecraft/src/BlockLadder.class b/bin/net/minecraft/src/BlockLadder.class
new file mode 100644
index 0000000..9ff01b4
Binary files /dev/null and b/bin/net/minecraft/src/BlockLadder.class differ
diff --git a/bin/net/minecraft/src/BlockLeaves.class b/bin/net/minecraft/src/BlockLeaves.class
new file mode 100644
index 0000000..f135e9f
Binary files /dev/null and b/bin/net/minecraft/src/BlockLeaves.class differ
diff --git a/bin/net/minecraft/src/BlockLeavesBase.class b/bin/net/minecraft/src/BlockLeavesBase.class
new file mode 100644
index 0000000..002661c
Binary files /dev/null and b/bin/net/minecraft/src/BlockLeavesBase.class differ
diff --git a/bin/net/minecraft/src/BlockLog.class b/bin/net/minecraft/src/BlockLog.class
new file mode 100644
index 0000000..5b0be4d
Binary files /dev/null and b/bin/net/minecraft/src/BlockLog.class differ
diff --git a/bin/net/minecraft/src/BlockMinecartTrack.class b/bin/net/minecraft/src/BlockMinecartTrack.class
new file mode 100644
index 0000000..6fcdd0c
Binary files /dev/null and b/bin/net/minecraft/src/BlockMinecartTrack.class differ
diff --git a/bin/net/minecraft/src/BlockMobSpawner.class b/bin/net/minecraft/src/BlockMobSpawner.class
new file mode 100644
index 0000000..83d828b
Binary files /dev/null and b/bin/net/minecraft/src/BlockMobSpawner.class differ
diff --git a/bin/net/minecraft/src/BlockMushroom.class b/bin/net/minecraft/src/BlockMushroom.class
new file mode 100644
index 0000000..53920e6
Binary files /dev/null and b/bin/net/minecraft/src/BlockMushroom.class differ
diff --git a/bin/net/minecraft/src/BlockObsidian.class b/bin/net/minecraft/src/BlockObsidian.class
new file mode 100644
index 0000000..d2a2846
Binary files /dev/null and b/bin/net/minecraft/src/BlockObsidian.class differ
diff --git a/bin/net/minecraft/src/BlockOre.class b/bin/net/minecraft/src/BlockOre.class
new file mode 100644
index 0000000..2b2586a
Binary files /dev/null and b/bin/net/minecraft/src/BlockOre.class differ
diff --git a/bin/net/minecraft/src/BlockOreBlock.class b/bin/net/minecraft/src/BlockOreBlock.class
new file mode 100644
index 0000000..a336cbb
Binary files /dev/null and b/bin/net/minecraft/src/BlockOreBlock.class differ
diff --git a/bin/net/minecraft/src/BlockSand.class b/bin/net/minecraft/src/BlockSand.class
new file mode 100644
index 0000000..c9b6e44
Binary files /dev/null and b/bin/net/minecraft/src/BlockSand.class differ
diff --git a/bin/net/minecraft/src/BlockSapling.class b/bin/net/minecraft/src/BlockSapling.class
new file mode 100644
index 0000000..ed57843
Binary files /dev/null and b/bin/net/minecraft/src/BlockSapling.class differ
diff --git a/bin/net/minecraft/src/BlockSign.class b/bin/net/minecraft/src/BlockSign.class
new file mode 100644
index 0000000..df7db30
Binary files /dev/null and b/bin/net/minecraft/src/BlockSign.class differ
diff --git a/bin/net/minecraft/src/BlockSponge.class b/bin/net/minecraft/src/BlockSponge.class
new file mode 100644
index 0000000..c862792
Binary files /dev/null and b/bin/net/minecraft/src/BlockSponge.class differ
diff --git a/bin/net/minecraft/src/BlockStairs.class b/bin/net/minecraft/src/BlockStairs.class
new file mode 100644
index 0000000..a91244b
Binary files /dev/null and b/bin/net/minecraft/src/BlockStairs.class differ
diff --git a/bin/net/minecraft/src/BlockStationary.class b/bin/net/minecraft/src/BlockStationary.class
new file mode 100644
index 0000000..c74431e
Binary files /dev/null and b/bin/net/minecraft/src/BlockStationary.class differ
diff --git a/bin/net/minecraft/src/BlockStep.class b/bin/net/minecraft/src/BlockStep.class
new file mode 100644
index 0000000..b045baf
Binary files /dev/null and b/bin/net/minecraft/src/BlockStep.class differ
diff --git a/bin/net/minecraft/src/BlockStone.class b/bin/net/minecraft/src/BlockStone.class
new file mode 100644
index 0000000..204159c
Binary files /dev/null and b/bin/net/minecraft/src/BlockStone.class differ
diff --git a/bin/net/minecraft/src/BlockTNT.class b/bin/net/minecraft/src/BlockTNT.class
new file mode 100644
index 0000000..49ff07d
Binary files /dev/null and b/bin/net/minecraft/src/BlockTNT.class differ
diff --git a/bin/net/minecraft/src/BlockTorch.class b/bin/net/minecraft/src/BlockTorch.class
new file mode 100644
index 0000000..4527888
Binary files /dev/null and b/bin/net/minecraft/src/BlockTorch.class differ
diff --git a/bin/net/minecraft/src/BlockWorkbench.class b/bin/net/minecraft/src/BlockWorkbench.class
new file mode 100644
index 0000000..02b17c6
Binary files /dev/null and b/bin/net/minecraft/src/BlockWorkbench.class differ
diff --git a/bin/net/minecraft/src/CanvasCrashReport.class b/bin/net/minecraft/src/CanvasCrashReport.class
new file mode 100644
index 0000000..e1af844
Binary files /dev/null and b/bin/net/minecraft/src/CanvasCrashReport.class differ
diff --git a/bin/net/minecraft/src/CanvasIsomPreview.class b/bin/net/minecraft/src/CanvasIsomPreview.class
new file mode 100644
index 0000000..d3c1400
Binary files /dev/null and b/bin/net/minecraft/src/CanvasIsomPreview.class differ
diff --git a/bin/net/minecraft/src/CanvasMinecraftApplet.class b/bin/net/minecraft/src/CanvasMinecraftApplet.class
new file mode 100644
index 0000000..3731e4c
Binary files /dev/null and b/bin/net/minecraft/src/CanvasMinecraftApplet.class differ
diff --git a/bin/net/minecraft/src/CanvasMojangLogo.class b/bin/net/minecraft/src/CanvasMojangLogo.class
new file mode 100644
index 0000000..e263199
Binary files /dev/null and b/bin/net/minecraft/src/CanvasMojangLogo.class differ
diff --git a/bin/net/minecraft/src/ChatLine.class b/bin/net/minecraft/src/ChatLine.class
new file mode 100644
index 0000000..3dafc05
Binary files /dev/null and b/bin/net/minecraft/src/ChatLine.class differ
diff --git a/bin/net/minecraft/src/Chunk.class b/bin/net/minecraft/src/Chunk.class
new file mode 100644
index 0000000..7609d3d
Binary files /dev/null and b/bin/net/minecraft/src/Chunk.class differ
diff --git a/bin/net/minecraft/src/ChunkCache.class b/bin/net/minecraft/src/ChunkCache.class
new file mode 100644
index 0000000..9e9113c
Binary files /dev/null and b/bin/net/minecraft/src/ChunkCache.class differ
diff --git a/bin/net/minecraft/src/ChunkLoader.class b/bin/net/minecraft/src/ChunkLoader.class
new file mode 100644
index 0000000..2ca13ee
Binary files /dev/null and b/bin/net/minecraft/src/ChunkLoader.class differ
diff --git a/bin/net/minecraft/src/ChunkPosition.class b/bin/net/minecraft/src/ChunkPosition.class
new file mode 100644
index 0000000..1ca4bfe
Binary files /dev/null and b/bin/net/minecraft/src/ChunkPosition.class differ
diff --git a/bin/net/minecraft/src/ChunkProviderGenerate.class b/bin/net/minecraft/src/ChunkProviderGenerate.class
new file mode 100644
index 0000000..ad5931a
Binary files /dev/null and b/bin/net/minecraft/src/ChunkProviderGenerate.class differ
diff --git a/bin/net/minecraft/src/ChunkProviderIso.class b/bin/net/minecraft/src/ChunkProviderIso.class
new file mode 100644
index 0000000..9095d23
Binary files /dev/null and b/bin/net/minecraft/src/ChunkProviderIso.class differ
diff --git a/bin/net/minecraft/src/ChunkProviderLoadOrGenerate.class b/bin/net/minecraft/src/ChunkProviderLoadOrGenerate.class
new file mode 100644
index 0000000..6cb1fa6
Binary files /dev/null and b/bin/net/minecraft/src/ChunkProviderLoadOrGenerate.class differ
diff --git a/bin/net/minecraft/src/ClippingHelper.class b/bin/net/minecraft/src/ClippingHelper.class
new file mode 100644
index 0000000..6b6ca14
Binary files /dev/null and b/bin/net/minecraft/src/ClippingHelper.class differ
diff --git a/bin/net/minecraft/src/ClippingHelperImplementation.class b/bin/net/minecraft/src/ClippingHelperImplementation.class
new file mode 100644
index 0000000..385ffdb
Binary files /dev/null and b/bin/net/minecraft/src/ClippingHelperImplementation.class differ
diff --git a/bin/net/minecraft/src/CompressedStreamTools.class b/bin/net/minecraft/src/CompressedStreamTools.class
new file mode 100644
index 0000000..13554c5
Binary files /dev/null and b/bin/net/minecraft/src/CompressedStreamTools.class differ
diff --git a/bin/net/minecraft/src/CraftingManager.class b/bin/net/minecraft/src/CraftingManager.class
new file mode 100644
index 0000000..a9d4299
Binary files /dev/null and b/bin/net/minecraft/src/CraftingManager.class differ
diff --git a/bin/net/minecraft/src/CraftingRecipe.class b/bin/net/minecraft/src/CraftingRecipe.class
new file mode 100644
index 0000000..18358e5
Binary files /dev/null and b/bin/net/minecraft/src/CraftingRecipe.class differ
diff --git a/bin/net/minecraft/src/EffectRenderer.class b/bin/net/minecraft/src/EffectRenderer.class
new file mode 100644
index 0000000..1c95a4c
Binary files /dev/null and b/bin/net/minecraft/src/EffectRenderer.class differ
diff --git a/bin/net/minecraft/src/Entity.class b/bin/net/minecraft/src/Entity.class
new file mode 100644
index 0000000..ce2aa12
Binary files /dev/null and b/bin/net/minecraft/src/Entity.class differ
diff --git a/bin/net/minecraft/src/EntityAnimal.class b/bin/net/minecraft/src/EntityAnimal.class
new file mode 100644
index 0000000..534c4a9
Binary files /dev/null and b/bin/net/minecraft/src/EntityAnimal.class differ
diff --git a/bin/net/minecraft/src/EntityArrow.class b/bin/net/minecraft/src/EntityArrow.class
new file mode 100644
index 0000000..ef6462a
Binary files /dev/null and b/bin/net/minecraft/src/EntityArrow.class differ
diff --git a/bin/net/minecraft/src/EntityBubbleFX.class b/bin/net/minecraft/src/EntityBubbleFX.class
new file mode 100644
index 0000000..eb8160b
Binary files /dev/null and b/bin/net/minecraft/src/EntityBubbleFX.class differ
diff --git a/bin/net/minecraft/src/EntityCreature.class b/bin/net/minecraft/src/EntityCreature.class
new file mode 100644
index 0000000..b8bc373
Binary files /dev/null and b/bin/net/minecraft/src/EntityCreature.class differ
diff --git a/bin/net/minecraft/src/EntityCreeper.class b/bin/net/minecraft/src/EntityCreeper.class
new file mode 100644
index 0000000..70aef89
Binary files /dev/null and b/bin/net/minecraft/src/EntityCreeper.class differ
diff --git a/bin/net/minecraft/src/EntityDiggingFX.class b/bin/net/minecraft/src/EntityDiggingFX.class
new file mode 100644
index 0000000..c20225c
Binary files /dev/null and b/bin/net/minecraft/src/EntityDiggingFX.class differ
diff --git a/bin/net/minecraft/src/EntityExplodeFX.class b/bin/net/minecraft/src/EntityExplodeFX.class
new file mode 100644
index 0000000..fa943a3
Binary files /dev/null and b/bin/net/minecraft/src/EntityExplodeFX.class differ
diff --git a/bin/net/minecraft/src/EntityFX.class b/bin/net/minecraft/src/EntityFX.class
new file mode 100644
index 0000000..31f573e
Binary files /dev/null and b/bin/net/minecraft/src/EntityFX.class differ
diff --git a/bin/net/minecraft/src/EntityFallingSand.class b/bin/net/minecraft/src/EntityFallingSand.class
new file mode 100644
index 0000000..f5f8513
Binary files /dev/null and b/bin/net/minecraft/src/EntityFallingSand.class differ
diff --git a/bin/net/minecraft/src/EntityFlameFX.class b/bin/net/minecraft/src/EntityFlameFX.class
new file mode 100644
index 0000000..97a24a7
Binary files /dev/null and b/bin/net/minecraft/src/EntityFlameFX.class differ
diff --git a/bin/net/minecraft/src/EntityGiant.class b/bin/net/minecraft/src/EntityGiant.class
new file mode 100644
index 0000000..b13328c
Binary files /dev/null and b/bin/net/minecraft/src/EntityGiant.class differ
diff --git a/bin/net/minecraft/src/EntityItem.class b/bin/net/minecraft/src/EntityItem.class
new file mode 100644
index 0000000..d4fe056
Binary files /dev/null and b/bin/net/minecraft/src/EntityItem.class differ
diff --git a/bin/net/minecraft/src/EntityLavaFX.class b/bin/net/minecraft/src/EntityLavaFX.class
new file mode 100644
index 0000000..495b871
Binary files /dev/null and b/bin/net/minecraft/src/EntityLavaFX.class differ
diff --git a/bin/net/minecraft/src/EntityList.class b/bin/net/minecraft/src/EntityList.class
new file mode 100644
index 0000000..0533390
Binary files /dev/null and b/bin/net/minecraft/src/EntityList.class differ
diff --git a/bin/net/minecraft/src/EntityLiving.class b/bin/net/minecraft/src/EntityLiving.class
new file mode 100644
index 0000000..1b127c5
Binary files /dev/null and b/bin/net/minecraft/src/EntityLiving.class differ
diff --git a/bin/net/minecraft/src/EntityMinecart.class b/bin/net/minecraft/src/EntityMinecart.class
new file mode 100644
index 0000000..a65d6ba
Binary files /dev/null and b/bin/net/minecraft/src/EntityMinecart.class differ
diff --git a/bin/net/minecraft/src/EntityMonster.class b/bin/net/minecraft/src/EntityMonster.class
new file mode 100644
index 0000000..febcbc4
Binary files /dev/null and b/bin/net/minecraft/src/EntityMonster.class differ
diff --git a/bin/net/minecraft/src/EntityPainting.class b/bin/net/minecraft/src/EntityPainting.class
new file mode 100644
index 0000000..d5bd4b8
Binary files /dev/null and b/bin/net/minecraft/src/EntityPainting.class differ
diff --git a/bin/net/minecraft/src/EntityPickupFX.class b/bin/net/minecraft/src/EntityPickupFX.class
new file mode 100644
index 0000000..972e79e
Binary files /dev/null and b/bin/net/minecraft/src/EntityPickupFX.class differ
diff --git a/bin/net/minecraft/src/EntityPig.class b/bin/net/minecraft/src/EntityPig.class
new file mode 100644
index 0000000..ee32a89
Binary files /dev/null and b/bin/net/minecraft/src/EntityPig.class differ
diff --git a/bin/net/minecraft/src/EntityPlayer.class b/bin/net/minecraft/src/EntityPlayer.class
new file mode 100644
index 0000000..4d5555a
Binary files /dev/null and b/bin/net/minecraft/src/EntityPlayer.class differ
diff --git a/bin/net/minecraft/src/EntityPlayerSP.class b/bin/net/minecraft/src/EntityPlayerSP.class
new file mode 100644
index 0000000..7c61aab
Binary files /dev/null and b/bin/net/minecraft/src/EntityPlayerSP.class differ
diff --git a/bin/net/minecraft/src/EntityRainFX.class b/bin/net/minecraft/src/EntityRainFX.class
new file mode 100644
index 0000000..e0e78c7
Binary files /dev/null and b/bin/net/minecraft/src/EntityRainFX.class differ
diff --git a/bin/net/minecraft/src/EntityRenderer.class b/bin/net/minecraft/src/EntityRenderer.class
new file mode 100644
index 0000000..d41a19d
Binary files /dev/null and b/bin/net/minecraft/src/EntityRenderer.class differ
diff --git a/bin/net/minecraft/src/EntitySheep.class b/bin/net/minecraft/src/EntitySheep.class
new file mode 100644
index 0000000..daa0499
Binary files /dev/null and b/bin/net/minecraft/src/EntitySheep.class differ
diff --git a/bin/net/minecraft/src/EntitySkeleton.class b/bin/net/minecraft/src/EntitySkeleton.class
new file mode 100644
index 0000000..371ae13
Binary files /dev/null and b/bin/net/minecraft/src/EntitySkeleton.class differ
diff --git a/bin/net/minecraft/src/EntitySmokeFX.class b/bin/net/minecraft/src/EntitySmokeFX.class
new file mode 100644
index 0000000..690deff
Binary files /dev/null and b/bin/net/minecraft/src/EntitySmokeFX.class differ
diff --git a/bin/net/minecraft/src/EntitySorter.class b/bin/net/minecraft/src/EntitySorter.class
new file mode 100644
index 0000000..7f0ab5f
Binary files /dev/null and b/bin/net/minecraft/src/EntitySorter.class differ
diff --git a/bin/net/minecraft/src/EntitySpider.class b/bin/net/minecraft/src/EntitySpider.class
new file mode 100644
index 0000000..e97d4de
Binary files /dev/null and b/bin/net/minecraft/src/EntitySpider.class differ
diff --git a/bin/net/minecraft/src/EntitySplashFX.class b/bin/net/minecraft/src/EntitySplashFX.class
new file mode 100644
index 0000000..2272abe
Binary files /dev/null and b/bin/net/minecraft/src/EntitySplashFX.class differ
diff --git a/bin/net/minecraft/src/EntityTNTPrimed.class b/bin/net/minecraft/src/EntityTNTPrimed.class
new file mode 100644
index 0000000..f7d78c3
Binary files /dev/null and b/bin/net/minecraft/src/EntityTNTPrimed.class differ
diff --git a/bin/net/minecraft/src/EntityZombie.class b/bin/net/minecraft/src/EntityZombie.class
new file mode 100644
index 0000000..f19a3fe
Binary files /dev/null and b/bin/net/minecraft/src/EntityZombie.class differ
diff --git a/bin/net/minecraft/src/EnumArt.class b/bin/net/minecraft/src/EnumArt.class
new file mode 100644
index 0000000..e61cdd0
Binary files /dev/null and b/bin/net/minecraft/src/EnumArt.class differ
diff --git a/bin/net/minecraft/src/EnumOS.class b/bin/net/minecraft/src/EnumOS.class
new file mode 100644
index 0000000..bcde925
Binary files /dev/null and b/bin/net/minecraft/src/EnumOS.class differ
diff --git a/bin/net/minecraft/src/EnumOSIsom.class b/bin/net/minecraft/src/EnumOSIsom.class
new file mode 100644
index 0000000..95ea777
Binary files /dev/null and b/bin/net/minecraft/src/EnumOSIsom.class differ
diff --git a/bin/net/minecraft/src/EnumSkyBlock.class b/bin/net/minecraft/src/EnumSkyBlock.class
new file mode 100644
index 0000000..1338696
Binary files /dev/null and b/bin/net/minecraft/src/EnumSkyBlock.class differ
diff --git a/bin/net/minecraft/src/Explosion.class b/bin/net/minecraft/src/Explosion.class
new file mode 100644
index 0000000..c9d41e8
Binary files /dev/null and b/bin/net/minecraft/src/Explosion.class differ
diff --git a/bin/net/minecraft/src/FontRenderer.class b/bin/net/minecraft/src/FontRenderer.class
new file mode 100644
index 0000000..532a79a
Binary files /dev/null and b/bin/net/minecraft/src/FontRenderer.class differ
diff --git a/bin/net/minecraft/src/Frustrum.class b/bin/net/minecraft/src/Frustrum.class
new file mode 100644
index 0000000..5719063
Binary files /dev/null and b/bin/net/minecraft/src/Frustrum.class differ
diff --git a/bin/net/minecraft/src/GLAllocation.class b/bin/net/minecraft/src/GLAllocation.class
new file mode 100644
index 0000000..a152f7b
Binary files /dev/null and b/bin/net/minecraft/src/GLAllocation.class differ
diff --git a/bin/net/minecraft/src/GameSettings.class b/bin/net/minecraft/src/GameSettings.class
new file mode 100644
index 0000000..2c49a8b
Binary files /dev/null and b/bin/net/minecraft/src/GameSettings.class differ
diff --git a/bin/net/minecraft/src/Gui.class b/bin/net/minecraft/src/Gui.class
new file mode 100644
index 0000000..f172c1d
Binary files /dev/null and b/bin/net/minecraft/src/Gui.class differ
diff --git a/bin/net/minecraft/src/GuiButton.class b/bin/net/minecraft/src/GuiButton.class
new file mode 100644
index 0000000..7b36d53
Binary files /dev/null and b/bin/net/minecraft/src/GuiButton.class differ
diff --git a/bin/net/minecraft/src/GuiChest.class b/bin/net/minecraft/src/GuiChest.class
new file mode 100644
index 0000000..9abb462
Binary files /dev/null and b/bin/net/minecraft/src/GuiChest.class differ
diff --git a/bin/net/minecraft/src/GuiContainer.class b/bin/net/minecraft/src/GuiContainer.class
new file mode 100644
index 0000000..15b6a85
Binary files /dev/null and b/bin/net/minecraft/src/GuiContainer.class differ
diff --git a/bin/net/minecraft/src/GuiControls.class b/bin/net/minecraft/src/GuiControls.class
new file mode 100644
index 0000000..323c821
Binary files /dev/null and b/bin/net/minecraft/src/GuiControls.class differ
diff --git a/bin/net/minecraft/src/GuiCrafting.class b/bin/net/minecraft/src/GuiCrafting.class
new file mode 100644
index 0000000..aa0b141
Binary files /dev/null and b/bin/net/minecraft/src/GuiCrafting.class differ
diff --git a/bin/net/minecraft/src/GuiCreateWorld.class b/bin/net/minecraft/src/GuiCreateWorld.class
new file mode 100644
index 0000000..769506b
Binary files /dev/null and b/bin/net/minecraft/src/GuiCreateWorld.class differ
diff --git a/bin/net/minecraft/src/GuiDeleteWorld.class b/bin/net/minecraft/src/GuiDeleteWorld.class
new file mode 100644
index 0000000..2533924
Binary files /dev/null and b/bin/net/minecraft/src/GuiDeleteWorld.class differ
diff --git a/bin/net/minecraft/src/GuiEditSign.class b/bin/net/minecraft/src/GuiEditSign.class
new file mode 100644
index 0000000..9e95ab1
Binary files /dev/null and b/bin/net/minecraft/src/GuiEditSign.class differ
diff --git a/bin/net/minecraft/src/GuiErrorScreen.class b/bin/net/minecraft/src/GuiErrorScreen.class
new file mode 100644
index 0000000..1bdab86
Binary files /dev/null and b/bin/net/minecraft/src/GuiErrorScreen.class differ
diff --git a/bin/net/minecraft/src/GuiFurnace.class b/bin/net/minecraft/src/GuiFurnace.class
new file mode 100644
index 0000000..077c724
Binary files /dev/null and b/bin/net/minecraft/src/GuiFurnace.class differ
diff --git a/bin/net/minecraft/src/GuiGameOver.class b/bin/net/minecraft/src/GuiGameOver.class
new file mode 100644
index 0000000..d16514b
Binary files /dev/null and b/bin/net/minecraft/src/GuiGameOver.class differ
diff --git a/bin/net/minecraft/src/GuiIngame.class b/bin/net/minecraft/src/GuiIngame.class
new file mode 100644
index 0000000..022b346
Binary files /dev/null and b/bin/net/minecraft/src/GuiIngame.class differ
diff --git a/bin/net/minecraft/src/GuiIngameMenu.class b/bin/net/minecraft/src/GuiIngameMenu.class
new file mode 100644
index 0000000..a7e9505
Binary files /dev/null and b/bin/net/minecraft/src/GuiIngameMenu.class differ
diff --git a/bin/net/minecraft/src/GuiInventory.class b/bin/net/minecraft/src/GuiInventory.class
new file mode 100644
index 0000000..b98eb81
Binary files /dev/null and b/bin/net/minecraft/src/GuiInventory.class differ
diff --git a/bin/net/minecraft/src/GuiMainMenu.class b/bin/net/minecraft/src/GuiMainMenu.class
new file mode 100644
index 0000000..6a33582
Binary files /dev/null and b/bin/net/minecraft/src/GuiMainMenu.class differ
diff --git a/bin/net/minecraft/src/GuiOptions.class b/bin/net/minecraft/src/GuiOptions.class
new file mode 100644
index 0000000..424af2b
Binary files /dev/null and b/bin/net/minecraft/src/GuiOptions.class differ
diff --git a/bin/net/minecraft/src/GuiScreen.class b/bin/net/minecraft/src/GuiScreen.class
new file mode 100644
index 0000000..e74f333
Binary files /dev/null and b/bin/net/minecraft/src/GuiScreen.class differ
diff --git a/bin/net/minecraft/src/GuiSmallButton.class b/bin/net/minecraft/src/GuiSmallButton.class
new file mode 100644
index 0000000..33dc284
Binary files /dev/null and b/bin/net/minecraft/src/GuiSmallButton.class differ
diff --git a/bin/net/minecraft/src/GuiYesNo.class b/bin/net/minecraft/src/GuiYesNo.class
new file mode 100644
index 0000000..2adc3e6
Binary files /dev/null and b/bin/net/minecraft/src/GuiYesNo.class differ
diff --git a/bin/net/minecraft/src/IBlockAccess.class b/bin/net/minecraft/src/IBlockAccess.class
new file mode 100644
index 0000000..bcaf31e
Binary files /dev/null and b/bin/net/minecraft/src/IBlockAccess.class differ
diff --git a/bin/net/minecraft/src/ICamera.class b/bin/net/minecraft/src/ICamera.class
new file mode 100644
index 0000000..8942933
Binary files /dev/null and b/bin/net/minecraft/src/ICamera.class differ
diff --git a/bin/net/minecraft/src/IChunkLoader.class b/bin/net/minecraft/src/IChunkLoader.class
new file mode 100644
index 0000000..fda6a94
Binary files /dev/null and b/bin/net/minecraft/src/IChunkLoader.class differ
diff --git a/bin/net/minecraft/src/IChunkProvider.class b/bin/net/minecraft/src/IChunkProvider.class
new file mode 100644
index 0000000..0c33ae9
Binary files /dev/null and b/bin/net/minecraft/src/IChunkProvider.class differ
diff --git a/bin/net/minecraft/src/IInventory.class b/bin/net/minecraft/src/IInventory.class
new file mode 100644
index 0000000..6c471ca
Binary files /dev/null and b/bin/net/minecraft/src/IInventory.class differ
diff --git a/bin/net/minecraft/src/IProgressUpdate.class b/bin/net/minecraft/src/IProgressUpdate.class
new file mode 100644
index 0000000..cdccc24
Binary files /dev/null and b/bin/net/minecraft/src/IProgressUpdate.class differ
diff --git a/bin/net/minecraft/src/IWorldAccess.class b/bin/net/minecraft/src/IWorldAccess.class
new file mode 100644
index 0000000..ae29718
Binary files /dev/null and b/bin/net/minecraft/src/IWorldAccess.class differ
diff --git a/bin/net/minecraft/src/ImageBuffer.class b/bin/net/minecraft/src/ImageBuffer.class
new file mode 100644
index 0000000..b0f6f93
Binary files /dev/null and b/bin/net/minecraft/src/ImageBuffer.class differ
diff --git a/bin/net/minecraft/src/ImageBufferDownload.class b/bin/net/minecraft/src/ImageBufferDownload.class
new file mode 100644
index 0000000..448251e
Binary files /dev/null and b/bin/net/minecraft/src/ImageBufferDownload.class differ
diff --git a/bin/net/minecraft/src/InventoryCraftResult.class b/bin/net/minecraft/src/InventoryCraftResult.class
new file mode 100644
index 0000000..281c99f
Binary files /dev/null and b/bin/net/minecraft/src/InventoryCraftResult.class differ
diff --git a/bin/net/minecraft/src/InventoryCrafting.class b/bin/net/minecraft/src/InventoryCrafting.class
new file mode 100644
index 0000000..691c009
Binary files /dev/null and b/bin/net/minecraft/src/InventoryCrafting.class differ
diff --git a/bin/net/minecraft/src/InventoryLargeChest.class b/bin/net/minecraft/src/InventoryLargeChest.class
new file mode 100644
index 0000000..797ca63
Binary files /dev/null and b/bin/net/minecraft/src/InventoryLargeChest.class differ
diff --git a/bin/net/minecraft/src/InventoryPlayer.class b/bin/net/minecraft/src/InventoryPlayer.class
new file mode 100644
index 0000000..736ed78
Binary files /dev/null and b/bin/net/minecraft/src/InventoryPlayer.class differ
diff --git a/bin/net/minecraft/src/IsoImageBuffer.class b/bin/net/minecraft/src/IsoImageBuffer.class
new file mode 100644
index 0000000..ee96672
Binary files /dev/null and b/bin/net/minecraft/src/IsoImageBuffer.class differ
diff --git a/bin/net/minecraft/src/Item.class b/bin/net/minecraft/src/Item.class
new file mode 100644
index 0000000..01d1282
Binary files /dev/null and b/bin/net/minecraft/src/Item.class differ
diff --git a/bin/net/minecraft/src/ItemArmor.class b/bin/net/minecraft/src/ItemArmor.class
new file mode 100644
index 0000000..0ea6431
Binary files /dev/null and b/bin/net/minecraft/src/ItemArmor.class differ
diff --git a/bin/net/minecraft/src/ItemAxe.class b/bin/net/minecraft/src/ItemAxe.class
new file mode 100644
index 0000000..d54ff24
Binary files /dev/null and b/bin/net/minecraft/src/ItemAxe.class differ
diff --git a/bin/net/minecraft/src/ItemBlock.class b/bin/net/minecraft/src/ItemBlock.class
new file mode 100644
index 0000000..2c71ceb
Binary files /dev/null and b/bin/net/minecraft/src/ItemBlock.class differ
diff --git a/bin/net/minecraft/src/ItemBow.class b/bin/net/minecraft/src/ItemBow.class
new file mode 100644
index 0000000..5fdab4c
Binary files /dev/null and b/bin/net/minecraft/src/ItemBow.class differ
diff --git a/bin/net/minecraft/src/ItemBucket.class b/bin/net/minecraft/src/ItemBucket.class
new file mode 100644
index 0000000..4722f20
Binary files /dev/null and b/bin/net/minecraft/src/ItemBucket.class differ
diff --git a/bin/net/minecraft/src/ItemDoor.class b/bin/net/minecraft/src/ItemDoor.class
new file mode 100644
index 0000000..e416e97
Binary files /dev/null and b/bin/net/minecraft/src/ItemDoor.class differ
diff --git a/bin/net/minecraft/src/ItemFlintAndSteel.class b/bin/net/minecraft/src/ItemFlintAndSteel.class
new file mode 100644
index 0000000..ae8445b
Binary files /dev/null and b/bin/net/minecraft/src/ItemFlintAndSteel.class differ
diff --git a/bin/net/minecraft/src/ItemFood.class b/bin/net/minecraft/src/ItemFood.class
new file mode 100644
index 0000000..e5495eb
Binary files /dev/null and b/bin/net/minecraft/src/ItemFood.class differ
diff --git a/bin/net/minecraft/src/ItemHoe.class b/bin/net/minecraft/src/ItemHoe.class
new file mode 100644
index 0000000..915a366
Binary files /dev/null and b/bin/net/minecraft/src/ItemHoe.class differ
diff --git a/bin/net/minecraft/src/ItemMinecart.class b/bin/net/minecraft/src/ItemMinecart.class
new file mode 100644
index 0000000..b6a96ab
Binary files /dev/null and b/bin/net/minecraft/src/ItemMinecart.class differ
diff --git a/bin/net/minecraft/src/ItemPainting.class b/bin/net/minecraft/src/ItemPainting.class
new file mode 100644
index 0000000..488d00f
Binary files /dev/null and b/bin/net/minecraft/src/ItemPainting.class differ
diff --git a/bin/net/minecraft/src/ItemPickaxe.class b/bin/net/minecraft/src/ItemPickaxe.class
new file mode 100644
index 0000000..39ffc60
Binary files /dev/null and b/bin/net/minecraft/src/ItemPickaxe.class differ
diff --git a/bin/net/minecraft/src/ItemRenderer.class b/bin/net/minecraft/src/ItemRenderer.class
new file mode 100644
index 0000000..b2c7bf2
Binary files /dev/null and b/bin/net/minecraft/src/ItemRenderer.class differ
diff --git a/bin/net/minecraft/src/ItemSaddle.class b/bin/net/minecraft/src/ItemSaddle.class
new file mode 100644
index 0000000..82bb47e
Binary files /dev/null and b/bin/net/minecraft/src/ItemSaddle.class differ
diff --git a/bin/net/minecraft/src/ItemSeeds.class b/bin/net/minecraft/src/ItemSeeds.class
new file mode 100644
index 0000000..f773f5c
Binary files /dev/null and b/bin/net/minecraft/src/ItemSeeds.class differ
diff --git a/bin/net/minecraft/src/ItemSign.class b/bin/net/minecraft/src/ItemSign.class
new file mode 100644
index 0000000..7d29c12
Binary files /dev/null and b/bin/net/minecraft/src/ItemSign.class differ
diff --git a/bin/net/minecraft/src/ItemSoup.class b/bin/net/minecraft/src/ItemSoup.class
new file mode 100644
index 0000000..6e90605
Binary files /dev/null and b/bin/net/minecraft/src/ItemSoup.class differ
diff --git a/bin/net/minecraft/src/ItemSpade.class b/bin/net/minecraft/src/ItemSpade.class
new file mode 100644
index 0000000..b909044
Binary files /dev/null and b/bin/net/minecraft/src/ItemSpade.class differ
diff --git a/bin/net/minecraft/src/ItemStack.class b/bin/net/minecraft/src/ItemStack.class
new file mode 100644
index 0000000..a1ad5d9
Binary files /dev/null and b/bin/net/minecraft/src/ItemStack.class differ
diff --git a/bin/net/minecraft/src/ItemSword.class b/bin/net/minecraft/src/ItemSword.class
new file mode 100644
index 0000000..3482a7f
Binary files /dev/null and b/bin/net/minecraft/src/ItemSword.class differ
diff --git a/bin/net/minecraft/src/ItemTool.class b/bin/net/minecraft/src/ItemTool.class
new file mode 100644
index 0000000..47955f5
Binary files /dev/null and b/bin/net/minecraft/src/ItemTool.class differ
diff --git a/bin/net/minecraft/src/KeyBinding.class b/bin/net/minecraft/src/KeyBinding.class
new file mode 100644
index 0000000..4745aff
Binary files /dev/null and b/bin/net/minecraft/src/KeyBinding.class differ
diff --git a/bin/net/minecraft/src/LoadingScreenRenderer.class b/bin/net/minecraft/src/LoadingScreenRenderer.class
new file mode 100644
index 0000000..8d2c275
Binary files /dev/null and b/bin/net/minecraft/src/LoadingScreenRenderer.class differ
diff --git a/bin/net/minecraft/src/Material.class b/bin/net/minecraft/src/Material.class
new file mode 100644
index 0000000..0d13514
Binary files /dev/null and b/bin/net/minecraft/src/Material.class differ
diff --git a/bin/net/minecraft/src/MaterialLiquid.class b/bin/net/minecraft/src/MaterialLiquid.class
new file mode 100644
index 0000000..38a8187
Binary files /dev/null and b/bin/net/minecraft/src/MaterialLiquid.class differ
diff --git a/bin/net/minecraft/src/MaterialLogic.class b/bin/net/minecraft/src/MaterialLogic.class
new file mode 100644
index 0000000..b2574d8
Binary files /dev/null and b/bin/net/minecraft/src/MaterialLogic.class differ
diff --git a/bin/net/minecraft/src/MaterialTransparent.class b/bin/net/minecraft/src/MaterialTransparent.class
new file mode 100644
index 0000000..4aabb77
Binary files /dev/null and b/bin/net/minecraft/src/MaterialTransparent.class differ
diff --git a/bin/net/minecraft/src/MathHelper.class b/bin/net/minecraft/src/MathHelper.class
new file mode 100644
index 0000000..1133a97
Binary files /dev/null and b/bin/net/minecraft/src/MathHelper.class differ
diff --git a/bin/net/minecraft/src/MetadataChunkBlock.class b/bin/net/minecraft/src/MetadataChunkBlock.class
new file mode 100644
index 0000000..e98c7a5
Binary files /dev/null and b/bin/net/minecraft/src/MetadataChunkBlock.class differ
diff --git a/bin/net/minecraft/src/MinecartTrackLogic.class b/bin/net/minecraft/src/MinecartTrackLogic.class
new file mode 100644
index 0000000..165d0b0
Binary files /dev/null and b/bin/net/minecraft/src/MinecartTrackLogic.class differ
diff --git a/bin/net/minecraft/src/Minecraft.class b/bin/net/minecraft/src/Minecraft.class
new file mode 100644
index 0000000..8269f6d
Binary files /dev/null and b/bin/net/minecraft/src/Minecraft.class differ
diff --git a/bin/net/minecraft/src/MinecraftAppletImpl.class b/bin/net/minecraft/src/MinecraftAppletImpl.class
new file mode 100644
index 0000000..ff8d532
Binary files /dev/null and b/bin/net/minecraft/src/MinecraftAppletImpl.class differ
diff --git a/bin/net/minecraft/src/MinecraftError.class b/bin/net/minecraft/src/MinecraftError.class
new file mode 100644
index 0000000..7289b29
Binary files /dev/null and b/bin/net/minecraft/src/MinecraftError.class differ
diff --git a/bin/net/minecraft/src/ModelBase.class b/bin/net/minecraft/src/ModelBase.class
new file mode 100644
index 0000000..482f8ab
Binary files /dev/null and b/bin/net/minecraft/src/ModelBase.class differ
diff --git a/bin/net/minecraft/src/ModelBiped.class b/bin/net/minecraft/src/ModelBiped.class
new file mode 100644
index 0000000..de309a7
Binary files /dev/null and b/bin/net/minecraft/src/ModelBiped.class differ
diff --git a/bin/net/minecraft/src/ModelCreeper.class b/bin/net/minecraft/src/ModelCreeper.class
new file mode 100644
index 0000000..bb357f8
Binary files /dev/null and b/bin/net/minecraft/src/ModelCreeper.class differ
diff --git a/bin/net/minecraft/src/ModelMinecart.class b/bin/net/minecraft/src/ModelMinecart.class
new file mode 100644
index 0000000..2ce2e1e
Binary files /dev/null and b/bin/net/minecraft/src/ModelMinecart.class differ
diff --git a/bin/net/minecraft/src/ModelPig.class b/bin/net/minecraft/src/ModelPig.class
new file mode 100644
index 0000000..e8c9906
Binary files /dev/null and b/bin/net/minecraft/src/ModelPig.class differ
diff --git a/bin/net/minecraft/src/ModelQuadruped.class b/bin/net/minecraft/src/ModelQuadruped.class
new file mode 100644
index 0000000..4e6c62f
Binary files /dev/null and b/bin/net/minecraft/src/ModelQuadruped.class differ
diff --git a/bin/net/minecraft/src/ModelRenderer.class b/bin/net/minecraft/src/ModelRenderer.class
new file mode 100644
index 0000000..f5a5f48
Binary files /dev/null and b/bin/net/minecraft/src/ModelRenderer.class differ
diff --git a/bin/net/minecraft/src/ModelSheep.class b/bin/net/minecraft/src/ModelSheep.class
new file mode 100644
index 0000000..fbb8d41
Binary files /dev/null and b/bin/net/minecraft/src/ModelSheep.class differ
diff --git a/bin/net/minecraft/src/ModelSheepFur.class b/bin/net/minecraft/src/ModelSheepFur.class
new file mode 100644
index 0000000..c6e453b
Binary files /dev/null and b/bin/net/minecraft/src/ModelSheepFur.class differ
diff --git a/bin/net/minecraft/src/ModelSkeleton.class b/bin/net/minecraft/src/ModelSkeleton.class
new file mode 100644
index 0000000..21df225
Binary files /dev/null and b/bin/net/minecraft/src/ModelSkeleton.class differ
diff --git a/bin/net/minecraft/src/ModelSpider.class b/bin/net/minecraft/src/ModelSpider.class
new file mode 100644
index 0000000..3757cb2
Binary files /dev/null and b/bin/net/minecraft/src/ModelSpider.class differ
diff --git a/bin/net/minecraft/src/ModelZombie.class b/bin/net/minecraft/src/ModelZombie.class
new file mode 100644
index 0000000..4a338bf
Binary files /dev/null and b/bin/net/minecraft/src/ModelZombie.class differ
diff --git a/bin/net/minecraft/src/MouseHelper.class b/bin/net/minecraft/src/MouseHelper.class
new file mode 100644
index 0000000..b62ac20
Binary files /dev/null and b/bin/net/minecraft/src/MouseHelper.class differ
diff --git a/bin/net/minecraft/src/MovementInput.class b/bin/net/minecraft/src/MovementInput.class
new file mode 100644
index 0000000..7126cc6
Binary files /dev/null and b/bin/net/minecraft/src/MovementInput.class differ
diff --git a/bin/net/minecraft/src/MovementInputFromOptions.class b/bin/net/minecraft/src/MovementInputFromOptions.class
new file mode 100644
index 0000000..c91411f
Binary files /dev/null and b/bin/net/minecraft/src/MovementInputFromOptions.class differ
diff --git a/bin/net/minecraft/src/MovingObjectPosition.class b/bin/net/minecraft/src/MovingObjectPosition.class
new file mode 100644
index 0000000..425c602
Binary files /dev/null and b/bin/net/minecraft/src/MovingObjectPosition.class differ
diff --git a/bin/net/minecraft/src/NBTBase.class b/bin/net/minecraft/src/NBTBase.class
new file mode 100644
index 0000000..9746306
Binary files /dev/null and b/bin/net/minecraft/src/NBTBase.class differ
diff --git a/bin/net/minecraft/src/NBTTagByte.class b/bin/net/minecraft/src/NBTTagByte.class
new file mode 100644
index 0000000..3ba421d
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagByte.class differ
diff --git a/bin/net/minecraft/src/NBTTagByteArray.class b/bin/net/minecraft/src/NBTTagByteArray.class
new file mode 100644
index 0000000..11d7ff7
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagByteArray.class differ
diff --git a/bin/net/minecraft/src/NBTTagCompound.class b/bin/net/minecraft/src/NBTTagCompound.class
new file mode 100644
index 0000000..ffbdd5c
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagCompound.class differ
diff --git a/bin/net/minecraft/src/NBTTagDouble.class b/bin/net/minecraft/src/NBTTagDouble.class
new file mode 100644
index 0000000..665dcc0
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagDouble.class differ
diff --git a/bin/net/minecraft/src/NBTTagEnd.class b/bin/net/minecraft/src/NBTTagEnd.class
new file mode 100644
index 0000000..288ee00
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagEnd.class differ
diff --git a/bin/net/minecraft/src/NBTTagFloat.class b/bin/net/minecraft/src/NBTTagFloat.class
new file mode 100644
index 0000000..0daf4de
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagFloat.class differ
diff --git a/bin/net/minecraft/src/NBTTagInt.class b/bin/net/minecraft/src/NBTTagInt.class
new file mode 100644
index 0000000..34bb690
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagInt.class differ
diff --git a/bin/net/minecraft/src/NBTTagList.class b/bin/net/minecraft/src/NBTTagList.class
new file mode 100644
index 0000000..9ea521f
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagList.class differ
diff --git a/bin/net/minecraft/src/NBTTagLong.class b/bin/net/minecraft/src/NBTTagLong.class
new file mode 100644
index 0000000..65ef691
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagLong.class differ
diff --git a/bin/net/minecraft/src/NBTTagShort.class b/bin/net/minecraft/src/NBTTagShort.class
new file mode 100644
index 0000000..7ac5301
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagShort.class differ
diff --git a/bin/net/minecraft/src/NBTTagString.class b/bin/net/minecraft/src/NBTTagString.class
new file mode 100644
index 0000000..05b4c4d
Binary files /dev/null and b/bin/net/minecraft/src/NBTTagString.class differ
diff --git a/bin/net/minecraft/src/NextTickListEntry.class b/bin/net/minecraft/src/NextTickListEntry.class
new file mode 100644
index 0000000..e84929b
Binary files /dev/null and b/bin/net/minecraft/src/NextTickListEntry.class differ
diff --git a/bin/net/minecraft/src/NibbleArray.class b/bin/net/minecraft/src/NibbleArray.class
new file mode 100644
index 0000000..9b815ff
Binary files /dev/null and b/bin/net/minecraft/src/NibbleArray.class differ
diff --git a/bin/net/minecraft/src/NoiseGenerator.class b/bin/net/minecraft/src/NoiseGenerator.class
new file mode 100644
index 0000000..157de09
Binary files /dev/null and b/bin/net/minecraft/src/NoiseGenerator.class differ
diff --git a/bin/net/minecraft/src/NoiseGeneratorOctaves.class b/bin/net/minecraft/src/NoiseGeneratorOctaves.class
new file mode 100644
index 0000000..2652c82
Binary files /dev/null and b/bin/net/minecraft/src/NoiseGeneratorOctaves.class differ
diff --git a/bin/net/minecraft/src/NoiseGeneratorPerlin.class b/bin/net/minecraft/src/NoiseGeneratorPerlin.class
new file mode 100644
index 0000000..6830cb4
Binary files /dev/null and b/bin/net/minecraft/src/NoiseGeneratorPerlin.class differ
diff --git a/bin/net/minecraft/src/OSMap.class b/bin/net/minecraft/src/OSMap.class
new file mode 100644
index 0000000..63fd4e2
Binary files /dev/null and b/bin/net/minecraft/src/OSMap.class differ
diff --git a/bin/net/minecraft/src/OSMapIsom.class b/bin/net/minecraft/src/OSMapIsom.class
new file mode 100644
index 0000000..7dab6ad
Binary files /dev/null and b/bin/net/minecraft/src/OSMapIsom.class differ
diff --git a/bin/net/minecraft/src/OpenGlCapsChecker.class b/bin/net/minecraft/src/OpenGlCapsChecker.class
new file mode 100644
index 0000000..030397e
Binary files /dev/null and b/bin/net/minecraft/src/OpenGlCapsChecker.class differ
diff --git a/bin/net/minecraft/src/PanelCrashReport.class b/bin/net/minecraft/src/PanelCrashReport.class
new file mode 100644
index 0000000..fc5f548
Binary files /dev/null and b/bin/net/minecraft/src/PanelCrashReport.class differ
diff --git a/bin/net/minecraft/src/Path.class b/bin/net/minecraft/src/Path.class
new file mode 100644
index 0000000..b78ff40
Binary files /dev/null and b/bin/net/minecraft/src/Path.class differ
diff --git a/bin/net/minecraft/src/PathEntity.class b/bin/net/minecraft/src/PathEntity.class
new file mode 100644
index 0000000..909088a
Binary files /dev/null and b/bin/net/minecraft/src/PathEntity.class differ
diff --git a/bin/net/minecraft/src/PathPoint.class b/bin/net/minecraft/src/PathPoint.class
new file mode 100644
index 0000000..8c18215
Binary files /dev/null and b/bin/net/minecraft/src/PathPoint.class differ
diff --git a/bin/net/minecraft/src/Pathfinder.class b/bin/net/minecraft/src/Pathfinder.class
new file mode 100644
index 0000000..ada8465
Binary files /dev/null and b/bin/net/minecraft/src/Pathfinder.class differ
diff --git a/bin/net/minecraft/src/PlayerController.class b/bin/net/minecraft/src/PlayerController.class
new file mode 100644
index 0000000..9034087
Binary files /dev/null and b/bin/net/minecraft/src/PlayerController.class differ
diff --git a/bin/net/minecraft/src/PlayerControllerCreative.class b/bin/net/minecraft/src/PlayerControllerCreative.class
new file mode 100644
index 0000000..f212e2c
Binary files /dev/null and b/bin/net/minecraft/src/PlayerControllerCreative.class differ
diff --git a/bin/net/minecraft/src/PlayerControllerSP.class b/bin/net/minecraft/src/PlayerControllerSP.class
new file mode 100644
index 0000000..ae37159
Binary files /dev/null and b/bin/net/minecraft/src/PlayerControllerSP.class differ
diff --git a/bin/net/minecraft/src/PositionTextureVertex.class b/bin/net/minecraft/src/PositionTextureVertex.class
new file mode 100644
index 0000000..332bab4
Binary files /dev/null and b/bin/net/minecraft/src/PositionTextureVertex.class differ
diff --git a/bin/net/minecraft/src/RecipeSorter.class b/bin/net/minecraft/src/RecipeSorter.class
new file mode 100644
index 0000000..21f6013
Binary files /dev/null and b/bin/net/minecraft/src/RecipeSorter.class differ
diff --git a/bin/net/minecraft/src/RecipesArmor.class b/bin/net/minecraft/src/RecipesArmor.class
new file mode 100644
index 0000000..9834a34
Binary files /dev/null and b/bin/net/minecraft/src/RecipesArmor.class differ
diff --git a/bin/net/minecraft/src/RecipesCrafting.class b/bin/net/minecraft/src/RecipesCrafting.class
new file mode 100644
index 0000000..4de1d77
Binary files /dev/null and b/bin/net/minecraft/src/RecipesCrafting.class differ
diff --git a/bin/net/minecraft/src/RecipesFood.class b/bin/net/minecraft/src/RecipesFood.class
new file mode 100644
index 0000000..02e0ac8
Binary files /dev/null and b/bin/net/minecraft/src/RecipesFood.class differ
diff --git a/bin/net/minecraft/src/RecipesIngots.class b/bin/net/minecraft/src/RecipesIngots.class
new file mode 100644
index 0000000..655c51e
Binary files /dev/null and b/bin/net/minecraft/src/RecipesIngots.class differ
diff --git a/bin/net/minecraft/src/RecipesTools.class b/bin/net/minecraft/src/RecipesTools.class
new file mode 100644
index 0000000..31fd54e
Binary files /dev/null and b/bin/net/minecraft/src/RecipesTools.class differ
diff --git a/bin/net/minecraft/src/RecipesWeapons.class b/bin/net/minecraft/src/RecipesWeapons.class
new file mode 100644
index 0000000..bafc50b
Binary files /dev/null and b/bin/net/minecraft/src/RecipesWeapons.class differ
diff --git a/bin/net/minecraft/src/Render.class b/bin/net/minecraft/src/Render.class
new file mode 100644
index 0000000..9df2813
Binary files /dev/null and b/bin/net/minecraft/src/Render.class differ
diff --git a/bin/net/minecraft/src/RenderArrow.class b/bin/net/minecraft/src/RenderArrow.class
new file mode 100644
index 0000000..ca8067f
Binary files /dev/null and b/bin/net/minecraft/src/RenderArrow.class differ
diff --git a/bin/net/minecraft/src/RenderBlocks.class b/bin/net/minecraft/src/RenderBlocks.class
new file mode 100644
index 0000000..4da6af5
Binary files /dev/null and b/bin/net/minecraft/src/RenderBlocks.class differ
diff --git a/bin/net/minecraft/src/RenderCreeper.class b/bin/net/minecraft/src/RenderCreeper.class
new file mode 100644
index 0000000..446c90f
Binary files /dev/null and b/bin/net/minecraft/src/RenderCreeper.class differ
diff --git a/bin/net/minecraft/src/RenderEngine.class b/bin/net/minecraft/src/RenderEngine.class
new file mode 100644
index 0000000..7203b49
Binary files /dev/null and b/bin/net/minecraft/src/RenderEngine.class differ
diff --git a/bin/net/minecraft/src/RenderEntity.class b/bin/net/minecraft/src/RenderEntity.class
new file mode 100644
index 0000000..8cf56d0
Binary files /dev/null and b/bin/net/minecraft/src/RenderEntity.class differ
diff --git a/bin/net/minecraft/src/RenderFallingSand.class b/bin/net/minecraft/src/RenderFallingSand.class
new file mode 100644
index 0000000..1a50c85
Binary files /dev/null and b/bin/net/minecraft/src/RenderFallingSand.class differ
diff --git a/bin/net/minecraft/src/RenderGiantZombie.class b/bin/net/minecraft/src/RenderGiantZombie.class
new file mode 100644
index 0000000..ceaa20a
Binary files /dev/null and b/bin/net/minecraft/src/RenderGiantZombie.class differ
diff --git a/bin/net/minecraft/src/RenderGlobal.class b/bin/net/minecraft/src/RenderGlobal.class
new file mode 100644
index 0000000..d1f0a25
Binary files /dev/null and b/bin/net/minecraft/src/RenderGlobal.class differ
diff --git a/bin/net/minecraft/src/RenderHelper.class b/bin/net/minecraft/src/RenderHelper.class
new file mode 100644
index 0000000..1ec0391
Binary files /dev/null and b/bin/net/minecraft/src/RenderHelper.class differ
diff --git a/bin/net/minecraft/src/RenderItem.class b/bin/net/minecraft/src/RenderItem.class
new file mode 100644
index 0000000..7f17a59
Binary files /dev/null and b/bin/net/minecraft/src/RenderItem.class differ
diff --git a/bin/net/minecraft/src/RenderList.class b/bin/net/minecraft/src/RenderList.class
new file mode 100644
index 0000000..5fe6158
Binary files /dev/null and b/bin/net/minecraft/src/RenderList.class differ
diff --git a/bin/net/minecraft/src/RenderLiving.class b/bin/net/minecraft/src/RenderLiving.class
new file mode 100644
index 0000000..068082f
Binary files /dev/null and b/bin/net/minecraft/src/RenderLiving.class differ
diff --git a/bin/net/minecraft/src/RenderManager.class b/bin/net/minecraft/src/RenderManager.class
new file mode 100644
index 0000000..6d61873
Binary files /dev/null and b/bin/net/minecraft/src/RenderManager.class differ
diff --git a/bin/net/minecraft/src/RenderMinecart.class b/bin/net/minecraft/src/RenderMinecart.class
new file mode 100644
index 0000000..08cbc15
Binary files /dev/null and b/bin/net/minecraft/src/RenderMinecart.class differ
diff --git a/bin/net/minecraft/src/RenderPainting.class b/bin/net/minecraft/src/RenderPainting.class
new file mode 100644
index 0000000..db3664e
Binary files /dev/null and b/bin/net/minecraft/src/RenderPainting.class differ
diff --git a/bin/net/minecraft/src/RenderPig.class b/bin/net/minecraft/src/RenderPig.class
new file mode 100644
index 0000000..6a6b1fe
Binary files /dev/null and b/bin/net/minecraft/src/RenderPig.class differ
diff --git a/bin/net/minecraft/src/RenderPlayer.class b/bin/net/minecraft/src/RenderPlayer.class
new file mode 100644
index 0000000..da8f79a
Binary files /dev/null and b/bin/net/minecraft/src/RenderPlayer.class differ
diff --git a/bin/net/minecraft/src/RenderSheep.class b/bin/net/minecraft/src/RenderSheep.class
new file mode 100644
index 0000000..9da7c1f
Binary files /dev/null and b/bin/net/minecraft/src/RenderSheep.class differ
diff --git a/bin/net/minecraft/src/RenderSorter.class b/bin/net/minecraft/src/RenderSorter.class
new file mode 100644
index 0000000..da3f48b
Binary files /dev/null and b/bin/net/minecraft/src/RenderSorter.class differ
diff --git a/bin/net/minecraft/src/RenderSpider.class b/bin/net/minecraft/src/RenderSpider.class
new file mode 100644
index 0000000..b50d98a
Binary files /dev/null and b/bin/net/minecraft/src/RenderSpider.class differ
diff --git a/bin/net/minecraft/src/RenderTNTPrimed.class b/bin/net/minecraft/src/RenderTNTPrimed.class
new file mode 100644
index 0000000..09bce8e
Binary files /dev/null and b/bin/net/minecraft/src/RenderTNTPrimed.class differ
diff --git a/bin/net/minecraft/src/ScaledResolution.class b/bin/net/minecraft/src/ScaledResolution.class
new file mode 100644
index 0000000..c1f8050
Binary files /dev/null and b/bin/net/minecraft/src/ScaledResolution.class differ
diff --git a/bin/net/minecraft/src/Session.class b/bin/net/minecraft/src/Session.class
new file mode 100644
index 0000000..7ae8fca
Binary files /dev/null and b/bin/net/minecraft/src/Session.class differ
diff --git a/bin/net/minecraft/src/SignModel.class b/bin/net/minecraft/src/SignModel.class
new file mode 100644
index 0000000..174e6fc
Binary files /dev/null and b/bin/net/minecraft/src/SignModel.class differ
diff --git a/bin/net/minecraft/src/Slot.class b/bin/net/minecraft/src/Slot.class
new file mode 100644
index 0000000..ae5417a
Binary files /dev/null and b/bin/net/minecraft/src/Slot.class differ
diff --git a/bin/net/minecraft/src/SlotArmor.class b/bin/net/minecraft/src/SlotArmor.class
new file mode 100644
index 0000000..78e3d94
Binary files /dev/null and b/bin/net/minecraft/src/SlotArmor.class differ
diff --git a/bin/net/minecraft/src/SlotCrafting.class b/bin/net/minecraft/src/SlotCrafting.class
new file mode 100644
index 0000000..86b401b
Binary files /dev/null and b/bin/net/minecraft/src/SlotCrafting.class differ
diff --git a/bin/net/minecraft/src/SoundManager.class b/bin/net/minecraft/src/SoundManager.class
new file mode 100644
index 0000000..840db0d
Binary files /dev/null and b/bin/net/minecraft/src/SoundManager.class differ
diff --git a/bin/net/minecraft/src/SoundPool.class b/bin/net/minecraft/src/SoundPool.class
new file mode 100644
index 0000000..59f0de0
Binary files /dev/null and b/bin/net/minecraft/src/SoundPool.class differ
diff --git a/bin/net/minecraft/src/SoundPoolEntry.class b/bin/net/minecraft/src/SoundPoolEntry.class
new file mode 100644
index 0000000..20750eb
Binary files /dev/null and b/bin/net/minecraft/src/SoundPoolEntry.class differ
diff --git a/bin/net/minecraft/src/SpawnerAnimals.class b/bin/net/minecraft/src/SpawnerAnimals.class
new file mode 100644
index 0000000..76aead6
Binary files /dev/null and b/bin/net/minecraft/src/SpawnerAnimals.class differ
diff --git a/bin/net/minecraft/src/SpawnerMonsters.class b/bin/net/minecraft/src/SpawnerMonsters.class
new file mode 100644
index 0000000..f70eef2
Binary files /dev/null and b/bin/net/minecraft/src/SpawnerMonsters.class differ
diff --git a/bin/net/minecraft/src/StepSound.class b/bin/net/minecraft/src/StepSound.class
new file mode 100644
index 0000000..d30a8be
Binary files /dev/null and b/bin/net/minecraft/src/StepSound.class differ
diff --git a/bin/net/minecraft/src/StepSoundGlass.class b/bin/net/minecraft/src/StepSoundGlass.class
new file mode 100644
index 0000000..88548c3
Binary files /dev/null and b/bin/net/minecraft/src/StepSoundGlass.class differ
diff --git a/bin/net/minecraft/src/StepSoundSand.class b/bin/net/minecraft/src/StepSoundSand.class
new file mode 100644
index 0000000..4348524
Binary files /dev/null and b/bin/net/minecraft/src/StepSoundSand.class differ
diff --git a/bin/net/minecraft/src/TerrainTextureManager.class b/bin/net/minecraft/src/TerrainTextureManager.class
new file mode 100644
index 0000000..9ae9b2e
Binary files /dev/null and b/bin/net/minecraft/src/TerrainTextureManager.class differ
diff --git a/bin/net/minecraft/src/Tessellator.class b/bin/net/minecraft/src/Tessellator.class
new file mode 100644
index 0000000..89de137
Binary files /dev/null and b/bin/net/minecraft/src/Tessellator.class differ
diff --git a/bin/net/minecraft/src/TextureFX.class b/bin/net/minecraft/src/TextureFX.class
new file mode 100644
index 0000000..6af5f67
Binary files /dev/null and b/bin/net/minecraft/src/TextureFX.class differ
diff --git a/bin/net/minecraft/src/TextureFlamesFX.class b/bin/net/minecraft/src/TextureFlamesFX.class
new file mode 100644
index 0000000..3bfff49
Binary files /dev/null and b/bin/net/minecraft/src/TextureFlamesFX.class differ
diff --git a/bin/net/minecraft/src/TextureGearsFX.class b/bin/net/minecraft/src/TextureGearsFX.class
new file mode 100644
index 0000000..ff3115d
Binary files /dev/null and b/bin/net/minecraft/src/TextureGearsFX.class differ
diff --git a/bin/net/minecraft/src/TextureLavaFX.class b/bin/net/minecraft/src/TextureLavaFX.class
new file mode 100644
index 0000000..a61f76d
Binary files /dev/null and b/bin/net/minecraft/src/TextureLavaFX.class differ
diff --git a/bin/net/minecraft/src/TextureLavaFlowFX.class b/bin/net/minecraft/src/TextureLavaFlowFX.class
new file mode 100644
index 0000000..8b1ff5a
Binary files /dev/null and b/bin/net/minecraft/src/TextureLavaFlowFX.class differ
diff --git a/bin/net/minecraft/src/TextureWaterFX.class b/bin/net/minecraft/src/TextureWaterFX.class
new file mode 100644
index 0000000..50fdadf
Binary files /dev/null and b/bin/net/minecraft/src/TextureWaterFX.class differ
diff --git a/bin/net/minecraft/src/TextureWaterFlowFX.class b/bin/net/minecraft/src/TextureWaterFlowFX.class
new file mode 100644
index 0000000..f06e7a3
Binary files /dev/null and b/bin/net/minecraft/src/TextureWaterFlowFX.class differ
diff --git a/bin/net/minecraft/src/TexturedQuad.class b/bin/net/minecraft/src/TexturedQuad.class
new file mode 100644
index 0000000..268692d
Binary files /dev/null and b/bin/net/minecraft/src/TexturedQuad.class differ
diff --git a/bin/net/minecraft/src/ThreadDownloadImage.class b/bin/net/minecraft/src/ThreadDownloadImage.class
new file mode 100644
index 0000000..23cd715
Binary files /dev/null and b/bin/net/minecraft/src/ThreadDownloadImage.class differ
diff --git a/bin/net/minecraft/src/ThreadDownloadImageData.class b/bin/net/minecraft/src/ThreadDownloadImageData.class
new file mode 100644
index 0000000..b3b27cc
Binary files /dev/null and b/bin/net/minecraft/src/ThreadDownloadImageData.class differ
diff --git a/bin/net/minecraft/src/ThreadDownloadResources.class b/bin/net/minecraft/src/ThreadDownloadResources.class
new file mode 100644
index 0000000..d5949ca
Binary files /dev/null and b/bin/net/minecraft/src/ThreadDownloadResources.class differ
diff --git a/bin/net/minecraft/src/ThreadRunIsoClient.class b/bin/net/minecraft/src/ThreadRunIsoClient.class
new file mode 100644
index 0000000..0b4cd7e
Binary files /dev/null and b/bin/net/minecraft/src/ThreadRunIsoClient.class differ
diff --git a/bin/net/minecraft/src/ThreadSleepForever.class b/bin/net/minecraft/src/ThreadSleepForever.class
new file mode 100644
index 0000000..3260349
Binary files /dev/null and b/bin/net/minecraft/src/ThreadSleepForever.class differ
diff --git a/bin/net/minecraft/src/TileEntity.class b/bin/net/minecraft/src/TileEntity.class
new file mode 100644
index 0000000..5a488aa
Binary files /dev/null and b/bin/net/minecraft/src/TileEntity.class differ
diff --git a/bin/net/minecraft/src/TileEntityChest.class b/bin/net/minecraft/src/TileEntityChest.class
new file mode 100644
index 0000000..97d2e32
Binary files /dev/null and b/bin/net/minecraft/src/TileEntityChest.class differ
diff --git a/bin/net/minecraft/src/TileEntityFurnace.class b/bin/net/minecraft/src/TileEntityFurnace.class
new file mode 100644
index 0000000..d70ab25
Binary files /dev/null and b/bin/net/minecraft/src/TileEntityFurnace.class differ
diff --git a/bin/net/minecraft/src/TileEntityMobSpawner.class b/bin/net/minecraft/src/TileEntityMobSpawner.class
new file mode 100644
index 0000000..7a8cadc
Binary files /dev/null and b/bin/net/minecraft/src/TileEntityMobSpawner.class differ
diff --git a/bin/net/minecraft/src/TileEntityMobSpawnerRenderer.class b/bin/net/minecraft/src/TileEntityMobSpawnerRenderer.class
new file mode 100644
index 0000000..9ac15dc
Binary files /dev/null and b/bin/net/minecraft/src/TileEntityMobSpawnerRenderer.class differ
diff --git a/bin/net/minecraft/src/TileEntityRenderer.class b/bin/net/minecraft/src/TileEntityRenderer.class
new file mode 100644
index 0000000..7132c80
Binary files /dev/null and b/bin/net/minecraft/src/TileEntityRenderer.class differ
diff --git a/bin/net/minecraft/src/TileEntitySign.class b/bin/net/minecraft/src/TileEntitySign.class
new file mode 100644
index 0000000..daf17e4
Binary files /dev/null and b/bin/net/minecraft/src/TileEntitySign.class differ
diff --git a/bin/net/minecraft/src/TileEntitySignRenderer.class b/bin/net/minecraft/src/TileEntitySignRenderer.class
new file mode 100644
index 0000000..64c814e
Binary files /dev/null and b/bin/net/minecraft/src/TileEntitySignRenderer.class differ
diff --git a/bin/net/minecraft/src/TileEntitySpecialRenderer.class b/bin/net/minecraft/src/TileEntitySpecialRenderer.class
new file mode 100644
index 0000000..cbbc7cc
Binary files /dev/null and b/bin/net/minecraft/src/TileEntitySpecialRenderer.class differ
diff --git a/bin/net/minecraft/src/Timer.class b/bin/net/minecraft/src/Timer.class
new file mode 100644
index 0000000..3ad56ca
Binary files /dev/null and b/bin/net/minecraft/src/Timer.class differ
diff --git a/bin/net/minecraft/src/UnexpectedThrowable.class b/bin/net/minecraft/src/UnexpectedThrowable.class
new file mode 100644
index 0000000..aa29c4c
Binary files /dev/null and b/bin/net/minecraft/src/UnexpectedThrowable.class differ
diff --git a/bin/net/minecraft/src/Vec3D.class b/bin/net/minecraft/src/Vec3D.class
new file mode 100644
index 0000000..1a87e11
Binary files /dev/null and b/bin/net/minecraft/src/Vec3D.class differ
diff --git a/bin/net/minecraft/src/World.class b/bin/net/minecraft/src/World.class
new file mode 100644
index 0000000..fd408ab
Binary files /dev/null and b/bin/net/minecraft/src/World.class differ
diff --git a/bin/net/minecraft/src/WorldGenDungeons.class b/bin/net/minecraft/src/WorldGenDungeons.class
new file mode 100644
index 0000000..678fc1a
Binary files /dev/null and b/bin/net/minecraft/src/WorldGenDungeons.class differ
diff --git a/bin/net/minecraft/src/WorldGenFlowers.class b/bin/net/minecraft/src/WorldGenFlowers.class
new file mode 100644
index 0000000..dfc3bad
Binary files /dev/null and b/bin/net/minecraft/src/WorldGenFlowers.class differ
diff --git a/bin/net/minecraft/src/WorldGenLiquids.class b/bin/net/minecraft/src/WorldGenLiquids.class
new file mode 100644
index 0000000..9d83e01
Binary files /dev/null and b/bin/net/minecraft/src/WorldGenLiquids.class differ
diff --git a/bin/net/minecraft/src/WorldGenMinable.class b/bin/net/minecraft/src/WorldGenMinable.class
new file mode 100644
index 0000000..3769864
Binary files /dev/null and b/bin/net/minecraft/src/WorldGenMinable.class differ
diff --git a/bin/net/minecraft/src/WorldGenTrees.class b/bin/net/minecraft/src/WorldGenTrees.class
new file mode 100644
index 0000000..575b188
Binary files /dev/null and b/bin/net/minecraft/src/WorldGenTrees.class differ
diff --git a/bin/net/minecraft/src/WorldGenerator.class b/bin/net/minecraft/src/WorldGenerator.class
new file mode 100644
index 0000000..8ed1fcf
Binary files /dev/null and b/bin/net/minecraft/src/WorldGenerator.class differ
diff --git a/bin/net/minecraft/src/WorldIso.class b/bin/net/minecraft/src/WorldIso.class
new file mode 100644
index 0000000..1858bf0
Binary files /dev/null and b/bin/net/minecraft/src/WorldIso.class differ
diff --git a/bin/net/minecraft/src/WorldRenderer.class b/bin/net/minecraft/src/WorldRenderer.class
new file mode 100644
index 0000000..0c3b62b
Binary files /dev/null and b/bin/net/minecraft/src/WorldRenderer.class differ
diff --git a/jars/deobfuscated-source.jar b/jars/deobfuscated-source.jar
new file mode 100644
index 0000000..226094d
Binary files /dev/null and b/jars/deobfuscated-source.jar differ
diff --git a/jars/deobfuscated.jar b/jars/deobfuscated.jar
new file mode 100644
index 0000000..786f946
Binary files /dev/null and b/jars/deobfuscated.jar differ
diff --git a/md5/original.md5 b/md5/original.md5
new file mode 100644
index 0000000..7158ff4
--- /dev/null
+++ b/md5/original.md5
@@ -0,0 +1,294 @@
+net/minecraft/client/MinecraftApplet 8d6fe53c7b0adb1c46f60c5e23b25807
+net/minecraft/isom/IsomPreviewApplet 40fcc17437de42b9f6a892dc261599ec
+net/minecraft/src/AxisAlignedBB 7de35a6e52c41fe3305e2663b08dd89b
+net/minecraft/src/Block d1f13a7a0988453428033d97ec9ed736
+net/minecraft/src/BlockBookshelf bc8f79e1cddba49eec9eb393c5bf539e
+net/minecraft/src/BlockBreakable 8e91c5b61a19247d047c1a502c351709
+net/minecraft/src/BlockChest 2ff6c9b0a62d21dc777667467f729fb8
+net/minecraft/src/BlockContainer 209d0b60592b29cf235d9ebdb4da5600
+net/minecraft/src/BlockCrops 0b7e1073b3410308e11f14e4d86665fe
+net/minecraft/src/BlockDirt 629d9c69ca4a061b4d486082fdbc2d0d
+net/minecraft/src/BlockDoor 5ed3c20d5147a11d8cc528f1b62b3c44
+net/minecraft/src/BlockFarmland cf769d712ee3ea7542fe828264eda4b9
+net/minecraft/src/BlockFire c5071625c617aa9dceb8d1d8e97c1d9a
+net/minecraft/src/BlockFlower 1c04cb2841c61bd5916dace99d1571d1
+net/minecraft/src/BlockFlowing 7d7ea5341114eab82e2b731aabf8d98d
+net/minecraft/src/BlockFluid 7ffccd6ad5e8e2fc544cdf8324419a77
+net/minecraft/src/BlockFurnace 0504179b68d405041ca224b0e19ddac4
+net/minecraft/src/BlockGears 2326f51f44b05cd54d9b9771b06d42cb
+net/minecraft/src/BlockGlass 70b9353af2382f347350cd468c45f203
+net/minecraft/src/BlockGrass 4b90366b7674acde24adf7f11d42d4e6
+net/minecraft/src/BlockGravel 4e3b0d9785fdc3c7d9c559f116934b82
+net/minecraft/src/BlockLadder c07a7cf5d2ad71dcb54a5b84327c8616
+net/minecraft/src/BlockLeaves 29e37cc7fe00c852ca1acdcccce7d6c9
+net/minecraft/src/BlockLeavesBase 0bee12b5ffcab49e67bd2e97ce6bfd89
+net/minecraft/src/BlockLog 620e600699308fcf5991db0ed03e20db
+net/minecraft/src/BlockMinecartTrack b1c68d30e5f4d7a7adbd5268aef72a49
+net/minecraft/src/BlockMobSpawner 9bccbb389429e6d6e7f4461ca8210b15
+net/minecraft/src/BlockMushroom 35406fe6feea3259e3d263c8e533c096
+net/minecraft/src/BlockObsidian c9dd5ad11b0f30e4765dadeeca2079ed
+net/minecraft/src/BlockOre c893596028ad809af9944e005748a173
+net/minecraft/src/BlockOreBlock 591c3612d131ebc500be3b24e8855ece
+net/minecraft/src/BlockSand 0b2c95e0a142d9ddebe3ec07b70ea067
+net/minecraft/src/BlockSapling 14e2f19aa69a643e96d3f3a5a46b064e
+net/minecraft/src/BlockSign 180382cc84599ee7b4b9f32e9954bb0b
+net/minecraft/src/BlockSponge 5fdb2fc6f87a2334c270c74967ca31ca
+net/minecraft/src/BlockStairs 1a32cab8f86b9a7e3fbd1e8e50e32f8b
+net/minecraft/src/BlockStationary 3deef6dfcec59f6fa5a401d19ed24fa4
+net/minecraft/src/BlockStep 8d420aa35b954dcc390cb6bfa9d96fd8
+net/minecraft/src/BlockStone 9949fab686673d79f5e201dee0dba2ad
+net/minecraft/src/BlockTNT c2239aa9b296010c957d9c9f223596e1
+net/minecraft/src/BlockTorch 04d26a4f2ec03df7cf4fa4f498200623
+net/minecraft/src/BlockWorkbench 67f226168f5c30410f8aa683d5c774e9
+net/minecraft/src/CanvasCrashReport 2ef401f30cd026a5bf165f712b22875d
+net/minecraft/src/CanvasIsomPreview 20638d19595b13b41f85f4c519bf1a52
+net/minecraft/src/CanvasMinecraftApplet d98f090faf78f93e556d21e5c349048e
+net/minecraft/src/CanvasMojangLogo d500e4a447a493f68cbad28ffdaf6f5b
+net/minecraft/src/ChatLine a49783126af9b456ea87e852ce8ccad6
+net/minecraft/src/Chunk d3afdda03ec92b401a0b3069c9609bc3
+net/minecraft/src/ChunkCache 8e6582037542034e695b90c7d776c5b1
+net/minecraft/src/ChunkLoader 310f5889898634c5224787f9b8626ac8
+net/minecraft/src/ChunkPosition aff8b61b357efa17c68fbb4372243a7f
+net/minecraft/src/ChunkProviderGenerate a78c06a671bfb8323987f7af9c27805f
+net/minecraft/src/ChunkProviderIso 0912c64413ae69de2a8169244adff393
+net/minecraft/src/ChunkProviderLoadOrGenerate c6d953d7444e8ea2c87ae67d70f934d6
+net/minecraft/src/ClippingHelper b03129faf8e2f8a10c483b539f1d4b00
+net/minecraft/src/ClippingHelperImplementation d6b978e583748d954e818854a2ea6c52
+net/minecraft/src/CompressedStreamTools a6ce36d2db398c3f9020f5634f907b14
+net/minecraft/src/CraftingManager 467836f936b52dab9522500c1e22b09d
+net/minecraft/src/CraftingRecipe 3696877116b5488dad9597230c1c66b9
+net/minecraft/src/EffectRenderer 048a400c14b37c3fef26c549f84c42a2
+net/minecraft/src/Entity c1a9e00c474fb488ed3de9eb45124fbb
+net/minecraft/src/EntityAnimal e106bcff5016de8e7b19d4a5d4c4ce16
+net/minecraft/src/EntityArrow d611634fa8bd40e5de73f100df95b4cd
+net/minecraft/src/EntityBubbleFX edf2184d1e9b71512aa571a96917a75a
+net/minecraft/src/EntityCreature 232d0ffe63313137dad2e2fdb34205ac
+net/minecraft/src/EntityCreeper 88cb73f2f6235180a6d6cfb2a953331d
+net/minecraft/src/EntityDiggingFX 1998558ac6f50ec2969579ba8911a30d
+net/minecraft/src/EntityExplodeFX f9c4095fe49d29465d21d4889ba7791c
+net/minecraft/src/EntityFallingSand 07a1311320ff9cad8414447c78c02a37
+net/minecraft/src/EntityFlameFX 3fdf057cb36341086138de8381ef866f
+net/minecraft/src/EntityFX c5dcc3b1b5ce954f9bb21e01be95b081
+net/minecraft/src/EntityGiant 9d6dffbe6ceaee69aab0eece1c41b557
+net/minecraft/src/EntityItem b0e4961920250992aeccb3d5f140c4e3
+net/minecraft/src/EntityLavaFX 38eced4f2a1e899d283af9d92d3cb409
+net/minecraft/src/EntityList 6f007a51eb53ebca1ad7a13a8491590d
+net/minecraft/src/EntityLiving 6eb36afa9be937c275d375218cb7b619
+net/minecraft/src/EntityMinecart ccddb4e137875396fb87e9366eaf1e64
+net/minecraft/src/EntityMonster 956963483b326fe63ce910cf461e7278
+net/minecraft/src/EntityPainting 9b19e077100b73463a290d1e32a5f62a
+net/minecraft/src/EntityPickupFX 0feede59ad464a5b449853bc174d3131
+net/minecraft/src/EntityPig 449964f4f07ebfc2cc840bbc5871c6eb
+net/minecraft/src/EntityPlayer 4986bbda58d284814464c4f5bd29f92a
+net/minecraft/src/EntityPlayerSP f5bc5ad5a21cea87bee057b12bd751bc
+net/minecraft/src/EntityRainFX 9906f32900405d9fe62d6ff42903c0be
+net/minecraft/src/EntityRenderer 53b09438ddd18de129fef06a0274dfed
+net/minecraft/src/EntitySheep 2af07b28fa380ec235d94e95c8b8e44a
+net/minecraft/src/EntitySkeleton 289f9c68df4c3d7cfd1ccedd25eb099d
+net/minecraft/src/EntitySmokeFX b90baad5499cf2a2f3c8b5d2be7ab2ce
+net/minecraft/src/EntitySorter 98207dc064926874ad74342fcd875ff6
+net/minecraft/src/EntitySpider 0c074336a7f37f5211c763f1c5a6dc9c
+net/minecraft/src/EntitySplashFX c712e50c56c0114d391b8be7ac041899
+net/minecraft/src/EntityTNTPrimed 0a48eb926ad992b58785289f7035822b
+net/minecraft/src/EntityZombie f25dbc8707e725256dc115c904108442
+net/minecraft/src/EnumArt 2e5c75fcbda2455f01511beaf5a0cd03
+net/minecraft/src/EnumOS 23599aaa3ffb1f1e15afc2a9392b4574
+net/minecraft/src/EnumOSIsom 4c7ba56c585e65a0ad0422c47886465d
+net/minecraft/src/EnumSkyBlock 83cfa185186b1b0b88936be0b5e1b0b6
+net/minecraft/src/Explosion d13eab4c7b378e3b77d347315a008f0f
+net/minecraft/src/FontRenderer b76eb20e4cd67f3104c877188ff510ae
+net/minecraft/src/Frustrum bfc3861659d2f323d1128e4cefcb95da
+net/minecraft/src/GameSettings 6a817bb7ce46fb9abfa2f387647df83d
+net/minecraft/src/GLAllocation 4374fa4647409570f62d09fa7eddbd11
+net/minecraft/src/Gui c28835ed231cceec3f39a1d7c2356ac6
+net/minecraft/src/GuiButton e75b5e01152fcfc9083404a9ac88c2ea
+net/minecraft/src/GuiChest 0c549356c9c47abdf86af80201b508c7
+net/minecraft/src/GuiContainer 0ebb48a49a3929287329eb8f46fc9a44
+net/minecraft/src/GuiControls 3b5f744243b028e0a431d76475d50205
+net/minecraft/src/GuiCrafting b00d190f3c8220be4d55a89d11cb8f86
+net/minecraft/src/GuiCreateWorld 38048655f1e4ccc1304a3526b4a39e56
+net/minecraft/src/GuiDeleteWorld 73ad06fd8120d1dc9d36359d8f22519a
+net/minecraft/src/GuiEditSign 09a31e211a18f8b7b2565b17c83ae05b
+net/minecraft/src/GuiErrorScreen 49a4f7db8ad4910ff0d0bf2714f6be1e
+net/minecraft/src/GuiFurnace 027d9f5a32d413ef9a598074df3a3394
+net/minecraft/src/GuiGameOver 337886148a6e0a0a16a006c756eca175
+net/minecraft/src/GuiIngame 21f1cf3538ccf5183314385126a2e28d
+net/minecraft/src/GuiIngameMenu 0e5a62c4660bbac5e6cdc513c0db3ff2
+net/minecraft/src/GuiInventory 3e79940d8a4d61e581c2c8ba0947a8af
+net/minecraft/src/GuiMainMenu 48e23469faafb66f486428afed73354f
+net/minecraft/src/GuiOptions b605b401d609de1f91d627a9aac85f2b
+net/minecraft/src/GuiScreen 1f90c51ed5549b3b2747f8086eece0fc
+net/minecraft/src/GuiSmallButton 1a0eae4fad1cbbea082819ea1d1a8b20
+net/minecraft/src/GuiYesNo 1444b4ba46744ad8a56fd580fdecb1a8
+net/minecraft/src/IBlockAccess 3f245c99e3dd50f95f054bb3ef23a552
+net/minecraft/src/ICamera bd7fd25734049b32cc5d63b6e95f3f3f
+net/minecraft/src/IChunkLoader 19834049fe129954692995eb389bcdaa
+net/minecraft/src/IChunkProvider 4950118e81f0892cdfa60dd80acb4ece
+net/minecraft/src/IInventory 417aec14cc48824ed9427bbedc182a27
+net/minecraft/src/ImageBuffer 1e3d2b803df5cc33825d0a725cab7b53
+net/minecraft/src/ImageBufferDownload 26b87993466f32143e29d2af02ab13c9
+net/minecraft/src/InventoryCrafting cffb587a1182840be1d1122f2e1eeb7c
+net/minecraft/src/InventoryCraftResult 1891a0986908e26c61f796f18f167437
+net/minecraft/src/InventoryLargeChest b73291a14a2075acfe14355ab52b072e
+net/minecraft/src/InventoryPlayer 27c4273b46abfdda55c6387ea32dcd08
+net/minecraft/src/IProgressUpdate 6831fda79dfb036273ccc47e9d26cdb2
+net/minecraft/src/IsoImageBuffer 4af3d5fb62b97e319b3021218e1b166a
+net/minecraft/src/Item b2a088bf5409b801a7d8699fa24cc867
+net/minecraft/src/ItemArmor 9b56041343b929f3eb92cbd0ca2b386c
+net/minecraft/src/ItemAxe b17866e5ec62fa961e64614f982183e3
+net/minecraft/src/ItemBlock 4463f9f02801c7f5731ffd93fca6b248
+net/minecraft/src/ItemBow c2377af76f133746be2e40b2f2db7373
+net/minecraft/src/ItemBucket c9096a409d878142799ac033cd0fe1c2
+net/minecraft/src/ItemDoor b3aedb2bfac578e0eac807ec758e450a
+net/minecraft/src/ItemFlintAndSteel 4fff45647c02a7c54936b3f32d2f6837
+net/minecraft/src/ItemFood 2cc2759c89fdce977ac999c374c9a0d4
+net/minecraft/src/ItemHoe ba6d0ea4c9ad2f038e12d54cef2c8d86
+net/minecraft/src/ItemMinecart 78acf361ab62258c925f40184883d1b9
+net/minecraft/src/ItemPainting 33d76778cdc6d096bec8c6505d9325c5
+net/minecraft/src/ItemPickaxe 92306d5f01d44934a413725189b7dcba
+net/minecraft/src/ItemRenderer f056d3dfac2bfb8794acd9b377cf37c9
+net/minecraft/src/ItemSaddle dc1aeb43b0d9bad0531b702853222064
+net/minecraft/src/ItemSeeds 763aa31a70edf2facedb615107e3fe23
+net/minecraft/src/ItemSign c40e2efc41e88d67abc2068916b588fa
+net/minecraft/src/ItemSoup 74c3f02b3fc2d9849fcee7e4cc4366a9
+net/minecraft/src/ItemSpade b0c40755bdafa6a7329c083f55013b88
+net/minecraft/src/ItemStack e7b6dfc3c34c59a6339d0e7260799ceb
+net/minecraft/src/ItemSword d45945ec2c691e0d5541c590917aae94
+net/minecraft/src/ItemTool 28504e77f13fbc60a3eaeebb19d4d9b2
+net/minecraft/src/IWorldAccess d741b55fdcd1b96ce93ebb1cf77e615f
+net/minecraft/src/KeyBinding 6f0178e04f1b55c630261b44166eba2a
+net/minecraft/src/LoadingScreenRenderer dd3c2c1cd4a21435ad172536e178c1d3
+net/minecraft/src/Material 980b90693ecbb9c923ed7a48f9578633
+net/minecraft/src/MaterialLiquid 17e71d3023ecea656a32d4e6b59241ae
+net/minecraft/src/MaterialLogic b9d043f53a44417c257fd7b8eb07115c
+net/minecraft/src/MaterialTransparent bd8a7a296eb26d1fb2f17fc92b14d817
+net/minecraft/src/MathHelper d0a2cc41ac7e331ca5c01901296a4e12
+net/minecraft/src/MetadataChunkBlock 02100696fbd2da0c4a266583d4d87c83
+net/minecraft/src/MinecartTrackLogic 7afb185325145bb3ae78ba53c4163b82
+net/minecraft/src/Minecraft 77275faf5a5bbdb31b755a63c8022323
+net/minecraft/src/MinecraftAppletImpl 3b093b102c34a18b02e75a2c9e934edd
+net/minecraft/src/MinecraftError d215f9ab6784f3caa9f0a07f68622abe
+net/minecraft/src/ModelBase 38093a8d0b4d0cace9debcc2864444c1
+net/minecraft/src/ModelBiped abea7f67a3593842a877206ab8cfe821
+net/minecraft/src/ModelCreeper e03ac79e0fa497962fa1b2af39db274d
+net/minecraft/src/ModelMinecart bfff17b759bf91ed92b4e0adb032ba7a
+net/minecraft/src/ModelPig 4897e4160d70d9c1bd7dfcdf81f3d5b7
+net/minecraft/src/ModelQuadruped 14c59aa420e0805faadd3b7536712170
+net/minecraft/src/ModelRenderer 558e5f9391a6a822282e517f6a0c8bbf
+net/minecraft/src/ModelSheep 1153dc07e2895f6ce6326c28f022a45b
+net/minecraft/src/ModelSheepFur 9caf40bfc7396c44b3776deb06139a79
+net/minecraft/src/ModelSkeleton 4c97935d4b549bc1a95505e08ffea2d8
+net/minecraft/src/ModelSpider 522ed5ce6d307ddf406c3eb7cdd85801
+net/minecraft/src/ModelZombie 86abe57d27056590c85442c4e3577fea
+net/minecraft/src/MouseHelper a69565ddbfa68b1a3980fc52ff4bbe6e
+net/minecraft/src/MovementInput 22fa46bfba79ad5527dd1836268587c1
+net/minecraft/src/MovementInputFromOptions 11f8157e8523eb7b4385f30d4db977b7
+net/minecraft/src/MovingObjectPosition c2aa19b1976ff4ddfeca0caeb59d5766
+net/minecraft/src/NBTBase eb1ae0abc23dbcac88af04d1f46f94b8
+net/minecraft/src/NBTTagByte 142ef1688e640546fd8f2a55abb94e0a
+net/minecraft/src/NBTTagByteArray 5a9ade9db5037ef032f14b08ea307e60
+net/minecraft/src/NBTTagCompound 7cc6305d18cf6cc1e9886f07776d585f
+net/minecraft/src/NBTTagDouble 7a1f7c99581c1c07df334df51770dd18
+net/minecraft/src/NBTTagEnd 931dd489855163d94d32a8caa0024797
+net/minecraft/src/NBTTagFloat c09e0173ce0da98ada1f0fe458ff5d72
+net/minecraft/src/NBTTagInt bd5c6c2f190c4aba1d2c708713c56ced
+net/minecraft/src/NBTTagList 8c9807ac01fa8f45eb156d0298c66ed6
+net/minecraft/src/NBTTagLong 26d93b62f53153499ab1a6dec6144a32
+net/minecraft/src/NBTTagShort 79f2195a9cdf1f16fc2cbfb27b76ef25
+net/minecraft/src/NBTTagString 562a59b6f1f72b3a9d0a5d334bf68ee3
+net/minecraft/src/NextTickListEntry 5e6b8dfa0dbeacd946f31e7223b3ed23
+net/minecraft/src/NibbleArray c784dba2c020b9eb824eff5eac1c2fff
+net/minecraft/src/NoiseGenerator e337643c861b3f1d88d3969c33b7dc6a
+net/minecraft/src/NoiseGeneratorOctaves a6f3a9082b2c818a182439be4798c831
+net/minecraft/src/NoiseGeneratorPerlin 70c1affe5f3238101f3739e753a11c08
+net/minecraft/src/OpenGlCapsChecker c6039cee77b230b3eb8caeae81da9175
+net/minecraft/src/OSMap e5d6ee091ee22aca91481d7219aef5d8
+net/minecraft/src/OSMapIsom 0b8b89d045d369b0afcb8f8b19f6d1e3
+net/minecraft/src/PanelCrashReport d9c0102b855c2d102ec3cd78cefa0bdf
+net/minecraft/src/Path 01bb1ac9df42e1e4e89cd05bb208bb25
+net/minecraft/src/PathEntity 44ee3c75609c9f7a775cf7e863e8a642
+net/minecraft/src/Pathfinder df8927c8e5747948edd25e64c32d6286
+net/minecraft/src/PathPoint 258e1906a1661eac44db42b8c33929b2
+net/minecraft/src/PlayerController 26dd0807fee6600edaeb80547e799d5a
+net/minecraft/src/PlayerControllerCreative 39a7efcce76f8f3cd88f18d76ccb6031
+net/minecraft/src/PlayerControllerSP f32e18ef816761f83f800d0de7417a46
+net/minecraft/src/PositionTextureVertex bb2fa009e8f559226103cf6f8bc8b5c0
+net/minecraft/src/RecipesArmor f5574fb0196f9b50c0162acf00457c03
+net/minecraft/src/RecipesCrafting 5b4b934f78078d2f4cbb759c345950a5
+net/minecraft/src/RecipesFood 2f6fc71f16695d42334bea115b923ccc
+net/minecraft/src/RecipesIngots 97c4d9d5c6133230ade8e1f7996e8536
+net/minecraft/src/RecipeSorter 1546e24883b661b1ecc4784ef4550cf8
+net/minecraft/src/RecipesTools a166ccbc2e6e7280e980557ef21c1877
+net/minecraft/src/RecipesWeapons 81f6d621786f7879ba6cd3c300ac64e6
+net/minecraft/src/Render 767f17aa1ad559da6c43432a8964c513
+net/minecraft/src/RenderArrow 0d5fe1b1b6c620a05f986e161ce4db48
+net/minecraft/src/RenderBlocks df4357d23cfeb7f2314e8a322e20ea65
+net/minecraft/src/RenderCreeper 4af7e7e5f49f242f04a712ac085ab006
+net/minecraft/src/RenderEngine 586bc02551536a1e4b967c49e636e7a0
+net/minecraft/src/RenderEntity 62ea494363eb40bb65d8627d12e84a3a
+net/minecraft/src/RenderFallingSand 35b08b5488ec8aa37265c87176e80fc5
+net/minecraft/src/RenderGiantZombie d65c6c83cd288d149cb09ec424c60c9e
+net/minecraft/src/RenderGlobal cc340a3525d4ba213277e8acb566a973
+net/minecraft/src/RenderHelper d9bfb22104ba2944b2e3f01c31b29003
+net/minecraft/src/RenderItem e13c6a393bab3183e66441961f0478ce
+net/minecraft/src/RenderList 37c04d753dbe9bdd6012a664596eb74e
+net/minecraft/src/RenderLiving c157601353a9312dfaf813969b438022
+net/minecraft/src/RenderManager 1b18db3121270de8e52f957449922f23
+net/minecraft/src/RenderMinecart 68b1d13465b6d00f4a1c896d5684bc03
+net/minecraft/src/RenderPainting b50c3bf93f41340858569a9a378d07cc
+net/minecraft/src/RenderPig 915fa78c00563fdb6e785f49a1b96655
+net/minecraft/src/RenderPlayer ec288a380cab493fddf785c560b5b5b7
+net/minecraft/src/RenderSheep 08078ef1f90cd78bf39fe9e6edd2f60c
+net/minecraft/src/RenderSorter 7a1657a27299a8ad90022b7503e2359d
+net/minecraft/src/RenderSpider 774b01b1747e5ff1c2e8eee27be687c3
+net/minecraft/src/RenderTNTPrimed 173a77d83b26e7b81d07d3de615f249b
+net/minecraft/src/ScaledResolution 71746cf151922c5849d585c144d8619f
+net/minecraft/src/Session 7a090f301b19935d780f344e0dadd5b7
+net/minecraft/src/SignModel 918d9a054221fb1b0d27795bb2b9412f
+net/minecraft/src/Slot 72a8135219fd2b508d1348487ffee81f
+net/minecraft/src/SlotArmor 2577ed556dfd26552e2c2b820089ebfc
+net/minecraft/src/SlotCrafting 081181ff4c1191c037854a305d7be743
+net/minecraft/src/SoundManager 27f88612e6213ac895723a437826c7f8
+net/minecraft/src/SoundPool e3c3260931269507d063c1690793e724
+net/minecraft/src/SoundPoolEntry 14549b52cd248ccf234638676dbe24c3
+net/minecraft/src/SpawnerAnimals de03b1f330a01a5bf0c9adc1fdd29d4f
+net/minecraft/src/SpawnerMonsters 79784852e26205648925b189e7752509
+net/minecraft/src/StepSound 8444ba8ac738f2b1170bf924c4a2c0fb
+net/minecraft/src/StepSoundGlass d42324f12fcb11ef0bc86517a6039d66
+net/minecraft/src/StepSoundSand d68f534fc32661a3da52b8bac0758bf3
+net/minecraft/src/TerrainTextureManager 3ecee39cc31200b5986e67ace5a82c68
+net/minecraft/src/Tessellator a8808d1f71e7cff6431179e0bf71b301
+net/minecraft/src/TexturedQuad 0dac74af67cf2cd46c3840624f3f8b7b
+net/minecraft/src/TextureFlamesFX 12e1c4da4f7892ceee6bab9bb6822c36
+net/minecraft/src/TextureFX afebf08145be6982e8ea8143bae27371
+net/minecraft/src/TextureGearsFX 40a4ea07328b930eee7e6de689ee1428
+net/minecraft/src/TextureLavaFlowFX 5000d4a0d7749812f2ecee75aecd6c16
+net/minecraft/src/TextureLavaFX 479ea1fbb28dc5570d2760fadb05a3fa
+net/minecraft/src/TextureWaterFlowFX cd8f71b24d806b424c3e03e8e5baf47e
+net/minecraft/src/TextureWaterFX 27c1676637c126d7aba650bdd45003bb
+net/minecraft/src/ThreadDownloadImage 8d71d37d5c2958df1f6cdbd4e63bd811
+net/minecraft/src/ThreadDownloadImageData 0a709907f9fd2ab4aa5dd3e5bd940098
+net/minecraft/src/ThreadDownloadResources 5db29972705756c5a0556760585da6c3
+net/minecraft/src/ThreadRunIsoClient c1dd25776dd635f50a6a3ce1a689cb9d
+net/minecraft/src/ThreadSleepForever 5d10f2259d80668fcffa01cb1569d449
+net/minecraft/src/TileEntity 9b0780f73efa21ac235c54f20513f926
+net/minecraft/src/TileEntityChest f0e9a510b38a4357ba69e74142cfcc11
+net/minecraft/src/TileEntityFurnace 80e6a37e4e315a809f492f889126f49a
+net/minecraft/src/TileEntityMobSpawner 0b4f73e722dfb0a47c4ad735fb7bb24f
+net/minecraft/src/TileEntityMobSpawnerRenderer a9061a8b9ae339cdae9c498e9b4e968d
+net/minecraft/src/TileEntityRenderer ffdeeef4bdc94c5a5996bc2a72d48906
+net/minecraft/src/TileEntitySign f38e6bf25f298b380201cfb533a1b34c
+net/minecraft/src/TileEntitySignRenderer f8b43e4236bbed9ef40efd9c5e256285
+net/minecraft/src/TileEntitySpecialRenderer 6b9f58031d144059e85a5b8ef10dc8bd
+net/minecraft/src/Timer 38b1919e29eb01f7525b4ae938be7c72
+net/minecraft/src/UnexpectedThrowable 9914e21fd6f5e23a993882c4d0d50bd1
+net/minecraft/src/Vec3D 7d71772924fc78ea5a41e3dcc467de3f
+net/minecraft/src/World aaa75660a9493f14dbfff7c7dd308290
+net/minecraft/src/WorldGenDungeons 099ffacbfcc744623a3bd3c73a17beaa
+net/minecraft/src/WorldGenerator b8242301950ad421598161abe3dee73f
+net/minecraft/src/WorldGenFlowers bf3e4852966b370d4926a61713b5a2f6
+net/minecraft/src/WorldGenLiquids b9b12612888f9533ad1cc7a19c748943
+net/minecraft/src/WorldGenMinable feecd1a3b2cd72cb16d4907d387d1f46
+net/minecraft/src/WorldGenTrees 919b05059c6d0e8bd5e822f21522697e
+net/minecraft/src/WorldIso 2e5d3bae8897c22a2e35f6b637dec28f
+net/minecraft/src/WorldRenderer 50f36d9486797350d9a3bd643ffab98f
diff --git a/source/net/minecraft/client/MinecraftApplet.java b/source/net/minecraft/client/MinecraftApplet.java
new file mode 100644
index 0000000..da453ec
--- /dev/null
+++ b/source/net/minecraft/client/MinecraftApplet.java
@@ -0,0 +1,105 @@
+package net.minecraft.client;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import net.minecraft.src.CanvasMinecraftApplet;
+import net.minecraft.src.Minecraft;
+import net.minecraft.src.MinecraftAppletImpl;
+import net.minecraft.src.Session;
+
+public class MinecraftApplet extends Applet {
+ private Canvas mcCanvas;
+ private Minecraft mc;
+ private Thread mcThread = null;
+
+ public void init() {
+ this.mcCanvas = new CanvasMinecraftApplet(this);
+ boolean var1 = false;
+ if(this.getParameter("fullscreen") != null) {
+ var1 = this.getParameter("fullscreen").equalsIgnoreCase("true");
+ }
+
+ this.mc = new MinecraftAppletImpl(this, this, this.mcCanvas, this, this.getWidth(), this.getHeight(), var1);
+ this.mc.minecraftUri = this.getDocumentBase().getHost();
+ if(this.getDocumentBase().getPort() > 0) {
+ this.mc.minecraftUri = this.mc.minecraftUri + ":" + this.getDocumentBase().getPort();
+ }
+
+ if(this.getParameter("username") != null && this.getParameter("sessionid") != null) {
+ this.mc.session = new Session(this.getParameter("username"), this.getParameter("sessionid"));
+ if(this.getParameter("mppass") != null) {
+ this.mc.session.mpPassParameter = this.getParameter("mppass");
+ }
+ }
+
+ if(this.getParameter("loadmap_user") != null && this.getParameter("loadmap_id") != null) {
+ this.mc.objectMouseOverString = this.getParameter("loadmap_user");
+ this.mc.rightClickDelayTimer = Integer.parseInt(this.getParameter("loadmap_id"));
+ } else if(this.getParameter("server") != null && this.getParameter("port") != null) {
+ this.mc.setServer(this.getParameter("server"), Integer.parseInt(this.getParameter("port")));
+ }
+
+ this.mc.appletMode = true;
+ this.setLayout(new BorderLayout());
+ this.add(this.mcCanvas, "Center");
+ this.mcCanvas.setFocusable(true);
+ this.validate();
+ }
+
+ public void startMainThread() {
+ if(this.mcThread == null) {
+ this.mcThread = new Thread(this.mc, "Minecraft main thread");
+ this.mcThread.start();
+ }
+ }
+
+ public void start() {
+ if(this.mc != null) {
+ this.mc.isGamePaused = false;
+ }
+
+ }
+
+ public void stop() {
+ if(this.mc != null) {
+ this.mc.isGamePaused = true;
+ }
+
+ }
+
+ public void destroy() {
+ this.shutdown();
+ }
+
+ public void shutdown() {
+ if(this.mcThread != null) {
+ this.mc.shutdown();
+
+ try {
+ this.mcThread.join(10000L);
+ } catch (InterruptedException var4) {
+ try {
+ this.mc.shutdownMinecraftApplet();
+ } catch (Exception var3) {
+ var3.printStackTrace();
+ }
+ }
+
+ this.mcThread = null;
+ }
+ }
+
+ public void clearApplet() {
+ this.mcCanvas = null;
+ this.mc = null;
+ this.mcThread = null;
+
+ try {
+ this.removeAll();
+ this.validate();
+ } catch (Exception var2) {
+ }
+
+ }
+}
diff --git a/source/net/minecraft/isom/IsomPreviewApplet.java b/source/net/minecraft/isom/IsomPreviewApplet.java
new file mode 100644
index 0000000..b192ed2
--- /dev/null
+++ b/source/net/minecraft/isom/IsomPreviewApplet.java
@@ -0,0 +1,22 @@
+package net.minecraft.isom;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import net.minecraft.src.CanvasIsomPreview;
+
+public class IsomPreviewApplet extends Applet {
+ private CanvasIsomPreview isomCanvas = new CanvasIsomPreview();
+
+ public IsomPreviewApplet() {
+ this.setLayout(new BorderLayout());
+ this.add(this.isomCanvas, "Center");
+ }
+
+ public void start() {
+ this.isomCanvas.start();
+ }
+
+ public void stop() {
+ this.isomCanvas.stop();
+ }
+}
diff --git a/source/net/minecraft/src/AxisAlignedBB.java b/source/net/minecraft/src/AxisAlignedBB.java
new file mode 100644
index 0000000..e680fee
--- /dev/null
+++ b/source/net/minecraft/src/AxisAlignedBB.java
@@ -0,0 +1,313 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AxisAlignedBB {
+ private static List boundingBoxes = new ArrayList();
+ private static int numBoundingBoxesInUse = 0;
+ public double minX;
+ public double minY;
+ public double minZ;
+ public double maxX;
+ 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);
+ }
+
+ public static void clearBoundingBoxPool() {
+ numBoundingBoxesInUse = 0;
+ }
+
+ public static AxisAlignedBB getBoundingBoxFromPool(double var0, double var2, double var4, double var6, double var8, double var10) {
+ if(numBoundingBoxesInUse >= boundingBoxes.size()) {
+ boundingBoxes.add(getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D));
+ }
+
+ return ((AxisAlignedBB)boundingBoxes.get(numBoundingBoxesInUse++)).setBounds(var0, var2, var4, var6, var8, var10);
+ }
+
+ private 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 this;
+ }
+
+ public AxisAlignedBB addCoord(double var1, double var3, double var5) {
+ 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 getBoundingBoxFromPool(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 getBoundingBoxFromPool(var7, var9, var11, var13, var15, var17);
+ }
+
+ public AxisAlignedBB getOffsetBoundingBox(double var1, double var3, double var5) {
+ return getBoundingBoxFromPool(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;
+ return this;
+ }
+
+ public double getAverageEdgeLength() {
+ double var1 = this.maxX - this.minX;
+ double var3 = this.maxY - this.minY;
+ double var5 = this.maxZ - this.minZ;
+ return (var1 + var3 + var5) / 3.0D;
+ }
+
+ public AxisAlignedBB copy() {
+ return getBoundingBoxFromPool(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
+ }
+
+ public MovingObjectPosition calculateIntercept(Vec3D var1, Vec3D var2) {
+ Vec3D var3 = var1.getIntermediateWithXValue(var2, this.minX);
+ Vec3D var4 = var1.getIntermediateWithXValue(var2, this.maxX);
+ Vec3D var5 = var1.getIntermediateWithYValue(var2, this.minY);
+ Vec3D var6 = var1.getIntermediateWithYValue(var2, this.maxY);
+ Vec3D var7 = var1.getIntermediateWithZValue(var2, this.minZ);
+ Vec3D var8 = var1.getIntermediateWithZValue(var2, this.maxZ);
+ if(!this.isVecInYZ(var3)) {
+ var3 = null;
+ }
+
+ if(!this.isVecInYZ(var4)) {
+ var4 = null;
+ }
+
+ if(!this.isVecInXZ(var5)) {
+ var5 = null;
+ }
+
+ if(!this.isVecInXZ(var6)) {
+ var6 = null;
+ }
+
+ if(!this.isVecInXY(var7)) {
+ var7 = null;
+ }
+
+ if(!this.isVecInXY(var8)) {
+ var8 = null;
+ }
+
+ Vec3D var9 = null;
+ if(var3 != null && (var9 == null || var1.squareDistanceTo(var3) < var1.squareDistanceTo(var9))) {
+ var9 = var3;
+ }
+
+ if(var4 != null && (var9 == null || var1.squareDistanceTo(var4) < var1.squareDistanceTo(var9))) {
+ var9 = var4;
+ }
+
+ if(var5 != null && (var9 == null || var1.squareDistanceTo(var5) < var1.squareDistanceTo(var9))) {
+ var9 = var5;
+ }
+
+ if(var6 != null && (var9 == null || var1.squareDistanceTo(var6) < var1.squareDistanceTo(var9))) {
+ var9 = var6;
+ }
+
+ if(var7 != null && (var9 == null || var1.squareDistanceTo(var7) < var1.squareDistanceTo(var9))) {
+ var9 = var7;
+ }
+
+ if(var8 != null && (var9 == null || var1.squareDistanceTo(var8) < var1.squareDistanceTo(var9))) {
+ var9 = var8;
+ }
+
+ if(var9 == null) {
+ return null;
+ } else {
+ byte var10 = -1;
+ if(var9 == var3) {
+ var10 = 4;
+ }
+
+ if(var9 == var4) {
+ var10 = 5;
+ }
+
+ if(var9 == var5) {
+ var10 = 0;
+ }
+
+ if(var9 == var6) {
+ var10 = 1;
+ }
+
+ if(var9 == var7) {
+ var10 = 2;
+ }
+
+ if(var9 == var8) {
+ var10 = 3;
+ }
+
+ return new MovingObjectPosition(0, 0, 0, var10, var9);
+ }
+ }
+
+ private boolean isVecInYZ(Vec3D var1) {
+ return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInXZ(Vec3D var1) {
+ return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInXY(Vec3D 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;
+ }
+}
diff --git a/source/net/minecraft/src/Block.java b/source/net/minecraft/src/Block.java
new file mode 100644
index 0000000..a962b9d
--- /dev/null
+++ b/source/net/minecraft/src/Block.java
@@ -0,0 +1,432 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+public class Block {
+ 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);
+ public static final StepSound soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F);
+ public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
+ public static final StepSound soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
+ public static final StepSound soundGlassFootstep = new StepSoundGlass("stone", 1.0F, 1.0F);
+ public static final StepSound soundClothFootstep = new StepSound("cloth", 1.0F, 1.0F);
+ public static final StepSound soundSandFootstep = new StepSoundSand("sand", 1.0F, 1.0F);
+ public static final Block[] blocksList = new Block[256];
+ public static final boolean[] tickOnLoad = new boolean[256];
+ public static final boolean[] opaqueCubeLookup = new boolean[256];
+ public static final int[] lightOpacity = new int[256];
+ public static final boolean[] canBlockGrass = new boolean[256];
+ public static final int[] lightValue = new int[256];
+ public static final Block stone = (new BlockStone(1, 1)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final BlockGrass grass = (BlockGrass)(new BlockGrass(2)).setHardness(0.6F).setStepSound(soundGrassFootstep);
+ public static final Block dirt = (new BlockDirt(3, 2)).setHardness(0.5F).setStepSound(soundGravelFootstep);
+ public static final Block cobblestone = (new Block(4, 16, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block planks = (new Block(5, 4, Material.wood)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep);
+ public static final Block sapling = (new BlockSapling(6, 15)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block bedrock = (new Block(7, 17, Material.rock)).setHardness(-1.0F).setResistance(6000000.0F).setStepSound(soundStoneFootstep);
+ public static final Block waterMoving = (new BlockFlowing(8, Material.water)).setHardness(100.0F).setLightOpacity(3);
+ public static final Block waterStill = (new BlockStationary(9, Material.water)).setHardness(100.0F).setLightOpacity(3);
+ public static final Block lavaMoving = (new BlockFlowing(10, Material.lava)).setHardness(0.0F).setLightValue(1.0F).setLightOpacity(255);
+ public static final Block lavaStill = (new BlockStationary(11, Material.lava)).setHardness(100.0F).setLightValue(1.0F).setLightOpacity(255);
+ public static final Block sand = (new BlockSand(12, 18)).setHardness(0.5F).setStepSound(soundSandFootstep);
+ public static final Block gravel = (new BlockGravel(13, 19)).setHardness(0.6F).setStepSound(soundGravelFootstep);
+ public static final Block oreGold = (new BlockOre(14, 32)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block oreIron = (new BlockOre(15, 33)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block oreCoal = (new BlockOre(16, 34)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block wood = (new BlockLog(17)).setHardness(2.0F).setStepSound(soundWoodFootstep);
+ public static final BlockLeaves leaves = (BlockLeaves)(new BlockLeaves(18, 52)).setHardness(0.2F).setLightOpacity(1).setStepSound(soundGrassFootstep);
+ public static final Block sponge = (new BlockSponge(19)).setHardness(0.6F).setStepSound(soundGrassFootstep);
+ public static final Block glass = (new BlockGlass(20, 49, Material.glass, false)).setHardness(0.3F).setStepSound(soundGlassFootstep);
+ public static final Block clothRed = null;
+ public static final Block clothOrange = null;
+ public static final Block clothYellow = null;
+ public static final Block clothChartreuse = null;
+ public static final Block clothGreen = null;
+ public static final Block clothSpringGreen = null;
+ public static final Block clothCyan = null;
+ public static final Block clothCapri = null;
+ public static final Block clothUltramarine = null;
+ public static final Block clothViolet = null;
+ public static final Block clothPurple = null;
+ public static final Block clothMagenta = null;
+ public static final Block clothRose = null;
+ public static final Block clothDarkGray = null;
+ public static final Block cloth = (new Block(35, 64, Material.cloth)).setHardness(0.8F).setStepSound(soundClothFootstep);
+ public static final Block clothWhite = null;
+ public static final BlockFlower plantYellow = (BlockFlower)(new BlockFlower(37, 13)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final BlockFlower plantRed = (BlockFlower)(new BlockFlower(38, 12)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final BlockFlower mushroomBrown = (BlockFlower)(new BlockMushroom(39, 29)).setHardness(0.0F).setStepSound(soundGrassFootstep).setLightValue(2.0F / 16.0F);
+ public static final BlockFlower mushroomRed = (BlockFlower)(new BlockMushroom(40, 28)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block blockGold = (new BlockOreBlock(41, 39)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
+ public static final Block blockSteel = (new BlockOreBlock(42, 38)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
+ public static final Block stairDouble = (new BlockStep(43, true)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block stairSingle = (new BlockStep(44, false)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block brick = (new Block(45, 7, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block tnt = (new BlockTNT(46, 8)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block bookshelf = (new BlockBookshelf(47, 35)).setHardness(1.5F).setStepSound(soundWoodFootstep);
+ public static final Block cobblestoneMossy = (new Block(48, 36, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block obsidian = (new BlockObsidian(49, 37)).setHardness(10.0F).setResistance(20.0F).setStepSound(soundStoneFootstep);
+ public static final Block torch = (new BlockTorch(50, 80)).setHardness(0.0F).setLightValue(15.0F / 16.0F).setStepSound(soundWoodFootstep);
+ public static final BlockFire fire = (BlockFire)((BlockFire)(new BlockFire(51, 31)).setHardness(0.0F).setLightValue(1.0F).setStepSound(soundWoodFootstep));
+ public static final Block mobSpawner = (new BlockMobSpawner(52, 65)).setHardness(5.0F).setStepSound(soundMetalFootstep);
+ public static final Block stairCompactWood = new BlockStairs(53, planks);
+ public static final Block chest = (new BlockChest(54)).setHardness(2.5F).setStepSound(soundWoodFootstep);
+ public static final Block cog = (new BlockGears(55, 62)).setHardness(0.5F).setStepSound(soundMetalFootstep);
+ public static final Block oreDiamond = (new BlockOre(56, 50)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block blockDiamond = (new BlockOreBlock(57, 40)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
+ public static final Block workbench = (new BlockWorkbench(58)).setHardness(2.5F).setStepSound(soundWoodFootstep);
+ public static final Block crops = (new BlockCrops(59, 88)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block tilledField = (new BlockFarmland(60)).setHardness(0.6F).setStepSound(soundGravelFootstep);
+ public static final Block stoneOvenIdle = (new BlockFurnace(61, false)).setHardness(3.5F).setStepSound(soundStoneFootstep);
+ public static final Block stoneOvenActive = (new BlockFurnace(62, true)).setHardness(3.5F).setStepSound(soundStoneFootstep).setLightValue(14.0F / 16.0F);
+ public static final Block signStanding = (new BlockSign(63, TileEntitySign.class, Item.sign.shiftedIndex)).setHardness(1.0F).setStepSound(soundWoodFootstep);
+ public static final Block doorWood = (new BlockDoor(64)).setHardness(3.0F).setStepSound(soundWoodFootstep);
+ public static final Block ladder = (new BlockLadder(65, 83)).setHardness(0.4F).setStepSound(soundWoodFootstep);
+ public static final Block minecartTrack = (new BlockMinecartTrack(66, 128)).setHardness(1.0F).setStepSound(soundMetalFootstep);
+ public static final Block stairCompactStone = new BlockStairs(67, cobblestone);
+ public int blockIndexInTexture;
+ public final int blockID;
+ protected float blockHardness;
+ protected float blockResistance;
+ public double minX;
+ public double minY;
+ public double minZ;
+ public double maxX;
+ public double maxY;
+ public double maxZ;
+ public StepSound stepSound;
+ public float blockParticleGravity;
+ public final Material blockMaterial;
+
+ protected Block(int var1, Material var2) {
+ this.stepSound = soundPowderFootstep;
+ this.blockParticleGravity = 1.0F;
+ if(blocksList[var1] != null) {
+ throw new IllegalArgumentException("Slot " + var1 + " is already occupied by " + blocksList[var1] + " when adding " + this);
+ } else {
+ this.blockMaterial = var2;
+ blocksList[var1] = this;
+ this.blockID = var1;
+ 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] = this.getCanBlockGrass();
+ }
+ }
+
+ protected Block(int var1, int var2, Material var3) {
+ this(var1, var3);
+ this.blockIndexInTexture = var2;
+ }
+
+ 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;
+ }
+
+ private boolean getCanBlockGrass() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ public int getRenderType() {
+ return 0;
+ }
+
+ protected Block setHardness(float var1) {
+ this.blockHardness = var1;
+ if(this.blockResistance < var1 * 5.0F) {
+ this.blockResistance = var1 * 5.0F;
+ }
+
+ return this;
+ }
+
+ protected void setTickOnLoad(boolean var1) {
+ tickOnLoad[this.blockID] = var1;
+ }
+
+ public 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);
+ }
+
+ 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.isBlockNormalCube(var2, var3, var4))))));
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return this.getBlockTextureFromSideAndMetadata(var5, var1.getBlockMetadata(var2, var3, var4));
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return this.getBlockTextureFromSide(var1);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return this.blockIndexInTexture;
+ }
+
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return AxisAlignedBB.getBoundingBoxFromPool((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 getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
+ AxisAlignedBB var7 = this.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
+ if(var7 != null && var5.intersectsWith(var7)) {
+ var6.add(var7);
+ }
+
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return AxisAlignedBB.getBoundingBoxFromPool((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 boolean isOpaqueCube() {
+ return true;
+ }
+
+ public boolean canCollideCheck(int var1, boolean var2) {
+ return this.isCollidable();
+ }
+
+ 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() {
+ return 10;
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ }
+
+ public void onBlockRemoval(World var1, int var2, int var3, int var4) {
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.blockID;
+ }
+
+ public float blockStrength(EntityPlayer var1) {
+ return this.blockHardness < 0.0F ? 0.0F : (!var1.canHarvestBlock(this) ? 1.0F / this.blockHardness / 100.0F : var1.getCurrentPlayerStrVsBlock(this) / this.blockHardness / 30.0F);
+ }
+
+ public void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5) {
+ this.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, 1.0F);
+ }
+
+ public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
+ int var7 = this.quantityDropped(var1.rand);
+
+ for(int var8 = 0; var8 < var7; ++var8) {
+ if(var1.rand.nextFloat() <= var6) {
+ int var9 = this.idDropped(var5, var1.rand);
+ if(var9 > 0) {
+ float var10 = 0.7F;
+ double var11 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
+ double var13 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
+ double var15 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
+ EntityItem var17 = new EntityItem(var1, (double)var2 + var11, (double)var3 + var13, (double)var4 + var15, new ItemStack(var9));
+ var17.delayBeforeCanPickup = 10;
+ var1.spawnEntityInWorld(var17);
+ }
+ }
+ }
+
+ }
+
+ public float getExplosionResistance(Entity var1) {
+ return this.blockResistance / 5.0F;
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ var5 = var5.addVector((double)(-var2), (double)(-var3), (double)(-var4));
+ var6 = var6.addVector((double)(-var2), (double)(-var3), (double)(-var4));
+ Vec3D var7 = var5.getIntermediateWithXValue(var6, this.minX);
+ Vec3D var8 = var5.getIntermediateWithXValue(var6, this.maxX);
+ Vec3D var9 = var5.getIntermediateWithYValue(var6, this.minY);
+ Vec3D var10 = var5.getIntermediateWithYValue(var6, this.maxY);
+ Vec3D var11 = var5.getIntermediateWithZValue(var6, this.minZ);
+ Vec3D var12 = var5.getIntermediateWithZValue(var6, this.maxZ);
+ if(!this.isVecInsideYZBounds(var7)) {
+ var7 = null;
+ }
+
+ if(!this.isVecInsideYZBounds(var8)) {
+ var8 = null;
+ }
+
+ if(!this.isVecInsideXZBounds(var9)) {
+ var9 = null;
+ }
+
+ if(!this.isVecInsideXZBounds(var10)) {
+ var10 = null;
+ }
+
+ if(!this.isVecInsideXYBounds(var11)) {
+ var11 = null;
+ }
+
+ if(!this.isVecInsideXYBounds(var12)) {
+ var12 = null;
+ }
+
+ Vec3D var13 = null;
+ if(var7 != null && (var13 == null || var5.distanceTo(var7) < var5.distanceTo(var13))) {
+ var13 = var7;
+ }
+
+ if(var8 != null && (var13 == null || var5.distanceTo(var8) < var5.distanceTo(var13))) {
+ var13 = var8;
+ }
+
+ if(var9 != null && (var13 == null || var5.distanceTo(var9) < var5.distanceTo(var13))) {
+ var13 = var9;
+ }
+
+ if(var10 != null && (var13 == null || var5.distanceTo(var10) < var5.distanceTo(var13))) {
+ var13 = var10;
+ }
+
+ if(var11 != null && (var13 == null || var5.distanceTo(var11) < var5.distanceTo(var13))) {
+ var13 = var11;
+ }
+
+ if(var12 != null && (var13 == null || var5.distanceTo(var12) < var5.distanceTo(var13))) {
+ var13 = var12;
+ }
+
+ if(var13 == null) {
+ return null;
+ } else {
+ byte var14 = -1;
+ if(var13 == var7) {
+ var14 = 4;
+ }
+
+ if(var13 == var8) {
+ var14 = 5;
+ }
+
+ if(var13 == var9) {
+ var14 = 0;
+ }
+
+ if(var13 == var10) {
+ var14 = 1;
+ }
+
+ if(var13 == var11) {
+ var14 = 2;
+ }
+
+ if(var13 == var12) {
+ var14 = 3;
+ }
+
+ return new MovingObjectPosition(var2, var3, var4, var14, var13.addVector((double)var2, (double)var3, (double)var4));
+ }
+ }
+
+ private boolean isVecInsideYZBounds(Vec3D var1) {
+ return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInsideXZBounds(Vec3D var1) {
+ return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInsideXYBounds(Vec3D 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) {
+ }
+
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return true;
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ return false;
+ }
+
+ public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
+ }
+
+ public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
+ }
+
+ 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, Vec3D var6) {
+ }
+
+ public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
+ }
+
+ public int getRenderColor(IBlockAccess var1, int var2, int var3, int var4) {
+ return 16777215;
+ }
+
+ static {
+ for(int var0 = 0; var0 < 256; ++var0) {
+ if(blocksList[var0] != null) {
+ Item.itemsList[var0] = new ItemBlock(var0 - 256);
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockBookshelf.java b/source/net/minecraft/src/BlockBookshelf.java
new file mode 100644
index 0000000..e91f8a9
--- /dev/null
+++ b/source/net/minecraft/src/BlockBookshelf.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockBookshelf extends Block {
+ public BlockBookshelf(int var1, int var2) {
+ super(var1, var2, Material.wood);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 <= 1 ? 4 : this.blockIndexInTexture;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+}
diff --git a/source/net/minecraft/src/BlockBreakable.java b/source/net/minecraft/src/BlockBreakable.java
new file mode 100644
index 0000000..a037862
--- /dev/null
+++ b/source/net/minecraft/src/BlockBreakable.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class BlockBreakable extends Block {
+ private boolean localFlag;
+
+ protected BlockBreakable(int var1, int var2, Material var3, boolean var4) {
+ super(var1, var2, var3);
+ this.localFlag = var4;
+ }
+
+ 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);
+ }
+}
diff --git a/source/net/minecraft/src/BlockChest.java b/source/net/minecraft/src/BlockChest.java
new file mode 100644
index 0000000..9807507
--- /dev/null
+++ b/source/net/minecraft/src/BlockChest.java
@@ -0,0 +1,196 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockChest extends BlockContainer {
+ private Random random = new Random();
+
+ protected BlockChest(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 26;
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ if(var5 == 1) {
+ return this.blockIndexInTexture - 1;
+ } else if(var5 == 0) {
+ return this.blockIndexInTexture - 1;
+ } else {
+ 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;
+ int var11;
+ int var12;
+ byte var13;
+ if(var6 != this.blockID && var7 != this.blockID) {
+ if(var8 != this.blockID && var9 != this.blockID) {
+ byte var14 = 3;
+ if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var7]) {
+ var14 = 3;
+ }
+
+ if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var6]) {
+ var14 = 2;
+ }
+
+ if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var9]) {
+ var14 = 5;
+ }
+
+ if(Block.opaqueCubeLookup[var9] && !Block.opaqueCubeLookup[var8]) {
+ var14 = 4;
+ }
+
+ return var5 == var14 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
+ } else if(var5 != 4 && var5 != 5) {
+ var10 = 0;
+ if(var8 == this.blockID) {
+ var10 = -1;
+ }
+
+ var11 = var1.getBlockId(var8 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 - 1);
+ var12 = var1.getBlockId(var8 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 + 1);
+ if(var5 == 3) {
+ var10 = -1 - var10;
+ }
+
+ var13 = 3;
+ if((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var12]) {
+ var13 = 3;
+ }
+
+ if((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var12]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) {
+ var13 = 2;
+ }
+
+ return (var5 == var13 ? this.blockIndexInTexture + 16 : this.blockIndexInTexture + 32) + var10;
+ } else {
+ return this.blockIndexInTexture;
+ }
+ } else if(var5 != 2 && var5 != 3) {
+ var10 = 0;
+ if(var6 == this.blockID) {
+ var10 = -1;
+ }
+
+ var11 = var1.getBlockId(var2 - 1, var3, var6 == this.blockID ? var4 - 1 : var4 + 1);
+ var12 = var1.getBlockId(var2 + 1, var3, var6 == this.blockID ? var4 - 1 : var4 + 1);
+ if(var5 == 4) {
+ var10 = -1 - var10;
+ }
+
+ var13 = 5;
+ if((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var9] && !Block.opaqueCubeLookup[var12]) {
+ var13 = 5;
+ }
+
+ if((Block.opaqueCubeLookup[var9] || Block.opaqueCubeLookup[var12]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) {
+ var13 = 4;
+ }
+
+ return (var5 == var13 ? this.blockIndexInTexture + 16 : this.blockIndexInTexture + 32) + var10;
+ } else {
+ return this.blockIndexInTexture;
+ }
+ }
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? this.blockIndexInTexture - 1 : (var1 == 0 ? this.blockIndexInTexture - 1 : (var1 == 3 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture));
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ 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 onBlockRemoval(World var1, int var2, int var3, int var4) {
+ TileEntityChest var5 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4);
+
+ for(int var6 = 0; var6 < var5.getSizeInventory(); ++var6) {
+ ItemStack var7 = var5.getStackInSlot(var6);
+ if(var7 != null) {
+ float var8 = this.random.nextFloat() * 0.8F + 0.1F;
+ float var9 = this.random.nextFloat() * 0.8F + 0.1F;
+ float var10 = this.random.nextFloat() * 0.8F + 0.1F;
+
+ while(var7.stackSize > 0) {
+ int var11 = this.random.nextInt(21) + 10;
+ if(var11 > var7.stackSize) {
+ var11 = var7.stackSize;
+ }
+
+ var7.stackSize -= var11;
+ EntityItem var12 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(var7.itemID, var11, var7.itemDmg));
+ float var13 = 0.05F;
+ var12.motionX = (double)((float)this.random.nextGaussian() * var13);
+ var12.motionY = (double)((float)this.random.nextGaussian() * var13 + 0.2F);
+ var12.motionZ = (double)((float)this.random.nextGaussian() * var13);
+ var1.spawnEntityInWorld(var12);
+ }
+ }
+ }
+
+ super.onBlockRemoval(var1, var2, var3, var4);
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ Object var6 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4);
+ if(var1.isBlockNormalCube(var2, var3 + 1, var4)) {
+ return true;
+ } else if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID && var1.isBlockNormalCube(var2 - 1, var3 + 1, var4)) {
+ return true;
+ } else if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID && var1.isBlockNormalCube(var2 + 1, var3 + 1, var4)) {
+ return true;
+ } else if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID && var1.isBlockNormalCube(var2, var3 + 1, var4 - 1)) {
+ return true;
+ } else if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID && var1.isBlockNormalCube(var2, var3 + 1, var4 + 1)) {
+ return true;
+ } else {
+ if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (TileEntityChest)var1.getBlockTileEntity(var2 - 1, var3, var4), (IInventory)var6);
+ }
+
+ if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (IInventory)var6, (TileEntityChest)var1.getBlockTileEntity(var2 + 1, var3, var4));
+ }
+
+ if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 - 1), (IInventory)var6);
+ }
+
+ if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (IInventory)var6, (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 + 1));
+ }
+
+ var5.displayGUIChest((IInventory)var6);
+ return true;
+ }
+ }
+
+ protected TileEntity getBlockEntity() {
+ return new TileEntityChest();
+ }
+}
diff --git a/source/net/minecraft/src/BlockContainer.java b/source/net/minecraft/src/BlockContainer.java
new file mode 100644
index 0000000..6b5cee0
--- /dev/null
+++ b/source/net/minecraft/src/BlockContainer.java
@@ -0,0 +1,23 @@
+package net.minecraft.src;
+
+public abstract class BlockContainer extends Block {
+ protected BlockContainer(int var1, Material var2) {
+ super(var1, var2);
+ }
+
+ protected BlockContainer(int var1, int var2, Material var3) {
+ super(var1, var2, var3);
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ super.onBlockAdded(var1, var2, var3, var4);
+ var1.setBlockTileEntity(var2, var3, var4, this.getBlockEntity());
+ }
+
+ public void onBlockRemoval(World var1, int var2, int var3, int var4) {
+ super.onBlockRemoval(var1, var2, var3, var4);
+ var1.removeBlockTileEntity(var2, var3, var4);
+ }
+
+ protected abstract TileEntity getBlockEntity();
+}
diff --git a/source/net/minecraft/src/BlockCrops.java b/source/net/minecraft/src/BlockCrops.java
new file mode 100644
index 0000000..9cb6741
--- /dev/null
+++ b/source/net/minecraft/src/BlockCrops.java
@@ -0,0 +1,110 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockCrops extends BlockFlower {
+ protected BlockCrops(int var1, int var2) {
+ super(var1, var2);
+ this.blockIndexInTexture = var2;
+ this.setTickOnLoad(true);
+ float var3 = 0.5F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3);
+ }
+
+ protected boolean canThisPlantGrowOnThisBlockID(int var1) {
+ return var1 == 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.updateTick(var1, var2, var3, var4);
+ if(var5.nextInt((int)(100.0F / var7)) == 0) {
+ ++var6;
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
+ }
+ }
+ }
+
+ }
+
+ private float updateTick(World var1, int var2, int var3, int var4) {
+ 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);
+ 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);
+ float var20 = 0.0F;
+ if(var19 == Block.tilledField.blockID) {
+ var20 = 1.0F;
+ if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) {
+ var20 = 3.0F;
+ }
+ }
+
+ if(var17 != var2 || var18 != var4) {
+ var20 /= 4.0F;
+ }
+
+ var5 += var20;
+ }
+ }
+
+ if(var16 || var14 && var15) {
+ var5 /= 2.0F;
+ }
+
+ return var5;
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ if(var2 < 0) {
+ var2 = 7;
+ }
+
+ return this.blockIndexInTexture + var2;
+ }
+
+ public int getRenderType() {
+ return 6;
+ }
+
+ public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
+ super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5);
+
+ for(int var6 = 0; var6 < 3; ++var6) {
+ if(var1.rand.nextInt(15) <= var5) {
+ float var7 = 0.7F;
+ float var8 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
+ float var9 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
+ float var10 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
+ EntityItem var11 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(Item.seeds));
+ var11.delayBeforeCanPickup = 10;
+ var1.spawnEntityInWorld(var11);
+ }
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ System.out.println("Get resource: " + var1);
+ return var1 == 7 ? Item.wheat.shiftedIndex : -1;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+}
diff --git a/source/net/minecraft/src/BlockDirt.java b/source/net/minecraft/src/BlockDirt.java
new file mode 100644
index 0000000..d3b8a7a
--- /dev/null
+++ b/source/net/minecraft/src/BlockDirt.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+public class BlockDirt extends Block {
+ protected BlockDirt(int var1, int var2) {
+ super(var1, var2, Material.ground);
+ }
+}
diff --git a/source/net/minecraft/src/BlockDoor.java b/source/net/minecraft/src/BlockDoor.java
new file mode 100644
index 0000000..25b2c67
--- /dev/null
+++ b/source/net/minecraft/src/BlockDoor.java
@@ -0,0 +1,154 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockDoor extends Block {
+ protected BlockDoor(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 97;
+ float var2 = 0.5F;
+ float var3 = 1.0F;
+ this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var3, 0.5F + var2);
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ if(var1 != 0 && var1 != 1) {
+ int var3 = this.getState(var2);
+ if((var3 == 0 || var3 == 2) ^ var1 <= 3) {
+ return this.blockIndexInTexture;
+ } else {
+ int var4 = var3 / 2 + (var1 & 1 ^ var3);
+ var4 += (var2 & 4) / 4;
+ int var5 = this.blockIndexInTexture - (var2 & 8) * 2;
+ if((var4 & 1) != 0) {
+ var5 = -var5;
+ }
+
+ return var5;
+ }
+ } else {
+ return this.blockIndexInTexture;
+ }
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ 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.getState(var1.getBlockMetadata(var2, var3, var4)));
+ }
+
+ public void setDoorRotation(int var1) {
+ float var2 = 3.0F / 16.0F;
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
+ if(var1 == 0) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
+ }
+
+ if(var1 == 1) {
+ this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var1 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var1 == 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) {
+ this.blockActivated(var1, var2, var3, var4, var5);
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if((var6 & 8) != 0) {
+ if(var1.getBlockId(var2, var3 - 1, var4) == this.blockID) {
+ this.blockActivated(var1, var2, var3 - 1, var4, var5);
+ }
+
+ return true;
+ } else {
+ if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
+ var1.setBlockMetadataWithNotify(var2, var3 + 1, var4, (var6 ^ 4) + 8);
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 ^ 4);
+ var1.markBlocksDirty(var2, var3 - 1, var4, var2, var3, var4);
+ if(Math.random() < 0.5D) {
+ var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
+ } else {
+ var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
+ }
+
+ return true;
+ }
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if((var6 & 8) != 0) {
+ if(var1.getBlockId(var2, var3 - 1, var4) != this.blockID) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ } else {
+ boolean var7 = false;
+ if(var1.getBlockId(var2, var3 + 1, var4) != this.blockID) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ var7 = true;
+ }
+
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ var7 = true;
+ if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
+ var1.setBlockWithNotify(var2, var3 + 1, var4, 0);
+ }
+ }
+
+ if(var7) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var6);
+ }
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return (var1 & 8) != 0 ? 0 : Item.door.shiftedIndex;
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
+ return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
+ }
+
+ public int getState(int var1) {
+ return (var1 & 4) == 0 ? var1 - 1 & 3 : var1 & 3;
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return var3 >= 127 ? false : var1.isBlockNormalCube(var2, var3 - 1, var4) && super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4);
+ }
+}
diff --git a/source/net/minecraft/src/BlockFarmland.java b/source/net/minecraft/src/BlockFarmland.java
new file mode 100644
index 0000000..790d39c
--- /dev/null
+++ b/source/net/minecraft/src/BlockFarmland.java
@@ -0,0 +1,93 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFarmland extends Block {
+ protected BlockFarmland(int var1) {
+ super(var1, Material.ground);
+ this.blockIndexInTexture = 87;
+ this.setTickOnLoad(true);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 15.0F / 16.0F, 1.0F);
+ this.setLightOpacity(255);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return AxisAlignedBB.getBoundingBoxFromPool((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 0), (double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1));
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return var1 == 1 && var2 > 0 ? this.blockIndexInTexture - 1 : (var1 == 1 ? this.blockIndexInTexture : 2);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(var5.nextInt(5) == 0) {
+ if(this.isWaterNearby(var1, var2, var3, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 7);
+ } else {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 > 0) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 - 1);
+ } else if(!this.isCropsNearby(var1, var2, var3, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ }
+ }
+ }
+
+ }
+
+ public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
+ if(var1.rand.nextInt(4) == 0) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ }
+
+ }
+
+ private boolean isCropsNearby(World var1, int var2, int var3, int var4) {
+ byte var5 = 0;
+
+ for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
+ for(int var7 = var4 - var5; var7 <= var4 + var5; ++var7) {
+ if(var1.getBlockId(var6, var3 + 1, var7) == Block.crops.blockID) {
+ return true;
+ }
+ }
+ }
+
+ 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) {
+ return true;
+ }
+ }
+ }
+ }
+
+ 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.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.dirt.idDropped(0, var2);
+ }
+}
diff --git a/source/net/minecraft/src/BlockFire.java b/source/net/minecraft/src/BlockFire.java
new file mode 100644
index 0000000..594e81e
--- /dev/null
+++ b/source/net/minecraft/src/BlockFire.java
@@ -0,0 +1,225 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFire extends Block {
+ private int[] chanceToEncourageFire = new int[256];
+ private int[] abilityToCatchFire = new int[256];
+
+ protected BlockFire(int var1, int var2) {
+ super(var1, var2, Material.fire);
+ this.setBurnRate(Block.planks.blockID, 5, 20);
+ this.setBurnRate(Block.wood.blockID, 5, 5);
+ this.setBurnRate(Block.leaves.blockID, 30, 60);
+ this.setBurnRate(Block.bookshelf.blockID, 30, 20);
+ this.setBurnRate(Block.tnt.blockID, 15, 100);
+ this.setBurnRate(Block.cloth.blockID, 30, 60);
+ this.setTickOnLoad(true);
+ }
+
+ private void setBurnRate(int var1, int var2, int var3) {
+ this.chanceToEncourageFire[var1] = var2;
+ this.abilityToCatchFire[var1] = var3;
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 3;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+
+ public int tickRate() {
+ return 20;
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 < 15) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + 1);
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+
+ if(!this.canNeighborCatchFire(var1, var2, var3, var4)) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4) || var6 > 3) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ } else if(!this.canBlockCatchFire(var1, var2, var3 - 1, var4) && var6 == 15 && var5.nextInt(4) == 0) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ } else {
+ if(var6 % 5 == 0 && var6 > 5) {
+ this.tryToCatchBlockOnFire(var1, var2 + 1, var3, var4, 300, var5);
+ this.tryToCatchBlockOnFire(var1, var2 - 1, var3, var4, 300, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 100, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 200, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3, var4 - 1, 300, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3, var4 + 1, 300, var5);
+
+ for(int var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
+ for(int var8 = var4 - 1; var8 <= var4 + 1; ++var8) {
+ for(int var9 = var3 - 1; var9 <= var3 + 4; ++var9) {
+ if(var7 != var2 || var9 != var3 || var8 != var4) {
+ int var10 = 100;
+ if(var9 > var3 + 1) {
+ var10 += (var9 - (var3 + 1)) * 100;
+ }
+
+ int var11 = this.getChanceOfNeighborsEncouragingFire(var1, var7, var9, var8);
+ if(var11 > 0 && var5.nextInt(var10) <= var11) {
+ var1.setBlockWithNotify(var7, var9, var8, this.blockID);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ private void tryToCatchBlockOnFire(World var1, int var2, int var3, int var4, int var5, Random var6) {
+ int var7 = this.abilityToCatchFire[var1.getBlockId(var2, var3, var4)];
+ if(var6.nextInt(var5) < var7) {
+ boolean var8 = var1.getBlockId(var2, var3, var4) == Block.tnt.blockID;
+ if(var6.nextInt(2) == 0) {
+ var1.setBlockWithNotify(var2, var3, var4, this.blockID);
+ } else {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ if(var8) {
+ Block.tnt.onBlockDestroyedByPlayer(var1, var2, var3, var4, 0);
+ }
+ }
+
+ }
+
+ private boolean canNeighborCatchFire(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) {
+ byte var5 = 0;
+ if(var1.getBlockId(var2, var3, var4) != 0) {
+ 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);
+ return var6;
+ }
+ }
+
+ 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.isBlockNormalCube(var2, var3 - 1, var4) || this.canNeighborCatchFire(var1, var2, var3, var4);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4) && !this.canNeighborCatchFire(var1, var2, var3, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4) && !this.canNeighborCatchFire(var1, var2, var3, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ } else {
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+ }
+
+ public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(var5.nextInt(24) == 0) {
+ var1.playSoundEffect((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);
+ }
+
+ int var6;
+ float var7;
+ float var8;
+ float var9;
+ if(!var1.isBlockNormalCube(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);
+ }
+ }
+ } 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);
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockFlower.java b/source/net/minecraft/src/BlockFlower.java
new file mode 100644
index 0000000..8551ad0
--- /dev/null
+++ b/source/net/minecraft/src/BlockFlower.java
@@ -0,0 +1,58 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFlower extends Block {
+ protected BlockFlower(int var1, int var2) {
+ super(var1, Material.plants);
+ this.blockIndexInTexture = var2;
+ this.setTickOnLoad(true);
+ float var3 = 0.2F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 3.0F, 0.5F + var3);
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return 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));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ }
+
+ public boolean canBlockStay(World var1, int var2, int var3, int var4) {
+ return (var1.getBlockLightValue(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) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 1;
+ }
+}
diff --git a/source/net/minecraft/src/BlockFlowing.java b/source/net/minecraft/src/BlockFlowing.java
new file mode 100644
index 0000000..7052e0c
--- /dev/null
+++ b/source/net/minecraft/src/BlockFlowing.java
@@ -0,0 +1,253 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFlowing extends BlockFluid {
+ int numAdjacentSources = 0;
+ boolean[] isOptimalFlowDirection = new boolean[4];
+ 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.setBlockAndMetadata(var2, var3, var4, this.blockID + 1, var5);
+ var1.markBlocksDirty(var2, var3, var4, var2, var3, var4);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ int var6 = this.getFlowDecay(var1, var2, var3, var4);
+ boolean var7 = true;
+ int var9;
+ if(var6 > 0) {
+ byte var8 = -100;
+ this.numAdjacentSources = 0;
+ int var11 = this.getSmallestFlowDecay(var1, var2 - 1, var3, var4, var8);
+ var11 = this.getSmallestFlowDecay(var1, var2 + 1, var3, var4, var11);
+ var11 = this.getSmallestFlowDecay(var1, var2, var3, var4 - 1, var11);
+ var11 = this.getSmallestFlowDecay(var1, var2, var3, var4 + 1, var11);
+ var9 = var11 + this.fluidType;
+ if(var9 >= 8 || var11 < 0) {
+ var9 = -1;
+ }
+
+ if(this.getFlowDecay(var1, var2, var3 + 1, var4) >= 0) {
+ int var10 = this.getFlowDecay(var1, var2, var3 + 1, var4);
+ if(var10 >= 8) {
+ var9 = var10;
+ } else {
+ var9 = var10 + 8;
+ }
+ }
+
+ if(this.numAdjacentSources >= 2 && this.blockMaterial == Material.water) {
+ var9 = 0;
+ }
+
+ if(this.blockMaterial == Material.lava && var6 < 8 && var9 < 8 && var9 > var6 && var5.nextInt(4) != 0) {
+ var9 = var6;
+ var7 = false;
+ }
+
+ if(var9 != var6) {
+ var6 = var9;
+ if(var9 < 0) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ } else {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var9);
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
+ }
+ } else if(var7) {
+ this.updateFlow(var1, var2, var3, var4);
+ }
+ } else {
+ this.updateFlow(var1, var2, var3, var4);
+ }
+
+ if(this.liquidCanDisplaceBlock(var1, var2, var3 - 1, var4)) {
+ if(var6 >= 8) {
+ var1.setBlockAndMetadataWithNotify(var2, var3 - 1, var4, this.blockID, var6);
+ } else {
+ var1.setBlockAndMetadataWithNotify(var2, var3 - 1, var4, this.blockID, var6 + 8);
+ }
+ } else if(var6 >= 0 && (var6 == 0 || this.blockBlocksFlow(var1, var2, var3 - 1, var4))) {
+ boolean[] var12 = this.getOptimalFlowDirections(var1, var2, var3, var4);
+ var9 = var6 + this.fluidType;
+ if(var6 >= 8) {
+ var9 = 1;
+ }
+
+ if(var9 >= 8) {
+ return;
+ }
+
+ if(var12[0]) {
+ this.flowIntoBlock(var1, var2 - 1, var3, var4, var9);
+ }
+
+ if(var12[1]) {
+ this.flowIntoBlock(var1, var2 + 1, var3, var4, var9);
+ }
+
+ if(var12[2]) {
+ this.flowIntoBlock(var1, var2, var3, var4 - 1, var9);
+ }
+
+ if(var12[3]) {
+ this.flowIntoBlock(var1, var2, var3, var4 + 1, var9);
+ }
+ }
+
+ }
+
+ 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);
+ } else {
+ Block.blocksList[var6].dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ }
+ }
+
+ var1.setBlockAndMetadataWithNotify(var2, var3, var4, this.blockID, var5);
+ }
+
+ }
+
+ private int calculateFlowCost(World var1, int var2, int var3, int var4, int var5, int var6) {
+ 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;
+ }
+
+ if(var8 == 1) {
+ ++var9;
+ }
+
+ if(var8 == 2) {
+ var11 = var4 - 1;
+ }
+
+ 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(var5 < 4) {
+ int var12 = this.calculateFlowCost(var1, var9, var3, var11, var5 + 1, var8);
+ if(var12 < var7) {
+ var7 = var12;
+ }
+ }
+ }
+ }
+ }
+
+ return var7;
+ }
+
+ private boolean[] getOptimalFlowDirections(World var1, int var2, int var3, int var4) {
+ int var5;
+ int var6;
+ for(var5 = 0; var5 < 4; ++var5) {
+ this.flowCost[var5] = 1000;
+ var6 = var2;
+ int var8 = var4;
+ if(var5 == 0) {
+ var6 = var2 - 1;
+ }
+
+ if(var5 == 1) {
+ ++var6;
+ }
+
+ if(var5 == 2) {
+ var8 = var4 - 1;
+ }
+
+ 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] = 0;
+ } else {
+ this.flowCost[var5] = this.calculateFlowCost(var1, var6, var3, var8, 1, var5);
+ }
+ }
+ }
+
+ var5 = this.flowCost[0];
+
+ for(var6 = 1; var6 < 4; ++var6) {
+ if(this.flowCost[var6] < var5) {
+ var5 = this.flowCost[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.signStanding.blockID && var5 != Block.ladder.blockID) {
+ if(var5 == 0) {
+ return false;
+ } else {
+ Material var6 = Block.blocksList[var5].blockMaterial;
+ return var6.isSolid();
+ }
+ } else {
+ return true;
+ }
+ }
+
+ 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;
+ } else {
+ if(var6 == 0) {
+ ++this.numAdjacentSources;
+ }
+
+ 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);
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockFluid.java b/source/net/minecraft/src/BlockFluid.java
new file mode 100644
index 0000000..cb56215
--- /dev/null
+++ b/source/net/minecraft/src/BlockFluid.java
@@ -0,0 +1,273 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public abstract class BlockFluid extends Block {
+ protected int fluidType = 1;
+
+ protected BlockFluid(int var1, Material var2) {
+ super(var1, (var2 == Material.lava ? 14 : 12) * 16 + 13, var2);
+ float var3 = 0.0F;
+ float var4 = 0.0F;
+ if(var2 == Material.lava) {
+ this.fluidType = 2;
+ }
+
+ this.setBlockBounds(0.0F + var4, 0.0F + var3, 0.0F + var4, 1.0F + var4, 1.0F + var3, 1.0F + var4);
+ this.setTickOnLoad(true);
+ }
+
+ public static float getPercentAir(int var0) {
+ if(var0 >= 8) {
+ var0 = 0;
+ }
+
+ float var1 = (float)(var0 + 1) / 9.0F;
+ return var1;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 != 0 && var1 != 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
+ }
+
+ protected int getFlowDecay(World var1, int var2, int var3, int var4) {
+ return var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial ? -1 : var1.getBlockMetadata(var2, var3, var4);
+ }
+
+ protected int getEffectiveFlowDecay(IBlockAccess var1, int var2, int var3, int var4) {
+ if(var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial) {
+ return -1;
+ } else {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ if(var5 >= 8) {
+ var5 = 0;
+ }
+
+ return var5;
+ }
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean canCollideCheck(int var1, boolean var2) {
+ return var2 && var1 == 0;
+ }
+
+ 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 : super.shouldSideBeRendered(var1, var2, var3, var4, var5));
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public int getRenderType() {
+ return 4;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return 0;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+
+ private Vec3D getFlowVector(IBlockAccess var1, int var2, int var3, int var4) {
+ Vec3D var5 = Vec3D.createVector(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) {
+ ++var8;
+ }
+
+ if(var7 == 3) {
+ ++var10;
+ }
+
+ int var11 = this.getEffectiveFlowDecay(var1, var8, var3, var10);
+ int var12;
+ if(var11 < 0) {
+ var11 = this.getEffectiveFlowDecay(var1, var8, var3 - 1, var10);
+ if(var11 >= 0) {
+ var12 = var11 - (var6 - 8);
+ var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12));
+ }
+ } else if(var11 >= 0) {
+ var12 = var11 - var6;
+ var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12));
+ }
+ }
+
+ if(var1.getBlockMetadata(var2, var3, var4) >= 8) {
+ boolean var13 = false;
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3, var4 - 1, 2)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3, var4 + 1, 3)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 - 1, var3, var4, 4)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 + 1, var3, var4, 5)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3 + 1, var4 - 1, 2)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3 + 1, var4 + 1, 3)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 - 1, var3 + 1, var4, 4)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 + 1, var3 + 1, var4, 5)) {
+ var13 = true;
+ }
+
+ if(var13) {
+ var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D);
+ }
+ }
+
+ var5 = var5.normalize();
+ return var5;
+ }
+
+ public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3D var6) {
+ Vec3D var7 = this.getFlowVector(var1, var2, var3, var4);
+ var6.xCoord += var7.xCoord;
+ var6.yCoord += var7.yCoord;
+ var6.zCoord += var7.zCoord;
+ }
+
+ public int tickRate() {
+ return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? 30 : 0);
+ }
+
+ public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) {
+ float var5 = var1.getBrightness(var2, var3, var4);
+ float var6 = var1.getBrightness(var2, var3 + 1, var4);
+ return var5 > var6 ? var5 : var6;
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ super.updateTick(var1, var2, var3, var4, var5);
+ }
+
+ public int getRenderBlockPass() {
+ return this.blockMaterial == Material.water ? 1 : 0;
+ }
+
+ public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(this.blockMaterial == Material.water && var5.nextInt(64) == 0) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 > 0 && var6 < 8) {
+ var1.playSoundEffect((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);
+ }
+ }
+
+ if(this.blockMaterial == Material.lava && var1.getBlockMaterial(var2, var3 + 1, var4) == Material.air && !var1.isBlockNormalCube(var2, var3 + 1, var4) && var5.nextInt(100) == 0) {
+ double var12 = (double)((float)var2 + var5.nextFloat());
+ double var8 = (double)var3 + this.maxY;
+ double var10 = (double)((float)var4 + var5.nextFloat());
+ var1.spawnParticle("lava", var12, var8, var10, 0.0D, 0.0D, 0.0D);
+ }
+
+ }
+
+ public static double getFlowDirection(IBlockAccess var0, int var1, int var2, int var3, Material var4) {
+ Vec3D var5 = null;
+ if(var4 == Material.water) {
+ var5 = ((BlockFluid)Block.waterMoving).getFlowVector(var0, var1, var2, var3);
+ }
+
+ if(var4 == Material.lava) {
+ var5 = ((BlockFluid)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) {
+ 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.setBlockWithNotify(var2, var3, var4, Block.obsidian.blockID);
+ } else if(var6 <= 4) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.cobblestone.blockID);
+ }
+
+ this.triggerLavaMixEffects(var1, var2, var3, var4);
+ }
+ }
+
+ }
+ }
+
+ 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.rand.nextFloat() - var1.rand.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);
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockFurnace.java b/source/net/minecraft/src/BlockFurnace.java
new file mode 100644
index 0000000..69a78c5
--- /dev/null
+++ b/source/net/minecraft/src/BlockFurnace.java
@@ -0,0 +1,106 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFurnace extends BlockContainer {
+ private final boolean isActive;
+
+ protected BlockFurnace(int var1, boolean var2) {
+ super(var1, Material.rock);
+ this.isActive = var2;
+ this.blockIndexInTexture = 45;
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ super.onBlockAdded(var1, var2, var3, var4);
+ this.setDefaultDirection(var1, var2, var3, var4);
+ }
+
+ private void setDefaultDirection(World var1, int var2, int var3, int 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);
+ byte var9 = 3;
+ if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) {
+ var9 = 3;
+ }
+
+ if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) {
+ var9 = 2;
+ }
+
+ if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) {
+ var9 = 5;
+ }
+
+ if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) {
+ var9 = 4;
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var9);
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ if(var5 == 1) {
+ return Block.stone.blockIndexInTexture;
+ } else if(var5 == 0) {
+ return Block.stone.blockIndexInTexture;
+ } else {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ return var5 != var6 ? this.blockIndexInTexture : (this.isActive ? this.blockIndexInTexture + 16 : this.blockIndexInTexture - 1);
+ }
+ }
+
+ 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;
+ 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);
+ }
+
+ }
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? Block.stone.blockID : (var1 == 0 ? Block.stone.blockID : (var1 == 3 ? this.blockIndexInTexture - 1 : this.blockIndexInTexture));
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ TileEntityFurnace var6 = (TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4);
+ var5.displayGUIFurnace(var6);
+ 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);
+ if(var0) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.stoneOvenActive.blockID);
+ } else {
+ var1.setBlockWithNotify(var2, var3, var4, Block.stoneOvenIdle.blockID);
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var5);
+ var1.setBlockTileEntity(var2, var3, var4, var6);
+ }
+
+ protected TileEntity getBlockEntity() {
+ return new TileEntityFurnace();
+ }
+}
diff --git a/source/net/minecraft/src/BlockGears.java b/source/net/minecraft/src/BlockGears.java
new file mode 100644
index 0000000..a58762f
--- /dev/null
+++ b/source/net/minecraft/src/BlockGears.java
@@ -0,0 +1,33 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGears extends Block {
+ protected BlockGears(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 5;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public boolean isCollidable() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/BlockGlass.java b/source/net/minecraft/src/BlockGlass.java
new file mode 100644
index 0000000..c2672d1
--- /dev/null
+++ b/source/net/minecraft/src/BlockGlass.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGlass extends BlockBreakable {
+ public BlockGlass(int var1, int var2, Material var3, boolean var4) {
+ super(var1, var2, var3, var4);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+}
diff --git a/source/net/minecraft/src/BlockGrass.java b/source/net/minecraft/src/BlockGrass.java
new file mode 100644
index 0000000..f9bff22
--- /dev/null
+++ b/source/net/minecraft/src/BlockGrass.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGrass extends Block {
+ protected BlockGrass(int var1) {
+ super(var1, Material.ground);
+ this.blockIndexInTexture = 3;
+ this.setTickOnLoad(true);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? 0 : (var1 == 0 ? 2 : 3);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && var1.getBlockMaterial(var2, var3 + 1, var4).getCanBlockGrass()) {
+ if(var5.nextInt(4) != 0) {
+ return;
+ }
+
+ var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ } else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) {
+ int var6 = var2 + var5.nextInt(3) - 1;
+ int var7 = var3 + var5.nextInt(5) - 3;
+ int var8 = var4 + var5.nextInt(3) - 1;
+ if(var1.getBlockId(var6, var7, var8) == Block.dirt.blockID && var1.getBlockLightValue(var6, var7 + 1, var8) >= 4 && !var1.getBlockMaterial(var6, var7 + 1, var8).getCanBlockGrass()) {
+ var1.setBlockWithNotify(var6, var7, var8, Block.grass.blockID);
+ }
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.dirt.idDropped(0, var2);
+ }
+}
diff --git a/source/net/minecraft/src/BlockGravel.java b/source/net/minecraft/src/BlockGravel.java
new file mode 100644
index 0000000..c0fd641
--- /dev/null
+++ b/source/net/minecraft/src/BlockGravel.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGravel extends BlockSand {
+ public BlockGravel(int var1, int var2) {
+ super(var1, var2);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return var2.nextInt(10) == 0 ? Item.flint.shiftedIndex : this.blockID;
+ }
+}
diff --git a/source/net/minecraft/src/BlockLadder.java b/source/net/minecraft/src/BlockLadder.java
new file mode 100644
index 0000000..dfcce6f
--- /dev/null
+++ b/source/net/minecraft/src/BlockLadder.java
@@ -0,0 +1,121 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockLadder extends Block {
+ protected BlockLadder(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ float var6 = 2.0F / 16.0F;
+ if(var5 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - var6, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 3) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var6);
+ }
+
+ if(var5 == 4) {
+ this.setBlockBounds(1.0F - var6, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 5) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, var6, 1.0F, 1.0F);
+ }
+
+ return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
+ }
+
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ float var6 = 2.0F / 16.0F;
+ if(var5 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - var6, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 3) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var6);
+ }
+
+ if(var5 == 4) {
+ this.setBlockBounds(1.0F - var6, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 5) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, var6, 1.0F, 1.0F);
+ }
+
+ return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4);
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ 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)));
+ }
+
+ public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if((var6 == 0 || var5 == 2) && var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var6 = 2;
+ }
+
+ if((var6 == 0 || var5 == 3) && var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var6 = 3;
+ }
+
+ if((var6 == 0 || var5 == 4) && var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var6 = 4;
+ }
+
+ if((var6 == 0 || var5 == 5) && var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var6 = 5;
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ 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);
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ super.onNeighborBlockChange(var1, var2, var3, var4, var5);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+}
diff --git a/source/net/minecraft/src/BlockLeaves.java b/source/net/minecraft/src/BlockLeaves.java
new file mode 100644
index 0000000..d79b80e
--- /dev/null
+++ b/source/net/minecraft/src/BlockLeaves.java
@@ -0,0 +1,53 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockLeaves extends BlockLeavesBase {
+ private int leafTexIndex;
+
+ protected BlockLeaves(int var1, int var2) {
+ super(var1, var2, Material.leaves, false);
+ this.leafTexIndex = var2;
+ this.setTickOnLoad(true);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(!var1.getBlockMaterial(var2, var3 - 1, var4).isSolid()) {
+ byte var6 = 2;
+
+ for(int var7 = var2 - var6; var7 <= var2 + var6; ++var7) {
+ for(int var8 = var3 - 1; var8 <= var3 + 1; ++var8) {
+ for(int var9 = var4 - var6; var9 <= var4 + var6; ++var9) {
+ if(var1.getBlockId(var7, var8, var9) == Block.wood.blockID) {
+ return;
+ }
+ }
+ }
+ }
+
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ }
+
+ public int quantityDropped(Random var1) {
+ return var1.nextInt(10) == 0 ? 1 : 0;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.sapling.blockID;
+ }
+
+ public boolean isOpaqueCube() {
+ return !this.graphicsLevel;
+ }
+
+ public void setGraphicsLevel(boolean var1) {
+ this.graphicsLevel = var1;
+ this.blockIndexInTexture = this.leafTexIndex + (var1 ? 0 : 1);
+ }
+
+ public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
+ super.onEntityWalking(var1, var2, var3, var4, var5);
+ }
+}
diff --git a/source/net/minecraft/src/BlockLeavesBase.java b/source/net/minecraft/src/BlockLeavesBase.java
new file mode 100644
index 0000000..c719d88
--- /dev/null
+++ b/source/net/minecraft/src/BlockLeavesBase.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class BlockLeavesBase extends Block {
+ protected boolean graphicsLevel;
+
+ protected BlockLeavesBase(int var1, int var2, Material var3, boolean var4) {
+ super(var1, var2, var3);
+ this.graphicsLevel = var4;
+ }
+
+ 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);
+ }
+}
diff --git a/source/net/minecraft/src/BlockLog.java b/source/net/minecraft/src/BlockLog.java
new file mode 100644
index 0000000..357e5a0
--- /dev/null
+++ b/source/net/minecraft/src/BlockLog.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockLog extends Block {
+ protected BlockLog(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 20;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.wood.blockID;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? 21 : (var1 == 0 ? 21 : 20);
+ }
+}
diff --git a/source/net/minecraft/src/BlockMinecartTrack.java b/source/net/minecraft/src/BlockMinecartTrack.java
new file mode 100644
index 0000000..6566102
--- /dev/null
+++ b/source/net/minecraft/src/BlockMinecartTrack.java
@@ -0,0 +1,92 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockMinecartTrack extends Block {
+ protected BlockMinecartTrack(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
+ return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
+ }
+
+ 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);
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
+ }
+
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return var2 >= 6 ? this.blockIndexInTexture - 16 : this.blockIndexInTexture;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 9;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return var1.isBlockNormalCube(var2, var3 - 1, var4);
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 15);
+ this.refreshTrackShape(var1, var2, var3, var4);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ boolean var7 = false;
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var7 = true;
+ }
+
+ if(var6 == 2 && !var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var7 = true;
+ }
+
+ if(var6 == 3 && !var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var7 = true;
+ }
+
+ if(var6 == 4 && !var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var7 = true;
+ }
+
+ if(var6 == 5 && !var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var7 = true;
+ }
+
+ if(var7) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ }
+
+ private void refreshTrackShape(World var1, int var2, int var3, int var4) {
+ (new MinecartTrackLogic(this, var1, var2, var3, var4)).place();
+ }
+}
diff --git a/source/net/minecraft/src/BlockMobSpawner.java b/source/net/minecraft/src/BlockMobSpawner.java
new file mode 100644
index 0000000..b845263
--- /dev/null
+++ b/source/net/minecraft/src/BlockMobSpawner.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class BlockMobSpawner extends BlockContainer {
+ protected BlockMobSpawner(int var1, int var2) {
+ super(var1, var2, Material.rock);
+ }
+
+ protected TileEntity getBlockEntity() {
+ return new TileEntityMobSpawner();
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/BlockMushroom.java b/source/net/minecraft/src/BlockMushroom.java
new file mode 100644
index 0000000..f129b7b
--- /dev/null
+++ b/source/net/minecraft/src/BlockMushroom.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class BlockMushroom extends BlockFlower {
+ protected BlockMushroom(int var1, int var2) {
+ super(var1, var2);
+ float var3 = 0.2F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3);
+ }
+
+ protected boolean canThisPlantGrowOnThisBlockID(int var1) {
+ return Block.opaqueCubeLookup[var1];
+ }
+
+ public boolean canBlockStay(World var1, int var2, int var3, int var4) {
+ return var1.getBlockLightValue(var2, var3, var4) <= 13 && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4));
+ }
+}
diff --git a/source/net/minecraft/src/BlockObsidian.java b/source/net/minecraft/src/BlockObsidian.java
new file mode 100644
index 0000000..c75b227
--- /dev/null
+++ b/source/net/minecraft/src/BlockObsidian.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockObsidian extends BlockStone {
+ public BlockObsidian(int var1, int var2) {
+ super(var1, var2);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.obsidian.blockID;
+ }
+}
diff --git a/source/net/minecraft/src/BlockOre.java b/source/net/minecraft/src/BlockOre.java
new file mode 100644
index 0000000..a66fd91
--- /dev/null
+++ b/source/net/minecraft/src/BlockOre.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockOre extends Block {
+ public BlockOre(int var1, int var2) {
+ super(var1, var2, Material.rock);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.blockID == Block.oreCoal.blockID ? Item.coal.shiftedIndex : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.shiftedIndex : this.blockID);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+}
diff --git a/source/net/minecraft/src/BlockOreBlock.java b/source/net/minecraft/src/BlockOreBlock.java
new file mode 100644
index 0000000..5655234
--- /dev/null
+++ b/source/net/minecraft/src/BlockOreBlock.java
@@ -0,0 +1,12 @@
+package net.minecraft.src;
+
+public class BlockOreBlock extends Block {
+ public BlockOreBlock(int var1, int var2) {
+ super(var1, Material.iron);
+ this.blockIndexInTexture = var2;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? this.blockIndexInTexture - 16 : (var1 == 0 ? this.blockIndexInTexture + 16 : this.blockIndexInTexture);
+ }
+}
diff --git a/source/net/minecraft/src/BlockSand.java b/source/net/minecraft/src/BlockSand.java
new file mode 100644
index 0000000..451a32e
--- /dev/null
+++ b/source/net/minecraft/src/BlockSand.java
@@ -0,0 +1,53 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockSand extends Block {
+ public static boolean fallInstantly = false;
+
+ public BlockSand(int var1, int var2) {
+ super(var1, var2, Material.sand);
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ this.tryToFall(var1, var2, var3, var4);
+ }
+
+ private void tryToFall(World var1, int var2, int var3, int var4) {
+ if(canFallBelow(var1, var2, var3 - 1, var4) && var3 >= 0) {
+ EntityFallingSand var8 = new EntityFallingSand(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F, this.blockID);
+ if(fallInstantly) {
+ while(!var8.isDead) {
+ var8.onUpdate();
+ }
+ } else {
+ var1.spawnEntityInWorld(var8);
+ }
+ }
+
+ }
+
+ public int tickRate() {
+ return 3;
+ }
+
+ public static boolean canFallBelow(World var0, int var1, int var2, int var3) {
+ int var4 = var0.getBlockId(var1, var2, var3);
+ if(var4 == 0) {
+ return true;
+ } else if(var4 == Block.fire.blockID) {
+ return true;
+ } else {
+ Material var5 = Block.blocksList[var4].blockMaterial;
+ return var5 == Material.water ? true : var5 == Material.lava;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/BlockSapling.java b/source/net/minecraft/src/BlockSapling.java
new file mode 100644
index 0000000..7d13f83
--- /dev/null
+++ b/source/net/minecraft/src/BlockSapling.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockSapling extends BlockFlower {
+ protected BlockSapling(int var1, int var2) {
+ super(var1, var2);
+ float var3 = 0.4F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3);
+ }
+
+ 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 && var5.nextInt(5) == 0) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 < 15) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + 1);
+ } else {
+ var1.setBlock(var2, var3, var4, 0);
+ WorldGenTrees var7 = new WorldGenTrees();
+ if(!var7.generate(var1, var5, var2, var3, var4)) {
+ var1.setBlock(var2, var3, var4, this.blockID);
+ }
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockSign.java b/source/net/minecraft/src/BlockSign.java
new file mode 100644
index 0000000..03b8536
--- /dev/null
+++ b/source/net/minecraft/src/BlockSign.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockSign extends BlockContainer {
+ private Class signEntityClass;
+ private int itemDropID;
+
+ protected BlockSign(int var1, Class var2, int var3) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 4;
+ this.signEntityClass = var2;
+ float var4 = 0.25F;
+ float var5 = 1.625F;
+ this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4);
+ this.itemDropID = var3;
+ }
+
+ public int getRenderType() {
+ return -1;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ protected TileEntity getBlockEntity() {
+ try {
+ return (TileEntity)this.signEntityClass.newInstance();
+ } catch (Exception var2) {
+ throw new RuntimeException(var2);
+ }
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.itemDropID;
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockSponge.java b/source/net/minecraft/src/BlockSponge.java
new file mode 100644
index 0000000..d8a441d
--- /dev/null
+++ b/source/net/minecraft/src/BlockSponge.java
@@ -0,0 +1,35 @@
+package net.minecraft.src;
+
+public class BlockSponge extends Block {
+ protected BlockSponge(int var1) {
+ super(var1, Material.sponge);
+ this.blockIndexInTexture = 48;
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ byte var5 = 2;
+
+ for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
+ for(int var7 = var3 - var5; var7 <= var3 + var5; ++var7) {
+ for(int var8 = var4 - var5; var8 <= var4 + var5; ++var8) {
+ if(var1.getBlockMaterial(var6, var7, var8) == Material.water) {
+ }
+ }
+ }
+ }
+
+ }
+
+ public void onBlockRemoval(World var1, int var2, int var3, int var4) {
+ byte var5 = 2;
+
+ for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
+ for(int var7 = var3 - var5; var7 <= var3 + var5; ++var7) {
+ for(int var8 = var4 - var5; var8 <= var4 + var5; ++var8) {
+ var1.notifyBlocksOfNeighborChange(var6, var7, var8, var1.getBlockId(var6, var7, var8));
+ }
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockStairs.java b/source/net/minecraft/src/BlockStairs.java
new file mode 100644
index 0000000..aec58f7
--- /dev/null
+++ b/source/net/minecraft/src/BlockStairs.java
@@ -0,0 +1,249 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+public class BlockStairs extends Block {
+ private Block modelBlock;
+
+ protected BlockStairs(int var1, Block var2) {
+ super(var1, var2.blockIndexInTexture, var2.blockMaterial);
+ this.modelBlock = var2;
+ this.setHardness(var2.blockHardness);
+ this.setResistance(var2.blockResistance / 3.0F);
+ this.setStepSound(var2.stepSound);
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 10;
+ }
+
+ public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return super.shouldSideBeRendered(var1, var2, var3, var4, var5);
+ }
+
+ public void getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
+ int var7 = var1.getBlockMetadata(var2, var3, var4);
+ if(var7 == 0) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ } else if(var7 == 1) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ } else if(var7 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ } else if(var7 == 3) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ }
+
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(var1.getBlockMaterial(var2, var3 + 1, var4).isSolid()) {
+ var1.setBlockWithNotify(var2, var3, var4, this.modelBlock.blockID);
+ } else {
+ this.updateState(var1, var2, var3, var4);
+ this.updateState(var1, var2 + 1, var3 - 1, var4);
+ this.updateState(var1, var2 - 1, var3 - 1, var4);
+ this.updateState(var1, var2, var3 - 1, var4 - 1);
+ this.updateState(var1, var2, var3 - 1, var4 + 1);
+ this.updateState(var1, var2 + 1, var3 + 1, var4);
+ this.updateState(var1, var2 - 1, var3 + 1, var4);
+ this.updateState(var1, var2, var3 + 1, var4 - 1);
+ this.updateState(var1, var2, var3 + 1, var4 + 1);
+ }
+
+ this.modelBlock.onNeighborBlockChange(var1, var2, var3, var4, var5);
+ }
+
+ private void updateState(World var1, int var2, int var3, int var4) {
+ if(this.isBlockStair(var1, var2, var3, var4)) {
+ byte var5 = -1;
+ if(this.isBlockStair(var1, var2 + 1, var3 + 1, var4)) {
+ var5 = 0;
+ }
+
+ if(this.isBlockStair(var1, var2 - 1, var3 + 1, var4)) {
+ var5 = 1;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 + 1, var4 + 1)) {
+ var5 = 2;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 + 1, var4 - 1)) {
+ var5 = 3;
+ }
+
+ if(var5 < 0) {
+ if(this.isBlockSolid(var1, var2 + 1, var3, var4) && !this.isBlockSolid(var1, var2 - 1, var3, var4)) {
+ var5 = 0;
+ }
+
+ if(this.isBlockSolid(var1, var2 - 1, var3, var4) && !this.isBlockSolid(var1, var2 + 1, var3, var4)) {
+ var5 = 1;
+ }
+
+ if(this.isBlockSolid(var1, var2, var3, var4 + 1) && !this.isBlockSolid(var1, var2, var3, var4 - 1)) {
+ var5 = 2;
+ }
+
+ if(this.isBlockSolid(var1, var2, var3, var4 - 1) && !this.isBlockSolid(var1, var2, var3, var4 + 1)) {
+ var5 = 3;
+ }
+ }
+
+ if(var5 < 0) {
+ if(this.isBlockStair(var1, var2 - 1, var3 - 1, var4)) {
+ var5 = 0;
+ }
+
+ if(this.isBlockStair(var1, var2 + 1, var3 - 1, var4)) {
+ var5 = 1;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 - 1, var4 - 1)) {
+ var5 = 2;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 - 1, var4 + 1)) {
+ var5 = 3;
+ }
+ }
+
+ if(var5 >= 0) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var5);
+ }
+
+ }
+ }
+
+ private boolean isBlockSolid(World var1, int var2, int var3, int var4) {
+ return var1.getBlockMaterial(var2, var3, var4).isSolid();
+ }
+
+ private boolean isBlockStair(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockId(var2, var3, var4);
+ return var5 == 0 ? false : Block.blocksList[var5].getRenderType() == 10;
+ }
+
+ 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 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);
+ }
+
+ public int getRenderBlockPass() {
+ return this.modelBlock.getRenderBlockPass();
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.modelBlock.idDropped(var1, var2);
+ }
+
+ public int quantityDropped(Random var1) {
+ return this.modelBlock.quantityDropped(var1);
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return this.modelBlock.getBlockTextureFromSideAndMetadata(var1, var2);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return this.modelBlock.getBlockTextureFromSide(var1);
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return this.modelBlock.getBlockTextureGeneric(var1, var2, var3, var4, var5);
+ }
+
+ public int tickRate() {
+ return this.modelBlock.tickRate();
+ }
+
+ 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, Vec3D var6) {
+ this.modelBlock.velocityToAddToEntity(var1, var2, var3, var4, var5, var6);
+ }
+
+ 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 onBlockRemoval(World var1, int var2, int var3, int var4) {
+ this.modelBlock.onBlockRemoval(var1, var2, var3, var4);
+ }
+
+ public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
+ this.modelBlock.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6);
+ }
+
+ public void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5) {
+ this.modelBlock.dropBlockAsItem(var1, var2, var3, var4, var5);
+ }
+
+ 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 blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ return this.modelBlock.blockActivated(var1, var2, var3, var4, var5);
+ }
+
+ public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
+ this.modelBlock.onBlockDestroyedByExplosion(var1, var2, var3, var4);
+ }
+}
diff --git a/source/net/minecraft/src/BlockStationary.java b/source/net/minecraft/src/BlockStationary.java
new file mode 100644
index 0000000..12332ea
--- /dev/null
+++ b/source/net/minecraft/src/BlockStationary.java
@@ -0,0 +1,25 @@
+package net.minecraft.src;
+
+public class BlockStationary extends BlockFluid {
+ protected BlockStationary(int var1, Material var2) {
+ super(var1, var2);
+ this.setTickOnLoad(false);
+ }
+
+ 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.updateTick(var1, var2, var3, var4);
+ }
+
+ }
+
+ private void updateTick(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ var1.editingBlocks = true;
+ var1.setBlockAndMetadata(var2, var3, var4, this.blockID - 1, var5);
+ var1.markBlocksDirty(var2, var3, var4, var2, var3, var4);
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID - 1);
+ var1.editingBlocks = false;
+ }
+}
diff --git a/source/net/minecraft/src/BlockStep.java b/source/net/minecraft/src/BlockStep.java
new file mode 100644
index 0000000..c9e7fce
--- /dev/null
+++ b/source/net/minecraft/src/BlockStep.java
@@ -0,0 +1,59 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockStep extends Block {
+ private boolean blockType;
+
+ public BlockStep(int var1, boolean var2) {
+ super(var1, 6, Material.rock);
+ this.blockType = var2;
+ if(!var2) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
+ }
+
+ this.setLightOpacity(255);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 <= 1 ? 6 : 5;
+ }
+
+ public boolean isOpaqueCube() {
+ return this.blockType;
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(this == Block.stairSingle) {
+ }
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ if(this != Block.stairSingle) {
+ super.onBlockAdded(var1, var2, var3, var4);
+ }
+
+ int var5 = var1.getBlockId(var2, var3 - 1, var4);
+ if(var5 == stairSingle.blockID) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ var1.setBlockWithNotify(var2, var3 - 1, var4, Block.stairDouble.blockID);
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.stairSingle.blockID;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return this.blockType;
+ }
+
+ public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ if(this != Block.stairSingle) {
+ super.shouldSideBeRendered(var1, var2, var3, var4, var5);
+ }
+
+ return var5 == 1 ? true : (!super.shouldSideBeRendered(var1, var2, var3, var4, var5) ? false : (var5 == 0 ? true : var1.getBlockId(var2, var3, var4) != this.blockID));
+ }
+}
diff --git a/source/net/minecraft/src/BlockStone.java b/source/net/minecraft/src/BlockStone.java
new file mode 100644
index 0000000..eae4ecd
--- /dev/null
+++ b/source/net/minecraft/src/BlockStone.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockStone extends Block {
+ public BlockStone(int var1, int var2) {
+ super(var1, var2, Material.rock);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.cobblestone.blockID;
+ }
+}
diff --git a/source/net/minecraft/src/BlockTNT.java b/source/net/minecraft/src/BlockTNT.java
new file mode 100644
index 0000000..aa103d5
--- /dev/null
+++ b/source/net/minecraft/src/BlockTNT.java
@@ -0,0 +1,29 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockTNT extends Block {
+ public BlockTNT(int var1, int var2) {
+ super(var1, var2, Material.tnt);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 0 ? this.blockIndexInTexture + 2 : (var1 == 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+
+ public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
+ EntityTNTPrimed var5 = new EntityTNTPrimed(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F);
+ var5.fuse = var1.rand.nextInt(var5.fuse / 4) + var5.fuse / 8;
+ var1.spawnEntityInWorld(var5);
+ }
+
+ public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
+ EntityTNTPrimed var6 = new EntityTNTPrimed(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F);
+ var1.spawnEntityInWorld(var6);
+ var1.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F);
+ }
+}
diff --git a/source/net/minecraft/src/BlockTorch.java b/source/net/minecraft/src/BlockTorch.java
new file mode 100644
index 0000000..a099e4a
--- /dev/null
+++ b/source/net/minecraft/src/BlockTorch.java
@@ -0,0 +1,166 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockTorch extends Block {
+ protected BlockTorch(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ this.setTickOnLoad(true);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 2;
+ }
+
+ 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.isBlockNormalCube(var2, var3 - 1, var4))));
+ }
+
+ public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var5 == 1 && var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var6 = 5;
+ }
+
+ if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var6 = 4;
+ }
+
+ if(var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var6 = 3;
+ }
+
+ if(var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var6 = 2;
+ }
+
+ if(var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var6 = 1;
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
+ }
+
+ 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);
+ }
+
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ if(var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
+ } else if(var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
+ } else if(var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
+ } else if(var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
+ } else if(var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 5);
+ }
+
+ this.dropTorchIfCantStay(var1, var2, var3, var4);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(this.dropTorchIfCantStay(var1, var2, var3, var4)) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ 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.isBlockNormalCube(var2, var3 - 1, var4) && var6 == 5) {
+ var7 = true;
+ }
+
+ if(var7) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ }
+
+ }
+
+ private boolean dropTorchIfCantStay(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));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ int var7 = var1.getBlockMetadata(var2, var3, var4);
+ float var8 = 0.15F;
+ if(var7 == 1) {
+ this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8);
+ } 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) {
+ this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F);
+ } 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);
+ }
+
+ public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ float var7 = (float)var2 + 0.5F;
+ float var8 = (float)var3 + 0.7F;
+ float var9 = (float)var4 + 0.5F;
+ float var10 = 0.22F;
+ float var11 = 0.27F;
+ if(var6 == 1) {
+ var1.spawnParticle("smoke", (double)(var7 - var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)(var7 - var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ } else if(var6 == 2) {
+ var1.spawnParticle("smoke", (double)(var7 + var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)(var7 + var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ } else if(var6 == 3) {
+ var1.spawnParticle("smoke", (double)var7, (double)(var8 + var10), (double)(var9 - var11), 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)var7, (double)(var8 + var10), (double)(var9 - var11), 0.0D, 0.0D, 0.0D);
+ } else if(var6 == 4) {
+ var1.spawnParticle("smoke", (double)var7, (double)(var8 + var10), (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)var7, (double)(var8 + var10), (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
+ } else {
+ var1.spawnParticle("smoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/BlockWorkbench.java b/source/net/minecraft/src/BlockWorkbench.java
new file mode 100644
index 0000000..8b02c5f
--- /dev/null
+++ b/source/net/minecraft/src/BlockWorkbench.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class BlockWorkbench extends Block {
+ protected BlockWorkbench(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 59;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? this.blockIndexInTexture - 16 : (var1 == 0 ? Block.planks.getBlockTextureFromSide(0) : (var1 != 2 && var1 != 4 ? this.blockIndexInTexture : this.blockIndexInTexture + 1));
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ var5.displayWorkbenchGUI();
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/CanvasCrashReport.java b/source/net/minecraft/src/CanvasCrashReport.java
new file mode 100644
index 0000000..caa70c7
--- /dev/null
+++ b/source/net/minecraft/src/CanvasCrashReport.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Dimension;
+
+class CanvasCrashReport extends Canvas {
+ public CanvasCrashReport(int var1) {
+ this.setPreferredSize(new Dimension(var1, var1));
+ this.setMinimumSize(new Dimension(var1, var1));
+ }
+}
diff --git a/source/net/minecraft/src/CanvasIsomPreview.java b/source/net/minecraft/src/CanvasIsomPreview.java
new file mode 100644
index 0000000..d175b90
--- /dev/null
+++ b/source/net/minecraft/src/CanvasIsomPreview.java
@@ -0,0 +1,378 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferStrategy;
+import java.awt.image.ImageObserver;
+import java.io.File;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+public class CanvasIsomPreview extends Canvas implements KeyListener, MouseListener, MouseMotionListener, Runnable {
+ private int currentRender = 0;
+ private int zoomLevel = 2;
+ private boolean displayHelpText = true;
+ private World level;
+ private File dataFolder = this.getMinecraftDir();
+ private boolean running = true;
+ private List zonesToRender = Collections.synchronizedList(new LinkedList());
+ private IsoImageBuffer[][] zoneMap = new IsoImageBuffer[64][64];
+ private int translateX;
+ private int translateY;
+ private int xPosition;
+ private int yPosition;
+
+ public File getMinecraftDir() {
+ if(this.dataFolder == null) {
+ this.dataFolder = this.getWorkingDirectory("minecraft");
+ }
+
+ return this.dataFolder;
+ }
+
+ public File getWorkingDirectory(String var1) {
+ String var2 = System.getProperty("user.home", ".");
+ File var3;
+ switch(OSMapIsom.osValues[getPlatform().ordinal()]) {
+ case 1:
+ case 2:
+ var3 = new File(var2, '.' + var1 + '/');
+ break;
+ case 3:
+ String var4 = System.getenv("APPDATA");
+ if(var4 != null) {
+ var3 = new File(var4, "." + var1 + '/');
+ } else {
+ var3 = new File(var2, '.' + var1 + '/');
+ }
+ break;
+ case 4:
+ var3 = new File(var2, "Library/Application Support/" + var1);
+ break;
+ default:
+ var3 = new File(var2, var1 + '/');
+ }
+
+ if(!var3.exists() && !var3.mkdirs()) {
+ throw new RuntimeException("The working directory could not be created: " + var3);
+ } else {
+ return var3;
+ }
+ }
+
+ private static EnumOSIsom getPlatform() {
+ String var0 = System.getProperty("os.name").toLowerCase();
+ return var0.contains("win") ? EnumOSIsom.windows : (var0.contains("mac") ? EnumOSIsom.macos : (var0.contains("solaris") ? EnumOSIsom.solaris : (var0.contains("sunos") ? EnumOSIsom.solaris : (var0.contains("linux") ? EnumOSIsom.linux : (var0.contains("unix") ? EnumOSIsom.linux : EnumOSIsom.unknown)))));
+ }
+
+ public CanvasIsomPreview() {
+ for(int var1 = 0; var1 < 64; ++var1) {
+ for(int var2 = 0; var2 < 64; ++var2) {
+ this.zoneMap[var1][var2] = new IsoImageBuffer((World)null, var1, var2);
+ }
+ }
+
+ this.addMouseListener(this);
+ this.addMouseMotionListener(this);
+ this.addKeyListener(this);
+ this.setFocusable(true);
+ this.requestFocus();
+ this.setBackground(Color.red);
+ }
+
+ public void loadWorld(String var1) {
+ this.translateX = this.translateY = 0;
+ this.level = new WorldIso(this, new File(this.dataFolder, "saves"), var1);
+ this.level.skylightSubtracted = 0;
+ List var2 = this.zonesToRender;
+ synchronized(var2) {
+ this.zonesToRender.clear();
+
+ for(int var3 = 0; var3 < 64; ++var3) {
+ for(int var4 = 0; var4 < 64; ++var4) {
+ this.zoneMap[var3][var4].setWorldAndChunkPosition(this.level, var3, var4);
+ }
+ }
+
+ }
+ }
+
+ private void setBrightness(int var1) {
+ List var2 = this.zonesToRender;
+ synchronized(var2) {
+ this.level.skylightSubtracted = var1;
+ this.zonesToRender.clear();
+
+ for(int var3 = 0; var3 < 64; ++var3) {
+ for(int var4 = 0; var4 < 64; ++var4) {
+ this.zoneMap[var3][var4].setWorldAndChunkPosition(this.level, var3, var4);
+ }
+ }
+
+ }
+ }
+
+ public void start() {
+ (new ThreadRunIsoClient(this)).start();
+
+ for(int var1 = 0; var1 < 1; ++var1) {
+ (new Thread(this)).start();
+ }
+
+ }
+
+ public void stop() {
+ this.running = false;
+ }
+
+ private IsoImageBuffer getZone(int var1, int var2) {
+ int var3 = var1 & 63;
+ int var4 = var2 & 63;
+ IsoImageBuffer var5 = this.zoneMap[var3][var4];
+ if(var5.chunkX == var1 && var5.chunkZ == var2) {
+ return var5;
+ } else {
+ List var6 = this.zonesToRender;
+ synchronized(var6) {
+ this.zonesToRender.remove(var5);
+ }
+
+ var5.setChunkPosition(var1, var2);
+ return var5;
+ }
+ }
+
+ public void run() {
+ TerrainTextureManager var1 = new TerrainTextureManager();
+
+ while(this.running) {
+ IsoImageBuffer var2 = null;
+ List var3 = this.zonesToRender;
+ synchronized(var3) {
+ if(this.zonesToRender.size() > 0) {
+ var2 = (IsoImageBuffer)this.zonesToRender.remove(0);
+ }
+ }
+
+ if(var2 != null) {
+ if(this.currentRender - var2.lastVisible < 2) {
+ var1.render(var2);
+ this.repaint();
+ } else {
+ var2.addedToRenderQueue = false;
+ }
+ }
+
+ try {
+ Thread.sleep(2L);
+ } catch (InterruptedException var5) {
+ var5.printStackTrace();
+ }
+ }
+
+ }
+
+ public void update(Graphics var1) {
+ }
+
+ public void paint(Graphics var1) {
+ }
+
+ public void render() {
+ BufferStrategy var1 = this.getBufferStrategy();
+ if(var1 == null) {
+ this.createBufferStrategy(2);
+ } else {
+ this.render((Graphics2D)var1.getDrawGraphics());
+ var1.show();
+ }
+ }
+
+ public void render(Graphics2D var1) {
+ ++this.currentRender;
+ AffineTransform var2 = var1.getTransform();
+ var1.setClip(0, 0, this.getWidth(), this.getHeight());
+ var1.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
+ var1.translate(this.getWidth() / 2, this.getHeight() / 2);
+ var1.scale((double)this.zoomLevel, (double)this.zoomLevel);
+ var1.translate(this.translateX, this.translateY);
+ if(this.level != null) {
+ var1.translate(-(this.level.spawnX + this.level.spawnZ), -(-this.level.spawnX + this.level.spawnZ) + 64);
+ }
+
+ Rectangle var3 = var1.getClipBounds();
+ var1.setColor(new Color(-15724512));
+ var1.fillRect(var3.x, var3.y, var3.width, var3.height);
+ byte var4 = 16;
+ byte var5 = 3;
+ int var6 = var3.x / var4 / 2 - 2 - var5;
+ int var7 = (var3.x + var3.width) / var4 / 2 + 1 + var5;
+ int var8 = var3.y / var4 - 1 - var5 * 2;
+ int var9 = (var3.y + var3.height + 16 + 128) / var4 + 1 + var5 * 2;
+
+ int var10;
+ for(var10 = var8; var10 <= var9; ++var10) {
+ for(int var11 = var6; var11 <= var7; ++var11) {
+ int var12 = var11 - (var10 >> 1);
+ int var13 = var11 + (var10 + 1 >> 1);
+ IsoImageBuffer var14 = this.getZone(var12, var13);
+ var14.lastVisible = this.currentRender;
+ if(!var14.rendered) {
+ if(!var14.addedToRenderQueue) {
+ var14.addedToRenderQueue = true;
+ this.zonesToRender.add(var14);
+ }
+ } else {
+ var14.addedToRenderQueue = false;
+ if(!var14.noContent) {
+ int var15 = var11 * var4 * 2 + (var10 & 1) * var4;
+ int var16 = var10 * var4 - 128 - 16;
+ var1.drawImage(var14.image, var15, var16, (ImageObserver)null);
+ }
+ }
+ }
+ }
+
+ if(this.displayHelpText) {
+ var1.setTransform(var2);
+ var10 = this.getHeight() - 32 - 4;
+ var1.setColor(new Color(Integer.MIN_VALUE, true));
+ var1.fillRect(4, this.getHeight() - 32 - 4, this.getWidth() - 8, 32);
+ var1.setColor(Color.WHITE);
+ String var17 = "F1 - F5: load levels | 0-9: Set time of day | Space: return to spawn | Double click: zoom | Escape: hide this text";
+ var1.drawString(var17, this.getWidth() / 2 - var1.getFontMetrics().stringWidth(var17) / 2, var10 + 20);
+ }
+
+ var1.dispose();
+ }
+
+ public void mouseDragged(MouseEvent var1) {
+ int var2 = var1.getX() / this.zoomLevel;
+ int var3 = var1.getY() / this.zoomLevel;
+ this.translateX += var2 - this.xPosition;
+ this.translateY += var3 - this.yPosition;
+ this.xPosition = var2;
+ this.yPosition = var3;
+ this.repaint();
+ }
+
+ public void mouseMoved(MouseEvent var1) {
+ }
+
+ public void mouseClicked(MouseEvent var1) {
+ if(var1.getClickCount() == 2) {
+ this.zoomLevel = 3 - this.zoomLevel;
+ this.repaint();
+ }
+
+ }
+
+ public void mouseEntered(MouseEvent var1) {
+ }
+
+ public void mouseExited(MouseEvent var1) {
+ }
+
+ public void mousePressed(MouseEvent var1) {
+ int var2 = var1.getX() / this.zoomLevel;
+ int var3 = var1.getY() / this.zoomLevel;
+ this.xPosition = var2;
+ this.yPosition = var3;
+ }
+
+ public void mouseReleased(MouseEvent var1) {
+ }
+
+ public void keyPressed(KeyEvent var1) {
+ if(var1.getKeyCode() == 48) {
+ this.setBrightness(11);
+ }
+
+ if(var1.getKeyCode() == 49) {
+ this.setBrightness(10);
+ }
+
+ if(var1.getKeyCode() == 50) {
+ this.setBrightness(9);
+ }
+
+ if(var1.getKeyCode() == 51) {
+ this.setBrightness(7);
+ }
+
+ if(var1.getKeyCode() == 52) {
+ this.setBrightness(6);
+ }
+
+ if(var1.getKeyCode() == 53) {
+ this.setBrightness(5);
+ }
+
+ if(var1.getKeyCode() == 54) {
+ this.setBrightness(3);
+ }
+
+ if(var1.getKeyCode() == 55) {
+ this.setBrightness(2);
+ }
+
+ if(var1.getKeyCode() == 56) {
+ this.setBrightness(1);
+ }
+
+ if(var1.getKeyCode() == 57) {
+ this.setBrightness(0);
+ }
+
+ if(var1.getKeyCode() == 112) {
+ this.loadWorld("World1");
+ }
+
+ if(var1.getKeyCode() == 113) {
+ this.loadWorld("World2");
+ }
+
+ if(var1.getKeyCode() == 114) {
+ this.loadWorld("World3");
+ }
+
+ if(var1.getKeyCode() == 115) {
+ this.loadWorld("World4");
+ }
+
+ if(var1.getKeyCode() == 116) {
+ this.loadWorld("World5");
+ }
+
+ if(var1.getKeyCode() == 32) {
+ this.translateX = this.translateY = 0;
+ }
+
+ if(var1.getKeyCode() == 27) {
+ this.displayHelpText = !this.displayHelpText;
+ }
+
+ this.repaint();
+ }
+
+ public void keyReleased(KeyEvent var1) {
+ }
+
+ public void keyTyped(KeyEvent var1) {
+ }
+
+ static boolean a(CanvasIsomPreview var0) {
+ return var0.running;
+ }
+}
diff --git a/source/net/minecraft/src/CanvasMinecraftApplet.java b/source/net/minecraft/src/CanvasMinecraftApplet.java
new file mode 100644
index 0000000..51f39f3
--- /dev/null
+++ b/source/net/minecraft/src/CanvasMinecraftApplet.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import net.minecraft.client.MinecraftApplet;
+
+public class CanvasMinecraftApplet extends Canvas {
+ final MinecraftApplet mcApplet;
+
+ public CanvasMinecraftApplet(MinecraftApplet var1) {
+ this.mcApplet = var1;
+ }
+
+ public synchronized void addNotify() {
+ super.addNotify();
+ this.mcApplet.startMainThread();
+ }
+
+ public synchronized void removeNotify() {
+ this.mcApplet.shutdown();
+ super.removeNotify();
+ }
+}
diff --git a/source/net/minecraft/src/CanvasMojangLogo.java b/source/net/minecraft/src/CanvasMojangLogo.java
new file mode 100644
index 0000000..796b0a3
--- /dev/null
+++ b/source/net/minecraft/src/CanvasMojangLogo.java
@@ -0,0 +1,29 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+class CanvasMojangLogo extends Canvas {
+ private BufferedImage logo;
+
+ public CanvasMojangLogo() {
+ try {
+ this.logo = ImageIO.read(PanelCrashReport.class.getResource("/gui/logo.png"));
+ } catch (IOException var2) {
+ }
+
+ byte var1 = 100;
+ this.setPreferredSize(new Dimension(var1, var1));
+ this.setMinimumSize(new Dimension(var1, var1));
+ }
+
+ public void paint(Graphics var1) {
+ super.paint(var1);
+ var1.drawImage(this.logo, this.getWidth() / 2 - this.logo.getWidth() / 2, 32, (ImageObserver)null);
+ }
+}
diff --git a/source/net/minecraft/src/ChatLine.java b/source/net/minecraft/src/ChatLine.java
new file mode 100644
index 0000000..98635da
--- /dev/null
+++ b/source/net/minecraft/src/ChatLine.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class ChatLine {
+ public String message;
+ public int updateCounter;
+
+ public ChatLine(String var1) {
+ this.message = var1;
+ this.updateCounter = 0;
+ }
+}
diff --git a/source/net/minecraft/src/Chunk.java b/source/net/minecraft/src/Chunk.java
new file mode 100644
index 0000000..56f534b
--- /dev/null
+++ b/source/net/minecraft/src/Chunk.java
@@ -0,0 +1,473 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Chunk {
+ public static boolean isLit;
+ public byte[] blocks;
+ public boolean isChunkLoaded;
+ public World worldObj;
+ public NibbleArray data;
+ public NibbleArray skylightMap;
+ public NibbleArray blocklightMap;
+ public byte[] heightMap;
+ public int height;
+ public final int xPosition;
+ public final int zPosition;
+ public Map chunkTileEntityMap;
+ public List[] entities;
+ public boolean isTerrainPopulated;
+ public boolean isModified;
+ public boolean neverSave;
+ public boolean isChunkRendered;
+ public boolean hasEntities;
+ public long lastSaveTime;
+
+ public Chunk(World var1, int var2, int var3) {
+ this.chunkTileEntityMap = new HashMap();
+ this.entities = new List[8];
+ this.isTerrainPopulated = false;
+ this.isModified = false;
+ this.isChunkRendered = false;
+ this.hasEntities = false;
+ this.lastSaveTime = 0L;
+ this.worldObj = var1;
+ this.xPosition = var2;
+ this.zPosition = var3;
+ this.heightMap = new byte[256];
+
+ for(int var4 = 0; var4 < this.entities.length; ++var4) {
+ this.entities[var4] = new ArrayList();
+ }
+
+ }
+
+ public Chunk(World var1, byte[] var2, int var3, int var4) {
+ this(var1, var3, var4);
+ this.blocks = var2;
+ this.data = new NibbleArray(var2.length);
+ this.skylightMap = new NibbleArray(var2.length);
+ this.blocklightMap = new NibbleArray(var2.length);
+ }
+
+ 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] & 255;
+ }
+
+ public void doNothing() {
+ }
+
+ public void generateHeightMap() {
+ int var1 = 127;
+
+ int var2;
+ int var3;
+ for(var2 = 0; var2 < 16; ++var2) {
+ for(var3 = 0; var3 < 16; ++var3) {
+ this.heightMap[var3 << 4 | var2] = -128;
+ this.relightBlock(var2, 127, var3);
+ if((this.heightMap[var3 << 4 | var2] & 255) < var1) {
+ var1 = this.heightMap[var3 << 4 | var2] & 255;
+ }
+ }
+ }
+
+ this.height = var1;
+
+ for(var2 = 0; var2 < 16; ++var2) {
+ for(var3 = 0; var3 < 16; ++var3) {
+ this.updateSkylight_do(var2, var3);
+ }
+ }
+
+ this.isModified = true;
+ }
+
+ private void updateSkylight_do(int var1, int var2) {
+ int var3 = this.getHeightValue(var1, var2);
+ int var4 = this.xPosition * 16 + var1;
+ int var5 = this.zPosition * 16 + var2;
+ this.checkSkylightNeighborHeight(var4 - 1, var5, var3);
+ this.checkSkylightNeighborHeight(var4 + 1, var5, var3);
+ this.checkSkylightNeighborHeight(var4, var5 - 1, var3);
+ this.checkSkylightNeighborHeight(var4, var5 + 1, var3);
+ }
+
+ private void checkSkylightNeighborHeight(int var1, int var2, int var3) {
+ int var4 = this.worldObj.getHeightValue(var1, var2);
+ if(var4 > var3) {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var1, var3, var2, var1, var4, var2);
+ } else if(var4 < var3) {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var1, var4, var2, var1, var3, var2);
+ }
+
+ this.isModified = true;
+ }
+
+ private void relightBlock(int var1, int var2, int var3) {
+ int var4 = this.heightMap[var3 << 4 | var1] & 255;
+ int var5 = var4;
+ if(var2 > var4) {
+ var5 = var2;
+ }
+
+ while(var5 > 0 && Block.lightOpacity[this.getBlockID(var1, var5 - 1, var3)] == 0) {
+ --var5;
+ }
+
+ if(var5 != var4) {
+ this.worldObj.markBlockAsNeedsUpdate(var1, var3, var5, var4);
+ this.heightMap[var3 << 4 | var1] = (byte)var5;
+ int var6;
+ int var7;
+ int var8;
+ if(var5 < this.height) {
+ this.height = var5;
+ } else {
+ var6 = 127;
+
+ for(var7 = 0; var7 < 16; ++var7) {
+ for(var8 = 0; var8 < 16; ++var8) {
+ if((this.heightMap[var8 << 4 | var7] & 255) < var6) {
+ var6 = this.heightMap[var8 << 4 | var7] & 255;
+ }
+ }
+ }
+
+ this.height = var6;
+ }
+
+ var6 = this.xPosition * 16 + var1;
+ var7 = this.zPosition * 16 + var3;
+ if(var5 < var4) {
+ for(var8 = var5; var8 < var4; ++var8) {
+ this.skylightMap.set(var1, var8, var3, 15);
+ }
+ } else {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var6, var4, var7, var6, var5, var7);
+
+ for(var8 = var4; var8 < var5; ++var8) {
+ this.skylightMap.set(var1, var8, var3, 0);
+ }
+ }
+
+ var8 = 15;
+
+ int var9;
+ for(var9 = var5; var5 > 0 && var8 > 0; this.skylightMap.set(var1, var5, var3, var8)) {
+ --var5;
+ int var10 = Block.lightOpacity[this.getBlockID(var1, var5, var3)];
+ if(var10 == 0) {
+ var10 = 1;
+ }
+
+ var8 -= var10;
+ if(var8 < 0) {
+ var8 = 0;
+ }
+ }
+
+ while(var5 > 0 && Block.lightOpacity[this.getBlockID(var1, var5 - 1, var3)] == 0) {
+ --var5;
+ }
+
+ if(var5 != var9) {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var6 - 1, var5, var7 - 1, var6 + 1, var9, var7 + 1);
+ }
+
+ this.isModified = true;
+ }
+ }
+
+ public int getBlockID(int var1, int var2, int var3) {
+ return this.blocks[var1 << 11 | var3 << 7 | var2];
+ }
+
+ public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) {
+ byte var6 = (byte)var4;
+ int var7 = this.heightMap[var3 << 4 | var1] & 255;
+ int var8 = this.blocks[var1 << 11 | var3 << 7 | var2] & 255;
+ if(var8 == var4) {
+ return false;
+ } else {
+ int var9 = this.xPosition * 16 + var1;
+ int var10 = this.zPosition * 16 + var3;
+ this.blocks[var1 << 11 | var3 << 7 | var2] = var6;
+ if(var8 != 0) {
+ Block.blocksList[var8].onBlockRemoval(this.worldObj, var9, var2, var10);
+ }
+
+ this.data.set(var1, var2, var3, var5);
+ if(Block.lightOpacity[var6] != 0) {
+ if(var2 >= var7) {
+ this.relightBlock(var1, var2 + 1, var3);
+ }
+ } else if(var2 == var7 - 1) {
+ this.relightBlock(var1, var2, var3);
+ }
+
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var9, var2, var10, var9, var2, var10);
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Block, var9, var2, var10, var9, var2, var10);
+ this.updateSkylight_do(var1, var3);
+ if(var4 != 0) {
+ Block.blocksList[var4].onBlockAdded(this.worldObj, var9, var2, var10);
+ }
+
+ this.isModified = true;
+ return true;
+ }
+ }
+
+ public boolean setBlockID(int var1, int var2, int var3, int var4) {
+ byte var5 = (byte)var4;
+ int var6 = this.heightMap[var3 << 4 | var1] & 255;
+ int var7 = this.blocks[var1 << 11 | var3 << 7 | var2] & 255;
+ if(var7 == var4) {
+ return false;
+ } else {
+ int var8 = this.xPosition * 16 + var1;
+ int var9 = this.zPosition * 16 + var3;
+ this.blocks[var1 << 11 | var3 << 7 | var2] = var5;
+ if(var7 != 0) {
+ Block.blocksList[var7].onBlockRemoval(this.worldObj, var8, var2, var9);
+ }
+
+ this.data.set(var1, var2, var3, 0);
+ if(Block.lightOpacity[var5] != 0) {
+ if(var2 >= var6) {
+ this.relightBlock(var1, var2 + 1, var3);
+ }
+ } else if(var2 == var6 - 1) {
+ this.relightBlock(var1, var2, var3);
+ }
+
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var8, var2, var9, var8, var2, var9);
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Block, var8, var2, var9, var8, var2, var9);
+ this.updateSkylight_do(var1, var3);
+ if(var4 != 0) {
+ Block.blocksList[var4].onBlockAdded(this.worldObj, var8, var2, var9);
+ }
+
+ this.isModified = true;
+ return true;
+ }
+ }
+
+ public int getBlockMetadata(int var1, int var2, int var3) {
+ return this.data.get(var1, var2, var3);
+ }
+
+ public void setBlockMetadata(int var1, int var2, int var3, int var4) {
+ this.isModified = true;
+ this.data.set(var1, var2, var3, var4);
+ }
+
+ public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) {
+ return var1 == EnumSkyBlock.Sky ? this.skylightMap.get(var2, var3, var4) : (var1 == EnumSkyBlock.Block ? this.blocklightMap.get(var2, var3, var4) : 0);
+ }
+
+ public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
+ this.isModified = true;
+ if(var1 == EnumSkyBlock.Sky) {
+ this.skylightMap.set(var2, var3, var4, var5);
+ } else {
+ if(var1 != EnumSkyBlock.Block) {
+ return;
+ }
+
+ this.blocklightMap.set(var2, var3, var4, var5);
+ }
+
+ }
+
+ public int getBlockLightValue(int var1, int var2, int var3, int var4) {
+ int var5 = this.skylightMap.get(var1, var2, var3);
+ if(var5 > 0) {
+ isLit = true;
+ }
+
+ var5 -= var4;
+ int var6 = this.blocklightMap.get(var1, var2, var3);
+ if(var6 > var5) {
+ var5 = var6;
+ }
+
+ return var5;
+ }
+
+ public void addEntity(Entity var1) {
+ 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) {
+ System.out.println("Wrong location! " + var1);
+ }
+
+ int var4 = MathHelper.floor_double(var1.posY / 16.0D);
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var4 >= this.entities.length) {
+ var4 = this.entities.length - 1;
+ }
+
+ this.entities[var4].add(var1);
+ }
+
+ public void removeEntity(Entity var1) {
+ this.removeEntityAtIndex(var1, MathHelper.floor_double(var1.posY / 16.0D));
+ }
+
+ public void removeEntityAtIndex(Entity var1, int var2) {
+ if(var2 < 0) {
+ var2 = 0;
+ }
+
+ if(var2 >= this.entities.length) {
+ var2 = this.entities.length - 1;
+ }
+
+ if(!this.entities[var2].contains(var1)) {
+ System.out.println("There\'s no such entity to remove: " + var1);
+ }
+
+ this.entities[var2].remove(var1);
+ }
+
+ public boolean canBlockSeeTheSky(int var1, int var2, int var3) {
+ return var2 >= (this.heightMap[var3 << 4 | var1] & 255);
+ }
+
+ public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) {
+ int var4 = var1 + var2 * 1024 + var3 * 1024 * 1024;
+ TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(Integer.valueOf(var4));
+ if(var5 == null) {
+ int var6 = this.getBlockID(var1, var2, var3);
+ BlockContainer var7 = (BlockContainer)Block.blocksList[var6];
+ var7.onBlockAdded(this.worldObj, this.xPosition * 16 + var1, var2, this.zPosition * 16 + var3);
+ var5 = (TileEntity)this.chunkTileEntityMap.get(Integer.valueOf(var4));
+ }
+
+ 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);
+ }
+
+ public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) {
+ int var5 = var1 + var2 * 1024 + var3 * 1024 * 1024;
+ var4.worldObj = 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 BlockContainer) {
+ if(this.isChunkLoaded) {
+ if(this.chunkTileEntityMap.get(Integer.valueOf(var5)) != null) {
+ this.worldObj.loadedTileEntityList.remove(this.chunkTileEntityMap.get(Integer.valueOf(var5)));
+ }
+
+ this.worldObj.loadedTileEntityList.add(var4);
+ }
+
+ this.chunkTileEntityMap.put(Integer.valueOf(var5), var4);
+ } else {
+ System.out.println("Attempted to place a tile entity where there was no entity tile!");
+ }
+ }
+
+ public void removeChunkBlockTileEntity(int var1, int var2, int var3) {
+ int var4 = var1 + var2 * 1024 + var3 * 1024 * 1024;
+ if(this.isChunkLoaded) {
+ this.worldObj.loadedTileEntityList.remove(this.chunkTileEntityMap.remove(Integer.valueOf(var4)));
+ }
+
+ }
+
+ public void onChunkLoad() {
+ this.isChunkLoaded = true;
+ this.worldObj.loadedTileEntityList.addAll(this.chunkTileEntityMap.values());
+
+ for(int var1 = 0; var1 < this.entities.length; ++var1) {
+ this.worldObj.addLoadedEntities(this.entities[var1]);
+ }
+
+ }
+
+ public void onChunkUnload() {
+ this.isChunkLoaded = false;
+ this.worldObj.loadedTileEntityList.removeAll(this.chunkTileEntityMap.values());
+
+ for(int var1 = 0; var1 < this.entities.length; ++var1) {
+ this.worldObj.unloadEntities(this.entities[var1]);
+ }
+
+ }
+
+ public void setChunkModified() {
+ this.isModified = true;
+ }
+
+ public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3) {
+ int var4 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D);
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var5 >= this.entities.length) {
+ var5 = this.entities.length - 1;
+ }
+
+ for(int var6 = var4; var6 <= var5; ++var6) {
+ List var7 = this.entities[var6];
+
+ for(int var8 = 0; var8 < var7.size(); ++var8) {
+ Entity var9 = (Entity)var7.get(var8);
+ if(var9 != var1 && var9.boundingBox.intersectsWith(var2)) {
+ var3.add(var9);
+ }
+ }
+ }
+
+ }
+
+ public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3) {
+ int var4 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D);
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var5 >= this.entities.length) {
+ var5 = this.entities.length - 1;
+ }
+
+ for(int var6 = var4; var6 <= var5; ++var6) {
+ List var7 = this.entities[var6];
+
+ for(int var8 = 0; var8 < var7.size(); ++var8) {
+ Entity var9 = (Entity)var7.get(var8);
+ if(var1.isAssignableFrom(var9.getClass()) && var9.boundingBox.intersectsWith(var2)) {
+ var3.add(var9);
+ }
+ }
+ }
+
+ }
+
+ public boolean needsSaving(boolean var1) {
+ return this.neverSave ? false : (this.hasEntities && this.worldObj.worldTime != this.lastSaveTime ? true : this.isModified);
+ }
+}
diff --git a/source/net/minecraft/src/ChunkCache.java b/source/net/minecraft/src/ChunkCache.java
new file mode 100644
index 0000000..8856be6
--- /dev/null
+++ b/source/net/minecraft/src/ChunkCache.java
@@ -0,0 +1,123 @@
+package net.minecraft.src;
+
+public class ChunkCache implements IBlockAccess {
+ private int chunkX;
+ private int chunkZ;
+ private Chunk[][] chunkArray;
+ private World worldObj;
+
+ public ChunkCache(World var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ this.worldObj = var1;
+ this.chunkX = var2 >> 4;
+ this.chunkZ = var4 >> 4;
+ int var8 = var5 >> 4;
+ int var9 = var7 >> 4;
+ this.chunkArray = new Chunk[var8 - this.chunkX + 1][var9 - this.chunkZ + 1];
+
+ for(int var10 = this.chunkX; var10 <= var8; ++var10) {
+ for(int var11 = this.chunkZ; var11 <= var9; ++var11) {
+ this.chunkArray[var10 - this.chunkX][var11 - this.chunkZ] = var1.getChunkFromChunkCoords(var10, var11);
+ }
+ }
+
+ }
+
+ public int getBlockId(int var1, int var2, int var3) {
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ return 0;
+ } else {
+ int var4 = (var1 >> 4) - this.chunkX;
+ int var5 = (var3 >> 4) - this.chunkZ;
+ return this.chunkArray[var4][var5].getBlockID(var1 & 15, var2, var3 & 15);
+ }
+ }
+
+ 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);
+ }
+
+ public float getBrightness(int var1, int var2, int var3) {
+ return World.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 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ int var5;
+ int var6;
+ if(var4) {
+ var5 = this.getBlockId(var1, var2, var3);
+ if(var5 == Block.stairSingle.blockID || var5 == Block.tilledField.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) {
+ var6 = var7;
+ }
+
+ if(var8 > var6) {
+ var6 = var8;
+ }
+
+ if(var9 > var6) {
+ var6 = var9;
+ }
+
+ if(var10 > var6) {
+ var6 = var10;
+ }
+
+ return var6;
+ }
+ }
+
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ var5 = 15 - this.worldObj.skylightSubtracted;
+ 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);
+ }
+ } else {
+ return 15;
+ }
+ }
+
+ public int getBlockMetadata(int var1, int var2, int var3) {
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ 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);
+ }
+ }
+
+ public Material getBlockMaterial(int var1, int var2, int var3) {
+ int var4 = this.getBlockId(var1, var2, var3);
+ return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial;
+ }
+
+ public boolean isBlockNormalCube(int var1, int var2, int var3) {
+ Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)];
+ return var4 == null ? false : var4.isOpaqueCube();
+ }
+}
diff --git a/source/net/minecraft/src/ChunkLoader.java b/source/net/minecraft/src/ChunkLoader.java
new file mode 100644
index 0000000..4d6af16
--- /dev/null
+++ b/source/net/minecraft/src/ChunkLoader.java
@@ -0,0 +1,186 @@
+package net.minecraft.src;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.Iterator;
+
+public class ChunkLoader implements IChunkLoader {
+ private File saveDir;
+ private boolean createIfNecessary;
+
+ public ChunkLoader(File var1, boolean var2) {
+ this.saveDir = var1;
+ this.createIfNecessary = var2;
+ }
+
+ private File chunkFileForXZ(int var1, int var2) {
+ String var3 = "c." + Integer.toString(var1, 36) + "." + Integer.toString(var2, 36) + ".dat";
+ String var4 = Integer.toString(var1 & 63, 36);
+ String var5 = Integer.toString(var2 & 63, 36);
+ File var6 = new File(this.saveDir, var4);
+ if(!var6.exists()) {
+ if(!this.createIfNecessary) {
+ return null;
+ }
+
+ var6.mkdir();
+ }
+
+ var6 = new File(var6, var5);
+ if(!var6.exists()) {
+ if(!this.createIfNecessary) {
+ return null;
+ }
+
+ var6.mkdir();
+ }
+
+ var6 = new File(var6, var3);
+ return !var6.exists() && !this.createIfNecessary ? null : var6;
+ }
+
+ public Chunk loadChunk(World var1, int var2, int var3) {
+ File var4 = this.chunkFileForXZ(var2, var3);
+ if(var4 != null && var4.exists()) {
+ try {
+ FileInputStream var5 = new FileInputStream(var4);
+ NBTTagCompound var6 = CompressedStreamTools.readCompressed(var5);
+ return loadChunkIntoWorldFromCompound(var1, var6.getCompoundTag("Level"));
+ } catch (Exception var7) {
+ var7.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+
+ public void saveChunk(World var1, Chunk var2) {
+ File var3 = this.chunkFileForXZ(var2.xPosition, var2.zPosition);
+ if(var3.exists()) {
+ var1.setSizeOnDisk -= var3.length();
+ }
+
+ try {
+ File var4 = new File(this.saveDir, "tmp_chunk.dat");
+ FileOutputStream var5 = new FileOutputStream(var4);
+ NBTTagCompound var6 = new NBTTagCompound();
+ NBTTagCompound var7 = new NBTTagCompound();
+ var6.setTag("Level", var7);
+ this.storeChunkInCompound(var2, var1, var7);
+ CompressedStreamTools.writeCompressed(var6, var5);
+ var5.close();
+ if(var3.exists()) {
+ var3.delete();
+ }
+
+ var4.renameTo(var3);
+ var1.setSizeOnDisk += var3.length();
+ } catch (Exception var8) {
+ var8.printStackTrace();
+ }
+
+ }
+
+ public void storeChunkInCompound(Chunk var1, World var2, NBTTagCompound var3) {
+ var3.setInteger("xPos", var1.xPosition);
+ var3.setInteger("zPos", var1.zPosition);
+ var3.setLong("LastUpdate", var2.worldTime);
+ var3.setByteArray("Blocks", var1.blocks);
+ var3.setByteArray("Data", var1.data.data);
+ var3.setByteArray("SkyLight", var1.skylightMap.data);
+ var3.setByteArray("BlockLight", var1.blocklightMap.data);
+ var3.setByteArray("HeightMap", var1.heightMap);
+ var3.setBoolean("TerrainPopulated", var1.isTerrainPopulated);
+ var1.hasEntities = false;
+ NBTTagList var4 = new NBTTagList();
+
+ Iterator var6;
+ NBTTagCompound var8;
+ for(int var5 = 0; var5 < var1.entities.length; ++var5) {
+ var6 = var1.entities[var5].iterator();
+
+ while(var6.hasNext()) {
+ Entity var7 = (Entity)var6.next();
+ var1.hasEntities = true;
+ var8 = new NBTTagCompound();
+ if(var7.addEntityID(var8)) {
+ var4.setTag(var8);
+ }
+ }
+ }
+
+ var3.setTag("Entities", var4);
+ NBTTagList var9 = new NBTTagList();
+ var6 = var1.chunkTileEntityMap.values().iterator();
+
+ while(var6.hasNext()) {
+ TileEntity var10 = (TileEntity)var6.next();
+ var8 = new NBTTagCompound();
+ var10.writeToNBT(var8);
+ var9.setTag(var8);
+ }
+
+ var3.setTag("TileEntities", var9);
+ }
+
+ public static Chunk loadChunkIntoWorldFromCompound(World var0, NBTTagCompound var1) {
+ int var2 = var1.getInteger("xPos");
+ int var3 = var1.getInteger("zPos");
+ Chunk var4 = new Chunk(var0, var2, var3);
+ var4.blocks = var1.getByteArray("Blocks");
+ var4.data = new NibbleArray(var1.getByteArray("Data"));
+ var4.skylightMap = new NibbleArray(var1.getByteArray("SkyLight"));
+ var4.blocklightMap = new NibbleArray(var1.getByteArray("BlockLight"));
+ var4.heightMap = var1.getByteArray("HeightMap");
+ var4.isTerrainPopulated = var1.getBoolean("TerrainPopulated");
+ if(!var4.data.isValid()) {
+ var4.data = new NibbleArray(var4.blocks.length);
+ }
+
+ if(var4.heightMap == null || !var4.skylightMap.isValid()) {
+ var4.heightMap = new byte[256];
+ var4.skylightMap = new NibbleArray(var4.blocks.length);
+ var4.generateHeightMap();
+ }
+
+ if(!var4.blocklightMap.isValid()) {
+ var4.blocklightMap = new NibbleArray(var4.blocks.length);
+ var4.doNothing();
+ }
+
+ NBTTagList var5 = var1.getTagList("Entities");
+ if(var5 != null) {
+ for(int var6 = 0; var6 < var5.tagCount(); ++var6) {
+ NBTTagCompound var7 = (NBTTagCompound)var5.tagAt(var6);
+ Entity var8 = EntityList.createEntityFromNBT(var7, var0);
+ var4.hasEntities = true;
+ if(var8 != null) {
+ var4.addEntity(var8);
+ }
+ }
+ }
+
+ NBTTagList var10 = var1.getTagList("TileEntities");
+ if(var10 != null) {
+ for(int var11 = 0; var11 < var10.tagCount(); ++var11) {
+ NBTTagCompound var12 = (NBTTagCompound)var10.tagAt(var11);
+ TileEntity var9 = TileEntity.createAndLoadEntity(var12);
+ if(var9 != null) {
+ var4.addTileEntity(var9);
+ }
+ }
+ }
+
+ return var4;
+ }
+
+ public void chunkTick() {
+ }
+
+ public void saveExtraData() {
+ }
+
+ public void saveExtraChunkData(World var1, Chunk var2) {
+ }
+}
diff --git a/source/net/minecraft/src/ChunkPosition.java b/source/net/minecraft/src/ChunkPosition.java
new file mode 100644
index 0000000..8b19854
--- /dev/null
+++ b/source/net/minecraft/src/ChunkPosition.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ChunkPosition {
+ public final int x;
+ public final int y;
+ public final int z;
+
+ public ChunkPosition(int var1, int var2, int var3) {
+ this.x = var1;
+ this.y = var2;
+ this.z = var3;
+ }
+
+ public boolean equals(Object var1) {
+ if(!(var1 instanceof ChunkPosition)) {
+ return false;
+ } else {
+ ChunkPosition var2 = (ChunkPosition)var1;
+ return var2.x == this.x && var2.y == this.y && var2.z == this.z;
+ }
+ }
+
+ public int hashCode() {
+ return this.x * 8976890 + this.y * 981131 + this.z;
+ }
+}
diff --git a/source/net/minecraft/src/ChunkProviderGenerate.java b/source/net/minecraft/src/ChunkProviderGenerate.java
new file mode 100644
index 0000000..5a97630
--- /dev/null
+++ b/source/net/minecraft/src/ChunkProviderGenerate.java
@@ -0,0 +1,610 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class ChunkProviderGenerate implements IChunkProvider {
+ private Random rand;
+ private NoiseGeneratorOctaves noiseGen1;
+ private NoiseGeneratorOctaves noiseGen2;
+ private NoiseGeneratorOctaves noiseGen3;
+ private NoiseGeneratorOctaves noiseGen4;
+ private NoiseGeneratorOctaves noiseGen5;
+ private NoiseGeneratorOctaves noiseGen6;
+ private NoiseGeneratorOctaves noiseGen7;
+ private NoiseGeneratorOctaves mobSpawnerNoise;
+ private World worldObj;
+ private double[] noiseArray;
+ double[] noise3;
+ double[] noise1;
+ double[] noise2;
+ double[] noise6;
+ double[] noise7;
+ int[][] unused = new int[32][32];
+
+ public ChunkProviderGenerate(World var1, long var2) {
+ this.worldObj = var1;
+ this.rand = new Random(var2);
+ 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, 4);
+ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 10);
+ this.noiseGen7 = new NoiseGeneratorOctaves(this.rand, 16);
+ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
+ }
+
+ public void generateTerrain(int var1, int var2, byte[] var3) {
+ byte var4 = 4;
+ byte var5 = 64;
+ int var6 = var4 + 1;
+ byte var7 = 17;
+ int var8 = var4 + 1;
+ this.noiseArray = this.initializeNoiseField(this.noiseArray, var1 * var4, 0, var2 * 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) {
+ double var12 = 0.125D;
+ double var14 = this.noiseArray[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0];
+ double var16 = this.noiseArray[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0];
+ double var18 = this.noiseArray[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 0];
+ double var20 = this.noiseArray[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 0];
+ double var22 = (this.noiseArray[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 1] - var14) * var12;
+ double var24 = (this.noiseArray[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 1] - var16) * var12;
+ double var26 = (this.noiseArray[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12;
+ double var28 = (this.noiseArray[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12;
+
+ 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) {
+ 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) {
+ int var51 = 0;
+ if(var11 * 8 + var30 < var5) {
+ var51 = Block.waterStill.blockID;
+ }
+
+ if(var46 > 0.0D) {
+ var51 = Block.stone.blockID;
+ }
+
+ var3[var42] = (byte)var51;
+ var42 += var43;
+ var46 += var48;
+ }
+
+ var33 += var37;
+ var35 += var39;
+ }
+
+ var14 += var22;
+ var16 += var24;
+ var18 += var26;
+ var20 += var28;
+ }
+ }
+ }
+ }
+
+ }
+
+ public void replaceBlocks(int var1, int var2, byte[] var3) {
+ byte var4 = 64;
+
+ for(int var5 = 0; var5 < 16; ++var5) {
+ for(int var6 = 0; var6 < 16; ++var6) {
+ double var7 = (double)(var1 * 16 + var5);
+ double var9 = (double)(var2 * 16 + var6);
+ double var11 = 1.0D / 32.0D;
+ boolean var13 = this.noiseGen4.a(var7 * var11, var9 * var11, 0.0D) + this.rand.nextDouble() * 0.2D > 0.0D;
+ boolean var14 = this.noiseGen4.a(var9 * var11, 109.0134D, var7 * var11) + this.rand.nextDouble() * 0.2D > 3.0D;
+ int var15 = (int)(this.noiseGen5.generateNoiseOctaves(var7 * var11 * 2.0D, var9 * var11 * 2.0D) / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
+ int var16 = -1;
+ int var17 = Block.grass.blockID;
+ int var18 = Block.dirt.blockID;
+ int var19 = (var5 * 16 + var6) * 128 + 128;
+
+ for(int var20 = 127; var20 >= 0; --var20) {
+ --var19;
+ if(var20 <= 0 + this.rand.nextInt(6) - 1) {
+ var3[var19] = (byte)Block.bedrock.blockID;
+ } else if(var3[var19] == 0) {
+ var16 = -1;
+ } else if(var3[var19] == Block.stone.blockID) {
+ if(var16 == -1) {
+ if(var15 <= 0) {
+ var17 = 0;
+ var18 = (byte)Block.stone.blockID;
+ } else if(var20 >= var4 - 4 && var20 <= var4 + 1) {
+ var17 = Block.grass.blockID;
+ var18 = Block.dirt.blockID;
+ if(var14) {
+ var17 = 0;
+ }
+
+ if(var14) {
+ var18 = Block.gravel.blockID;
+ }
+
+ if(var13) {
+ var17 = Block.sand.blockID;
+ }
+
+ if(var13) {
+ var18 = Block.sand.blockID;
+ }
+ }
+
+ if(var20 < var4 && var17 == 0) {
+ var17 = Block.waterStill.blockID;
+ }
+
+ var16 = var15;
+ if(var20 >= var4 - 1) {
+ var3[var19] = (byte)var17;
+ } else {
+ var3[var19] = (byte)var18;
+ }
+ } else if(var16 > 0) {
+ --var16;
+ var3[var19] = (byte)var18;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ public Chunk provideChunk(int var1, int var2) {
+ this.rand.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L);
+ byte[] var3 = new byte[-Short.MIN_VALUE];
+ Chunk var4 = new Chunk(this.worldObj, var3, var1, var2);
+ this.generateTerrain(var1, var2, var3);
+ this.replaceBlocks(var1, var2, var3);
+ this.generateCaves(var1, var2, var3);
+ var4.generateHeightMap();
+ return var4;
+ }
+
+ protected void generateLargeCaveNode(int var1, int var2, byte[] var3, double var4, double var6, double var8) {
+ this.generateCaveNode(var1, var2, var3, var4, var6, var8, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
+ }
+
+ protected void generateCaveNode(int var1, int var2, byte[] var3, double var4, double var6, double var8, float var10, float var11, float var12, int var13, int var14, double var15) {
+ double var17 = (double)(var1 * 16 + 8);
+ double var19 = (double)(var2 * 16 + 8);
+ float var21 = 0.0F;
+ float var22 = 0.0F;
+ Random var23 = new Random(this.rand.nextLong());
+ if(var14 <= 0) {
+ byte var24 = 112;
+ var14 = var24 - var23.nextInt(var24 / 4);
+ }
+
+ boolean var52 = false;
+ if(var13 == -1) {
+ var13 = var14 / 2;
+ var52 = true;
+ }
+
+ int var25 = var23.nextInt(var14 / 2) + var14 / 4;
+
+ for(boolean var26 = var23.nextInt(6) == 0; var13 < var14; ++var13) {
+ double var27 = 1.5D + (double)(MathHelper.sin((float)var13 * (float)Math.PI / (float)var14) * var10 * 1.0F);
+ double var29 = var27 * var15;
+ float var31 = MathHelper.cos(var12);
+ float var32 = MathHelper.sin(var12);
+ var4 += (double)(MathHelper.cos(var11) * var31);
+ var6 += (double)var32;
+ var8 += (double)(MathHelper.sin(var11) * var31);
+ if(var26) {
+ var12 *= 0.92F;
+ } else {
+ var12 *= 0.7F;
+ }
+
+ var12 += var22 * 0.1F;
+ var11 += var21 * 0.1F;
+ var22 *= 0.9F;
+ var21 *= 12.0F / 16.0F;
+ var22 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 2.0F;
+ var21 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 4.0F;
+ if(!var52 && var13 == var25 && var10 > 1.0F) {
+ this.generateCaveNode(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 - (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
+ this.generateCaveNode(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 + (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
+ return;
+ }
+
+ if(var52 || var23.nextInt(4) != 0) {
+ double var33 = var4 - var17;
+ double var35 = var8 - var19;
+ double var37 = (double)(var14 - var13);
+ double var39 = (double)(var10 + 2.0F + 16.0F);
+ if(var33 * var33 + var35 * var35 - var37 * var37 > var39 * var39) {
+ return;
+ }
+
+ if(var4 >= var17 - 16.0D - var27 * 2.0D && var8 >= var19 - 16.0D - var27 * 2.0D && var4 <= var17 + 16.0D + var27 * 2.0D && var8 <= var19 + 16.0D + var27 * 2.0D) {
+ int var53 = MathHelper.floor_double(var4 - var27) - var1 * 16 - 1;
+ int var34 = MathHelper.floor_double(var4 + var27) - var1 * 16 + 1;
+ int var54 = MathHelper.floor_double(var6 - var29) - 1;
+ int var36 = MathHelper.floor_double(var6 + var29) + 1;
+ int var55 = MathHelper.floor_double(var8 - var27) - var2 * 16 - 1;
+ int var38 = MathHelper.floor_double(var8 + var27) - var2 * 16 + 1;
+ if(var53 < 0) {
+ var53 = 0;
+ }
+
+ if(var34 > 16) {
+ var34 = 16;
+ }
+
+ if(var54 < 1) {
+ var54 = 1;
+ }
+
+ if(var36 > 120) {
+ var36 = 120;
+ }
+
+ if(var55 < 0) {
+ var55 = 0;
+ }
+
+ if(var38 > 16) {
+ var38 = 16;
+ }
+
+ boolean var56 = false;
+
+ int var40;
+ int var43;
+ for(var40 = var53; !var56 && var40 < var34; ++var40) {
+ for(int var41 = var55; !var56 && var41 < var38; ++var41) {
+ for(int var42 = var36 + 1; !var56 && var42 >= var54 - 1; --var42) {
+ var43 = (var40 * 16 + var41) * 128 + var42;
+ if(var42 >= 0 && var42 < 128) {
+ if(var3[var43] == Block.waterMoving.blockID || var3[var43] == Block.waterStill.blockID) {
+ var56 = true;
+ }
+
+ if(var42 != var54 - 1 && var40 != var53 && var40 != var34 - 1 && var41 != var55 && var41 != var38 - 1) {
+ var42 = var54;
+ }
+ }
+ }
+ }
+ }
+
+ if(!var56) {
+ for(var40 = var53; var40 < var34; ++var40) {
+ double var57 = ((double)(var40 + var1 * 16) + 0.5D - var4) / var27;
+
+ for(var43 = var55; var43 < var38; ++var43) {
+ double var44 = ((double)(var43 + var2 * 16) + 0.5D - var8) / var27;
+ int var46 = (var40 * 16 + var43) * 128 + var36;
+ boolean var47 = false;
+
+ for(int var48 = var36 - 1; var48 >= var54; --var48) {
+ double var49 = ((double)var48 + 0.5D - var6) / var29;
+ if(var49 > -0.7D && var57 * var57 + var49 * var49 + var44 * var44 < 1.0D) {
+ byte var51 = var3[var46];
+ if(var51 == Block.grass.blockID) {
+ var47 = true;
+ }
+
+ if(var51 == Block.stone.blockID || var51 == Block.dirt.blockID || var51 == Block.grass.blockID) {
+ if(var48 < 10) {
+ var3[var46] = (byte)Block.lavaMoving.blockID;
+ } else {
+ var3[var46] = 0;
+ if(var47 && var3[var46 - 1] == Block.dirt.blockID) {
+ var3[var46 - 1] = (byte)Block.grass.blockID;
+ }
+ }
+ }
+ }
+
+ --var46;
+ }
+ }
+ }
+
+ if(var52) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ private void generateCaves(int var1, int var2, byte[] var3) {
+ byte var4 = 8;
+ this.rand.setSeed(this.worldObj.randomSeed);
+ long var5 = this.rand.nextLong() / 2L * 2L + 1L;
+ long var7 = this.rand.nextLong() / 2L * 2L + 1L;
+
+ for(int var9 = var1 - var4; var9 <= var1 + var4; ++var9) {
+ for(int var10 = var2 - var4; var10 <= var2 + var4; ++var10) {
+ this.rand.setSeed((long)var9 * var5 + (long)var10 * var7 ^ this.worldObj.randomSeed);
+ int var11 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
+ if(this.rand.nextInt(15) != 0) {
+ var11 = 0;
+ }
+
+ for(int var12 = 0; var12 < var11; ++var12) {
+ double var13 = (double)(var9 * 16 + this.rand.nextInt(16));
+ double var15 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
+ double var17 = (double)(var10 * 16 + this.rand.nextInt(16));
+ int var19 = 1;
+ if(this.rand.nextInt(4) == 0) {
+ this.generateLargeCaveNode(var1, var2, var3, var13, var15, var17);
+ var19 += this.rand.nextInt(4);
+ }
+
+ for(int var20 = 0; var20 < var19; ++var20) {
+ float var21 = this.rand.nextFloat() * (float)Math.PI * 2.0F;
+ float var22 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
+ float var23 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
+ this.generateCaveNode(var1, var2, var3, var13, var15, var17, var23, var21, var22, 0, 0, 1.0D);
+ }
+ }
+ }
+ }
+
+ }
+
+ 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];
+ }
+
+ double var8 = 684.412D;
+ double var10 = 684.412D;
+ this.noise6 = this.noiseGen6.a(this.noise6, var2, var3, var4, var5, 1, var7, 1.0D, 0.0D, 1.0D);
+ this.noise7 = this.noiseGen7.a(this.noise7, var2, var3, var4, var5, 1, var7, 100.0D, 0.0D, 100.0D);
+ this.noise3 = this.noiseGen3.a(this.noise3, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D);
+ this.noise1 = this.noiseGen1.a(this.noise1, var2, var3, var4, var5, var6, var7, var8, var10, var8);
+ this.noise2 = this.noiseGen2.a(this.noise2, var2, var3, var4, var5, var6, var7, var8, var10, var8);
+ int var12 = 0;
+ int var13 = 0;
+
+ for(int var14 = 0; var14 < var5; ++var14) {
+ for(int var15 = 0; var15 < var7; ++var15) {
+ double var16 = (this.noise6[var13] + 256.0D) / 512.0D;
+ if(var16 > 1.0D) {
+ var16 = 1.0D;
+ }
+
+ double var18 = 0.0D;
+ double var20 = this.noise7[var13] / 8000.0D;
+ if(var20 < 0.0D) {
+ var20 = -var20;
+ }
+
+ var20 = var20 * 3.0D - 3.0D;
+ if(var20 < 0.0D) {
+ var20 /= 2.0D;
+ if(var20 < -1.0D) {
+ var20 = -1.0D;
+ }
+
+ var20 /= 1.4D;
+ var20 /= 2.0D;
+ var16 = 0.0D;
+ } else {
+ if(var20 > 1.0D) {
+ var20 = 1.0D;
+ }
+
+ var20 /= 6.0D;
+ }
+
+ var16 += 0.5D;
+ var20 = var20 * (double)var6 / 16.0D;
+ double var22 = (double)var6 / 2.0D + var20 * 4.0D;
+ ++var13;
+
+ for(int var24 = 0; var24 < var6; ++var24) {
+ double var25 = 0.0D;
+ double var27 = ((double)var24 - var22) * 12.0D / var16;
+ if(var27 < 0.0D) {
+ var27 *= 4.0D;
+ }
+
+ double var29 = this.noise1[var12] / 512.0D;
+ double var31 = this.noise2[var12] / 512.0D;
+ double var33 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
+ if(var33 < 0.0D) {
+ var25 = var29;
+ } else if(var33 > 1.0D) {
+ var25 = var31;
+ } else {
+ var25 = var29 + (var31 - var29) * var33;
+ }
+
+ var25 -= var27;
+ double var35;
+ if(var24 > var6 - 4) {
+ var35 = (double)((float)(var24 - (var6 - 4)) / 3.0F);
+ var25 = var25 * (1.0D - var35) + -10.0D * var35;
+ }
+
+ if((double)var24 < var18) {
+ var35 = (var18 - (double)var24) / 4.0D;
+ if(var35 < 0.0D) {
+ var35 = 0.0D;
+ }
+
+ if(var35 > 1.0D) {
+ var35 = 1.0D;
+ }
+
+ var25 = var25 * (1.0D - var35) + -10.0D * var35;
+ }
+
+ var1[var12] = var25;
+ ++var12;
+ }
+ }
+ }
+
+ return var1;
+ }
+
+ public boolean chunkExists(int var1, int var2) {
+ return true;
+ }
+
+ public void populate(IChunkProvider var1, int var2, int var3) {
+ int var4 = var2 * 16;
+ int var5 = var3 * 16;
+ this.rand.setSeed(this.worldObj.randomSeed);
+ long var6 = this.rand.nextLong() / 2L * 2L + 1L;
+ long var8 = this.rand.nextLong() / 2L * 2L + 1L;
+ this.rand.setSeed((long)var2 * var6 + (long)var3 * var8 ^ this.worldObj.randomSeed);
+ double var10 = 0.25D;
+
+ int var12;
+ int var13;
+ int var14;
+ int var15;
+ for(var12 = 0; var12 < 4; ++var12) {
+ var13 = var4 + this.rand.nextInt(16) + 8;
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 20; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.dirt.blockID, 32)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 10; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.gravel.blockID, 32)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 20; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 20; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(64);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreIron.blockID, 8)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ if(this.rand.nextInt(1) == 0) {
+ var12 = var4 + this.rand.nextInt(16);
+ var13 = this.rand.nextInt(32);
+ var14 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreGold.blockID, 8)).generate(this.worldObj, this.rand, var12, var13, var14);
+ }
+
+ if(this.rand.nextInt(4) == 0) {
+ var12 = var4 + this.rand.nextInt(16);
+ var13 = this.rand.nextInt(16);
+ var14 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreDiamond.blockID, 8)).generate(this.worldObj, this.rand, var12, var13, var14);
+ }
+
+ var10 = 0.5D;
+ var12 = (int)((this.mobSpawnerNoise.generateNoiseOctaves((double)var4 * var10, (double)var5 * var10) / 8.0D + this.rand.nextDouble() * 4.0D + 4.0D) / 3.0D);
+ if(var12 < 0) {
+ var12 = 0;
+ }
+
+ WorldGenTrees var18 = new WorldGenTrees();
+ if(this.rand.nextInt(10) == 0) {
+ ++var12;
+ }
+
+ int var16;
+ for(var14 = 0; var14 < var12; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ var18.setScale(1.0D, 1.0D, 1.0D);
+ var18.generate(this.worldObj, this.rand, var15, this.worldObj.getHeightValue(var15, var16), var16);
+ }
+
+ int var17;
+ for(var14 = 0; var14 < 2; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = this.rand.nextInt(128);
+ var17 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.plantYellow.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
+ }
+
+ if(this.rand.nextInt(2) == 0) {
+ var14 = var4 + this.rand.nextInt(16) + 8;
+ var15 = this.rand.nextInt(128);
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.plantRed.blockID)).generate(this.worldObj, this.rand, var14, var15, var16);
+ }
+
+ if(this.rand.nextInt(4) == 0) {
+ var14 = var4 + this.rand.nextInt(16) + 8;
+ var15 = this.rand.nextInt(128);
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.rand, var14, var15, var16);
+ }
+
+ if(this.rand.nextInt(8) == 0) {
+ var14 = var4 + this.rand.nextInt(16) + 8;
+ var15 = this.rand.nextInt(128);
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.rand, var14, var15, var16);
+ }
+
+ for(var14 = 0; var14 < 50; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = this.rand.nextInt(this.rand.nextInt(120) + 8);
+ var17 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenLiquids(Block.waterMoving.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
+ }
+
+ for(var14 = 0; var14 < 20; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(112) + 8) + 8);
+ var17 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
+ }
+
+ }
+
+ public boolean saveChunks(boolean var1, IProgressUpdate var2) {
+ return true;
+ }
+
+ public boolean unload100OldestChunks() {
+ return false;
+ }
+
+ public boolean canSave() {
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/ChunkProviderIso.java b/source/net/minecraft/src/ChunkProviderIso.java
new file mode 100644
index 0000000..ca7a076
--- /dev/null
+++ b/source/net/minecraft/src/ChunkProviderIso.java
@@ -0,0 +1,66 @@
+package net.minecraft.src;
+
+import java.io.IOException;
+
+public class ChunkProviderIso implements IChunkProvider {
+ private Chunk[] chunks = new Chunk[256];
+ private World worldObj;
+ private IChunkLoader chunkLoader;
+ byte[] blocks = new byte[-Short.MIN_VALUE];
+
+ public ChunkProviderIso(World var1, IChunkLoader var2) {
+ this.worldObj = var1;
+ this.chunkLoader = var2;
+ }
+
+ public boolean chunkExists(int var1, int var2) {
+ int var3 = var1 & 15 | (var2 & 15) * 16;
+ return this.chunks[var3] != null && this.chunks[var3].isAtLocation(var1, var2);
+ }
+
+ public Chunk provideChunk(int var1, int var2) {
+ int var3 = var1 & 15 | (var2 & 15) * 16;
+
+ try {
+ if(!this.chunkExists(var1, var2)) {
+ Chunk var4 = this.getChunkAt(var1, var2);
+ if(var4 == null) {
+ var4 = new Chunk(this.worldObj, this.blocks, var1, var2);
+ var4.isChunkRendered = true;
+ var4.neverSave = true;
+ }
+
+ this.chunks[var3] = var4;
+ }
+
+ return this.chunks[var3];
+ } catch (Exception var5) {
+ var5.printStackTrace();
+ return null;
+ }
+ }
+
+ private synchronized Chunk getChunkAt(int var1, int var2) {
+ try {
+ return this.chunkLoader.loadChunk(this.worldObj, var1, var2);
+ } catch (IOException var4) {
+ var4.printStackTrace();
+ return null;
+ }
+ }
+
+ public void populate(IChunkProvider var1, int var2, int var3) {
+ }
+
+ public boolean saveChunks(boolean var1, IProgressUpdate var2) {
+ return true;
+ }
+
+ public boolean unload100OldestChunks() {
+ return false;
+ }
+
+ public boolean canSave() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/ChunkProviderLoadOrGenerate.java b/source/net/minecraft/src/ChunkProviderLoadOrGenerate.java
new file mode 100644
index 0000000..b4aff3d
--- /dev/null
+++ b/source/net/minecraft/src/ChunkProviderLoadOrGenerate.java
@@ -0,0 +1,203 @@
+package net.minecraft.src;
+
+import java.io.IOException;
+
+public class ChunkProviderLoadOrGenerate implements IChunkProvider {
+ private Chunk blankChunk;
+ private IChunkProvider chunkProvider;
+ private IChunkLoader chunkLoader;
+ private Chunk[] chunks = new Chunk[1024];
+ private World worldObj;
+ int lastQueriedChunkXPos = -999999999;
+ int lastQueriedChunkZPos = -999999999;
+ private Chunk lastQueriedChunk;
+
+ public ChunkProviderLoadOrGenerate(World var1, IChunkLoader var2, IChunkProvider var3) {
+ this.blankChunk = new Chunk(var1, new byte[-Short.MIN_VALUE], 0, 0);
+ this.blankChunk.isChunkRendered = true;
+ this.blankChunk.neverSave = true;
+ this.worldObj = var1;
+ this.chunkLoader = var2;
+ this.chunkProvider = var3;
+ }
+
+ public boolean chunkExists(int var1, int var2) {
+ if(var1 == this.lastQueriedChunkXPos && var2 == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
+ return true;
+ } else {
+ int var3 = var1 & 31;
+ int var4 = var2 & 31;
+ int var5 = var3 + var4 * 32;
+ return this.chunks[var5] != null && (this.chunks[var5] == this.blankChunk || this.chunks[var5].isAtLocation(var1, var2));
+ }
+ }
+
+ public Chunk provideChunk(int var1, int var2) {
+ if(var1 == this.lastQueriedChunkXPos && var2 == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
+ return this.lastQueriedChunk;
+ } else {
+ int var3 = var1 & 31;
+ int var4 = var2 & 31;
+ int var5 = var3 + var4 * 32;
+ if(!this.chunkExists(var1, var2)) {
+ BlockSand.fallInstantly = true;
+ if(this.chunks[var5] != null) {
+ this.chunks[var5].onChunkUnload();
+ this.saveChunk(this.chunks[var5]);
+ this.saveExtraChunkData(this.chunks[var5]);
+ }
+
+ Chunk var6 = this.getChunkAt(var1, var2);
+ if(var6 == null) {
+ if(this.chunkProvider == null) {
+ var6 = this.blankChunk;
+ } else {
+ var6 = this.chunkProvider.provideChunk(var1, var2);
+ }
+ }
+
+ this.chunks[var5] = var6;
+ if(this.chunks[var5] != null) {
+ this.chunks[var5].onChunkLoad();
+ }
+
+ if(!this.chunks[var5].isTerrainPopulated && this.chunkExists(var1 + 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 + 1, var2)) {
+ this.populate(this, var1, var2);
+ }
+
+ if(this.chunkExists(var1 - 1, var2) && !this.provideChunk(var1 - 1, var2).isTerrainPopulated && this.chunkExists(var1 - 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 - 1, var2)) {
+ this.populate(this, var1 - 1, var2);
+ }
+
+ if(this.chunkExists(var1, var2 - 1) && !this.provideChunk(var1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 + 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 + 1, var2)) {
+ this.populate(this, var1, var2 - 1);
+ }
+
+ if(this.chunkExists(var1 - 1, var2 - 1) && !this.provideChunk(var1 - 1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 - 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 - 1, var2)) {
+ this.populate(this, var1 - 1, var2 - 1);
+ }
+
+ BlockSand.fallInstantly = false;
+ }
+
+ this.lastQueriedChunkXPos = var1;
+ this.lastQueriedChunkZPos = var2;
+ this.lastQueriedChunk = this.chunks[var5];
+ return this.chunks[var5];
+ }
+ }
+
+ private Chunk getChunkAt(int var1, int var2) {
+ if(this.chunkLoader == null) {
+ return null;
+ } else {
+ try {
+ Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2);
+ if(var3 != null) {
+ var3.lastSaveTime = this.worldObj.worldTime;
+ }
+
+ return var3;
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ return null;
+ }
+ }
+ }
+
+ private void saveExtraChunkData(Chunk var1) {
+ if(this.chunkLoader != null) {
+ try {
+ this.chunkLoader.saveExtraChunkData(this.worldObj, var1);
+ } catch (Exception var3) {
+ var3.printStackTrace();
+ }
+
+ }
+ }
+
+ private void saveChunk(Chunk var1) {
+ if(this.chunkLoader != null) {
+ try {
+ var1.lastSaveTime = this.worldObj.worldTime;
+ this.chunkLoader.saveChunk(this.worldObj, var1);
+ } catch (IOException var3) {
+ var3.printStackTrace();
+ }
+
+ }
+ }
+
+ public void populate(IChunkProvider var1, int var2, int var3) {
+ Chunk var4 = this.provideChunk(var2, var3);
+ if(!var4.isTerrainPopulated) {
+ var4.isTerrainPopulated = true;
+ if(this.chunkProvider != null) {
+ this.chunkProvider.populate(var1, var2, var3);
+ var4.setChunkModified();
+ }
+ }
+
+ }
+
+ public boolean saveChunks(boolean var1, IProgressUpdate var2) {
+ int var3 = 0;
+ int var4 = 0;
+ int var5;
+ if(var2 != null) {
+ for(var5 = 0; var5 < this.chunks.length; ++var5) {
+ if(this.chunks[var5] != null && this.chunks[var5].needsSaving(var1)) {
+ ++var4;
+ }
+ }
+ }
+
+ var5 = 0;
+
+ for(int var6 = 0; var6 < this.chunks.length; ++var6) {
+ if(this.chunks[var6] != null) {
+ if(var1 && !this.chunks[var6].neverSave) {
+ this.saveExtraChunkData(this.chunks[var6]);
+ }
+
+ if(this.chunks[var6].needsSaving(var1)) {
+ this.saveChunk(this.chunks[var6]);
+ this.chunks[var6].isModified = false;
+ ++var3;
+ if(var3 == 2 && !var1) {
+ return false;
+ }
+
+ if(var2 != null) {
+ ++var5;
+ if(var5 % 10 == 0) {
+ var2.setLoadingProgress(var5 * 100 / var4);
+ }
+ }
+ }
+ }
+ }
+
+ if(var1) {
+ if(this.chunkLoader == null) {
+ return true;
+ }
+
+ this.chunkLoader.saveExtraData();
+ }
+
+ return true;
+ }
+
+ public boolean unload100OldestChunks() {
+ if(this.chunkLoader != null) {
+ this.chunkLoader.chunkTick();
+ }
+
+ return this.chunkProvider.unload100OldestChunks();
+ }
+
+ public boolean canSave() {
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/ClippingHelper.java b/source/net/minecraft/src/ClippingHelper.java
new file mode 100644
index 0000000..df283be
--- /dev/null
+++ b/source/net/minecraft/src/ClippingHelper.java
@@ -0,0 +1,18 @@
+package net.minecraft.src;
+
+public class ClippingHelper {
+ public float[][] frustum = new float[16][16];
+ public float[] projectionMatrix = new float[16];
+ 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) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/ClippingHelperImplementation.java b/source/net/minecraft/src/ClippingHelperImplementation.java
new file mode 100644
index 0000000..8bf16a5
--- /dev/null
+++ b/source/net/minecraft/src/ClippingHelperImplementation.java
@@ -0,0 +1,82 @@
+package net.minecraft.src;
+
+import java.nio.FloatBuffer;
+import org.lwjgl.opengl.GL11;
+
+public class ClippingHelperImplementation extends ClippingHelper {
+ private static ClippingHelperImplementation instance = new ClippingHelperImplementation();
+ private FloatBuffer projectionMatrixBuffer = GLAllocation.createFloatBuffer(16);
+ private FloatBuffer modelviewMatrixBuffer = GLAllocation.createFloatBuffer(16);
+ private FloatBuffer floatBuffer = GLAllocation.createFloatBuffer(16);
+
+ 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;
+ }
+
+ private void init() {
+ this.projectionMatrixBuffer.clear();
+ this.modelviewMatrixBuffer.clear();
+ this.floatBuffer.clear();
+ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer);
+ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer);
+ 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];
+ this.clippingMatrix[3] = this.modelviewMatrix[0] * this.projectionMatrix[3] + this.modelviewMatrix[1] * this.projectionMatrix[7] + this.modelviewMatrix[2] * this.projectionMatrix[11] + this.modelviewMatrix[3] * this.projectionMatrix[15];
+ this.clippingMatrix[4] = this.modelviewMatrix[4] * this.projectionMatrix[0] + this.modelviewMatrix[5] * this.projectionMatrix[4] + this.modelviewMatrix[6] * this.projectionMatrix[8] + this.modelviewMatrix[7] * this.projectionMatrix[12];
+ this.clippingMatrix[5] = this.modelviewMatrix[4] * this.projectionMatrix[1] + this.modelviewMatrix[5] * this.projectionMatrix[5] + this.modelviewMatrix[6] * this.projectionMatrix[9] + this.modelviewMatrix[7] * this.projectionMatrix[13];
+ this.clippingMatrix[6] = this.modelviewMatrix[4] * this.projectionMatrix[2] + this.modelviewMatrix[5] * this.projectionMatrix[6] + this.modelviewMatrix[6] * this.projectionMatrix[10] + this.modelviewMatrix[7] * this.projectionMatrix[14];
+ this.clippingMatrix[7] = this.modelviewMatrix[4] * this.projectionMatrix[3] + this.modelviewMatrix[5] * this.projectionMatrix[7] + this.modelviewMatrix[6] * this.projectionMatrix[11] + this.modelviewMatrix[7] * this.projectionMatrix[15];
+ this.clippingMatrix[8] = this.modelviewMatrix[8] * this.projectionMatrix[0] + this.modelviewMatrix[9] * this.projectionMatrix[4] + this.modelviewMatrix[10] * this.projectionMatrix[8] + this.modelviewMatrix[11] * this.projectionMatrix[12];
+ this.clippingMatrix[9] = this.modelviewMatrix[8] * this.projectionMatrix[1] + this.modelviewMatrix[9] * this.projectionMatrix[5] + this.modelviewMatrix[10] * this.projectionMatrix[9] + this.modelviewMatrix[11] * this.projectionMatrix[13];
+ this.clippingMatrix[10] = this.modelviewMatrix[8] * this.projectionMatrix[2] + this.modelviewMatrix[9] * this.projectionMatrix[6] + this.modelviewMatrix[10] * this.projectionMatrix[10] + this.modelviewMatrix[11] * this.projectionMatrix[14];
+ this.clippingMatrix[11] = this.modelviewMatrix[8] * this.projectionMatrix[3] + this.modelviewMatrix[9] * this.projectionMatrix[7] + this.modelviewMatrix[10] * this.projectionMatrix[11] + this.modelviewMatrix[11] * this.projectionMatrix[15];
+ this.clippingMatrix[12] = this.modelviewMatrix[12] * this.projectionMatrix[0] + this.modelviewMatrix[13] * this.projectionMatrix[4] + this.modelviewMatrix[14] * this.projectionMatrix[8] + this.modelviewMatrix[15] * this.projectionMatrix[12];
+ this.clippingMatrix[13] = this.modelviewMatrix[12] * this.projectionMatrix[1] + this.modelviewMatrix[13] * this.projectionMatrix[5] + this.modelviewMatrix[14] * this.projectionMatrix[9] + this.modelviewMatrix[15] * this.projectionMatrix[13];
+ this.clippingMatrix[14] = this.modelviewMatrix[12] * this.projectionMatrix[2] + this.modelviewMatrix[13] * this.projectionMatrix[6] + this.modelviewMatrix[14] * this.projectionMatrix[10] + this.modelviewMatrix[15] * this.projectionMatrix[14];
+ this.clippingMatrix[15] = this.modelviewMatrix[12] * this.projectionMatrix[3] + this.modelviewMatrix[13] * this.projectionMatrix[7] + this.modelviewMatrix[14] * this.projectionMatrix[11] + this.modelviewMatrix[15] * this.projectionMatrix[15];
+ this.frustum[0][0] = this.clippingMatrix[3] - this.clippingMatrix[0];
+ this.frustum[0][1] = this.clippingMatrix[7] - this.clippingMatrix[4];
+ this.frustum[0][2] = this.clippingMatrix[11] - this.clippingMatrix[8];
+ this.frustum[0][3] = this.clippingMatrix[15] - this.clippingMatrix[12];
+ this.normalize(this.frustum, 0);
+ this.frustum[1][0] = this.clippingMatrix[3] + this.clippingMatrix[0];
+ this.frustum[1][1] = this.clippingMatrix[7] + this.clippingMatrix[4];
+ this.frustum[1][2] = this.clippingMatrix[11] + this.clippingMatrix[8];
+ this.frustum[1][3] = this.clippingMatrix[15] + this.clippingMatrix[12];
+ this.normalize(this.frustum, 1);
+ this.frustum[2][0] = this.clippingMatrix[3] + this.clippingMatrix[1];
+ this.frustum[2][1] = this.clippingMatrix[7] + this.clippingMatrix[5];
+ this.frustum[2][2] = this.clippingMatrix[11] + this.clippingMatrix[9];
+ this.frustum[2][3] = this.clippingMatrix[15] + this.clippingMatrix[13];
+ this.normalize(this.frustum, 2);
+ this.frustum[3][0] = this.clippingMatrix[3] - this.clippingMatrix[1];
+ this.frustum[3][1] = this.clippingMatrix[7] - this.clippingMatrix[5];
+ this.frustum[3][2] = this.clippingMatrix[11] - this.clippingMatrix[9];
+ this.frustum[3][3] = this.clippingMatrix[15] - this.clippingMatrix[13];
+ this.normalize(this.frustum, 3);
+ this.frustum[4][0] = this.clippingMatrix[3] - this.clippingMatrix[2];
+ this.frustum[4][1] = this.clippingMatrix[7] - this.clippingMatrix[6];
+ this.frustum[4][2] = this.clippingMatrix[11] - this.clippingMatrix[10];
+ this.frustum[4][3] = this.clippingMatrix[15] - this.clippingMatrix[14];
+ this.normalize(this.frustum, 4);
+ this.frustum[5][0] = this.clippingMatrix[3] + this.clippingMatrix[2];
+ this.frustum[5][1] = this.clippingMatrix[7] + this.clippingMatrix[6];
+ this.frustum[5][2] = this.clippingMatrix[11] + this.clippingMatrix[10];
+ this.frustum[5][3] = this.clippingMatrix[15] + this.clippingMatrix[14];
+ this.normalize(this.frustum, 5);
+ }
+}
diff --git a/source/net/minecraft/src/CompressedStreamTools.java b/source/net/minecraft/src/CompressedStreamTools.java
new file mode 100644
index 0000000..025017f
--- /dev/null
+++ b/source/net/minecraft/src/CompressedStreamTools.java
@@ -0,0 +1,50 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+public class CompressedStreamTools {
+ public static NBTTagCompound readCompressed(InputStream var0) throws IOException {
+ DataInputStream var1 = new DataInputStream(new GZIPInputStream(var0));
+
+ NBTTagCompound var2;
+ try {
+ var2 = read(var1);
+ } finally {
+ var1.close();
+ }
+
+ return var2;
+ }
+
+ public static void writeCompressed(NBTTagCompound var0, OutputStream var1) throws IOException {
+ DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1));
+
+ try {
+ write(var0, var2);
+ } finally {
+ var2.close();
+ }
+
+ }
+
+ public static NBTTagCompound read(DataInput var0) throws IOException {
+ NBTBase var1 = NBTBase.readNamedTag(var0);
+ 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);
+ }
+}
diff --git a/source/net/minecraft/src/CraftingManager.java b/source/net/minecraft/src/CraftingManager.java
new file mode 100644
index 0000000..21ff2e3
--- /dev/null
+++ b/source/net/minecraft/src/CraftingManager.java
@@ -0,0 +1,107 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+public class CraftingManager {
+ private static final CraftingManager instance = new CraftingManager();
+ private List recipes = new ArrayList();
+
+ public static final CraftingManager getInstance() {
+ return instance;
+ }
+
+ private CraftingManager() {
+ (new RecipesTools()).addRecipes(this);
+ (new RecipesWeapons()).addRecipe(this);
+ (new RecipesIngots()).addRecipes(this);
+ (new RecipesFood()).addRecipes(this);
+ (new RecipesCrafting()).addRecipes(this);
+ (new RecipesArmor()).addRecipes(this);
+ 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.stairSingle, 3), new Object[]{"###", Character.valueOf('#'), Block.cobblestone});
+ this.addRecipe(new ItemStack(Block.ladder, 1), new Object[]{"# #", "###", "# #", Character.valueOf('#'), Item.stick});
+ this.addRecipe(new ItemStack(Item.door, 1), new Object[]{"##", "##", "##", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Item.sign, 1), new Object[]{"###", "###", " X ", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.stick});
+ this.addRecipe(new ItemStack(Block.planks, 4), new Object[]{"#", Character.valueOf('#'), Block.wood});
+ this.addRecipe(new ItemStack(Item.stick, 4), new Object[]{"#", "#", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Block.torch, 4), new Object[]{"X", "#", Character.valueOf('X'), Item.coal, Character.valueOf('#'), Item.stick});
+ this.addRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[]{"# #", " # ", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Block.minecartTrack, 16), new Object[]{"X X", "X#X", "X X", Character.valueOf('X'), Item.ingotIron, Character.valueOf('#'), Item.stick});
+ this.addRecipe(new ItemStack(Item.minecart, 1), new Object[]{"# #", "###", Character.valueOf('#'), Item.ingotIron});
+ this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[]{"# #", " # ", Character.valueOf('#'), Item.ingotIron});
+ this.addRecipe(new ItemStack(Item.striker, 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.stairCompactWood, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Block.stairCompactStone, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.cobblestone});
+ this.addRecipe(new ItemStack(Item.painting, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Block.cloth});
+ this.addRecipe(new ItemStack(Item.appleGold, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.blockGold, Character.valueOf('X'), Item.appleRed});
+ Collections.sort(this.recipes, new RecipeSorter(this));
+ System.out.println(this.recipes.size() + " recipes");
+ }
+
+ void addRecipe(ItemStack var1, Object... var2) {
+ 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];
+ ++var6;
+ var5 = var9.length();
+ var3 = var3 + var9;
+ }
+ } else {
+ while(var2[var4] instanceof String) {
+ String var7 = (String)var2[var4++];
+ ++var6;
+ var5 = var7.length();
+ var3 = var3 + var7;
+ }
+ }
+
+ HashMap var12;
+ int var15;
+ for(var12 = new HashMap(); var4 < var2.length; var4 += 2) {
+ Character var13 = (Character)var2[var4];
+ var15 = 0;
+ if(var2[var4 + 1] instanceof Item) {
+ var15 = ((Item)var2[var4 + 1]).shiftedIndex;
+ } else if(var2[var4 + 1] instanceof Block) {
+ var15 = ((Block)var2[var4 + 1]).blockID;
+ }
+
+ var12.put(var13, Integer.valueOf(var15));
+ }
+
+ int[] var14 = new int[var5 * var6];
+
+ for(var15 = 0; var15 < var5 * var6; ++var15) {
+ char var10 = var3.charAt(var15);
+ if(var12.containsKey(Character.valueOf(var10))) {
+ var14[var15] = ((Integer)var12.get(Character.valueOf(var10))).intValue();
+ } else {
+ var14[var15] = -1;
+ }
+ }
+
+ this.recipes.add(new CraftingRecipe(var5, var6, var14, var1));
+ }
+
+ public ItemStack findMatchingRecipe(int[] var1) {
+ for(int var2 = 0; var2 < this.recipes.size(); ++var2) {
+ CraftingRecipe var3 = (CraftingRecipe)this.recipes.get(var2);
+ if(var3.matchRecipe(var1)) {
+ return var3.createResult(var1);
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/source/net/minecraft/src/CraftingRecipe.java b/source/net/minecraft/src/CraftingRecipe.java
new file mode 100644
index 0000000..37b74c6
--- /dev/null
+++ b/source/net/minecraft/src/CraftingRecipe.java
@@ -0,0 +1,64 @@
+package net.minecraft.src;
+
+public class CraftingRecipe {
+ private int width;
+ private int height;
+ private int[] ingredientMap;
+ private ItemStack resultStack;
+ public final int resultId;
+
+ public CraftingRecipe(int var1, int var2, int[] var3, ItemStack var4) {
+ this.resultId = var4.itemID;
+ this.width = var1;
+ this.height = var2;
+ this.ingredientMap = var3;
+ this.resultStack = var4;
+ }
+
+ public boolean matchRecipe(int[] var1) {
+ for(int var2 = 0; var2 <= 3 - this.width; ++var2) {
+ for(int var3 = 0; var3 <= 3 - this.height; ++var3) {
+ if(this.checkMatch(var1, var2, var3, true)) {
+ return true;
+ }
+
+ if(this.checkMatch(var1, var2, var3, false)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private boolean checkMatch(int[] 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;
+ int var9 = -1;
+ if(var7 >= 0 && var8 >= 0 && var7 < this.width && var8 < this.height) {
+ if(var4) {
+ var9 = this.ingredientMap[this.width - var7 - 1 + var8 * this.width];
+ } else {
+ var9 = this.ingredientMap[var7 + var8 * this.width];
+ }
+ }
+
+ if(var1[var5 + var6 * 3] != var9) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public ItemStack createResult(int[] var1) {
+ return new ItemStack(this.resultStack.itemID, this.resultStack.stackSize);
+ }
+
+ public int getRecipeSize() {
+ return this.width * this.height;
+ }
+}
diff --git a/source/net/minecraft/src/EffectRenderer.java b/source/net/minecraft/src/EffectRenderer.java
new file mode 100644
index 0000000..8b30d9b
--- /dev/null
+++ b/source/net/minecraft/src/EffectRenderer.java
@@ -0,0 +1,162 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+
+public class EffectRenderer {
+ protected World worldObj;
+ private List[] fxLayers = new List[3];
+ private RenderEngine renderer;
+ private Random rand = new Random();
+
+ public EffectRenderer(World var1, RenderEngine var2) {
+ if(var1 != null) {
+ this.worldObj = var1;
+ }
+
+ this.renderer = var2;
+
+ for(int var3 = 0; var3 < 3; ++var3) {
+ this.fxLayers[var3] = new ArrayList();
+ }
+
+ }
+
+ public void addEffect(EntityFX var1) {
+ int var2 = var1.getFXLayer();
+ this.fxLayers[var2].add(var1);
+ }
+
+ public void updateEffects() {
+ for(int var1 = 0; var1 < 3; ++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.fxLayers[var1].remove(var2--);
+ }
+ }
+ }
+
+ }
+
+ public void renderParticles(Entity var1, float var2) {
+ float var3 = MathHelper.cos(var1.rotationYaw * (float)Math.PI / 180.0F);
+ float var4 = MathHelper.sin(var1.rotationYaw * (float)Math.PI / 180.0F);
+ float var5 = -var4 * MathHelper.sin(var1.rotationPitch * (float)Math.PI / 180.0F);
+ float var6 = var3 * MathHelper.sin(var1.rotationPitch * (float)Math.PI / 180.0F);
+ float var7 = MathHelper.cos(var1.rotationPitch * (float)Math.PI / 180.0F);
+ 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;
+
+ for(int var8 = 0; var8 < 2; ++var8) {
+ if(this.fxLayers[var8].size() != 0) {
+ int var9 = 0;
+ if(var8 == 0) {
+ var9 = this.renderer.getTexture("/particles.png");
+ }
+
+ if(var8 == 1) {
+ var9 = this.renderer.getTexture("/terrain.png");
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var9);
+ Tessellator var10 = Tessellator.instance;
+ var10.startDrawingQuads();
+
+ for(int var11 = 0; var11 < this.fxLayers[var8].size(); ++var11) {
+ EntityFX var12 = (EntityFX)this.fxLayers[var8].get(var11);
+ var12.renderParticle(var10, var2, var3, var7, var4, var5, var6);
+ }
+
+ var10.draw();
+ }
+ }
+
+ }
+
+ public void renderLitParticles(Entity var1, float var2) {
+ byte var3 = 2;
+ if(this.fxLayers[var3].size() != 0) {
+ Tessellator var4 = Tessellator.instance;
+
+ for(int var5 = 0; var5 < this.fxLayers[var3].size(); ++var5) {
+ EntityFX var6 = (EntityFX)this.fxLayers[var3].get(var5);
+ var6.renderParticle(var4, var2, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+
+ }
+ }
+
+ public void clearEffects(World var1) {
+ this.worldObj = var1;
+
+ for(int var2 = 0; var2 < 3; ++var2) {
+ this.fxLayers[var2].clear();
+ }
+
+ }
+
+ public void addBlockDestroyEffects(int var1, int var2, int var3) {
+ int var4 = this.worldObj.getBlockId(var1, var2, var3);
+ if(var4 != 0) {
+ Block var5 = Block.blocksList[var4];
+ byte var6 = 4;
+
+ for(int var7 = 0; var7 < var6; ++var7) {
+ for(int var8 = 0; var8 < var6; ++var8) {
+ for(int var9 = 0; var9 < var6; ++var9) {
+ double var10 = (double)var1 + ((double)var7 + 0.5D) / (double)var6;
+ double var12 = (double)var2 + ((double)var8 + 0.5D) / (double)var6;
+ double var14 = (double)var3 + ((double)var9 + 0.5D) / (double)var6;
+ this.addEffect(new EntityDiggingFX(this.worldObj, var10, var12, var14, var10 - (double)var1 - 0.5D, var12 - (double)var2 - 0.5D, var14 - (double)var3 - 0.5D, var5));
+ }
+ }
+ }
+
+ }
+ }
+
+ public void addBlockHitEffects(int var1, int var2, int var3, int var4) {
+ int var5 = this.worldObj.getBlockId(var1, var2, var3);
+ if(var5 != 0) {
+ Block var6 = Block.blocksList[var5];
+ float var7 = 0.1F;
+ double var8 = (double)var1 + this.rand.nextDouble() * (var6.maxX - var6.minX - (double)(var7 * 2.0F)) + (double)var7 + var6.minX;
+ double var10 = (double)var2 + this.rand.nextDouble() * (var6.maxY - var6.minY - (double)(var7 * 2.0F)) + (double)var7 + var6.minY;
+ double var12 = (double)var3 + this.rand.nextDouble() * (var6.maxZ - var6.minZ - (double)(var7 * 2.0F)) + (double)var7 + var6.minZ;
+ if(var4 == 0) {
+ var10 = (double)var2 + var6.minY - (double)var7;
+ }
+
+ if(var4 == 1) {
+ var10 = (double)var2 + var6.maxY + (double)var7;
+ }
+
+ if(var4 == 2) {
+ var12 = (double)var3 + var6.minZ - (double)var7;
+ }
+
+ if(var4 == 3) {
+ var12 = (double)var3 + var6.maxZ + (double)var7;
+ }
+
+ if(var4 == 4) {
+ var8 = (double)var1 + var6.minX - (double)var7;
+ }
+
+ if(var4 == 5) {
+ var8 = (double)var1 + var6.maxX + (double)var7;
+ }
+
+ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6)).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
+ }
+ }
+
+ public String getStatistics() {
+ return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size());
+ }
+}
diff --git a/source/net/minecraft/src/Entity.java b/source/net/minecraft/src/Entity.java
new file mode 100644
index 0000000..64fc4ce
--- /dev/null
+++ b/source/net/minecraft/src/Entity.java
@@ -0,0 +1,728 @@
+package net.minecraft.src;
+
+import java.util.List;
+import java.util.Random;
+
+public abstract class Entity {
+ public boolean preventEntitySpawning = false;
+ public Entity riddenByEntity;
+ public Entity ridingEntity;
+ protected World worldObj;
+ public double prevPosX;
+ public double prevPosY;
+ public double prevPosZ;
+ public double posX;
+ public double posY;
+ public double posZ;
+ public double motionX;
+ public double motionY;
+ public double motionZ;
+ public float rotationYaw;
+ 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);
+ public boolean onGround = false;
+ public boolean isCollidedHorizontally = false;
+ public boolean isCollided = false;
+ public boolean surfaceCollision = true;
+ public boolean isDead = false;
+ public float yOffset = 0.0F;
+ public float width = 0.6F;
+ public float height = 1.8F;
+ public float prevDistanceWalkedModified = 0.0F;
+ public float distanceWalkedModified = 0.0F;
+ protected boolean canTriggerWalking = true;
+ protected float fallDistance = 0.0F;
+ private int nextStepDistance = 1;
+ public double lastTickPosX;
+ public double lastTickPosY;
+ public double lastTickPosZ;
+ public float ySize = 0.0F;
+ public float stepHeight = 0.0F;
+ public boolean noClip = false;
+ public float entityCollisionReduction = 0.0F;
+ public boolean unusedBool = false;
+ protected Random rand = new Random();
+ public int ticksExisted = 0;
+ public int fireResistance = 1;
+ public int fire = 0;
+ protected int maxAir = 300;
+ protected boolean inWater = false;
+ public int heartsLife = 0;
+ public int air = 300;
+ private boolean isFirstUpdate = true;
+ public String skinUrl;
+ private double entityRiderPitchDelta;
+ private double entityRiderYawDelta;
+
+ public Entity(World var1) {
+ this.worldObj = var1;
+ this.setPosition(0.0D, 0.0D, 0.0D);
+ }
+
+ protected void preparePlayerToSpawn() {
+ if(this.worldObj != null) {
+ while(this.posY > 0.0D) {
+ this.setPosition(this.posX, this.posY, this.posZ);
+ if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0) {
+ break;
+ }
+
+ ++this.posY;
+ }
+
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+ this.rotationPitch = 0.0F;
+ }
+ }
+
+ public void setEntityDead() {
+ this.isDead = true;
+ }
+
+ protected void setSize(float var1, float var2) {
+ this.width = var1;
+ this.height = var2;
+ }
+
+ protected void setRotation(float var1, float var2) {
+ this.rotationYaw = var1;
+ this.rotationPitch = var2;
+ }
+
+ public void setPosition(double var1, double var3, double var5) {
+ this.posX = var1;
+ this.posY = var3;
+ this.posZ = var5;
+ float var7 = this.width / 2.0F;
+ float var8 = this.height / 2.0F;
+ this.boundingBox.setBounds(var1 - (double)var7, var3 - (double)var8, var5 - (double)var7, var1 + (double)var7, var3 + (double)var8, var5 + (double)var7);
+ }
+
+ public void setAngles(float var1, float var2) {
+ 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.rotationPitch = -90.0F;
+ }
+
+ if(this.rotationPitch > 90.0F) {
+ this.rotationPitch = 90.0F;
+ }
+
+ this.prevRotationPitch += this.rotationPitch - var3;
+ this.prevRotationYaw += this.rotationYaw - var4;
+ }
+
+ public void onUpdate() {
+ this.onEntityUpdate();
+ }
+
+ public void onEntityUpdate() {
+ if(this.ridingEntity != null && this.ridingEntity.isDead) {
+ this.ridingEntity = null;
+ }
+
+ ++this.ticksExisted;
+ this.prevDistanceWalkedModified = this.distanceWalkedModified;
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.prevRotationPitch = this.rotationPitch;
+ this.prevRotationYaw = this.rotationYaw;
+ if(this.handleWaterMovement()) {
+ if(!this.inWater && !this.isFirstUpdate) {
+ 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) {
+ var1 = 1.0F;
+ }
+
+ this.worldObj.playSoundAtEntity(this, "random.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.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.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);
+ }
+ }
+
+ this.fallDistance = 0.0F;
+ this.inWater = true;
+ this.fire = 0;
+ } else {
+ this.inWater = false;
+ }
+
+ if(this.fire > 0) {
+ if(this.fire % 20 == 0) {
+ this.attackEntityFrom((Entity)null, 1);
+ }
+
+ --this.fire;
+ }
+
+ if(this.handleLavaMovement()) {
+ this.attackEntityFrom((Entity)null, 10);
+ this.fire = 600;
+ }
+
+ if(this.posY < -64.0D) {
+ this.kill();
+ }
+
+ this.isFirstUpdate = false;
+ }
+
+ protected void kill() {
+ this.setEntityDead();
+ }
+
+ public boolean isOffsetPositionInLiquid(double var1, double var3, double var5) {
+ AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(var1, var3, var5);
+ List var8 = this.worldObj.getCollidingBoundingBoxes(this, var7);
+ return var8.size() > 0 ? false : !this.worldObj.getIsAnyLiquid(var7);
+ }
+
+ public void moveEntity(double var1, double var3, double var5) {
+ if(this.noClip) {
+ this.boundingBox.offset(var1, var3, var5);
+ 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;
+ } else {
+ double var7 = this.posX;
+ double var9 = this.posZ;
+ double var11 = var1;
+ double var13 = var3;
+ double var15 = var5;
+ AxisAlignedBB var17 = this.boundingBox.copy();
+ List var18 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var1, var3, var5));
+
+ for(int var19 = 0; var19 < var18.size(); ++var19) {
+ var3 = ((AxisAlignedBB)var18.get(var19)).calculateYOffset(this.boundingBox, var3);
+ }
+
+ this.boundingBox.offset(0.0D, var3, 0.0D);
+ if(!this.surfaceCollision && var13 != var3) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ boolean var29 = this.onGround || var13 != var3 && var13 < 0.0D;
+
+ int var20;
+ for(var20 = 0; var20 < var18.size(); ++var20) {
+ var1 = ((AxisAlignedBB)var18.get(var20)).calculateXOffset(this.boundingBox, var1);
+ }
+
+ this.boundingBox.offset(var1, 0.0D, 0.0D);
+ if(!this.surfaceCollision && var11 != var1) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ for(var20 = 0; var20 < var18.size(); ++var20) {
+ var5 = ((AxisAlignedBB)var18.get(var20)).calculateZOffset(this.boundingBox, var5);
+ }
+
+ this.boundingBox.offset(0.0D, 0.0D, var5);
+ if(!this.surfaceCollision && var15 != var5) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ double var22;
+ int var27;
+ double var30;
+ if(this.stepHeight > 0.0F && var29 && this.ySize < 0.05F && (var11 != var1 || var15 != var5)) {
+ var30 = var1;
+ var22 = var3;
+ double var24 = var5;
+ var1 = var11;
+ var3 = (double)this.stepHeight;
+ var5 = var15;
+ AxisAlignedBB var26 = this.boundingBox.copy();
+ this.boundingBox.setBB(var17);
+ var18 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var11, var3, var15));
+
+ for(var27 = 0; var27 < var18.size(); ++var27) {
+ var3 = ((AxisAlignedBB)var18.get(var27)).calculateYOffset(this.boundingBox, var3);
+ }
+
+ this.boundingBox.offset(0.0D, var3, 0.0D);
+ if(!this.surfaceCollision && var13 != var3) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ for(var27 = 0; var27 < var18.size(); ++var27) {
+ var1 = ((AxisAlignedBB)var18.get(var27)).calculateXOffset(this.boundingBox, var1);
+ }
+
+ this.boundingBox.offset(var1, 0.0D, 0.0D);
+ if(!this.surfaceCollision && var11 != var1) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ for(var27 = 0; var27 < var18.size(); ++var27) {
+ var5 = ((AxisAlignedBB)var18.get(var27)).calculateZOffset(this.boundingBox, var5);
+ }
+
+ this.boundingBox.offset(0.0D, 0.0D, var5);
+ if(!this.surfaceCollision && var15 != var5) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ if(var30 * var30 + var24 * var24 >= var1 * var1 + var5 * var5) {
+ var1 = var30;
+ var3 = var22;
+ var5 = var24;
+ this.boundingBox.setBB(var26);
+ } else {
+ this.ySize = (float)((double)this.ySize + 0.5D);
+ }
+ }
+
+ 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 = var11 != var1 || var15 != var5;
+ this.onGround = var13 != var3 && var13 < 0.0D;
+ this.isCollided = this.isCollidedHorizontally || var13 != var3;
+ if(this.onGround) {
+ if(this.fallDistance > 0.0F) {
+ this.fall(this.fallDistance);
+ this.fallDistance = 0.0F;
+ }
+ } else if(var3 < 0.0D) {
+ this.fallDistance = (float)((double)this.fallDistance - var3);
+ }
+
+ if(var11 != var1) {
+ this.motionX = 0.0D;
+ }
+
+ if(var13 != var3) {
+ this.motionY = 0.0D;
+ }
+
+ if(var15 != var5) {
+ this.motionZ = 0.0D;
+ }
+
+ var30 = this.posX - var7;
+ var22 = this.posZ - var9;
+ this.distanceWalkedModified = (float)((double)this.distanceWalkedModified + (double)MathHelper.sqrt_double(var30 * var30 + var22 * var22) * 0.6D);
+ if(this.canTriggerWalking) {
+ int var31 = MathHelper.floor_double(this.posX);
+ int var25 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset);
+ int var33 = MathHelper.floor_double(this.posZ);
+ var27 = this.worldObj.getBlockId(var31, var25, var33);
+ if(this.distanceWalkedModified > (float)this.nextStepDistance && var27 > 0) {
+ ++this.nextStepDistance;
+ StepSound var28 = Block.blocksList[var27].stepSound;
+ if(!Block.blocksList[var27].blockMaterial.getIsLiquid()) {
+ this.worldObj.playSoundAtEntity(this, var28.getStepSound(), var28.getVolume() * 0.15F, var28.getPitch());
+ }
+
+ Block.blocksList[var27].onEntityWalking(this.worldObj, var31, var25, var33, this);
+ }
+ }
+
+ this.ySize *= 0.4F;
+ boolean var32 = this.handleWaterMovement();
+ if(this.worldObj.isBoundingBoxBurning(this.boundingBox)) {
+ this.dealFireDamage(1);
+ if(!var32) {
+ ++this.fire;
+ if(this.fire == 0) {
+ this.fire = 300;
+ }
+ }
+ } else if(this.fire <= 0) {
+ this.fire = -this.fireResistance;
+ }
+
+ if(var32 && this.fire > 0) {
+ this.worldObj.playSoundAtEntity(this, "random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
+ this.fire = -this.fireResistance;
+ }
+
+ }
+ }
+
+ public AxisAlignedBB getBoundingBox() {
+ return null;
+ }
+
+ protected void dealFireDamage(int var1) {
+ this.attackEntityFrom((Entity)null, var1);
+ }
+
+ protected void fall(float var1) {
+ }
+
+ public boolean handleWaterMovement() {
+ return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, (double)-0.4F, 0.0D), Material.water, this);
+ }
+
+ public boolean isInsideOfMaterial(Material var1) {
+ double var2 = this.posY + (double)this.getEyeHeight();
+ 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.getPercentAir(this.worldObj.getBlockMetadata(var4, var5, var6)) - 1.0F / 9.0F;
+ float var9 = (float)(var5 + 1) - var8;
+ return var2 < (double)var9;
+ } else {
+ return false;
+ }
+ }
+
+ protected float getEyeHeight() {
+ return 0.0F;
+ }
+
+ public boolean handleLavaMovement() {
+ return this.worldObj.isMaterialInBB(this.boundingBox.expand(0.0D, (double)-0.4F, 0.0D), Material.lava);
+ }
+
+ public void moveFlying(float var1, float var2, float var3) {
+ float var4 = MathHelper.sqrt_float(var1 * var1 + var2 * var2);
+ if(var4 >= 0.01F) {
+ if(var4 < 1.0F) {
+ var4 = 1.0F;
+ }
+
+ var4 = var3 / var4;
+ var1 *= var4;
+ var2 *= 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);
+ }
+ }
+
+ public float getEntityBrightness(float var1) {
+ int var2 = MathHelper.floor_double(this.posX);
+ double var3 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
+ int var5 = MathHelper.floor_double(this.posY - (double)this.yOffset + var3);
+ int var6 = MathHelper.floor_double(this.posZ);
+ return this.worldObj.getBrightness(var2, var5, var6);
+ }
+
+ public void setWorld(World var1) {
+ this.worldObj = var1;
+ }
+
+ public void setPositionAndRotation(double var1, double var3, double var5, float var7, float var8) {
+ this.prevPosX = this.posX = var1;
+ this.prevPosY = this.posY = var3 + (double)this.yOffset;
+ this.prevPosZ = this.posZ = var5;
+ this.rotationYaw = var7;
+ this.rotationPitch = var8;
+ 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);
+ 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;
+ 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;
+ 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;
+ return var2 * var2 + var4 * var4 + var6 * var6;
+ }
+
+ public void onCollideWithPlayer(EntityPlayer var1) {
+ }
+
+ public void applyEntityCollision(Entity var1) {
+ double var2 = var1.posX - this.posX;
+ double var4 = var1.posZ - this.posZ;
+ double var6 = MathHelper.abs_max(var2, var4);
+ if(var6 >= (double)0.01F) {
+ var6 = (double)MathHelper.sqrt_double(var6);
+ var2 /= var6;
+ var4 /= var6;
+ double var8 = 1.0D / var6;
+ if(var8 > 1.0D) {
+ var8 = 1.0D;
+ }
+
+ var2 *= var8;
+ var4 *= var8;
+ var2 *= (double)0.05F;
+ var4 *= (double)0.05F;
+ var2 *= (double)(1.0F - this.entityCollisionReduction);
+ var4 *= (double)(1.0F - this.entityCollisionReduction);
+ this.addVelocity(-var2, 0.0D, -var4);
+ var1.addVelocity(var2, 0.0D, var4);
+ }
+
+ }
+
+ public void addVelocity(double var1, double var3, double var5) {
+ this.motionX += var1;
+ this.motionY += var3;
+ this.motionZ += var5;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ return false;
+ }
+
+ public boolean canBeCollidedWith() {
+ return false;
+ }
+
+ public boolean canBePushed() {
+ return false;
+ }
+
+ public void addToPlayerScore(Entity var1, int var2) {
+ }
+
+ public boolean isInRangeToRenderVec3D(Vec3D var1) {
+ double var2 = this.posX - var1.xCoord;
+ double var4 = this.posY - var1.yCoord;
+ double var6 = this.posZ - var1.zCoord;
+ double var8 = var2 * var2 + var4 * var4 + var6 * var6;
+ return this.isInRangeToRenderDist(var8);
+ }
+
+ public boolean isInRangeToRenderDist(double var1) {
+ double var3 = this.boundingBox.getAverageEdgeLength();
+ var3 *= 64.0D;
+ return var1 < var3 * var3;
+ }
+
+ public String getTexture() {
+ return null;
+ }
+
+ public boolean addEntityID(NBTTagCompound var1) {
+ String var2 = this.getEntityString();
+ if(!this.isDead && var2 != null) {
+ var1.setString("id", var2);
+ this.writeToNBT(var1);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ var1.setTag("Pos", this.newDoubleNBTList(new double[]{this.posX, this.posY, 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.air);
+ var1.setBoolean("OnGround", this.onGround);
+ this.writeEntityToNBT(var1);
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ NBTTagList var2 = var1.getTagList("Pos");
+ NBTTagList var3 = var1.getTagList("Motion");
+ NBTTagList var4 = var1.getTagList("Rotation");
+ this.setPosition(0.0D, 0.0D, 0.0D);
+ this.motionX = ((NBTTagDouble)var3.tagAt(0)).doubleValue;
+ this.motionY = ((NBTTagDouble)var3.tagAt(1)).doubleValue;
+ this.motionZ = ((NBTTagDouble)var3.tagAt(2)).doubleValue;
+ this.prevPosX = this.lastTickPosX = this.posX = ((NBTTagDouble)var2.tagAt(0)).doubleValue;
+ this.prevPosY = this.lastTickPosY = this.posY = ((NBTTagDouble)var2.tagAt(1)).doubleValue;
+ this.prevPosZ = this.lastTickPosZ = this.posZ = ((NBTTagDouble)var2.tagAt(2)).doubleValue;
+ this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var4.tagAt(0)).floatValue;
+ this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var4.tagAt(1)).floatValue;
+ this.fallDistance = var1.getFloat("FallDistance");
+ this.fire = var1.getShort("Fire");
+ this.air = var1.getShort("Air");
+ this.onGround = var1.getBoolean("OnGround");
+ this.setPosition(this.posX, this.posY, this.posZ);
+ this.readEntityFromNBT(var1);
+ }
+
+ protected final String getEntityString() {
+ return EntityList.getEntityString(this);
+ }
+
+ protected abstract void readEntityFromNBT(NBTTagCompound var1);
+
+ protected abstract void writeEntityToNBT(NBTTagCompound var1);
+
+ protected NBTTagList newDoubleNBTList(double... var1) {
+ NBTTagList var2 = new NBTTagList();
+ double[] var3 = var1;
+ int var4 = var1.length;
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ double var6 = var3[var5];
+ var2.setTag(new NBTTagDouble(var6));
+ }
+
+ return var2;
+ }
+
+ protected NBTTagList newFloatNBTList(float... var1) {
+ NBTTagList var2 = new NBTTagList();
+ float[] var3 = var1;
+ int var4 = var1.length;
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ float var6 = var3[var5];
+ var2.setTag(new NBTTagFloat(var6));
+ }
+
+ return var2;
+ }
+
+ public EntityItem dropItem(int var1, int var2) {
+ return this.entityDropItem(var1, var2, 0.0F);
+ }
+
+ public EntityItem entityDropItem(int var1, int var2, float var3) {
+ EntityItem var4 = new EntityItem(this.worldObj, this.posX, this.posY + (double)var3, this.posZ, new ItemStack(var1, var2));
+ var4.delayBeforeCanPickup = 10;
+ this.worldObj.spawnEntityInWorld(var4);
+ return var4;
+ }
+
+ public boolean isEntityAlive() {
+ return !this.isDead;
+ }
+
+ public boolean isEntityInsideOpaqueBlock() {
+ int var1 = MathHelper.floor_double(this.posX);
+ int var2 = MathHelper.floor_double(this.posY + (double)this.getEyeHeight());
+ int var3 = MathHelper.floor_double(this.posZ);
+ return this.worldObj.isBlockNormalCube(var1, var2, var3);
+ }
+
+ public boolean interact(EntityPlayer var1) {
+ return false;
+ }
+
+ public AxisAlignedBB getCollisionBox(Entity var1) {
+ return null;
+ }
+
+ public void updateRidden() {
+ if(this.ridingEntity.isDead) {
+ this.ridingEntity = null;
+ } else {
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.onUpdate();
+ this.setPosition(this.ridingEntity.posX, this.ridingEntity.posY + (double)this.yOffset + this.ridingEntity.getYOffset(), this.ridingEntity.posZ);
+ 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) {
+ }
+
+ while(this.entityRiderYawDelta < -180.0D) {
+ this.entityRiderYawDelta += 360.0D;
+ }
+
+ while(this.entityRiderPitchDelta >= 180.0D) {
+ this.entityRiderPitchDelta -= 360.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) {
+ var1 = (double)var5;
+ }
+
+ if(var1 < (double)(-var5)) {
+ var1 = (double)(-var5);
+ }
+
+ if(var3 > (double)var5) {
+ var3 = (double)var5;
+ }
+
+ if(var3 < (double)(-var5)) {
+ var3 = (double)(-var5);
+ }
+
+ this.entityRiderYawDelta -= var1;
+ this.entityRiderPitchDelta -= var3;
+ this.rotationYaw = (float)((double)this.rotationYaw + var1);
+ this.rotationPitch = (float)((double)this.rotationPitch + var3);
+ }
+ }
+
+ public double getYOffset() {
+ return (double)this.height * 0.75D;
+ }
+
+ public void mountEntity(Entity var1) {
+ this.entityRiderPitchDelta = 0.0D;
+ this.entityRiderYawDelta = 0.0D;
+ if(this.ridingEntity == var1) {
+ this.ridingEntity.riddenByEntity = null;
+ this.ridingEntity = null;
+ } else {
+ if(this.ridingEntity != null) {
+ this.ridingEntity.riddenByEntity = null;
+ }
+
+ if(var1.riddenByEntity != null) {
+ var1.riddenByEntity.ridingEntity = null;
+ }
+
+ this.ridingEntity = var1;
+ var1.riddenByEntity = this;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/EntityAnimal.java b/source/net/minecraft/src/EntityAnimal.java
new file mode 100644
index 0000000..ebf27f5
--- /dev/null
+++ b/source/net/minecraft/src/EntityAnimal.java
@@ -0,0 +1,23 @@
+package net.minecraft.src;
+
+public abstract class EntityAnimal extends EntityCreature {
+ public EntityAnimal(World var1) {
+ super(var1);
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID ? 10.0F : this.worldObj.getBrightness(var1, var2, var3) - 0.5F;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ return this.worldObj.getBlockLightValue(MathHelper.floor_double(var1), MathHelper.floor_double(var3), MathHelper.floor_double(var5)) > 8 && super.getCanSpawnHere(var1, var3, var5);
+ }
+}
diff --git a/source/net/minecraft/src/EntityArrow.java b/source/net/minecraft/src/EntityArrow.java
new file mode 100644
index 0000000..2417a82
--- /dev/null
+++ b/source/net/minecraft/src/EntityArrow.java
@@ -0,0 +1,217 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityArrow extends Entity {
+ private int xTile = -1;
+ private int yTile = -1;
+ private int zTile = -1;
+ private int inTile = 0;
+ private boolean inGround = false;
+ public int arrowShake = 0;
+ private EntityLiving shootingEntity;
+ private int ticksInGround;
+ private int ticksInAir = 0;
+
+ public EntityArrow(World var1) {
+ super(var1);
+ this.setSize(0.5F, 0.5F);
+ }
+
+ public EntityArrow(World var1, EntityLiving var2) {
+ super(var1);
+ this.shootingEntity = var2;
+ this.setSize(0.5F, 0.5F);
+ this.setPositionAndRotation(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch);
+ this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
+ this.posY -= (double)0.1F;
+ 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.setArrowHeading(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
+ }
+
+ public void setArrowHeading(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.rand.nextGaussian() * (double)0.0075F * (double)var8;
+ var3 += this.rand.nextGaussian() * (double)0.0075F * (double)var8;
+ var5 += this.rand.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));
+ this.ticksInGround = 0;
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ if(this.arrowShake > 0) {
+ --this.arrowShake;
+ }
+
+ if(this.inGround) {
+ int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
+ if(var1 == this.inTile) {
+ ++this.ticksInGround;
+ if(this.ticksInGround == 1200) {
+ this.setEntityDead();
+ }
+
+ return;
+ }
+
+ this.inGround = false;
+ 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;
+ }
+
+ Vec3D var15 = Vec3D.createVector(this.posX, this.posY, this.posZ);
+ Vec3D var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
+ MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2);
+ var15 = Vec3D.createVector(this.posX, this.posY, this.posZ);
+ var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
+ if(var3 != null) {
+ var2 = Vec3D.createVector(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;
+
+ float var10;
+ for(int var8 = 0; var8 < var5.size(); ++var8) {
+ Entity var9 = (Entity)var5.get(var8);
+ if(var9.canBeCollidedWith() && (var9 != this.shootingEntity || this.ticksInAir >= 5)) {
+ var10 = 0.3F;
+ AxisAlignedBB var11 = var9.boundingBox.expand((double)var10, (double)var10, (double)var10);
+ MovingObjectPosition var12 = var11.calculateIntercept(var15, var2);
+ if(var12 != null) {
+ double var13 = var15.distanceTo(var12.hitVec);
+ if(var13 < var6 || var6 == 0.0D) {
+ var4 = var9;
+ var6 = var13;
+ }
+ }
+ }
+ }
+
+ if(var4 != null) {
+ var3 = new MovingObjectPosition(var4);
+ }
+
+ float var16;
+ if(var3 != null) {
+ if(var3.entityHit != null) {
+ if(var3.entityHit.attackEntityFrom(this.shootingEntity, 4)) {
+ this.worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
+ this.setEntityDead();
+ } else {
+ this.motionX *= (double)-0.1F;
+ this.motionY *= (double)-0.1F;
+ this.motionZ *= (double)-0.1F;
+ this.rotationYaw += 180.0F;
+ this.prevRotationYaw += 180.0F;
+ this.ticksInAir = 0;
+ }
+ } else {
+ this.xTile = var3.blockX;
+ this.yTile = var3.blockY;
+ this.zTile = var3.blockZ;
+ this.inTile = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
+ this.motionX = (double)((float)(var3.hitVec.xCoord - this.posX));
+ this.motionY = (double)((float)(var3.hitVec.yCoord - this.posY));
+ this.motionZ = (double)((float)(var3.hitVec.zCoord - this.posZ));
+ var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
+ this.posX -= this.motionX / (double)var16 * (double)0.05F;
+ this.posY -= this.motionY / (double)var16 * (double)0.05F;
+ this.posZ -= this.motionZ / (double)var16 * (double)0.05F;
+ this.worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
+ this.inGround = true;
+ this.arrowShake = 7;
+ }
+ }
+
+ this.posX += this.motionX;
+ this.posY += this.motionY;
+ this.posZ += this.motionZ;
+ var16 = 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));
+
+ for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var16) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
+ }
+
+ while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
+ this.prevRotationYaw -= 360.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 = 0.99F;
+ var10 = 0.03F;
+ if(this.handleWaterMovement()) {
+ 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);
+ }
+
+ var17 = 0.8F;
+ }
+
+ this.motionX *= (double)var17;
+ this.motionY *= (double)var17;
+ this.motionZ *= (double)var17;
+ this.motionY -= (double)var10;
+ this.setPosition(this.posX, this.posY, this.posZ);
+ }
+
+ 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.arrowShake);
+ var1.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.arrowShake = var1.getByte("shake") & 255;
+ this.inGround = var1.getByte("inGround") == 1;
+ }
+
+ public void onCollideWithPlayer(EntityPlayer var1) {
+ if(this.inGround && this.shootingEntity == var1 && this.arrowShake <= 0 && var1.inventory.addItemStackToInventory(new ItemStack(Item.arrow.shiftedIndex, 1))) {
+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
+ var1.onItemPickup(this);
+ this.setEntityDead();
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityBubbleFX.java b/source/net/minecraft/src/EntityBubbleFX.java
new file mode 100644
index 0000000..e36404b
--- /dev/null
+++ b/source/net/minecraft/src/EntityBubbleFX.java
@@ -0,0 +1,36 @@
+package net.minecraft.src;
+
+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;
+ this.particleTextureIndex = 32;
+ this.setSize(0.02F, 0.02F);
+ this.particleScale *= this.rand.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.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
+ }
+
+ 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.setEntityDead();
+ }
+
+ if(this.particleMaxAge-- <= 0) {
+ this.setEntityDead();
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityCreature.java b/source/net/minecraft/src/EntityCreature.java
new file mode 100644
index 0000000..db340ed
--- /dev/null
+++ b/source/net/minecraft/src/EntityCreature.java
@@ -0,0 +1,125 @@
+package net.minecraft.src;
+
+public class EntityCreature extends EntityLiving {
+ private PathEntity pathToEntity;
+ protected Entity playerToAttack;
+ protected boolean hasAttacked = false;
+
+ public EntityCreature(World var1) {
+ super(var1);
+ }
+
+ protected boolean canEntityBeSeen(Entity var1) {
+ return this.worldObj.rayTraceBlocks(Vec3D.createVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), Vec3D.createVector(var1.posX, var1.posY + (double)var1.getEyeHeight(), var1.posZ)) == null;
+ }
+
+ protected void updatePlayerActionState() {
+ this.hasAttacked = false;
+ float var1 = 16.0F;
+ if(this.playerToAttack == null) {
+ this.playerToAttack = this.findPlayerToAttack();
+ if(this.playerToAttack != null) {
+ this.pathToEntity = this.worldObj.getPathToEntity(this, this.playerToAttack, var1);
+ }
+ } else if(!this.playerToAttack.isEntityAlive()) {
+ this.playerToAttack = null;
+ } else {
+ float var2 = this.playerToAttack.getDistanceToEntity(this);
+ if(this.canEntityBeSeen(this.playerToAttack)) {
+ this.attackEntity(this.playerToAttack, var2);
+ }
+ }
+
+ int var19;
+ if(this.hasAttacked || this.playerToAttack == null || this.pathToEntity != null && this.rand.nextInt(20) != 0) {
+ if(this.pathToEntity == null || this.rand.nextInt(100) == 0) {
+ var19 = -1;
+ int var3 = -1;
+ int var4 = -1;
+ float var5 = -99999.0F;
+
+ for(int var6 = 0; var6 < 50; ++var6) {
+ int var7 = MathHelper.floor_double(this.posX + (double)this.rand.nextInt(11) - 5.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(11) - 5.0D);
+ float var10 = this.getBlockPathWeight(var7, var8, var9);
+ if(var10 > var5) {
+ var5 = var10;
+ var19 = var7;
+ var3 = var8;
+ var4 = var9;
+ }
+ }
+
+ if(var19 > 0) {
+ this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var19, var3, var4, var1);
+ }
+ }
+ } else {
+ this.pathToEntity = this.worldObj.getPathToEntity(this, this.playerToAttack, var1);
+ }
+
+ var19 = MathHelper.floor_double(this.boundingBox.minY);
+ boolean var20 = this.handleWaterMovement();
+ boolean var21 = this.handleLavaMovement();
+ if(this.pathToEntity != null && this.rand.nextInt(100) != 0) {
+ Vec3D var22 = this.pathToEntity.getPosition(this);
+ float var23 = this.width * 2.0F;
+
+ while(var22 != null && var22.squareDistanceTo(this.posX, this.posY, this.posZ) < (double)(var23 * var23) && var22.yCoord <= (double)var19) {
+ this.pathToEntity.incrementPathIndex();
+ if(this.pathToEntity.isFinished()) {
+ var22 = null;
+ this.pathToEntity = null;
+ } else {
+ var22 = this.pathToEntity.getPosition(this);
+ }
+ }
+
+ this.isJumping = false;
+ if(var22 != null) {
+ double var24 = var22.xCoord - this.posX;
+ double var25 = var22.zCoord - this.posZ;
+ double var11 = var22.yCoord - (double)var19;
+ this.rotationYaw = (float)(Math.atan2(var25, var24) * 180.0D / (double)((float)Math.PI)) - 90.0F;
+ this.moveForward = this.moveSpeed;
+ if(this.hasAttacked && this.playerToAttack != null) {
+ double var13 = this.playerToAttack.posX - this.posX;
+ double var15 = this.playerToAttack.posZ - this.posZ;
+ float var17 = this.rotationYaw;
+ this.rotationYaw = (float)(Math.atan2(var15, var13) * 180.0D / (double)((float)Math.PI)) - 90.0F;
+ float var18 = (var17 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F;
+ this.moveStrafing = -MathHelper.sin(var18) * this.moveForward * 1.0F;
+ this.moveForward = MathHelper.cos(var18) * this.moveForward * 1.0F;
+ }
+
+ if(var11 != 0.0D) {
+ this.isJumping = true;
+ }
+ }
+
+ if(this.rand.nextFloat() < 0.8F && (var20 || var21)) {
+ this.isJumping = true;
+ }
+
+ } else {
+ super.updatePlayerActionState();
+ this.pathToEntity = null;
+ }
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return 0.0F;
+ }
+
+ protected Entity findPlayerToAttack() {
+ return null;
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ return super.getCanSpawnHere(var1, var3, var5) && this.getBlockPathWeight((int)var1, (int)var3, (int)var5) >= 0.0F;
+ }
+}
diff --git a/source/net/minecraft/src/EntityCreeper.java b/source/net/minecraft/src/EntityCreeper.java
new file mode 100644
index 0000000..28dfe5f
--- /dev/null
+++ b/source/net/minecraft/src/EntityCreeper.java
@@ -0,0 +1,64 @@
+package net.minecraft.src;
+
+public class EntityCreeper extends EntityMonster {
+ int timeSinceIgnited;
+ int lastActiveTime;
+ int fuseTime = 30;
+ int creeperState = -1;
+
+ public EntityCreeper(World var1) {
+ super(var1);
+ this.texture = "/mob/creeper.png";
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ protected void updatePlayerActionState() {
+ this.lastActiveTime = this.timeSinceIgnited;
+ if(this.timeSinceIgnited > 0 && this.creeperState < 0) {
+ --this.timeSinceIgnited;
+ }
+
+ if(this.creeperState >= 0) {
+ this.creeperState = 2;
+ }
+
+ super.updatePlayerActionState();
+ if(this.creeperState != 1) {
+ this.creeperState = -1;
+ }
+
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ if(this.creeperState <= 0 && var2 < 3.0F || this.creeperState > 0 && var2 < 7.0F) {
+ if(this.timeSinceIgnited == 0) {
+ this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 0.5F);
+ }
+
+ this.creeperState = 1;
+ ++this.timeSinceIgnited;
+ if(this.timeSinceIgnited == this.fuseTime) {
+ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3.0F);
+ this.setEntityDead();
+ }
+
+ this.hasAttacked = true;
+ }
+
+ }
+
+ public float setCreeperFlashTime(float var1) {
+ return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * var1) / (float)(this.fuseTime - 2);
+ }
+
+ protected int getDropItemId() {
+ return Item.gunpowder.shiftedIndex;
+ }
+}
diff --git a/source/net/minecraft/src/EntityDiggingFX.java b/source/net/minecraft/src/EntityDiggingFX.java
new file mode 100644
index 0000000..ddc26fb
--- /dev/null
+++ b/source/net/minecraft/src/EntityDiggingFX.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+public class EntityDiggingFX extends EntityFX {
+ public EntityDiggingFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, Block var14) {
+ super(var1, var2, var4, var6, var8, var10, var12);
+ this.particleTextureIndex = var14.blockIndexInTexture;
+ this.particleGravity = var14.blockParticleGravity;
+ this.particleRed = this.particleGreen = this.particleBlue = 0.6F;
+ this.particleScale /= 2.0F;
+ }
+
+ public int getFXLayer() {
+ return 1;
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ float var8 = ((float)(this.particleTextureIndex % 16) + this.particleTextureJitterX / 4.0F) / 16.0F;
+ float var9 = var8 + 0.999F / 64.0F;
+ float var10 = ((float)(this.particleTextureIndex / 16) + this.particleTextureJitterY / 4.0F) / 16.0F;
+ float var11 = var10 + 0.999F / 64.0F;
+ float var12 = 0.1F * this.particleScale;
+ 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 var16 = this.getEntityBrightness(var2);
+ 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);
+ }
+}
diff --git a/source/net/minecraft/src/EntityExplodeFX.java b/source/net/minecraft/src/EntityExplodeFX.java
new file mode 100644
index 0000000..e6ed054
--- /dev/null
+++ b/source/net/minecraft/src/EntityExplodeFX.java
@@ -0,0 +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.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;
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ this.particleTextureIndex = 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;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityFX.java b/source/net/minecraft/src/EntityFX.java
new file mode 100644
index 0000000..9809da0
--- /dev/null
+++ b/source/net/minecraft/src/EntityFX.java
@@ -0,0 +1,99 @@
+package net.minecraft.src;
+
+public class EntityFX extends Entity {
+ protected int particleTextureIndex;
+ protected float particleTextureJitterX;
+ protected float particleTextureJitterY;
+ protected int particleAge = 0;
+ protected int particleMaxAge = 0;
+ protected float particleScale;
+ protected float particleGravity;
+ protected float particleRed;
+ protected float particleGreen;
+ protected float particleBlue;
+ public static double interpPosX;
+ public static double interpPosY;
+ public static double interpPosZ;
+
+ public EntityFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) {
+ super(var1);
+ this.setSize(0.2F, 0.2F);
+ this.yOffset = this.height / 2.0F;
+ this.setPosition(var2, var4, var6);
+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
+ 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);
+ 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;
+ 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;
+ this.canTriggerWalking = false;
+ }
+
+ 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 onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ 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;
+ }
+
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ float var8 = (float)(this.particleTextureIndex % 16) / 16.0F;
+ float var9 = var8 + 0.999F / 16.0F;
+ float var10 = (float)(this.particleTextureIndex / 16) / 16.0F;
+ float var11 = var10 + 0.999F / 16.0F;
+ float var12 = 0.1F * this.particleScale;
+ 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 var16 = this.getEntityBrightness(var2);
+ var1.setColorOpaque_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16);
+ 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);
+ }
+
+ public int getFXLayer() {
+ return 0;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ }
+}
diff --git a/source/net/minecraft/src/EntityFallingSand.java b/source/net/minecraft/src/EntityFallingSand.java
new file mode 100644
index 0000000..4dc1c13
--- /dev/null
+++ b/source/net/minecraft/src/EntityFallingSand.java
@@ -0,0 +1,78 @@
+package net.minecraft.src;
+
+public class EntityFallingSand extends Entity {
+ public int blockID;
+ public int fallTime = 0;
+
+ public EntityFallingSand(World var1) {
+ super(var1);
+ }
+
+ public EntityFallingSand(World var1, float var2, float var3, float var4, int var5) {
+ super(var1);
+ this.blockID = var5;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.98F);
+ this.yOffset = this.height / 2.0F;
+ this.setPosition((double)var2, (double)var3, (double)var4);
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.canTriggerWalking = false;
+ this.prevPosX = (double)var2;
+ this.prevPosY = (double)var3;
+ this.prevPosZ = (double)var4;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public void onUpdate() {
+ if(this.blockID == 0) {
+ this.setEntityDead();
+ } else {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ ++this.fallTime;
+ this.motionY -= (double)0.04F;
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= (double)0.98F;
+ this.motionY *= (double)0.98F;
+ this.motionZ *= (double)0.98F;
+ 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) == this.blockID) {
+ this.worldObj.setBlockWithNotify(var1, var2, var3, 0);
+ }
+
+ if(this.onGround) {
+ this.motionX *= (double)0.7F;
+ this.motionZ *= (double)0.7F;
+ this.motionY *= -0.5D;
+ this.setEntityDead();
+ if(!this.worldObj.canBlockBePlacedAt(this.blockID, var1, var2, var3, true) || !this.worldObj.setBlockWithNotify(var1, var2, var3, this.blockID)) {
+ this.dropItem(this.blockID, 1);
+ }
+ } else if(this.fallTime > 100) {
+ this.dropItem(this.blockID, 1);
+ this.setEntityDead();
+ }
+
+ }
+ }
+
+ protected void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setByte("Tile", (byte)this.blockID);
+ }
+
+ protected void readEntityFromNBT(NBTTagCompound var1) {
+ this.blockID = var1.getByte("Tile") & 255;
+ }
+
+ public World getWorld() {
+ return this.worldObj;
+ }
+}
diff --git a/source/net/minecraft/src/EntityFlameFX.java b/source/net/minecraft/src/EntityFlameFX.java
new file mode 100644
index 0000000..192090a
--- /dev/null
+++ b/source/net/minecraft/src/EntityFlameFX.java
@@ -0,0 +1,59 @@
+package net.minecraft.src;
+
+public class EntityFlameFX extends EntityFX {
+ 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.rand.nextFloat() - this.rand.nextFloat()) * 0.05F);
+ var10000 = var4 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F);
+ var10000 = var6 + (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;
+ this.noClip = true;
+ this.particleTextureIndex = 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;
+ this.particleScale = this.flameScale * (1.0F - var8 * var8 * 0.5F);
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public float getEntityBrightness(float var1) {
+ float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge;
+ if(var2 < 0.0F) {
+ var2 = 0.0F;
+ }
+
+ if(var2 > 1.0F) {
+ var2 = 1.0F;
+ }
+
+ float var3 = super.getEntityBrightness(var1);
+ return var3 * var2 + (1.0F - var2);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ 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;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityGiant.java b/source/net/minecraft/src/EntityGiant.java
new file mode 100644
index 0000000..115d51d
--- /dev/null
+++ b/source/net/minecraft/src/EntityGiant.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class EntityGiant extends EntityMonster {
+ public EntityGiant(World var1) {
+ super(var1);
+ this.texture = "/mob/zombie.png";
+ this.moveSpeed = 0.5F;
+ this.attackStrength = 50;
+ this.health *= 10;
+ this.yOffset *= 6.0F;
+ this.setSize(this.width * 6.0F, this.height * 6.0F);
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return this.worldObj.getBrightness(var1, var2, var3) - 0.5F;
+ }
+}
diff --git a/source/net/minecraft/src/EntityItem.java b/source/net/minecraft/src/EntityItem.java
new file mode 100644
index 0000000..785a54e
--- /dev/null
+++ b/source/net/minecraft/src/EntityItem.java
@@ -0,0 +1,180 @@
+package net.minecraft.src;
+
+public class EntityItem extends Entity {
+ public ItemStack item;
+ private int age2;
+ public int age = 0;
+ public int delayBeforeCanPickup;
+ private int health = 5;
+ public float hoverStart = (float)(Math.random() * Math.PI * 2.0D);
+
+ public EntityItem(World var1, double var2, double var4, double var6, ItemStack var8) {
+ super(var1);
+ this.setSize(0.25F, 0.25F);
+ this.yOffset = this.height / 2.0F;
+ this.setPosition(var2, var4, var6);
+ this.item = var8;
+ 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));
+ this.canTriggerWalking = false;
+ }
+
+ public EntityItem(World var1) {
+ super(var1);
+ this.setSize(0.25F, 0.25F);
+ this.yOffset = this.height / 2.0F;
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ if(this.delayBeforeCanPickup > 0) {
+ --this.delayBeforeCanPickup;
+ }
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= (double)0.04F;
+ 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.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
+ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
+ this.worldObj.playSoundAtEntity(this, "random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
+ }
+
+ this.pushOutOfBlocks(this.posX, this.posY, this.posZ);
+ this.handleWaterMovement();
+ 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.motionY *= -0.5D;
+ }
+
+ ++this.age2;
+ ++this.age;
+ if(this.age >= 6000) {
+ this.setEntityDead();
+ }
+
+ }
+
+ public boolean handleWaterMovement() {
+ return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this);
+ }
+
+ private 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;
+ if(Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8, var9)]) {
+ boolean var16 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7 - 1, var8, var9)];
+ boolean var17 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7 + 1, var8, var9)];
+ boolean var18 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8 - 1, var9)];
+ boolean var19 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8 + 1, var9)];
+ boolean var20 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8, var9 - 1)];
+ boolean var21 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8, var9 + 1)];
+ byte var22 = -1;
+ double var23 = 9999.0D;
+ if(var16 && var10 < var23) {
+ var23 = var10;
+ var22 = 0;
+ }
+
+ if(var17 && 1.0D - var10 < var23) {
+ var23 = 1.0D - var10;
+ var22 = 1;
+ }
+
+ if(var18 && var12 < var23) {
+ var23 = var12;
+ var22 = 2;
+ }
+
+ if(var19 && 1.0D - var12 < var23) {
+ var23 = 1.0D - var12;
+ var22 = 3;
+ }
+
+ if(var20 && var14 < var23) {
+ var23 = var14;
+ var22 = 4;
+ }
+
+ if(var21 && 1.0D - var14 < var23) {
+ var23 = 1.0D - var14;
+ var22 = 5;
+ }
+
+ float var25 = this.rand.nextFloat() * 0.2F + 0.1F;
+ if(var22 == 0) {
+ this.motionX = (double)(-var25);
+ }
+
+ if(var22 == 1) {
+ this.motionX = (double)var25;
+ }
+
+ if(var22 == 2) {
+ this.motionY = (double)(-var25);
+ }
+
+ if(var22 == 3) {
+ this.motionY = (double)var25;
+ }
+
+ if(var22 == 4) {
+ this.motionZ = (double)(-var25);
+ }
+
+ if(var22 == 5) {
+ this.motionZ = (double)var25;
+ }
+ }
+
+ return false;
+ }
+
+ protected void dealFireDamage(int var1) {
+ this.attackEntityFrom((Entity)null, var1);
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.health -= var2;
+ if(this.health <= 0) {
+ this.setEntityDead();
+ }
+
+ return false;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setShort("Health", (short)((byte)this.health));
+ var1.setShort("Age", (short)this.age);
+ var1.setCompoundTag("Item", this.item.writeToNBT(new NBTTagCompound()));
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ this.health = var1.getShort("Health") & 255;
+ this.age = var1.getShort("Age");
+ NBTTagCompound var2 = var1.getCompoundTag("Item");
+ this.item = new ItemStack(var2);
+ }
+
+ public void onCollideWithPlayer(EntityPlayer var1) {
+ if(this.delayBeforeCanPickup == 0 && var1.inventory.addItemStackToInventory(this.item)) {
+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
+ var1.onItemPickup(this);
+ this.setEntityDead();
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityLavaFX.java b/source/net/minecraft/src/EntityLavaFX.java
new file mode 100644
index 0000000..f6b735f
--- /dev/null
+++ b/source/net/minecraft/src/EntityLavaFX.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+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.rand.nextFloat() * 0.4F + 0.05F);
+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
+ 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.particleTextureIndex = 49;
+ }
+
+ public float getEntityBrightness(float var1) {
+ 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;
+ this.particleScale = this.lavaParticleScale * (1.0F - var8 * var8);
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ float var1 = (float)this.particleAge / (float)this.particleMaxAge;
+ 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;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityList.java b/source/net/minecraft/src/EntityList.java
new file mode 100644
index 0000000..0d673ef
--- /dev/null
+++ b/source/net/minecraft/src/EntityList.java
@@ -0,0 +1,72 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class EntityList {
+ private static Map stringToClassMapping = new HashMap();
+ private static Map classToStringMapping = new HashMap();
+
+ private static void addMapping(Class var0, String var1) {
+ stringToClassMapping.put(var1, var0);
+ classToStringMapping.put(var0, var1);
+ }
+
+ public static Entity createEntityInWorld(String var0, World var1) {
+ Entity var2 = null;
+
+ try {
+ Class var3 = (Class)stringToClassMapping.get(var0);
+ if(var3 != null) {
+ var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
+ }
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ }
+
+ return var2;
+ }
+
+ public static Entity createEntityFromNBT(NBTTagCompound var0, World var1) {
+ Entity var2 = null;
+
+ try {
+ Class var3 = (Class)stringToClassMapping.get(var0.getString("id"));
+ if(var3 != null) {
+ var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
+ }
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ }
+
+ if(var2 != null) {
+ var2.readFromNBT(var0);
+ } else {
+ System.out.println("Skipping Entity with id " + var0.getString("id"));
+ }
+
+ return var2;
+ }
+
+ public static String getEntityString(Entity var0) {
+ return (String)classToStringMapping.get(var0.getClass());
+ }
+
+ static {
+ addMapping(EntityArrow.class, "Arrow");
+ addMapping(EntityItem.class, "Item");
+ addMapping(EntityPainting.class, "Painting");
+ addMapping(EntityLiving.class, "Mob");
+ addMapping(EntityMonster.class, "Monster");
+ addMapping(EntityCreeper.class, "Creeper");
+ addMapping(EntitySkeleton.class, "Skeleton");
+ addMapping(EntitySpider.class, "Spider");
+ addMapping(EntityGiant.class, "Giant");
+ addMapping(EntityZombie.class, "Zombie");
+ addMapping(EntityPig.class, "Pig");
+ addMapping(EntitySheep.class, "Sheep");
+ addMapping(EntityTNTPrimed.class, "PrimedTnt");
+ addMapping(EntityFallingSand.class, "FallingSand");
+ addMapping(EntityMinecart.class, "Minecart");
+ }
+}
diff --git a/source/net/minecraft/src/EntityLiving.java b/source/net/minecraft/src/EntityLiving.java
new file mode 100644
index 0000000..09a9db0
--- /dev/null
+++ b/source/net/minecraft/src/EntityLiving.java
@@ -0,0 +1,548 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityLiving extends Entity {
+ public int heartsHalvesLife = 20;
+ public float unusedRotationPitch2;
+ public float unusedFloat;
+ public float unusedRotationPitch;
+ public float renderYawOffset = 0.0F;
+ public float prevRenderYawOffset = 0.0F;
+ protected float ridingRotUnused;
+ protected float prevRidingRotUnused;
+ protected float rotationUnused;
+ protected float prevRotationUnused;
+ protected boolean unusedBool1 = true;
+ protected String texture = "/char.png";
+ protected boolean unusedBool2 = true;
+ protected float unusedRotation = 0.0F;
+ protected String entityType = null;
+ protected float unusedFloat1 = 1.0F;
+ protected int scoreValue = 0;
+ protected float unusedFloat2 = 0.0F;
+ public int health = 10;
+ public int prevHealth;
+ private int livingSoundTime;
+ public int hurtTime;
+ public int maxHurtTime;
+ public float attackedAtYaw = 0.0F;
+ public int deathTime = 0;
+ public int attackTime = 0;
+ public float prevCameraPitch;
+ public float cameraPitch;
+ protected boolean dead = false;
+ public int unusedInt = -1;
+ public float unusedFloat4 = (float)(Math.random() * (double)0.9F + (double)0.1F);
+ public float prevLimbYaw;
+ public float limbYaw;
+ public float limbSwing;
+ protected int entityAge = 0;
+ protected float moveStrafing;
+ protected float moveForward;
+ protected float randomYawVelocity;
+ protected boolean isJumping = false;
+ protected float defaultPitch = 0.0F;
+ protected float moveSpeed = 0.7F;
+
+ public EntityLiving(World var1) {
+ super(var1);
+ this.preventEntitySpawning = true;
+ this.unusedRotationPitch = (float)(Math.random() + 1.0D) * 0.01F;
+ this.setPosition(this.posX, this.posY, this.posZ);
+ this.unusedRotationPitch2 = (float)Math.random() * 12398.0F;
+ this.rotationYaw = (float)(Math.random() * (double)((float)Math.PI) * 2.0D);
+ this.unusedFloat = 1.0F;
+ this.stepHeight = 0.5F;
+ }
+
+ public String getTexture() {
+ return this.texture;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public boolean canBePushed() {
+ return !this.isDead;
+ }
+
+ protected float getEyeHeight() {
+ return this.height * 0.85F;
+ }
+
+ public void onEntityUpdate() {
+ super.onEntityUpdate();
+ if(this.rand.nextInt(1000) < this.livingSoundTime++) {
+ this.livingSoundTime = -80;
+ String var1 = this.getLivingSound();
+ if(var1 != null) {
+ this.worldObj.playSoundAtEntity(this, var1, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
+ }
+
+ if(this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) {
+ this.attackEntityFrom((Entity)null, 1);
+ }
+
+ int var8;
+ if(this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) {
+ --this.air;
+ if(this.air == -20) {
+ this.air = 0;
+
+ for(var8 = 0; var8 < 8; ++var8) {
+ float var2 = this.rand.nextFloat() - this.rand.nextFloat();
+ float var3 = this.rand.nextFloat() - this.rand.nextFloat();
+ float var4 = this.rand.nextFloat() - this.rand.nextFloat();
+ this.worldObj.spawnParticle("bubble", this.posX + (double)var2, this.posY + (double)var3, this.posZ + (double)var4, this.motionX, this.motionY, this.motionZ);
+ }
+
+ this.attackEntityFrom((Entity)null, 2);
+ }
+
+ this.fire = 0;
+ } else {
+ this.air = this.maxAir;
+ }
+
+ this.prevCameraPitch = this.cameraPitch;
+ if(this.attackTime > 0) {
+ --this.attackTime;
+ }
+
+ if(this.hurtTime > 0) {
+ --this.hurtTime;
+ }
+
+ if(this.heartsLife > 0) {
+ --this.heartsLife;
+ }
+
+ if(this.health <= 0) {
+ ++this.deathTime;
+ if(this.deathTime > 20) {
+ this.onEntityDeath();
+ this.setEntityDead();
+
+ for(var8 = 0; var8 < 20; ++var8) {
+ double var9 = this.rand.nextGaussian() * 0.02D;
+ double var10 = 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, var9, var10, var6);
+ }
+ }
+ }
+
+ this.prevRotationUnused = this.rotationUnused;
+ this.prevRenderYawOffset = this.renderYawOffset;
+ this.prevRotationYaw = this.rotationYaw;
+ this.prevRotationPitch = this.rotationPitch;
+ }
+
+ public void spawnExplosionParticle() {
+ 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.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);
+ }
+
+ }
+
+ public void updateRidden() {
+ super.updateRidden();
+ this.ridingRotUnused = this.prevRidingRotUnused;
+ this.prevRidingRotUnused = 0.0F;
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ this.onLivingUpdate();
+ double var1 = this.posX - this.prevPosX;
+ double var3 = this.posZ - this.prevPosZ;
+ float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3);
+ float var6 = this.renderYawOffset;
+ float var7 = 0.0F;
+ this.ridingRotUnused = this.prevRidingRotUnused;
+ float var8 = 0.0F;
+ if(var5 > 0.05F) {
+ var8 = 1.0F;
+ var7 = var5 * 3.0F;
+ var6 = (float)Math.atan2(var3, var1) * 180.0F / (float)Math.PI - 90.0F;
+ }
+
+ if(!this.onGround) {
+ var8 = 0.0F;
+ }
+
+ this.prevRidingRotUnused += (var8 - this.prevRidingRotUnused) * 0.3F;
+
+ float var9;
+ for(var9 = var6 - this.renderYawOffset; var9 < -180.0F; var9 += 360.0F) {
+ }
+
+ while(var9 >= 180.0F) {
+ var9 -= 360.0F;
+ }
+
+ this.renderYawOffset += var9 * 0.1F;
+
+ float var10;
+ for(var10 = this.rotationYaw - this.renderYawOffset; var10 < -180.0F; var10 += 360.0F) {
+ }
+
+ while(var10 >= 180.0F) {
+ var10 -= 360.0F;
+ }
+
+ boolean var11 = var10 < -90.0F || var10 >= 90.0F;
+ if(var10 < -75.0F) {
+ var10 = -75.0F;
+ }
+
+ if(var10 >= 75.0F) {
+ var10 = 75.0F;
+ }
+
+ this.renderYawOffset = this.rotationYaw - var10;
+ this.renderYawOffset += var10 * 0.1F;
+ if(var11) {
+ var7 *= -1.0F;
+ }
+
+ while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ while(this.renderYawOffset - this.prevRenderYawOffset < -180.0F) {
+ this.prevRenderYawOffset -= 360.0F;
+ }
+
+ while(this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) {
+ this.prevRenderYawOffset += 360.0F;
+ }
+
+ while(this.rotationPitch - this.prevRotationPitch < -180.0F) {
+ this.prevRotationPitch -= 360.0F;
+ }
+
+ while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ this.rotationUnused += var7;
+ }
+
+ protected void setSize(float var1, float var2) {
+ super.setSize(var1, var2);
+ }
+
+ public void heal(int var1) {
+ if(this.health > 0) {
+ this.health += var1;
+ if(this.health > 20) {
+ this.health = 20;
+ }
+
+ this.heartsLife = this.heartsHalvesLife / 2;
+ }
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.entityAge = 0;
+ if(this.health <= 0) {
+ return false;
+ } else {
+ this.limbYaw = 1.5F;
+ if((float)this.heartsLife > (float)this.heartsHalvesLife / 2.0F) {
+ if(this.prevHealth - var2 >= this.health) {
+ return false;
+ }
+
+ this.health = this.prevHealth - var2;
+ } else {
+ this.prevHealth = this.health;
+ this.heartsLife = this.heartsHalvesLife;
+ this.health -= var2;
+ this.hurtTime = this.maxHurtTime = 10;
+ }
+
+ this.attackedAtYaw = 0.0F;
+ if(var1 != null) {
+ double var3 = var1.posX - this.posX;
+
+ double var5;
+ for(var5 = var1.posZ - this.posZ; var3 * var3 + var5 * var5 < 1.0E-4D; var5 = (Math.random() - Math.random()) * 0.01D) {
+ var3 = (Math.random() - Math.random()) * 0.01D;
+ }
+
+ this.attackedAtYaw = (float)(Math.atan2(var5, var3) * 180.0D / (double)((float)Math.PI)) - this.rotationYaw;
+ this.knockBack(var1, var2, var3, var5);
+ } else {
+ this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180);
+ }
+
+ if(this.health <= 0) {
+ this.worldObj.playSoundAtEntity(this, this.getDeathSound(), 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ this.onDeath(var1);
+ } else {
+ this.worldObj.playSoundAtEntity(this, this.getHurtSound(), 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
+
+ return true;
+ }
+ }
+
+ protected String getLivingSound() {
+ return null;
+ }
+
+ protected String getHurtSound() {
+ return "random.hurt";
+ }
+
+ protected String getDeathSound() {
+ return "random.hurt";
+ }
+
+ public void knockBack(Entity var1, int var2, double var3, double var5) {
+ float var7 = MathHelper.sqrt_double(var3 * var3 + var5 * var5);
+ float var8 = 0.4F;
+ this.motionX /= 2.0D;
+ this.motionY /= 2.0D;
+ this.motionZ /= 2.0D;
+ this.motionX -= var3 / (double)var7 * (double)var8;
+ this.motionY += (double)0.4F;
+ this.motionZ -= var5 / (double)var7 * (double)var8;
+ if(this.motionY > (double)0.4F) {
+ this.motionY = (double)0.4F;
+ }
+
+ }
+
+ public void onDeath(Entity var1) {
+ if(this.scoreValue > 0 && var1 != null) {
+ var1.addToPlayerScore(this, this.scoreValue);
+ }
+
+ this.dead = true;
+ int var2 = this.getDropItemId();
+ if(var2 > 0) {
+ int var3 = this.rand.nextInt(3);
+
+ for(int var4 = 0; var4 < var3; ++var4) {
+ this.dropItem(var2, 1);
+ }
+ }
+
+ }
+
+ protected int getDropItemId() {
+ return 0;
+ }
+
+ protected void fall(float var1) {
+ int var2 = (int)Math.ceil((double)(var1 - 3.0F));
+ if(var2 > 0) {
+ this.attackEntityFrom((Entity)null, var2);
+ int var3 = 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(var3 > 0) {
+ StepSound var4 = Block.blocksList[var3].stepSound;
+ this.worldObj.playSoundAtEntity(this, var4.getStepSound(), var4.getVolume() * 0.5F, var4.getPitch() * (12.0F / 16.0F));
+ }
+ }
+
+ }
+
+ public void moveEntityWithHeading(float var1, float var2) {
+ double var3;
+ if(this.handleWaterMovement()) {
+ var3 = this.posY;
+ this.moveFlying(var1, var2, 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;
+ 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;
+ }
+ } else if(this.handleLavaMovement()) {
+ 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;
+ }
+ } else {
+ this.moveFlying(var1, var2, this.onGround ? 0.1F : 0.02F);
+ if(this.isOnLadder()) {
+ this.fallDistance = 0.0F;
+ if(this.motionY < -0.15D) {
+ this.motionY = -0.15D;
+ }
+ }
+
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ if(this.isCollidedHorizontally && this.isOnLadder()) {
+ this.motionY = 0.2D;
+ }
+
+ this.motionX *= (double)0.91F;
+ this.motionY *= (double)0.98F;
+ this.motionZ *= (double)0.91F;
+ this.motionY -= 0.08D;
+ if(this.onGround) {
+ float var8 = 0.6F;
+ this.motionX *= (double)var8;
+ this.motionZ *= (double)var8;
+ }
+ }
+
+ this.prevLimbYaw = this.limbYaw;
+ var3 = this.posX - this.prevPosX;
+ double var5 = this.posZ - this.prevPosZ;
+ float var7 = MathHelper.sqrt_double(var3 * var3 + var5 * var5) * 4.0F;
+ if(var7 > 1.0F) {
+ var7 = 1.0F;
+ }
+
+ this.limbYaw += (var7 - this.limbYaw) * 0.4F;
+ this.limbSwing += this.limbYaw;
+ }
+
+ public boolean isOnLadder() {
+ int var1 = MathHelper.floor_double(this.posX);
+ int var2 = MathHelper.floor_double(this.boundingBox.minY);
+ int var3 = MathHelper.floor_double(this.posZ);
+ return this.worldObj.getBlockId(var1, var2, var3) == Block.ladder.blockID || this.worldObj.getBlockId(var1, var2 + 1, var3) == Block.ladder.blockID;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setShort("Health", (short)this.health);
+ var1.setShort("HurtTime", (short)this.hurtTime);
+ var1.setShort("DeathTime", (short)this.deathTime);
+ var1.setShort("AttackTime", (short)this.attackTime);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ this.health = var1.getShort("Health");
+ if(!var1.hasKey("Health")) {
+ this.health = 10;
+ }
+
+ this.hurtTime = var1.getShort("HurtTime");
+ this.deathTime = var1.getShort("DeathTime");
+ this.attackTime = var1.getShort("AttackTime");
+ }
+
+ public boolean isEntityAlive() {
+ return !this.isDead && this.health > 0;
+ }
+
+ public void onLivingUpdate() {
+ ++this.entityAge;
+ Entity var1 = this.worldObj.getPlayerEntity();
+ 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(var8 > 16384.0D) {
+ this.setEntityDead();
+ }
+
+ if(this.entityAge > 600 && this.rand.nextInt(800) == 0) {
+ if(var8 < 1024.0D) {
+ this.entityAge = 0;
+ } else {
+ this.setEntityDead();
+ }
+ }
+ }
+
+ if(this.health <= 0) {
+ this.isJumping = false;
+ this.moveStrafing = 0.0F;
+ this.moveForward = 0.0F;
+ this.randomYawVelocity = 0.0F;
+ } else {
+ this.updatePlayerActionState();
+ }
+
+ boolean var10 = this.handleWaterMovement();
+ boolean var3 = this.handleLavaMovement();
+ if(this.isJumping) {
+ if(var10) {
+ this.motionY += (double)0.04F;
+ } else if(var3) {
+ this.motionY += (double)0.04F;
+ } else if(this.onGround) {
+ this.jump();
+ }
+ }
+
+ this.moveStrafing *= 0.98F;
+ this.moveForward *= 0.98F;
+ this.randomYawVelocity *= 0.9F;
+ this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
+ List var11 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F));
+ if(var11 != null && var11.size() > 0) {
+ for(int var5 = 0; var5 < var11.size(); ++var5) {
+ Entity var12 = (Entity)var11.get(var5);
+ if(var12.canBePushed()) {
+ var12.applyEntityCollision(this);
+ }
+ }
+ }
+
+ }
+
+ protected void jump() {
+ this.motionY = (double)0.42F;
+ }
+
+ protected void updatePlayerActionState() {
+ if(this.rand.nextFloat() < 0.07F) {
+ this.moveStrafing = (this.rand.nextFloat() - 0.5F) * this.moveSpeed;
+ this.moveForward = this.rand.nextFloat() * this.moveSpeed;
+ }
+
+ this.isJumping = this.rand.nextFloat() < 0.01F;
+ if(this.rand.nextFloat() < 0.04F) {
+ this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 60.0F;
+ }
+
+ this.rotationYaw += this.randomYawVelocity;
+ this.rotationPitch = this.defaultPitch;
+ boolean var1 = this.handleWaterMovement();
+ boolean var2 = this.handleLavaMovement();
+ if(var1 || var2) {
+ this.isJumping = this.rand.nextFloat() < 0.8F;
+ }
+
+ }
+
+ public void onEntityDeath() {
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ this.setPosition(var1, var3 + (double)(this.height / 2.0F), var5);
+ return this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.getIsAnyLiquid(this.boundingBox);
+ }
+
+ protected void kill() {
+ this.attackEntityFrom((Entity)null, 4);
+ }
+}
diff --git a/source/net/minecraft/src/EntityMinecart.java b/source/net/minecraft/src/EntityMinecart.java
new file mode 100644
index 0000000..34926bb
--- /dev/null
+++ b/source/net/minecraft/src/EntityMinecart.java
@@ -0,0 +1,520 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityMinecart extends Entity implements IInventory {
+ private ItemStack[] cargoItems;
+ public int damageTaken;
+ public int timeSinceHit;
+ public int forwardDirection;
+ private boolean isInReverse;
+ 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}}};
+
+ public EntityMinecart(World var1) {
+ super(var1);
+ this.cargoItems = new ItemStack[36];
+ this.damageTaken = 0;
+ this.timeSinceHit = 0;
+ this.forwardDirection = 1;
+ this.isInReverse = false;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.7F);
+ this.yOffset = this.height / 2.0F;
+ this.canTriggerWalking = false;
+ }
+
+ public AxisAlignedBB getCollisionBox(Entity var1) {
+ return var1.boundingBox;
+ }
+
+ public AxisAlignedBB getBoundingBox() {
+ return this.boundingBox;
+ }
+
+ public boolean canBePushed() {
+ return true;
+ }
+
+ public EntityMinecart(World var1, double var2, double var4, double var6) {
+ this(var1);
+ this.setPosition(var2, var4 + (double)this.yOffset, var6);
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.prevPosX = var2;
+ this.prevPosY = var4;
+ this.prevPosZ = var6;
+ }
+
+ public double getYOffset() {
+ return (double)this.height * 0.2D;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.forwardDirection = -this.forwardDirection;
+ this.timeSinceHit = 10;
+ this.damageTaken += var2 * 10;
+ if(this.damageTaken > 40) {
+ this.entityDropItem(Item.minecart.shiftedIndex, 1, 0.0F);
+ this.setEntityDead();
+ }
+
+ return true;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public void setEntityDead() {
+ for(int var1 = 0; var1 < this.getSizeInventory(); ++var1) {
+ ItemStack var2 = this.getStackInSlot(var1);
+ 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.itemDmg));
+ float var8 = 0.05F;
+ 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);
+ }
+ }
+ }
+
+ super.setEntityDead();
+ }
+
+ public void onUpdate() {
+ if(this.timeSinceHit > 0) {
+ --this.timeSinceHit;
+ }
+
+ if(this.damageTaken > 0) {
+ --this.damageTaken;
+ }
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= (double)0.04F;
+ 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 - 1, var3) == Block.minecartTrack.blockID) {
+ --var2;
+ }
+
+ double var4 = 0.4D;
+ double var6 = 1.0D / 128.0D;
+ if(this.worldObj.getBlockId(var1, var2, var3) == Block.minecartTrack.blockID) {
+ Vec3D var8 = this.getPos(this.posX, this.posY, this.posZ);
+ int var9 = this.worldObj.getBlockMetadata(var1, var2, var3);
+ this.posY = (double)var2;
+ 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[][] var10 = matrix[var9];
+ double var11 = (double)(var10[1][0] - var10[0][0]);
+ double var13 = (double)(var10[1][2] - var10[0][2]);
+ double var15 = Math.sqrt(var11 * var11 + var13 * var13);
+ double var17 = this.motionX * var11 + this.motionZ * var13;
+ if(var17 < 0.0D) {
+ var11 = -var11;
+ var13 = -var13;
+ }
+
+ double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.motionX = var19 * var11 / var15;
+ this.motionZ = var19 * var13 / var15;
+ double var21 = 0.0D;
+ double var23 = (double)var1 + 0.5D + (double)var10[0][0] * 0.5D;
+ double var25 = (double)var3 + 0.5D + (double)var10[0][2] * 0.5D;
+ double var27 = (double)var1 + 0.5D + (double)var10[1][0] * 0.5D;
+ double var29 = (double)var3 + 0.5D + (double)var10[1][2] * 0.5D;
+ var11 = var27 - var23;
+ var13 = var29 - var25;
+ double var31;
+ double var33;
+ if(var11 == 0.0D) {
+ this.posX = (double)var1 + 0.5D;
+ var21 = this.posZ - (double)var3;
+ } else if(var13 == 0.0D) {
+ this.posZ = (double)var3 + 0.5D;
+ var21 = this.posX - (double)var1;
+ } else {
+ var31 = this.posX - var23;
+ var33 = this.posZ - var25;
+ double var35 = (var31 * var11 + var33 * var13) * 2.0D;
+ var21 = var35;
+ }
+
+ this.posX = var23 + var11 * var21;
+ this.posZ = var25 + var13 * var21;
+ this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ);
+ var31 = this.motionX;
+ var33 = this.motionZ;
+ if(this.riddenByEntity != null) {
+ var31 *= 0.75D;
+ var33 *= 0.75D;
+ }
+
+ if(var31 < -var4) {
+ var31 = -var4;
+ }
+
+ if(var31 > var4) {
+ var31 = var4;
+ }
+
+ if(var33 < -var4) {
+ var33 = -var4;
+ }
+
+ if(var33 > var4) {
+ var33 = var4;
+ }
+
+ this.moveEntity(var31, 0.0D, var33);
+ if(var10[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var10[0][0] && MathHelper.floor_double(this.posZ) - var3 == var10[0][2]) {
+ this.setPosition(this.posX, this.posY + (double)var10[0][1], this.posZ);
+ } else if(var10[1][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var10[1][0] && MathHelper.floor_double(this.posZ) - var3 == var10[1][2]) {
+ this.setPosition(this.posX, this.posY + (double)var10[1][1], this.posZ);
+ }
+
+ if(this.riddenByEntity != null) {
+ this.motionX *= (double)0.997F;
+ this.motionY *= 0.0D;
+ this.motionZ *= (double)0.997F;
+ } else {
+ this.motionX *= (double)0.96F;
+ this.motionY *= 0.0D;
+ this.motionZ *= (double)0.96F;
+ }
+
+ Vec3D var41 = this.getPos(this.posX, this.posY, this.posZ);
+ if(var41 != null && var8 != null) {
+ double var36 = (var8.yCoord - var41.yCoord) * 0.05D;
+ var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ if(var19 > 0.0D) {
+ this.motionX = this.motionX / var19 * (var19 + var36);
+ this.motionZ = this.motionZ / var19 * (var19 + var36);
+ }
+
+ this.setPosition(this.posX, var41.yCoord, this.posZ);
+ }
+
+ int var42 = MathHelper.floor_double(this.posX);
+ int var37 = MathHelper.floor_double(this.posZ);
+ if(var42 != var1 || var37 != var3) {
+ var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.motionX = var19 * (double)(var42 - var1);
+ this.motionZ = var19 * (double)(var37 - var3);
+ }
+ } else {
+ if(this.motionX < -var4) {
+ this.motionX = -var4;
+ }
+
+ if(this.motionX > var4) {
+ this.motionX = var4;
+ }
+
+ if(this.motionZ < -var4) {
+ this.motionZ = -var4;
+ }
+
+ if(this.motionZ > var4) {
+ this.motionZ = var4;
+ }
+
+ 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;
+ }
+ }
+
+ this.rotationPitch = 0.0F;
+ double var38 = this.prevPosX - this.posX;
+ double var39 = this.prevPosZ - this.posZ;
+ if(var38 * var38 + var39 * var39 > 0.001D) {
+ this.rotationYaw = (float)(Math.atan2(var39, var38) * 180.0D / Math.PI);
+ if(this.isInReverse) {
+ this.rotationYaw += 180.0F;
+ }
+ }
+
+ double var12;
+ for(var12 = (double)(this.rotationYaw - this.prevRotationYaw); var12 >= 180.0D; var12 -= 360.0D) {
+ }
+
+ while(var12 < -180.0D) {
+ var12 += 360.0D;
+ }
+
+ if(var12 < -170.0D || var12 >= 170.0D) {
+ this.rotationYaw += 180.0F;
+ this.isInReverse = !this.isInReverse;
+ }
+
+ this.setRotation(this.rotationYaw, this.rotationPitch);
+ List var14 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F));
+ if(var14 != null && var14.size() > 0) {
+ for(int var40 = 0; var40 < var14.size(); ++var40) {
+ Entity var16 = (Entity)var14.get(var40);
+ if(var16 != this.riddenByEntity && var16.canBePushed() && var16 instanceof EntityMinecart) {
+ var16.applyEntityCollision(this);
+ }
+ }
+ }
+
+ if(this.riddenByEntity != null && this.riddenByEntity.isDead) {
+ this.riddenByEntity = null;
+ }
+
+ }
+
+ public Vec3D getPosOffset(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(this.worldObj.getBlockId(var9, var10 - 1, var11) == Block.minecartTrack.blockID) {
+ --var10;
+ }
+
+ if(this.worldObj.getBlockId(var9, var10, var11) == Block.minecartTrack.blockID) {
+ int var12 = this.worldObj.getBlockMetadata(var9, var10, var11);
+ var3 = (double)var10;
+ if(var12 >= 2 && var12 <= 5) {
+ var3 = (double)(var10 + 1);
+ }
+
+ int[][] var13 = matrix[var12];
+ 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);
+ var14 /= var18;
+ var16 /= var18;
+ var1 += var14 * var7;
+ var5 += var16 * var7;
+ if(var13[0][1] != 0 && MathHelper.floor_double(var1) - var9 == var13[0][0] && MathHelper.floor_double(var5) - var11 == var13[0][2]) {
+ var3 += (double)var13[0][1];
+ } else if(var13[1][1] != 0 && MathHelper.floor_double(var1) - var9 == var13[1][0] && MathHelper.floor_double(var5) - var11 == var13[1][2]) {
+ var3 += (double)var13[1][1];
+ }
+
+ return this.getPos(var1, var3, var5);
+ } else {
+ return null;
+ }
+ }
+
+ public Vec3D getPos(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(this.worldObj.getBlockId(var7, var8 - 1, var9) == Block.minecartTrack.blockID) {
+ --var8;
+ }
+
+ if(this.worldObj.getBlockId(var7, var8, var9) == Block.minecartTrack.blockID) {
+ int var10 = this.worldObj.getBlockMetadata(var7, var8, var9);
+ var3 = (double)var8;
+ if(var10 >= 2 && var10 <= 5) {
+ var3 = (double)(var8 + 1);
+ }
+
+ int[][] var11 = matrix[var10];
+ double var12 = 0.0D;
+ double var14 = (double)var7 + 0.5D + (double)var11[0][0] * 0.5D;
+ double var16 = (double)var8 + 0.5D + (double)var11[0][1] * 0.5D;
+ double var18 = (double)var9 + 0.5D + (double)var11[0][2] * 0.5D;
+ double var20 = (double)var7 + 0.5D + (double)var11[1][0] * 0.5D;
+ double var22 = (double)var8 + 0.5D + (double)var11[1][1] * 0.5D;
+ double var24 = (double)var9 + 0.5D + (double)var11[1][2] * 0.5D;
+ double var26 = var20 - var14;
+ double var28 = (var22 - var16) * 2.0D;
+ double var30 = var24 - var18;
+ if(var26 == 0.0D) {
+ var1 = (double)var7 + 0.5D;
+ var12 = var5 - (double)var9;
+ } else if(var30 == 0.0D) {
+ var5 = (double)var9 + 0.5D;
+ var12 = var1 - (double)var7;
+ } else {
+ double var32 = var1 - var14;
+ double var34 = var5 - var18;
+ double var36 = (var32 * var26 + var34 * var30) * 2.0D;
+ var12 = var36;
+ }
+
+ var1 = var14 + var26 * var12;
+ var3 = var16 + var28 * var12;
+ var5 = var18 + var30 * var12;
+ if(var28 < 0.0D) {
+ ++var3;
+ }
+
+ if(var28 > 0.0D) {
+ var3 += 0.5D;
+ }
+
+ return Vec3D.createVector(var1, var3, var5);
+ } else {
+ return null;
+ }
+ }
+
+ protected void writeEntityToNBT(NBTTagCompound var1) {
+ NBTTagList var2 = new NBTTagList();
+
+ for(int var3 = 0; var3 < this.cargoItems.length; ++var3) {
+ if(this.cargoItems[var3] != null) {
+ NBTTagCompound var4 = new NBTTagCompound();
+ var4.setByte("Slot", (byte)var3);
+ this.cargoItems[var3].writeToNBT(var4);
+ var2.setTag(var4);
+ }
+ }
+
+ var1.setTag("Items", var2);
+ }
+
+ protected void readEntityFromNBT(NBTTagCompound var1) {
+ NBTTagList var2 = var1.getTagList("Items");
+ this.cargoItems = new ItemStack[this.getSizeInventory()];
+
+ 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.cargoItems.length) {
+ this.cargoItems[var5] = new ItemStack(var4);
+ }
+ }
+
+ }
+
+ public void applyEntityCollision(Entity var1) {
+ if(var1 != this.riddenByEntity) {
+ double var2 = var1.posX - this.posX;
+ double var4 = var1.posZ - this.posZ;
+ double var6 = var2 * var2 + var4 * var4;
+ if(var6 >= (double)1.0E-4F) {
+ var6 = (double)MathHelper.sqrt_double(var6);
+ var2 /= var6;
+ var4 /= var6;
+ double var8 = 1.0D / var6;
+ if(var8 > 1.0D) {
+ var8 = 1.0D;
+ }
+
+ var2 *= var8;
+ var4 *= var8;
+ var2 *= (double)0.1F;
+ var4 *= (double)0.1F;
+ 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.motionX + this.motionX) / 2.0D;
+ double var12 = (var1.motionZ + this.motionZ) / 2.0D;
+ this.motionX = this.motionZ = 0.0D;
+ this.addVelocity(var10 - var2, 0.0D, var12 - var4);
+ var1.motionX = var1.motionZ = 0.0D;
+ var1.addVelocity(var10 + var2, 0.0D, var12 + var4);
+ } else {
+ this.addVelocity(-var2, 0.0D, -var4);
+ var1.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D);
+ }
+ }
+
+ }
+ }
+
+ public int getSizeInventory() {
+ return 27;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.cargoItems[var1];
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.cargoItems[var1] != null) {
+ ItemStack var3;
+ if(this.cargoItems[var1].stackSize <= var2) {
+ var3 = this.cargoItems[var1];
+ this.cargoItems[var1] = null;
+ return var3;
+ } else {
+ var3 = this.cargoItems[var1].splitStack(var2);
+ if(this.cargoItems[var1].stackSize == 0) {
+ this.cargoItems[var1] = null;
+ }
+
+ return var3;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ this.cargoItems[var1] = var2;
+ if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) {
+ var2.stackSize = this.getInventoryStackLimit();
+ }
+
+ }
+
+ public String getInvName() {
+ return "Minecart";
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public void onInventoryChanged() {
+ }
+
+ public boolean interact(EntityPlayer var1) {
+ var1.mountEntity(this);
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/EntityMonster.java b/source/net/minecraft/src/EntityMonster.java
new file mode 100644
index 0000000..0e0fc19
--- /dev/null
+++ b/source/net/minecraft/src/EntityMonster.java
@@ -0,0 +1,70 @@
+package net.minecraft.src;
+
+public class EntityMonster extends EntityCreature {
+ protected int attackStrength = 2;
+
+ public EntityMonster(World var1) {
+ super(var1);
+ this.health = 20;
+ }
+
+ public void onLivingUpdate() {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 > 0.5F) {
+ this.entityAge += 2;
+ }
+
+ super.onLivingUpdate();
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ if(this.worldObj.difficultySetting == 0) {
+ this.setEntityDead();
+ }
+
+ }
+
+ protected Entity findPlayerToAttack() {
+ double var1 = this.worldObj.playerEntity.getDistanceSqToEntity(this);
+ double var3 = 16.0D;
+ return var1 < var3 * var3 && this.canEntityBeSeen(this.worldObj.playerEntity) ? this.worldObj.playerEntity : null;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ if(super.attackEntityFrom(var1, var2)) {
+ if(var1 != this) {
+ this.playerToAttack = var1;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ if((double)var2 < 2.5D && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) {
+ this.attackTime = 20;
+ var1.attackEntityFrom(this, this.attackStrength);
+ }
+
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return 0.5F - this.worldObj.getBrightness(var1, var2, var3);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ int var7 = this.worldObj.getBlockLightValue(MathHelper.floor_double(var1), MathHelper.floor_double(var3), MathHelper.floor_double(var5));
+ return var7 <= this.rand.nextInt(8) && super.getCanSpawnHere(var1, var3, var5);
+ }
+}
diff --git a/source/net/minecraft/src/EntityPainting.java b/source/net/minecraft/src/EntityPainting.java
new file mode 100644
index 0000000..3090aa2
--- /dev/null
+++ b/source/net/minecraft/src/EntityPainting.java
@@ -0,0 +1,212 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class EntityPainting extends Entity {
+ private int tickCounter;
+ public int direction;
+ private int xPosition;
+ private int yPosition;
+ private int zPosition;
+ public EnumArt art;
+
+ public EntityPainting(World var1) {
+ super(var1);
+ this.tickCounter = 0;
+ this.direction = 0;
+ this.yOffset = 0.0F;
+ this.setSize(0.5F, 0.5F);
+ }
+
+ public EntityPainting(World var1, int var2, int var3, int var4, int var5) {
+ this(var1);
+ this.xPosition = var2;
+ this.yPosition = var3;
+ this.zPosition = var4;
+ ArrayList var6 = new ArrayList();
+ EnumArt[] var7 = EnumArt.values();
+ int var8 = var7.length;
+
+ for(int var9 = 0; var9 < var8; ++var9) {
+ EnumArt var10 = var7[var9];
+ this.art = var10;
+ this.setDirection(var5);
+ if(this.onValidSurface()) {
+ var6.add(var10);
+ }
+ }
+
+ if(var6.size() > 0) {
+ this.art = (EnumArt)var6.get(this.rand.nextInt(var6.size()));
+ }
+
+ this.setDirection(var5);
+ }
+
+ public void setDirection(int var1) {
+ this.direction = var1;
+ this.prevRotationYaw = this.rotationYaw = (float)(var1 * 90);
+ float var2 = (float)this.art.sizeX;
+ float var3 = (float)this.art.sizeY;
+ float var4 = (float)this.art.sizeX;
+ if(var1 != 0 && var1 != 2) {
+ var2 = 0.5F;
+ } else {
+ var4 = 0.5F;
+ }
+
+ var2 /= 32.0F;
+ var3 /= 32.0F;
+ var4 /= 32.0F;
+ 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 == 0) {
+ var7 -= var8;
+ }
+
+ if(var1 == 1) {
+ var5 -= var8;
+ }
+
+ if(var1 == 2) {
+ var7 += var8;
+ }
+
+ if(var1 == 3) {
+ var5 += var8;
+ }
+
+ if(var1 == 0) {
+ var5 -= this.getArtSize(this.art.sizeX);
+ }
+
+ if(var1 == 1) {
+ var7 += this.getArtSize(this.art.sizeX);
+ }
+
+ if(var1 == 2) {
+ var5 += this.getArtSize(this.art.sizeX);
+ }
+
+ if(var1 == 3) {
+ var7 -= this.getArtSize(this.art.sizeX);
+ }
+
+ var6 += this.getArtSize(this.art.sizeY);
+ this.setPosition((double)var5, (double)var6, (double)var7);
+ float var9 = -(0.1F / 16.0F);
+ 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 getArtSize(int var1) {
+ return var1 == 32 ? 0.5F : (var1 == 64 ? 0.5F : 0.0F);
+ }
+
+ public void onUpdate() {
+ if(this.tickCounter++ == 100 && !this.onValidSurface()) {
+ this.tickCounter = 0;
+ this.setEntityDead();
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.painting)));
+ }
+
+ }
+
+ public boolean onValidSurface() {
+ if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() > 0) {
+ return false;
+ } else {
+ int var1 = this.art.sizeX / 16;
+ int var2 = this.art.sizeY / 16;
+ int var3 = this.xPosition;
+ int var4 = this.yPosition;
+ int var5 = this.zPosition;
+ if(this.direction == 0) {
+ var3 = MathHelper.floor_double(this.posX - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ if(this.direction == 1) {
+ var5 = MathHelper.floor_double(this.posZ - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ if(this.direction == 2) {
+ var3 = MathHelper.floor_double(this.posX - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ if(this.direction == 3) {
+ var5 = MathHelper.floor_double(this.posZ - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ var4 = MathHelper.floor_double(this.posY - (double)((float)this.art.sizeY / 32.0F));
+
+ int var7;
+ for(int var6 = 0; var6 < var1; ++var6) {
+ for(var7 = 0; var7 < var2; ++var7) {
+ Material var8;
+ if(this.direction != 0 && this.direction != 2) {
+ var8 = this.worldObj.getBlockMaterial(this.xPosition, var4 + var7, var5 + var6);
+ } else {
+ var8 = this.worldObj.getBlockMaterial(var3 + var6, var4 + var7, this.zPosition);
+ }
+
+ if(!var8.isSolid()) {
+ return false;
+ }
+ }
+ }
+
+ List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox);
+
+ for(var7 = 0; var7 < var9.size(); ++var7) {
+ if(var9.get(var7) instanceof EntityPainting) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ public boolean canBeCollidedWith() {
+ return true;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.setEntityDead();
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.painting)));
+ return true;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setByte("Dir", (byte)this.direction);
+ var1.setString("Motive", this.art.title);
+ var1.setInteger("TileX", this.xPosition);
+ var1.setInteger("TileY", this.yPosition);
+ var1.setInteger("TileZ", this.zPosition);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ this.direction = var1.getByte("Dir");
+ this.xPosition = var1.getInteger("TileX");
+ this.yPosition = var1.getInteger("TileY");
+ this.zPosition = var1.getInteger("TileZ");
+ String var2 = var1.getString("Motive");
+ EnumArt[] var3 = EnumArt.values();
+ int var4 = var3.length;
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ EnumArt var6 = var3[var5];
+ if(var6.title.equals(var2)) {
+ this.art = var6;
+ }
+ }
+
+ if(this.art == null) {
+ this.art = EnumArt.Kebab;
+ }
+
+ this.setDirection(this.direction);
+ }
+}
diff --git a/source/net/minecraft/src/EntityPickupFX.java b/source/net/minecraft/src/EntityPickupFX.java
new file mode 100644
index 0000000..7faaec3
--- /dev/null
+++ b/source/net/minecraft/src/EntityPickupFX.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class EntityPickupFX extends EntityFX {
+ private Entity entityToPickUp;
+ private EntityLiving entityPickingUp;
+ private int age = 0;
+ private int maxAge = 0;
+ private float yOffs;
+
+ public EntityPickupFX(World var1, Entity var2, EntityLiving var3, float var4) {
+ super(var1, var2.posX, var2.posY, var2.posZ, var2.motionX, var2.motionY, var2.motionZ);
+ this.entityToPickUp = var2;
+ this.entityPickingUp = var3;
+ this.maxAge = 3;
+ this.yOffs = var4;
+ }
+
+ 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;
+ 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 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);
+ float var30 = this.worldObj.getBrightness(var27, var28, var29);
+ var21 -= interpPosX;
+ var23 -= interpPosY;
+ var25 -= interpPosZ;
+ GL11.glColor4f(var30, var30, var30, 1.0F);
+ RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, var2);
+ }
+
+ public void onUpdate() {
+ ++this.age;
+ if(this.age == this.maxAge) {
+ this.setEntityDead();
+ }
+
+ }
+
+ public int getFXLayer() {
+ return 2;
+ }
+}
diff --git a/source/net/minecraft/src/EntityPig.java b/source/net/minecraft/src/EntityPig.java
new file mode 100644
index 0000000..805c3fd
--- /dev/null
+++ b/source/net/minecraft/src/EntityPig.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class EntityPig extends EntityAnimal {
+ public boolean saddled = false;
+
+ public EntityPig(World var1) {
+ super(var1);
+ this.texture = "/mob/pig.png";
+ this.setSize(0.9F, 0.9F);
+ this.saddled = false;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ var1.setBoolean("Saddle", this.saddled);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ this.saddled = var1.getBoolean("Saddle");
+ }
+
+ protected String getLivingSound() {
+ return "mob.pig";
+ }
+
+ protected String getHurtSound() {
+ return "mob.pig";
+ }
+
+ protected String getDeathSound() {
+ return "mob.pigdeath";
+ }
+
+ public boolean interact(EntityPlayer var1) {
+ if(this.saddled) {
+ var1.mountEntity(this);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected int getDropItemId() {
+ return Item.porkRaw.shiftedIndex;
+ }
+}
diff --git a/source/net/minecraft/src/EntityPlayer.java b/source/net/minecraft/src/EntityPlayer.java
new file mode 100644
index 0000000..b7db196
--- /dev/null
+++ b/source/net/minecraft/src/EntityPlayer.java
@@ -0,0 +1,219 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityPlayer extends EntityLiving {
+ public InventoryPlayer inventory = new InventoryPlayer(this);
+ public byte unusedMiningCooldown = 0;
+ public int score = 0;
+ public float prevCameraYaw;
+ public float cameraYaw;
+ protected String username;
+ private int damageRemainder = 0;
+
+ public EntityPlayer(World var1) {
+ super(var1);
+ this.setPositionAndRotation((double)var1.spawnX + 0.5D, (double)var1.spawnY, (double)var1.spawnZ + 0.5D, 0.0F, 0.0F);
+ this.yOffset = 1.62F;
+ this.health = 20;
+ this.entityType = "humanoid";
+ this.unusedRotation = 180.0F;
+ this.fireResistance = 20;
+ this.texture = "/char.png";
+ }
+
+ public void updateRidden() {
+ super.updateRidden();
+ this.prevCameraYaw = this.cameraYaw;
+ this.cameraYaw = 0.0F;
+ }
+
+ public void preparePlayerToSpawn() {
+ this.yOffset = 1.62F;
+ this.setSize(0.6F, 1.8F);
+ super.preparePlayerToSpawn();
+ if(this.worldObj != null) {
+ this.worldObj.playerEntity = this;
+ }
+
+ this.health = 20;
+ this.deathTime = 0;
+ }
+
+ public void onLivingUpdate() {
+ this.worldObj.playMusic(this.posX, this.posY, this.posZ, "calm", 0.0F);
+ if(this.worldObj.difficultySetting == 0 && this.health < 20 && this.ticksExisted % 20 * 4 == 0) {
+ this.heal(1);
+ }
+
+ this.inventory.decrementAnimations();
+ this.prevCameraYaw = this.cameraYaw;
+ super.onLivingUpdate();
+ float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ float var2 = (float)Math.atan(-this.motionY * (double)0.2F) * 15.0F;
+ if(var1 > 0.1F) {
+ var1 = 0.1F;
+ }
+
+ if(!this.onGround || this.health <= 0) {
+ var1 = 0.0F;
+ }
+
+ if(this.onGround || this.health <= 0) {
+ var2 = 0.0F;
+ }
+
+ this.cameraYaw += (var1 - this.cameraYaw) * 0.4F;
+ this.cameraPitch += (var2 - this.cameraPitch) * 0.8F;
+ if(this.health > 0) {
+ List var3 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(1.0D, 0.0D, 1.0D));
+ if(var3 != null) {
+ for(int var4 = 0; var4 < var3.size(); ++var4) {
+ this.collideWithPlayer((Entity)var3.get(var4));
+ }
+ }
+ }
+
+ }
+
+ private void collideWithPlayer(Entity var1) {
+ var1.onCollideWithPlayer(this);
+ }
+
+ public int getScore() {
+ return this.score;
+ }
+
+ public void onDeath(Entity var1) {
+ this.setSize(0.2F, 0.2F);
+ this.setPosition(this.posX, this.posY, this.posZ);
+ this.motionY = (double)0.1F;
+ if(this.username.equals("Notch")) {
+ this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true);
+ }
+
+ this.inventory.dropAllItems();
+ if(var1 != 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 {
+ this.motionX = this.motionZ = 0.0D;
+ }
+
+ this.yOffset = 0.1F;
+ }
+
+ public void addToPlayerScore(Entity var1, int var2) {
+ this.score += var2;
+ }
+
+ public void dropPlayerItem(ItemStack var1) {
+ this.dropPlayerItemWithRandomChoice(var1, false);
+ }
+
+ public void dropPlayerItemWithRandomChoice(ItemStack var1, boolean var2) {
+ if(var1 != null) {
+ EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - (double)0.3F, this.posZ, var1);
+ var3.delayBeforeCanPickup = 40;
+ float var4 = 0.1F;
+ float var5;
+ if(var2) {
+ 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;
+ } 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.rand.nextFloat() * (float)Math.PI * 2.0F;
+ var4 *= this.rand.nextFloat();
+ var3.motionX += Math.cos((double)var5) * (double)var4;
+ var3.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
+ var3.motionZ += Math.sin((double)var5) * (double)var4;
+ }
+
+ this.worldObj.spawnEntityInWorld(var3);
+ }
+ }
+
+ public float getCurrentPlayerStrVsBlock(Block var1) {
+ float var2 = this.inventory.getStrVsBlock(var1);
+ if(this.isInsideOfMaterial(Material.water)) {
+ var2 /= 5.0F;
+ }
+
+ if(!this.onGround) {
+ var2 /= 5.0F;
+ }
+
+ return var2;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return this.inventory.canHarvestBlock(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void displayGUIChest(IInventory var1) {
+ }
+
+ public void displayWorkbenchGUI() {
+ }
+
+ public void onItemPickup(Entity var1) {
+ }
+
+ protected float getEyeHeight() {
+ return 0.12F;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.entityAge = 0;
+ if(this.health <= 0) {
+ return false;
+ } else if((float)this.heartsLife > (float)this.heartsHalvesLife / 2.0F) {
+ return false;
+ } else {
+ if(var1 instanceof EntityMonster || var1 instanceof EntityArrow) {
+ if(this.worldObj.difficultySetting == 0) {
+ var2 = 0;
+ }
+
+ if(this.worldObj.difficultySetting == 1) {
+ var2 = var2 / 3 + 1;
+ }
+
+ if(this.worldObj.difficultySetting == 3) {
+ var2 = var2 * 3 / 2;
+ }
+ }
+
+ int var3 = 25 - this.inventory.getTotalArmorValue();
+ int var4 = var2 * var3 + this.damageRemainder;
+ this.inventory.damageArmor(var2);
+ var2 = var4 / 25;
+ this.damageRemainder = var4 % 25;
+ return var2 == 0 ? false : super.attackEntityFrom(var1, var2);
+ }
+ }
+
+ public void displayGUIFurnace(TileEntityFurnace var1) {
+ }
+
+ public void displayGUIEditSign(TileEntitySign var1) {
+ }
+
+ public void interactWithEntity(Entity var1) {
+ }
+}
diff --git a/source/net/minecraft/src/EntityPlayerSP.java b/source/net/minecraft/src/EntityPlayerSP.java
new file mode 100644
index 0000000..7b791e1
--- /dev/null
+++ b/source/net/minecraft/src/EntityPlayerSP.java
@@ -0,0 +1,118 @@
+package net.minecraft.src;
+
+public class EntityPlayerSP extends EntityPlayer {
+ public MovementInput movementInput;
+ private Minecraft mc;
+
+ public EntityPlayerSP(Minecraft var1, World var2, Session var3) {
+ super(var2);
+ this.mc = var1;
+ if(var2 != null) {
+ if(var2.playerEntity != null) {
+ var2.setEntityDead(var2.playerEntity);
+ }
+
+ var2.playerEntity = this;
+ }
+
+ if(var3 != null && var3.username != null && var3.username.length() > 0) {
+ this.skinUrl = "http://www.minecraft.net/skin/" + var3.username + ".png";
+ }
+
+ this.username = var3.username;
+ }
+
+ public void updatePlayerActionState() {
+ this.moveStrafing = this.movementInput.moveStrafe;
+ this.moveForward = this.movementInput.moveForward;
+ this.isJumping = this.movementInput.jump;
+ }
+
+ public void onLivingUpdate() {
+ this.movementInput.updatePlayerMoveState(this);
+ super.onLivingUpdate();
+ }
+
+ public void resetPlayerKeyState() {
+ this.movementInput.resetKeyState();
+ }
+
+ public void handleKeyPress(int var1, boolean var2) {
+ this.movementInput.checkKeyForMovementInput(var1, var2);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ var1.setInteger("Score", this.score);
+ var1.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList()));
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ this.score = var1.getInteger("Score");
+ NBTTagList var2 = var1.getTagList("Inventory");
+ this.inventory.readFromNBT(var2);
+ }
+
+ public void displayGUIChest(IInventory var1) {
+ this.mc.displayGuiScreen(new GuiChest(this.inventory, var1));
+ }
+
+ public void displayGUIEditSign(TileEntitySign var1) {
+ this.mc.displayGuiScreen(new GuiEditSign(var1));
+ }
+
+ public void displayWorkbenchGUI() {
+ this.mc.displayGuiScreen(new GuiCrafting(this.inventory));
+ }
+
+ public void displayGUIFurnace(TileEntityFurnace var1) {
+ this.mc.displayGuiScreen(new GuiFurnace(this.inventory, var1));
+ }
+
+ public ItemStack getCurrentEquippedItem() {
+ return this.inventory.getCurrentItem();
+ }
+
+ public void displayGUIInventory() {
+ this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null);
+ }
+
+ public void attackEntity(Entity var1) {
+ int var2 = this.inventory.getDamageVsEntity(var1);
+ if(var2 > 0) {
+ var1.attackEntityFrom(this, var2);
+ ItemStack var3 = this.getCurrentEquippedItem();
+ if(var3 != null && var1 instanceof EntityLiving) {
+ var3.hitEntity((EntityLiving)var1);
+ if(var3.stackSize <= 0) {
+ var3.onItemDestroyedByUse(this);
+ this.displayGUIInventory();
+ }
+ }
+ }
+
+ }
+
+ public void onItemPickup(Entity var1) {
+ this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var1, this, -0.5F));
+ }
+
+ public int getPlayerArmorValue() {
+ return this.inventory.getTotalArmorValue();
+ }
+
+ public void interactWithEntity(Entity var1) {
+ if(!var1.interact(this)) {
+ ItemStack var2 = this.getCurrentEquippedItem();
+ if(var2 != null && var1 instanceof EntityLiving) {
+ var2.useItemOnEntity((EntityLiving)var1);
+ if(var2.stackSize <= 0) {
+ var2.onItemDestroyedByUse(this);
+ this.displayGUIInventory();
+ }
+ }
+
+ }
+ }
+}
diff --git a/source/net/minecraft/src/EntityRainFX.java b/source/net/minecraft/src/EntityRainFX.java
new file mode 100644
index 0000000..1b3c2bc
--- /dev/null
+++ b/source/net/minecraft/src/EntityRainFX.java
@@ -0,0 +1,53 @@
+package net.minecraft.src;
+
+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;
+ 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.particleTextureIndex = 16;
+ this.setSize(0.01F, 0.01F);
+ this.particleGravity = 0.06F;
+ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ 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.setEntityDead();
+ }
+
+ if(this.onGround) {
+ if(Math.random() < 0.5D) {
+ this.setEntityDead();
+ }
+
+ this.motionX *= (double)0.7F;
+ this.motionZ *= (double)0.7F;
+ }
+
+ Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
+ if(var1.getIsLiquid() || var1.isSolid()) {
+ double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getPercentAir(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))));
+ if(this.posY < var2) {
+ this.setEntityDead();
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityRenderer.java b/source/net/minecraft/src/EntityRenderer.java
new file mode 100644
index 0000000..7d2ce97
--- /dev/null
+++ b/source/net/minecraft/src/EntityRenderer.java
@@ -0,0 +1,623 @@
+package net.minecraft.src;
+
+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.GLU;
+
+public class EntityRenderer {
+ private Minecraft mc;
+ private boolean isDisplayActive = false;
+ private float farPlaneDistance = 0.0F;
+ public ItemRenderer itemRenderer;
+ private int rendererUpdateCount;
+ private Entity pointedEntity = null;
+ private int mouseDX;
+ private int mouseDY;
+ private Random random = new Random();
+ volatile int unusedInt1 = 0;
+ volatile int unusedInt2 = 0;
+ FloatBuffer fogColorBuffer = GLAllocation.createFloatBuffer(16);
+ float fogColorRed;
+ float fogColorGreen;
+ float fogColorBlue;
+ private float prevFogColor;
+ private float fogColor;
+
+ public EntityRenderer(Minecraft var1) {
+ this.mc = var1;
+ this.itemRenderer = new ItemRenderer(var1);
+ }
+
+ public void updateRenderer() {
+ this.prevFogColor = this.fogColor;
+ float var1 = this.mc.theWorld.getBrightness(MathHelper.floor_double(this.mc.thePlayer.posX), MathHelper.floor_double(this.mc.thePlayer.posY), MathHelper.floor_double(this.mc.thePlayer.posZ));
+ float var2 = (float)(3 - this.mc.gameSettings.renderDistance) / 3.0F;
+ float var3 = var1 * (1.0F - var2) + var2;
+ this.fogColor += (var3 - this.fogColor) * 0.1F;
+ ++this.rendererUpdateCount;
+ this.itemRenderer.updateEquippedItem();
+ if(this.mc.isRaining) {
+ this.addRainParticles();
+ }
+
+ }
+
+ private Vec3D getPlayerPosition(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ double var3 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1;
+ double var5 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1;
+ double var7 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1;
+ return Vec3D.createVector(var3, var5, var7);
+ }
+
+ private void getMouseOver(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ float var3 = var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1;
+ float var4 = var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1;
+ Vec3D var5 = this.getPlayerPosition(var1);
+ float var6 = MathHelper.cos(-var4 * ((float)Math.PI / 180.0F) - (float)Math.PI);
+ float var7 = MathHelper.sin(-var4 * ((float)Math.PI / 180.0F) - (float)Math.PI);
+ float var8 = -MathHelper.cos(-var3 * ((float)Math.PI / 180.0F));
+ float var9 = MathHelper.sin(-var3 * ((float)Math.PI / 180.0F));
+ float var10 = var7 * var8;
+ float var12 = var6 * var8;
+ double var13 = (double)this.mc.playerController.getBlockReachDistance();
+ Vec3D var15 = var5.addVector((double)var10 * var13, (double)var9 * var13, (double)var12 * var13);
+ this.mc.objectMouseOver = this.mc.theWorld.rayTraceBlocks(var5, var15);
+ double var16 = var13;
+ var5 = this.getPlayerPosition(var1);
+ if(this.mc.objectMouseOver != null) {
+ var16 = this.mc.objectMouseOver.hitVec.distanceTo(var5);
+ }
+
+ if(this.mc.playerController instanceof PlayerControllerCreative) {
+ var13 = 32.0D;
+ } else {
+ if(var16 > 3.0D) {
+ var16 = 3.0D;
+ }
+
+ var13 = var16;
+ }
+
+ var15 = var5.addVector((double)var10 * var13, (double)var9 * var13, (double)var12 * var13);
+ this.pointedEntity = null;
+ List var18 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(var2, var2.boundingBox.addCoord((double)var10 * var13, (double)var9 * var13, (double)var12 * var13));
+ double var19 = 0.0D;
+
+ for(int var21 = 0; var21 < var18.size(); ++var21) {
+ Entity var22 = (Entity)var18.get(var21);
+ if(var22.canBeCollidedWith()) {
+ float var23 = 0.1F;
+ AxisAlignedBB var24 = var22.boundingBox.expand((double)var23, (double)var23, (double)var23);
+ MovingObjectPosition var25 = var24.calculateIntercept(var5, var15);
+ if(var25 != null) {
+ double var26 = var5.distanceTo(var25.hitVec);
+ if(var26 < var19 || var19 == 0.0D) {
+ this.pointedEntity = var22;
+ var19 = var26;
+ }
+ }
+ }
+ }
+
+ if(this.pointedEntity != null && !(this.mc.playerController instanceof PlayerControllerCreative)) {
+ this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity);
+ }
+
+ }
+
+ private float getFOVModifier(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ float var3 = 70.0F;
+ if(var2.isInsideOfMaterial(Material.water)) {
+ var3 = 60.0F;
+ }
+
+ if(var2.health <= 0) {
+ float var4 = (float)var2.deathTime + var1;
+ var3 /= (1.0F - 500.0F / (var4 + 500.0F)) * 2.0F + 1.0F;
+ }
+
+ return var3;
+ }
+
+ private void hurtCameraEffect(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ float var3 = (float)var2.hurtTime - var1;
+ float var4;
+ if(var2.health <= 0) {
+ var4 = (float)var2.deathTime + var1;
+ GL11.glRotatef(40.0F - 8000.0F / (var4 + 200.0F), 0.0F, 0.0F, 1.0F);
+ }
+
+ if(var3 >= 0.0F) {
+ var3 /= (float)var2.maxHurtTime;
+ var3 = MathHelper.sin(var3 * var3 * var3 * var3 * (float)Math.PI);
+ var4 = var2.attackedAtYaw;
+ GL11.glRotatef(-var4, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var3 * 14.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(var4, 0.0F, 1.0F, 0.0F);
+ }
+ }
+
+ private void setupViewBobbing(float var1) {
+ if(!this.mc.gameSettings.thirdPersonView) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ 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;
+ 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);
+ GL11.glRotatef(var6, 1.0F, 0.0F, 0.0F);
+ }
+ }
+
+ private void orientCamera(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ double var3 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1;
+ double var5 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1;
+ double var7 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1;
+ if(this.mc.gameSettings.thirdPersonView) {
+ double var9 = 4.0D;
+ double var11 = (double)(-MathHelper.sin(var2.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(var2.rotationPitch / 180.0F * (float)Math.PI)) * var9;
+ double var13 = (double)(MathHelper.cos(var2.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(var2.rotationPitch / 180.0F * (float)Math.PI)) * var9;
+ double var15 = (double)(-MathHelper.sin(var2.rotationPitch / 180.0F * (float)Math.PI)) * var9;
+
+ for(int var17 = 0; var17 < 8; ++var17) {
+ float var18 = (float)((var17 & 1) * 2 - 1);
+ float var19 = (float)((var17 >> 1 & 1) * 2 - 1);
+ float var20 = (float)((var17 >> 2 & 1) * 2 - 1);
+ var18 *= 0.1F;
+ var19 *= 0.1F;
+ var20 *= 0.1F;
+ MovingObjectPosition var21 = this.mc.theWorld.rayTraceBlocks(Vec3D.createVector(var3 + (double)var18, var5 + (double)var19, var7 + (double)var20), Vec3D.createVector(var3 - var11 + (double)var18 + (double)var20, var5 - var15 + (double)var19, var7 - var13 + (double)var20));
+ if(var21 != null) {
+ double var22 = var21.hitVec.distanceTo(Vec3D.createVector(var3, var5, var7));
+ if(var22 < var9) {
+ var9 = var22;
+ }
+ }
+ }
+
+ GL11.glTranslatef(0.0F, 0.0F, (float)(-var9));
+ } else {
+ GL11.glTranslatef(0.0F, 0.0F, -0.1F);
+ }
+
+ 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);
+ }
+
+ private void setupCameraTransform(float var1, int var2) {
+ this.farPlaneDistance = (float)(256 >> this.mc.gameSettings.renderDistance);
+ 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);
+ }
+
+ GLU.gluPerspective(this.getFOVModifier(var1), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance);
+ 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);
+ }
+
+ this.orientCamera(var1);
+ }
+
+ private void renderHand(float var1, int var2) {
+ GL11.glLoadIdentity();
+ if(this.mc.gameSettings.anaglyph) {
+ GL11.glTranslatef((float)(var2 * 2 - 1) * 0.1F, 0.0F, 0.0F);
+ }
+
+ GL11.glPushMatrix();
+ this.hurtCameraEffect(var1);
+ if(this.mc.gameSettings.viewBobbing) {
+ this.setupViewBobbing(var1);
+ }
+
+ if(!this.mc.gameSettings.thirdPersonView) {
+ this.itemRenderer.renderItemInFirstPerson(var1);
+ }
+
+ GL11.glPopMatrix();
+ if(!this.mc.gameSettings.thirdPersonView) {
+ this.itemRenderer.renderOverlays(var1);
+ this.hurtCameraEffect(var1);
+ }
+
+ if(this.mc.gameSettings.viewBobbing) {
+ this.setupViewBobbing(var1);
+ }
+
+ }
+
+ public void updateCameraAndRender(float var1) {
+ if(this.isDisplayActive && !Display.isActive()) {
+ this.mc.displayInGameMenu();
+ }
+
+ this.isDisplayActive = Display.isActive();
+ int var3;
+ int var9;
+ int var10;
+ if(this.mc.inGameHasFocus) {
+ int var2 = Mouse.getDX() * 0;
+ var3 = Mouse.getDY() * 0;
+ this.mc.mouseHelper.mouseXYChange();
+ byte var4 = 1;
+ if(this.mc.gameSettings.invertMouse) {
+ var4 = -1;
+ }
+
+ boolean var5 = false;
+ boolean var6 = false;
+ var9 = var2 + this.mc.mouseHelper.deltaX;
+ var10 = var3 - this.mc.mouseHelper.deltaY;
+ if(var2 != 0 || this.mouseDX != 0) {
+ System.out.println("xxo: " + var2 + ", " + this.mouseDX + ": " + this.mouseDX + ", xo: " + var9);
+ }
+
+ if(this.mouseDX != 0) {
+ this.mouseDX = 0;
+ }
+
+ if(this.mouseDY != 0) {
+ this.mouseDY = 0;
+ }
+
+ if(var2 != 0) {
+ this.mouseDX = var2;
+ }
+
+ if(var3 != 0) {
+ this.mouseDY = var3;
+ }
+
+ this.mc.thePlayer.setAngles((float)var9, (float)(var10 * var4));
+ }
+
+ if(!this.mc.skipRenderWorld) {
+ ScaledResolution var7 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ var3 = var7.getScaledWidth();
+ int var8 = var7.getScaledHeight();
+ var9 = Mouse.getX() * var3 / this.mc.displayWidth;
+ var10 = var8 - Mouse.getY() * var8 / this.mc.displayHeight - 1;
+ if(this.mc.theWorld != null) {
+ this.renderWorld(var1);
+ this.mc.ingameGUI.renderGameOverlay(var1, this.mc.currentScreen != null, var9, var10);
+ } else {
+ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
+ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ this.setupOverlayRendering();
+ }
+
+ if(this.mc.currentScreen != null) {
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ this.mc.currentScreen.drawScreen(var9, var10, var1);
+ }
+
+ }
+ }
+
+ public void renderWorld(float var1) {
+ this.getMouseOver(var1);
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ RenderGlobal var3 = this.mc.renderGlobal;
+ EffectRenderer var4 = this.mc.effectRenderer;
+ double var5 = var2.lastTickPosX + (var2.posX - var2.lastTickPosX) * (double)var1;
+ double var7 = var2.lastTickPosY + (var2.posY - var2.lastTickPosY) * (double)var1;
+ double var9 = var2.lastTickPosZ + (var2.posZ - var2.lastTickPosZ) * (double)var1;
+
+ for(int var11 = 0; var11 < 2; ++var11) {
+ if(this.mc.gameSettings.anaglyph) {
+ if(var11 == 0) {
+ GL11.glColorMask(false, true, true, false);
+ } else {
+ GL11.glColorMask(true, false, false, false);
+ }
+ }
+
+ 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);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ this.setupCameraTransform(var1, var11);
+ ClippingHelperImplementation.getInstance();
+ if(this.mc.gameSettings.renderDistance < 2) {
+ this.setupFog(-1);
+ var3.renderSky(var1);
+ }
+
+ GL11.glEnable(GL11.GL_FOG);
+ this.setupFog(1);
+ Frustrum var12 = new Frustrum();
+ var12.setPosition(var5, var7, var9);
+ this.mc.renderGlobal.clipRenderersByFrustrum(var12, var1);
+ this.mc.renderGlobal.updateRenderers(var2, false);
+ this.setupFog(0);
+ GL11.glEnable(GL11.GL_FOG);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ RenderHelper.disableStandardItemLighting();
+ var3.sortAndRender(var2, 0, (double)var1);
+ RenderHelper.enableStandardItemLighting();
+ var3.renderEntities(this.getPlayerPosition(var1), var12, var1);
+ var4.renderLitParticles(var2, var1);
+ RenderHelper.disableStandardItemLighting();
+ this.setupFog(0);
+ var4.renderParticles(var2, var1);
+ if(this.mc.objectMouseOver != null && var2.isInsideOfMaterial(Material.water)) {
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ var3.drawBlockBreaking(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ var3.drawSelectionBox(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ this.setupFog(0);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ if(this.mc.gameSettings.fancyGraphics) {
+ GL11.glColorMask(false, false, false, false);
+ int var13 = var3.sortAndRender(var2, 1, (double)var1);
+ GL11.glColorMask(true, true, true, true);
+ if(this.mc.gameSettings.anaglyph) {
+ if(var11 == 0) {
+ GL11.glColorMask(false, true, true, false);
+ } else {
+ GL11.glColorMask(true, false, false, false);
+ }
+ }
+
+ if(var13 > 0) {
+ var3.renderAllRenderLists(1, (double)var1);
+ }
+ } else {
+ var3.sortAndRender(var2, 1, (double)var1);
+ }
+
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glDisable(GL11.GL_BLEND);
+ if(this.mc.objectMouseOver != null && !var2.isInsideOfMaterial(Material.water)) {
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ var3.drawBlockBreaking(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ var3.drawSelectionBox(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+
+ GL11.glDisable(GL11.GL_FOG);
+ if(this.mc.isRaining) {
+ this.renderRain(var1);
+ }
+
+ if(this.pointedEntity != null) {
+ }
+
+ this.setupFog(0);
+ GL11.glEnable(GL11.GL_FOG);
+ var3.renderClouds(var1);
+ GL11.glDisable(GL11.GL_FOG);
+ this.setupFog(1);
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ this.renderHand(var1, var11);
+ if(!this.mc.gameSettings.anaglyph) {
+ return;
+ }
+ }
+
+ GL11.glColorMask(true, true, true, false);
+ }
+
+ private void addRainParticles() {
+ EntityPlayerSP var1 = this.mc.thePlayer;
+ World var2 = this.mc.theWorld;
+ int var3 = MathHelper.floor_double(var1.posX);
+ int var4 = MathHelper.floor_double(var1.posY);
+ int var5 = MathHelper.floor_double(var1.posZ);
+ byte var6 = 4;
+
+ for(int var7 = 0; var7 < 50; ++var7) {
+ int var8 = var3 + this.random.nextInt(var6 * 2 + 1) - var6;
+ int var9 = var5 + this.random.nextInt(var6 * 2 + 1) - var6;
+ int var10 = var2.getTopSolidOrLiquidBlock(var8, var9);
+ int var11 = var2.getBlockId(var8, var10 - 1, var9);
+ if(var10 <= var4 + var6 && var10 >= var4 - var6) {
+ float var12 = this.random.nextFloat();
+ float var13 = this.random.nextFloat();
+ if(var11 > 0) {
+ this.mc.effectRenderer.addEffect(new EntityRainFX(var2, (double)((float)var8 + var12), (double)((float)var10 + 0.1F) - Block.blocksList[var11].minY, (double)((float)var9 + var13)));
+ }
+ }
+ }
+
+ }
+
+ private void renderRain(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ World var3 = this.mc.theWorld;
+ int var4 = MathHelper.floor_double(var2.posX);
+ int var5 = MathHelper.floor_double(var2.posY);
+ int var6 = MathHelper.floor_double(var2.posZ);
+ Tessellator var7 = Tessellator.instance;
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ GL11.glNormal3f(0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/rain.png"));
+ byte var8 = 5;
+
+ for(int var9 = var4 - var8; var9 <= var4 + var8; ++var9) {
+ for(int var10 = var6 - var8; var10 <= var6 + var8; ++var10) {
+ int var11 = var3.getTopSolidOrLiquidBlock(var9, var10);
+ int var12 = var5 - var8;
+ int var13 = var5 + var8;
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ if(var13 < var11) {
+ var13 = var11;
+ }
+
+ float var14 = 2.0F;
+ if(var12 != var13) {
+ float var15 = ((float)((this.rendererUpdateCount + var9 * 3121 + var10 * 418711) % 32) + var1) / 32.0F;
+ double var16 = (double)((float)var9 + 0.5F) - var2.posX;
+ double var18 = (double)((float)var10 + 0.5F) - var2.posZ;
+ float var20 = MathHelper.sqrt_double(var16 * var16 + var18 * var18) / (float)var8;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - var20 * var20) * 0.7F);
+ var7.startDrawingQuads();
+ var7.addVertexWithUV((double)(var9 + 0), (double)var12, (double)(var10 + 0), (double)(0.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var12, (double)(var10 + 1), (double)(1.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var13, (double)(var10 + 1), (double)(1.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 0), (double)var13, (double)(var10 + 0), (double)(0.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 0), (double)var12, (double)(var10 + 1), (double)(0.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var12, (double)(var10 + 0), (double)(1.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var13, (double)(var10 + 0), (double)(1.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 0), (double)var13, (double)(var10 + 1), (double)(0.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.draw();
+ }
+ }
+ }
+
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public void setupOverlayRendering() {
+ ScaledResolution var1 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var2 = var1.getScaledWidth();
+ int var3 = var1.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var2, (double)var3, 0.0D, 1000.0D, 3000.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
+ }
+
+ private void updateFogColor(float var1) {
+ World var2 = this.mc.theWorld;
+ EntityPlayerSP var3 = this.mc.thePlayer;
+ float var4 = 1.0F / (float)(4 - this.mc.gameSettings.renderDistance);
+ var4 = 1.0F - (float)Math.pow((double)var4, 0.25D);
+ Vec3D var5 = var2.getSkyColor(var1);
+ float var6 = (float)var5.xCoord;
+ float var7 = (float)var5.yCoord;
+ float var8 = (float)var5.zCoord;
+ Vec3D var9 = var2.getFogColor(var1);
+ this.fogColorRed = (float)var9.xCoord;
+ this.fogColorGreen = (float)var9.yCoord;
+ this.fogColorBlue = (float)var9.zCoord;
+ this.fogColorRed += (var6 - this.fogColorRed) * var4;
+ this.fogColorGreen += (var7 - this.fogColorGreen) * var4;
+ this.fogColorBlue += (var8 - this.fogColorBlue) * var4;
+ if(var3.isInsideOfMaterial(Material.water)) {
+ this.fogColorRed = 0.02F;
+ this.fogColorGreen = 0.02F;
+ this.fogColorBlue = 0.2F;
+ } else if(var3.isInsideOfMaterial(Material.lava)) {
+ this.fogColorRed = 0.6F;
+ this.fogColorGreen = 0.1F;
+ this.fogColorBlue = 0.0F;
+ }
+
+ float var10 = this.prevFogColor + (this.fogColor - this.prevFogColor) * var1;
+ this.fogColorRed *= var10;
+ this.fogColorGreen *= var10;
+ this.fogColorBlue *= var10;
+ if(this.mc.gameSettings.anaglyph) {
+ float var11 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F;
+ float var12 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F;
+ float var13 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F;
+ this.fogColorRed = var11;
+ this.fogColorGreen = var12;
+ this.fogColorBlue = var13;
+ }
+
+ GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F);
+ }
+
+ private void setupFog(int var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ 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);
+ float var3;
+ float var4;
+ float var5;
+ float var6;
+ float var7;
+ float var8;
+ if(var2.isInsideOfMaterial(Material.water)) {
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP);
+ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F);
+ var3 = 0.4F;
+ var4 = 0.4F;
+ var5 = 0.9F;
+ if(this.mc.gameSettings.anaglyph) {
+ var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
+ var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
+ var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
+ }
+ } else if(var2.isInsideOfMaterial(Material.lava)) {
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP);
+ GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F);
+ var3 = 0.4F;
+ var4 = 0.3F;
+ var5 = 0.3F;
+ if(this.mc.gameSettings.anaglyph) {
+ var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
+ var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
+ var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
+ }
+ } else {
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR);
+ GL11.glFogf(GL11.GL_FOG_START, this.farPlaneDistance * 0.25F);
+ GL11.glFogf(GL11.GL_FOG_END, this.farPlaneDistance);
+ if(var1 < 0) {
+ GL11.glFogf(GL11.GL_FOG_START, 0.0F);
+ GL11.glFogf(GL11.GL_FOG_END, this.farPlaneDistance * 0.8F);
+ }
+
+ if(GLContext.getCapabilities().GL_NV_fog_distance) {
+ GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV);
+ }
+ }
+
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glColorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT);
+ }
+
+ private FloatBuffer setFogColorBuffer(float var1, float var2, float var3, float var4) {
+ this.fogColorBuffer.clear();
+ this.fogColorBuffer.put(var1).put(var2).put(var3).put(var4);
+ this.fogColorBuffer.flip();
+ return this.fogColorBuffer;
+ }
+}
diff --git a/source/net/minecraft/src/EntitySheep.java b/source/net/minecraft/src/EntitySheep.java
new file mode 100644
index 0000000..33a2bcd
--- /dev/null
+++ b/source/net/minecraft/src/EntitySheep.java
@@ -0,0 +1,49 @@
+package net.minecraft.src;
+
+public class EntitySheep extends EntityAnimal {
+ public boolean sheared = false;
+
+ public EntitySheep(World var1) {
+ super(var1);
+ this.texture = "/mob/sheep.png";
+ this.setSize(0.9F, 1.3F);
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ if(!this.sheared && var1 instanceof EntityLiving) {
+ this.sheared = true;
+ int var3 = 1 + this.rand.nextInt(3);
+
+ for(int var4 = 0; var4 < var3; ++var4) {
+ EntityItem var5 = this.entityDropItem(Block.cloth.blockID, 1, 1.0F);
+ 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);
+ }
+ }
+
+ return super.attackEntityFrom(var1, var2);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ var1.setBoolean("Sheared", this.sheared);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ this.sheared = var1.getBoolean("Sheared");
+ }
+
+ protected String getLivingSound() {
+ return "mob.sheep";
+ }
+
+ protected String getHurtSound() {
+ return "mob.sheep";
+ }
+
+ protected String getDeathSound() {
+ return "mob.sheep";
+ }
+}
diff --git a/source/net/minecraft/src/EntitySkeleton.java b/source/net/minecraft/src/EntitySkeleton.java
new file mode 100644
index 0000000..3508baf
--- /dev/null
+++ b/source/net/minecraft/src/EntitySkeleton.java
@@ -0,0 +1,52 @@
+package net.minecraft.src;
+
+public class EntitySkeleton extends EntityMonster {
+ public EntitySkeleton(World var1) {
+ super(var1);
+ this.texture = "/mob/skeleton.png";
+ }
+
+ public void onLivingUpdate() {
+ if(this.worldObj.isDaytime()) {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 > 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 < (var1 - 0.4F) * 2.0F) {
+ this.fire = 300;
+ }
+ }
+
+ super.onLivingUpdate();
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ if(var2 < 10.0F) {
+ double var3 = var1.posX - this.posX;
+ double var5 = var1.posZ - this.posZ;
+ if(this.attackTime == 0) {
+ EntityArrow var7 = new EntityArrow(this.worldObj, this);
+ var7.posY += (double)1.4F;
+ double var8 = var1.posY - (double)0.2F - var7.posY;
+ float var10 = MathHelper.sqrt_double(var3 * var3 + var5 * var5) * 0.2F;
+ this.worldObj.playSoundAtEntity(this, "random.bow", 1.0F, 1.0F / (this.rand.nextFloat() * 0.4F + 0.8F));
+ this.worldObj.spawnEntityInWorld(var7);
+ var7.setArrowHeading(var3, var8 + (double)var10, var5, 0.6F, 12.0F);
+ this.attackTime = 30;
+ }
+
+ this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / (double)((float)Math.PI)) - 90.0F;
+ this.hasAttacked = true;
+ }
+
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ protected int getDropItemId() {
+ return Item.arrow.shiftedIndex;
+ }
+}
diff --git a/source/net/minecraft/src/EntitySmokeFX.java b/source/net/minecraft/src/EntitySmokeFX.java
new file mode 100644
index 0000000..269a249
--- /dev/null
+++ b/source/net/minecraft/src/EntitySmokeFX.java
@@ -0,0 +1,63 @@
+package net.minecraft.src;
+
+public class EntitySmokeFX extends EntityFX {
+ float smokeParticleScale;
+
+ public EntitySmokeFX(World var1, double var2, double var4, double var6) {
+ this(var1, var2, var4, var6, 1.0F);
+ }
+
+ public EntitySmokeFX(World var1, double var2, double var4, double var6, float var8) {
+ 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.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * (double)0.3F);
+ this.particleScale *= 12.0F / 16.0F;
+ this.particleScale *= var8;
+ this.smokeParticleScale = this.particleScale;
+ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
+ this.particleMaxAge = (int)((float)this.particleMaxAge * var8);
+ 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) {
+ var8 = 0.0F;
+ }
+
+ if(var8 > 1.0F) {
+ var8 = 1.0F;
+ }
+
+ this.particleScale = this.smokeParticleScale * var8;
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ this.particleTextureIndex = 7 - this.particleAge * 8 / this.particleMaxAge;
+ this.motionY += 0.004D;
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ 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;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntitySorter.java b/source/net/minecraft/src/EntitySorter.java
new file mode 100644
index 0000000..f7f866f
--- /dev/null
+++ b/source/net/minecraft/src/EntitySorter.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+import java.util.Comparator;
+
+public class EntitySorter implements Comparator {
+ private Entity comparedEntity;
+
+ public EntitySorter(Entity var1) {
+ this.comparedEntity = var1;
+ }
+
+ public int a(WorldRenderer var1, WorldRenderer var2) {
+ return var1.distanceToEntitySquared(this.comparedEntity) < var2.distanceToEntitySquared(this.comparedEntity) ? -1 : 1;
+ }
+
+ public int compare(Object var1, Object var2) {
+ return this.a((WorldRenderer)var1, (WorldRenderer)var2);
+ }
+}
diff --git a/source/net/minecraft/src/EntitySpider.java b/source/net/minecraft/src/EntitySpider.java
new file mode 100644
index 0000000..98b540f
--- /dev/null
+++ b/source/net/minecraft/src/EntitySpider.java
@@ -0,0 +1,56 @@
+package net.minecraft.src;
+
+public class EntitySpider extends EntityMonster {
+ public EntitySpider(World var1) {
+ super(var1);
+ this.texture = "/mob/spider.png";
+ this.setSize(1.4F, 0.9F);
+ this.moveSpeed = 0.8F;
+ }
+
+ protected Entity findPlayerToAttack() {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 < 0.5F) {
+ double var2 = this.worldObj.playerEntity.getDistanceSqToEntity(this);
+ double var4 = 16.0D;
+ if(var2 < var4 * var4) {
+ return this.worldObj.playerEntity;
+ }
+ }
+
+ return null;
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ float var3 = this.getEntityBrightness(1.0F);
+ if(var3 > 0.5F && this.rand.nextInt(100) == 0) {
+ this.playerToAttack = null;
+ } else {
+ if(var2 > 2.0F && var2 < 6.0F && this.rand.nextInt(10) == 0) {
+ if(this.onGround) {
+ double var4 = var1.posX - this.posX;
+ double var6 = var1.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;
+ }
+ } else {
+ super.attackEntity(var1, var2);
+ }
+
+ }
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ protected int getDropItemId() {
+ return Item.silk.shiftedIndex;
+ }
+}
diff --git a/source/net/minecraft/src/EntitySplashFX.java b/source/net/minecraft/src/EntitySplashFX.java
new file mode 100644
index 0000000..1375ad2
--- /dev/null
+++ b/source/net/minecraft/src/EntitySplashFX.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+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);
+ this.particleGravity = 0.04F;
+ ++this.particleTextureIndex;
+ if(var10 == 0.0D && (var8 != 0.0D || var12 != 0.0D)) {
+ this.motionX = var8;
+ this.motionY = var10 + 0.1D;
+ this.motionZ = var12;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/EntityTNTPrimed.java b/source/net/minecraft/src/EntityTNTPrimed.java
new file mode 100644
index 0000000..9e59e00
--- /dev/null
+++ b/source/net/minecraft/src/EntityTNTPrimed.java
@@ -0,0 +1,68 @@
+package net.minecraft.src;
+
+public class EntityTNTPrimed extends Entity {
+ public int fuse;
+
+ public EntityTNTPrimed(World var1) {
+ super(var1);
+ this.fuse = 0;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.98F);
+ this.yOffset = this.height / 2.0F;
+ }
+
+ public EntityTNTPrimed(World var1, float var2, float var3, float var4) {
+ this(var1);
+ this.setPosition((double)var2, (double)var3, (double)var4);
+ float var5 = (float)(Math.random() * (double)((float)Math.PI) * 2.0D);
+ this.motionX = (double)(-MathHelper.sin(var5 * (float)Math.PI / 180.0F) * 0.02F);
+ this.motionY = (double)0.2F;
+ this.motionZ = (double)(-MathHelper.cos(var5 * (float)Math.PI / 180.0F) * 0.02F);
+ this.canTriggerWalking = false;
+ this.fuse = 80;
+ this.prevPosX = (double)var2;
+ this.prevPosY = (double)var3;
+ this.prevPosZ = (double)var4;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= (double)0.04F;
+ 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.motionY *= -0.5D;
+ }
+
+ if(this.fuse-- <= 0) {
+ this.setEntityDead();
+ this.createExplosion();
+ } else {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ }
+
+ }
+
+ private void createExplosion() {
+ float var1 = 4.0F;
+ this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, var1);
+ }
+
+ protected void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setByte("Fuse", (byte)this.fuse);
+ }
+
+ protected void readEntityFromNBT(NBTTagCompound var1) {
+ this.fuse = var1.getByte("Fuse");
+ }
+}
diff --git a/source/net/minecraft/src/EntityZombie.java b/source/net/minecraft/src/EntityZombie.java
new file mode 100644
index 0000000..5e30538
--- /dev/null
+++ b/source/net/minecraft/src/EntityZombie.java
@@ -0,0 +1,25 @@
+package net.minecraft.src;
+
+public class EntityZombie extends EntityMonster {
+ public EntityZombie(World var1) {
+ super(var1);
+ this.texture = "/mob/zombie.png";
+ this.moveSpeed = 0.5F;
+ this.attackStrength = 5;
+ }
+
+ public void onLivingUpdate() {
+ if(this.worldObj.isDaytime()) {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 > 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 < (var1 - 0.4F) * 2.0F) {
+ this.fire = 300;
+ }
+ }
+
+ super.onLivingUpdate();
+ }
+
+ protected int getDropItemId() {
+ return Item.feather.shiftedIndex;
+ }
+}
diff --git a/source/net/minecraft/src/EnumArt.java b/source/net/minecraft/src/EnumArt.java
new file mode 100644
index 0000000..daa40fa
--- /dev/null
+++ b/source/net/minecraft/src/EnumArt.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public enum EnumArt {
+ Kebab("Kebab", 16, 16, 0, 0),
+ Aztec("Aztec", 16, 16, 16, 0),
+ Alban("Alban", 16, 16, 32, 0),
+ Aztec2("Aztec2", 16, 16, 48, 0),
+ Bomb("Bomb", 16, 16, 64, 0),
+ Plant("Plant", 16, 16, 80, 0),
+ Wasteland("Wasteland", 16, 16, 96, 0),
+ Pool("Pool", 32, 16, 0, 32),
+ Courbet("Courbet", 32, 16, 32, 32),
+ Sea("Sea", 32, 16, 64, 32),
+ Sunset("Sunset", 32, 16, 96, 32),
+ Wanderer("Wanderer", 16, 32, 0, 64),
+ Match("Match", 32, 32, 0, 128),
+ Bust("Bust", 32, 32, 32, 128),
+ Stage("Stage", 32, 32, 64, 128),
+ Void("Void", 32, 32, 96, 128),
+ SkullAndRoses("SkullAndRoses", 32, 32, 128, 128),
+ Fighters("Fighters", 64, 32, 0, 96),
+ Pointer("Pointer", 64, 64, 0, 192);
+
+ 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.title = var3;
+ this.sizeX = var4;
+ this.sizeY = var5;
+ this.offsetX = var6;
+ this.offsetY = var7;
+ }
+}
diff --git a/source/net/minecraft/src/EnumOS.java b/source/net/minecraft/src/EnumOS.java
new file mode 100644
index 0000000..d8447c5
--- /dev/null
+++ b/source/net/minecraft/src/EnumOS.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+enum EnumOS {
+ linux,
+ solaris,
+ windows,
+ macos,
+ unknown;
+}
diff --git a/source/net/minecraft/src/EnumOSIsom.java b/source/net/minecraft/src/EnumOSIsom.java
new file mode 100644
index 0000000..787fa2a
--- /dev/null
+++ b/source/net/minecraft/src/EnumOSIsom.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+enum EnumOSIsom {
+ linux,
+ solaris,
+ windows,
+ macos,
+ unknown;
+}
diff --git a/source/net/minecraft/src/EnumSkyBlock.java b/source/net/minecraft/src/EnumSkyBlock.java
new file mode 100644
index 0000000..92da84b
--- /dev/null
+++ b/source/net/minecraft/src/EnumSkyBlock.java
@@ -0,0 +1,12 @@
+package net.minecraft.src;
+
+public enum EnumSkyBlock {
+ Sky(15),
+ Block(0);
+
+ public final int defaultLightValue;
+
+ private EnumSkyBlock(int var3) {
+ this.defaultLightValue = var3;
+ }
+}
diff --git a/source/net/minecraft/src/Explosion.java b/source/net/minecraft/src/Explosion.java
new file mode 100644
index 0000000..34001ea
--- /dev/null
+++ b/source/net/minecraft/src/Explosion.java
@@ -0,0 +1,130 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+public class Explosion {
+ public void doExplosion(World var1, Entity var2, double var3, double var5, double var7, float var9) {
+ var1.playSoundEffect(var3, var5, var7, "random.explode", 4.0F, (1.0F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.2F) * 0.7F);
+ HashSet var10 = new HashSet();
+ float var11 = var9;
+ byte var12 = 16;
+
+ int var13;
+ int var14;
+ int var15;
+ double var25;
+ double var27;
+ double var29;
+ for(var13 = 0; var13 < var12; ++var13) {
+ for(var14 = 0; var14 < var12; ++var14) {
+ for(var15 = 0; var15 < var12; ++var15) {
+ if(var13 == 0 || var13 == var12 - 1 || var14 == 0 || var14 == var12 - 1 || var15 == 0 || var15 == var12 - 1) {
+ double var16 = (double)((float)var13 / ((float)var12 - 1.0F) * 2.0F - 1.0F);
+ double var18 = (double)((float)var14 / ((float)var12 - 1.0F) * 2.0F - 1.0F);
+ double var20 = (double)((float)var15 / ((float)var12 - 1.0F) * 2.0F - 1.0F);
+ double var22 = Math.sqrt(var16 * var16 + var18 * var18 + var20 * var20);
+ var16 /= var22;
+ var18 /= var22;
+ var20 /= var22;
+ float var24 = var9 * (0.7F + var1.rand.nextFloat() * 0.6F);
+ var25 = var3;
+ var27 = var5;
+ var29 = var7;
+
+ for(float var31 = 0.3F; var24 > 0.0F; var24 -= var31 * (12.0F / 16.0F)) {
+ int var32 = MathHelper.floor_double(var25);
+ int var33 = MathHelper.floor_double(var27);
+ int var34 = MathHelper.floor_double(var29);
+ int var35 = var1.getBlockId(var32, var33, var34);
+ if(var35 > 0) {
+ var24 -= (Block.blocksList[var35].getExplosionResistance(var2) + 0.3F) * var31;
+ }
+
+ if(var24 > 0.0F) {
+ var10.add(new ChunkPosition(var32, var33, var34));
+ }
+
+ var25 += var16 * (double)var31;
+ var27 += var18 * (double)var31;
+ var29 += var20 * (double)var31;
+ }
+ }
+ }
+ }
+ }
+
+ var9 *= 2.0F;
+ var13 = MathHelper.floor_double(var3 - (double)var9 - 1.0D);
+ var14 = MathHelper.floor_double(var3 + (double)var9 + 1.0D);
+ var15 = MathHelper.floor_double(var5 - (double)var9 - 1.0D);
+ int var45 = MathHelper.floor_double(var5 + (double)var9 + 1.0D);
+ int var17 = MathHelper.floor_double(var7 - (double)var9 - 1.0D);
+ int var46 = MathHelper.floor_double(var7 + (double)var9 + 1.0D);
+ List var19 = var1.getEntitiesWithinAABBExcludingEntity(var2, AxisAlignedBB.getBoundingBoxFromPool((double)var13, (double)var15, (double)var17, (double)var14, (double)var45, (double)var46));
+ Vec3D var47 = Vec3D.createVector(var3, var5, var7);
+
+ double var55;
+ double var56;
+ double var57;
+ for(int var21 = 0; var21 < var19.size(); ++var21) {
+ Entity var49 = (Entity)var19.get(var21);
+ double var23 = var49.getDistance(var3, var5, var7) / (double)var9;
+ if(var23 <= 1.0D) {
+ var25 = var49.posX - var3;
+ var27 = var49.posY - var5;
+ var29 = var49.posZ - var7;
+ var55 = (double)MathHelper.sqrt_double(var25 * var25 + var27 * var27 + var29 * var29);
+ var25 /= var55;
+ var27 /= var55;
+ var29 /= var55;
+ var56 = (double)var1.getBlockDensity(var47, var49.boundingBox);
+ var57 = (1.0D - var23) * var56;
+ var49.attackEntityFrom(var2, (int)((var57 * var57 + var57) / 2.0D * 8.0D * (double)var9 + 1.0D));
+ var49.motionX += var25 * var57;
+ var49.motionY += var27 * var57;
+ var49.motionZ += var29 * var57;
+ }
+ }
+
+ var9 = var11;
+ ArrayList var48 = new ArrayList();
+ var48.addAll(var10);
+
+ for(int var50 = var48.size() - 1; var50 >= 0; --var50) {
+ ChunkPosition var51 = (ChunkPosition)var48.get(var50);
+ int var52 = var51.x;
+ int var53 = var51.y;
+ int var26 = var51.z;
+ int var54 = var1.getBlockId(var52, var53, var26);
+
+ for(int var28 = 0; var28 < 1; ++var28) {
+ var29 = (double)((float)var52 + var1.rand.nextFloat());
+ var55 = (double)((float)var53 + var1.rand.nextFloat());
+ var56 = (double)((float)var26 + var1.rand.nextFloat());
+ var57 = var29 - var3;
+ double var37 = var55 - var5;
+ double var39 = var56 - var7;
+ double var41 = (double)MathHelper.sqrt_double(var57 * var57 + var37 * var37 + var39 * var39);
+ var57 /= var41;
+ var37 /= var41;
+ var39 /= var41;
+ double var43 = 0.5D / (var41 / (double)var9 + 0.1D);
+ var43 *= (double)(var1.rand.nextFloat() * var1.rand.nextFloat() + 0.3F);
+ var57 *= var43;
+ var37 *= var43;
+ var39 *= var43;
+ var1.spawnParticle("explode", (var29 + var3 * 1.0D) / 2.0D, (var55 + var5 * 1.0D) / 2.0D, (var56 + var7 * 1.0D) / 2.0D, var57, var37, var39);
+ var1.spawnParticle("smoke", var29, var55, var56, var57, var37, var39);
+ }
+
+ if(var54 > 0) {
+ Block.blocksList[var54].dropBlockAsItemWithChance(var1, var52, var53, var26, var1.getBlockMetadata(var52, var53, var26), 0.3F);
+ var1.setBlockWithNotify(var52, var53, var26, 0);
+ Block.blocksList[var54].onBlockDestroyedByExplosion(var1, var52, var53, var26);
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/FontRenderer.java b/source/net/minecraft/src/FontRenderer.java
new file mode 100644
index 0000000..e8b6015
--- /dev/null
+++ b/source/net/minecraft/src/FontRenderer.java
@@ -0,0 +1,177 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.nio.IntBuffer;
+import javax.imageio.ImageIO;
+import org.lwjgl.opengl.GL11;
+
+public class FontRenderer {
+ private int[] charWidth = new int[256];
+ private int fontTextureName = 0;
+ private int fontDisplayLists;
+ private IntBuffer buffer = GLAllocation.createIntBuffer(1024);
+
+ public FontRenderer(GameSettings var1, String var2, RenderEngine var3) {
+ BufferedImage var4;
+ try {
+ var4 = ImageIO.read(RenderEngine.class.getResourceAsStream(var2));
+ } catch (IOException var18) {
+ throw new RuntimeException(var18);
+ }
+
+ int var5 = var4.getWidth();
+ int var6 = var4.getHeight();
+ int[] var7 = new int[var5 * var6];
+ var4.getRGB(0, 0, var5, var6, var7, 0, var5);
+
+ int var9;
+ int var10;
+ int var11;
+ int var13;
+ int var15;
+ int var16;
+ for(int var8 = 0; var8 < 128; ++var8) {
+ var9 = var8 % 16;
+ var10 = var8 / 16;
+ var11 = 0;
+
+ for(boolean var12 = false; var11 < 8 && !var12; ++var11) {
+ var13 = var9 * 8 + var11;
+ var12 = true;
+
+ for(int var14 = 0; var14 < 8 && var12; ++var14) {
+ var15 = (var10 * 8 + var14) * var5;
+ var16 = var7[var13 + var15] & 255;
+ if(var16 > 128) {
+ var12 = false;
+ }
+ }
+ }
+
+ if(var8 == 32) {
+ var11 = 4;
+ }
+
+ this.charWidth[var8] = var11;
+ }
+
+ this.fontTextureName = var3.getTexture(var2);
+ this.fontDisplayLists = GLAllocation.generateDisplayLists(288);
+ Tessellator var19 = Tessellator.instance;
+
+ for(var9 = 0; var9 < 256; ++var9) {
+ GL11.glNewList(this.fontDisplayLists + var9, GL11.GL_COMPILE);
+ var19.startDrawingQuads();
+ var10 = var9 % 16 * 8;
+ var11 = var9 / 16 * 8;
+ float var20 = 7.99F;
+ var19.addVertexWithUV(0.0D, (double)(0.0F + var20), 0.0D, (double)((float)var10 / 128.0F), (double)(((float)var11 + var20) / 128.0F));
+ var19.addVertexWithUV((double)(0.0F + var20), (double)(0.0F + var20), 0.0D, (double)(((float)var10 + var20) / 128.0F), (double)(((float)var11 + var20) / 128.0F));
+ var19.addVertexWithUV((double)(0.0F + var20), 0.0D, 0.0D, (double)(((float)var10 + var20) / 128.0F), (double)((float)var11 / 128.0F));
+ var19.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)((float)var10 / 128.0F), (double)((float)var11 / 128.0F));
+ var19.draw();
+ GL11.glTranslatef((float)this.charWidth[var9], 0.0F, 0.0F);
+ GL11.glEndList();
+ }
+
+ for(var9 = 0; var9 < 32; ++var9) {
+ var10 = (var9 & 8) * 8;
+ var11 = (var9 & 1) * 191 + var10;
+ int var21 = ((var9 & 2) >> 1) * 191 + var10;
+ var13 = ((var9 & 4) >> 2) * 191 + var10;
+ boolean var22 = var9 >= 16;
+ if(var1.anaglyph) {
+ var15 = (var13 * 30 + var21 * 59 + var11 * 11) / 100;
+ var16 = (var13 * 30 + var21 * 70) / 100;
+ int var17 = (var13 * 30 + var11 * 70) / 100;
+ var13 = var15;
+ var21 = var16;
+ var11 = var17;
+ }
+
+ var9 += 2;
+ if(var22) {
+ var13 /= 4;
+ var21 /= 4;
+ var11 /= 4;
+ }
+
+ GL11.glColor4f((float)var13 / 255.0F, (float)var21 / 255.0F, (float)var11 / 255.0F, 1.0F);
+ }
+
+ }
+
+ public void drawStringWithShadow(String var1, int var2, int var3, int var4) {
+ this.renderString(var1, var2 + 1, var3 + 1, var4, true);
+ this.drawString(var1, var2, var3, var4);
+ }
+
+ public void drawString(String var1, int var2, int var3, int var4) {
+ this.renderString(var1, var2, var3, var4, false);
+ }
+
+ public void renderString(String var1, int var2, int var3, int var4, boolean var5) {
+ if(var1 != null) {
+ if(var5) {
+ var4 = (var4 & 16579836) >> 2;
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.fontTextureName);
+ float var6 = (float)(var4 >> 16 & 255) / 255.0F;
+ float var7 = (float)(var4 >> 8 & 255) / 255.0F;
+ float var8 = (float)(var4 & 255) / 255.0F;
+ float var9 = (float)(var4 >> 24 & 255) / 255.0F;
+ var9 = 1.0F;
+ GL11.glColor4f(var6, var7, var8, var9);
+ this.buffer.clear();
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var3, 0.0F);
+
+ for(int var10 = 0; var10 < var1.length(); ++var10) {
+ for(; var1.charAt(var10) == 38 && var1.length() > var10 + 1; var10 += 2) {
+ int var11 = "0123456789abcdef".indexOf(var1.charAt(var10 + 1));
+ if(var11 < 0 || var11 > 15) {
+ var11 = 15;
+ }
+
+ this.buffer.put(this.fontDisplayLists + 256 + var11 + (var5 ? 16 : 0));
+ if(this.buffer.remaining() == 0) {
+ this.buffer.flip();
+ GL11.glCallLists(this.buffer);
+ this.buffer.clear();
+ }
+ }
+
+ this.buffer.put(this.fontDisplayLists + var1.charAt(var10));
+ if(this.buffer.remaining() == 0) {
+ this.buffer.flip();
+ GL11.glCallLists(this.buffer);
+ this.buffer.clear();
+ }
+ }
+
+ this.buffer.flip();
+ GL11.glCallLists(this.buffer);
+ GL11.glPopMatrix();
+ }
+ }
+
+ public int getStringWidth(String var1) {
+ if(var1 == null) {
+ return 0;
+ } else {
+ int var2 = 0;
+
+ for(int var3 = 0; var3 < var1.length(); ++var3) {
+ if(var1.charAt(var3) == 38) {
+ ++var3;
+ } else {
+ var2 += this.charWidth[var1.charAt(var3)];
+ }
+ }
+
+ return var2;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/Frustrum.java b/source/net/minecraft/src/Frustrum.java
new file mode 100644
index 0000000..ad411d9
--- /dev/null
+++ b/source/net/minecraft/src/Frustrum.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+public class Frustrum implements ICamera {
+ private ClippingHelper clippingHelper = ClippingHelperImplementation.getInstance();
+ private double xPosition;
+ 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);
+ }
+}
diff --git a/source/net/minecraft/src/GLAllocation.java b/source/net/minecraft/src/GLAllocation.java
new file mode 100644
index 0000000..bcde76b
--- /dev/null
+++ b/source/net/minecraft/src/GLAllocation.java
@@ -0,0 +1,62 @@
+package net.minecraft.src;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import org.lwjgl.opengl.GL11;
+
+public class GLAllocation {
+ private static List displayLists = new ArrayList();
+ private static List textureNames = new ArrayList();
+
+ public static synchronized int generateDisplayLists(int var0) {
+ int var1 = GL11.glGenLists(var0);
+ displayLists.add(Integer.valueOf(var1));
+ displayLists.add(Integer.valueOf(var0));
+ return var1;
+ }
+
+ public static synchronized void generateDisplayLists(IntBuffer var0) {
+ GL11.glGenTextures(var0);
+
+ for(int var1 = var0.position(); var1 < var0.limit(); ++var1) {
+ textureNames.add(Integer.valueOf(var0.get(var1)));
+ }
+
+ }
+
+ public static synchronized void deleteTexturesAndDisplayLists() {
+ for(int var0 = 0; var0 < displayLists.size(); var0 += 2) {
+ GL11.glDeleteLists(((Integer)displayLists.get(var0)).intValue(), ((Integer)displayLists.get(var0 + 1)).intValue());
+ }
+
+ IntBuffer var2 = createIntBuffer(textureNames.size());
+ var2.flip();
+ GL11.glDeleteTextures(var2);
+
+ for(int var1 = 0; var1 < textureNames.size(); ++var1) {
+ var2.put(((Integer)textureNames.get(var1)).intValue());
+ }
+
+ var2.flip();
+ GL11.glDeleteTextures(var2);
+ displayLists.clear();
+ textureNames.clear();
+ }
+
+ public static synchronized ByteBuffer createDirectByteBuffer(int var0) {
+ ByteBuffer var1 = ByteBuffer.allocateDirect(var0).order(ByteOrder.nativeOrder());
+ return var1;
+ }
+
+ public static IntBuffer createIntBuffer(int var0) {
+ return createDirectByteBuffer(var0 << 2).asIntBuffer();
+ }
+
+ public static FloatBuffer createFloatBuffer(int var0) {
+ return createDirectByteBuffer(var0 << 2).asFloatBuffer();
+ }
+}
diff --git a/source/net/minecraft/src/GameSettings.java b/source/net/minecraft/src/GameSettings.java
new file mode 100644
index 0000000..9416cfd
--- /dev/null
+++ b/source/net/minecraft/src/GameSettings.java
@@ -0,0 +1,202 @@
+package net.minecraft.src;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import org.lwjgl.input.Keyboard;
+
+public class GameSettings {
+ private static final String[] RENDER_DISTANCES = new String[]{"FAR", "NORMAL", "SHORT", "TINY"};
+ private static final String[] DIFFICULTIES = new String[]{"Peaceful", "Easy", "Normal", "Hard"};
+ public boolean music = true;
+ public boolean sound = true;
+ public boolean invertMouse = false;
+ public boolean showFPS = false;
+ public int renderDistance = 0;
+ public boolean viewBobbing = true;
+ public boolean anaglyph = false;
+ public boolean limitFramerate = false;
+ public boolean fancyGraphics = true;
+ public KeyBinding keyBindForward = new KeyBinding("Forward", 17);
+ public KeyBinding keyBindLeft = new KeyBinding("Left", 30);
+ public KeyBinding keyBindBack = new KeyBinding("Back", 31);
+ public KeyBinding keyBindRight = new KeyBinding("Right", 32);
+ public KeyBinding keyBindJump = new KeyBinding("Jump", 57);
+ public KeyBinding keyBindInventory = new KeyBinding("Inventory", 23);
+ public KeyBinding keyBindDrop = new KeyBinding("Drop", 16);
+ public KeyBinding keyBindChat = new KeyBinding("Chat", 20);
+ public KeyBinding keyBindToggleFog = new KeyBinding("Toggle fog", 33);
+ public KeyBinding keyBindSave = new KeyBinding("Save location", 28);
+ public KeyBinding keyBindLoad = new KeyBinding("Load location", 19);
+ public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog, this.keyBindSave, this.keyBindLoad};
+ protected Minecraft mc;
+ private File optionsFile;
+ public int numberOfOptions = 10;
+ public int difficulty = 2;
+ public boolean thirdPersonView = false;
+
+ public GameSettings(Minecraft var1, File var2) {
+ this.mc = var1;
+ this.optionsFile = new File(var2, "options.txt");
+ this.loadOptions();
+ }
+
+ public String getOptionDisplayString(int var1) {
+ return this.keyBindings[var1].keyDescription + ": " + Keyboard.getKeyName(this.keyBindings[var1].keyCode);
+ }
+
+ public void setKeyBinding(int var1, int var2) {
+ this.keyBindings[var1].keyCode = var2;
+ this.saveOptions();
+ }
+
+ public void setOptionFloatValue(int var1, int var2) {
+ if(var1 == 0) {
+ this.music = !this.music;
+ this.mc.sndManager.onSoundOptionsChanged();
+ }
+
+ if(var1 == 1) {
+ this.sound = !this.sound;
+ this.mc.sndManager.onSoundOptionsChanged();
+ }
+
+ if(var1 == 2) {
+ this.invertMouse = !this.invertMouse;
+ }
+
+ if(var1 == 3) {
+ this.showFPS = !this.showFPS;
+ }
+
+ if(var1 == 4) {
+ this.renderDistance = this.renderDistance + var2 & 3;
+ }
+
+ if(var1 == 5) {
+ this.viewBobbing = !this.viewBobbing;
+ }
+
+ if(var1 == 6) {
+ this.anaglyph = !this.anaglyph;
+ this.mc.renderEngine.refreshTextures();
+ }
+
+ if(var1 == 7) {
+ this.limitFramerate = !this.limitFramerate;
+ }
+
+ if(var1 == 8) {
+ this.difficulty = this.difficulty + var2 & 3;
+ }
+
+ if(var1 == 9) {
+ this.fancyGraphics = !this.fancyGraphics;
+ this.mc.renderGlobal.loadRenderers();
+ }
+
+ this.saveOptions();
+ }
+
+ public String getKeyBinding(int var1) {
+ return var1 == 0 ? "Music: " + (this.music ? "ON" : "OFF") : (var1 == 1 ? "Sound: " + (this.sound ? "ON" : "OFF") : (var1 == 2 ? "Invert mouse: " + (this.invertMouse ? "ON" : "OFF") : (var1 == 3 ? "Show FPS: " + (this.showFPS ? "ON" : "OFF") : (var1 == 4 ? "Render distance: " + RENDER_DISTANCES[this.renderDistance] : (var1 == 5 ? "View bobbing: " + (this.viewBobbing ? "ON" : "OFF") : (var1 == 6 ? "3d anaglyph: " + (this.anaglyph ? "ON" : "OFF") : (var1 == 7 ? "Limit framerate: " + (this.limitFramerate ? "ON" : "OFF") : (var1 == 8 ? "Difficulty: " + DIFFICULTIES[this.difficulty] : (var1 == 9 ? "Graphics: " + (this.fancyGraphics ? "FANCY" : "FAST") : "")))))))));
+ }
+
+ public void loadOptions() {
+ try {
+ if(!this.optionsFile.exists()) {
+ return;
+ }
+
+ BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile));
+ String var2 = "";
+
+ while(true) {
+ var2 = var1.readLine();
+ if(var2 == null) {
+ var1.close();
+ break;
+ }
+
+ String[] var3 = var2.split(":");
+ if(var3[0].equals("music")) {
+ this.music = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("sound")) {
+ this.sound = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("invertYMouse")) {
+ this.invertMouse = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("showFrameRate")) {
+ this.showFPS = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("viewDistance")) {
+ this.renderDistance = Integer.parseInt(var3[1]);
+ }
+
+ if(var3[0].equals("bobView")) {
+ this.viewBobbing = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("anaglyph3d")) {
+ this.anaglyph = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("limitFramerate")) {
+ this.limitFramerate = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("difficulty")) {
+ this.difficulty = Integer.parseInt(var3[1]);
+ }
+
+ if(var3[0].equals("fancyGraphics")) {
+ this.fancyGraphics = var3[1].equals("true");
+ }
+
+ 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]);
+ }
+ }
+ }
+ } catch (Exception var5) {
+ System.out.println("Failed to load options");
+ var5.printStackTrace();
+ }
+
+ }
+
+ public void saveOptions() {
+ try {
+ PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile));
+ var1.println("music:" + this.music);
+ var1.println("sound:" + this.sound);
+ var1.println("invertYMouse:" + this.invertMouse);
+ var1.println("showFrameRate:" + this.showFPS);
+ var1.println("viewDistance:" + this.renderDistance);
+ var1.println("bobView:" + this.viewBobbing);
+ var1.println("anaglyph3d:" + this.anaglyph);
+ var1.println("limitFramerate:" + this.limitFramerate);
+ var1.println("difficulty:" + this.difficulty);
+ var1.println("fancyGraphics:" + this.fancyGraphics);
+
+ for(int var2 = 0; var2 < this.keyBindings.length; ++var2) {
+ var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode);
+ }
+
+ var1.close();
+ } catch (Exception var3) {
+ System.out.println("Failed to save options");
+ var3.printStackTrace();
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/Gui.java b/source/net/minecraft/src/Gui.java
new file mode 100644
index 0000000..8b4c529
--- /dev/null
+++ b/source/net/minecraft/src/Gui.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class Gui {
+ protected float zLevel = 0.0F;
+
+ 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;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Tessellator var15 = Tessellator.instance;
+ var15.startDrawingQuads();
+ var15.setColorRGBA_F(var8, var9, var10, var7);
+ var15.addVertex((double)var3, (double)var2, 0.0D);
+ var15.addVertex((double)var1, (double)var2, 0.0D);
+ var15.setColorRGBA_F(var12, var13, var14, var11);
+ var15.addVertex((double)var1, (double)var4, 0.0D);
+ var15.addVertex((double)var3, (double)var4, 0.0D);
+ var15.draw();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ 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) {
+ 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.draw();
+ }
+}
diff --git a/source/net/minecraft/src/GuiButton.java b/source/net/minecraft/src/GuiButton.java
new file mode 100644
index 0000000..3fbe2be
--- /dev/null
+++ b/source/net/minecraft/src/GuiButton.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiButton extends Gui {
+ private int width;
+ private int height;
+ public int xPosition;
+ public int yPosition;
+ public String displayString;
+ public int id;
+ public boolean enabled;
+ public boolean enabled2;
+
+ public GuiButton(int var1, int var2, int var3, String var4) {
+ this(var1, var2, var3, 200, 20, var4);
+ }
+
+ protected GuiButton(int var1, int var2, int var3, int var4, int var5, String var6) {
+ this.width = 200;
+ this.height = 20;
+ this.enabled = true;
+ this.enabled2 = true;
+ this.id = var1;
+ this.xPosition = var2;
+ this.yPosition = var3;
+ this.width = var4;
+ this.height = var5;
+ this.displayString = var6;
+ }
+
+ public void drawButton(Minecraft var1, int var2, int var3) {
+ if(this.enabled2) {
+ FontRenderer var4 = var1.fontRenderer;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.renderEngine.getTexture("/gui/gui.png"));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ byte var5 = 1;
+ boolean var6 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height;
+ if(!this.enabled) {
+ var5 = 0;
+ } else if(var6) {
+ var5 = 2;
+ }
+
+ 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);
+ if(!this.enabled) {
+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, -6250336);
+ } else if(var6) {
+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 16777120);
+ } else {
+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 14737632);
+ }
+
+ }
+ }
+
+ public boolean mousePressed(int var1, int var2) {
+ return this.enabled && var1 >= this.xPosition && var2 >= this.yPosition && var1 < this.xPosition + this.width && var2 < this.yPosition + this.height;
+ }
+}
diff --git a/source/net/minecraft/src/GuiChest.java b/source/net/minecraft/src/GuiChest.java
new file mode 100644
index 0000000..730e7f4
--- /dev/null
+++ b/source/net/minecraft/src/GuiChest.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiChest extends GuiContainer {
+ private IInventory upperChestInventory;
+ private IInventory lowerChestInventory;
+ private int inventoryRows = 0;
+
+ public GuiChest(IInventory var1, IInventory var2) {
+ this.upperChestInventory = var1;
+ this.lowerChestInventory = var2;
+ this.allowUserInput = false;
+ short var3 = 222;
+ int var4 = var3 - 108;
+ this.inventoryRows = var2.getSizeInventory() / 9;
+ this.ySize = var4 + this.inventoryRows * 18;
+ int var5 = (this.inventoryRows - 4) * 18;
+
+ int var6;
+ int var7;
+ for(var6 = 0; var6 < this.inventoryRows; ++var6) {
+ for(var7 = 0; var7 < 9; ++var7) {
+ this.inventorySlots.add(new Slot(this, var2, var7 + var6 * 9, 8 + var7 * 18, 18 + var6 * 18));
+ }
+ }
+
+ for(var6 = 0; var6 < 3; ++var6) {
+ for(var7 = 0; var7 < 9; ++var7) {
+ this.inventorySlots.add(new Slot(this, var1, var7 + (var6 + 1) * 9, 8 + var7 * 18, 103 + var6 * 18 + var5));
+ }
+ }
+
+ for(var6 = 0; var6 < 9; ++var6) {
+ this.inventorySlots.add(new Slot(this, var1, var6, 8 + var6 * 18, 161 + var5));
+ }
+
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString(this.lowerChestInventory.getInvName(), 8, 6, 4210752);
+ this.fontRenderer.drawString(this.upperChestInventory.getInvName(), 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/container.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
+ this.drawTexturedModalRect(var3, var4 + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
+ }
+}
diff --git a/source/net/minecraft/src/GuiContainer.java b/source/net/minecraft/src/GuiContainer.java
new file mode 100644
index 0000000..4e3e8fe
--- /dev/null
+++ b/source/net/minecraft/src/GuiContainer.java
@@ -0,0 +1,226 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public abstract class GuiContainer extends GuiScreen {
+ private static RenderItem itemRenderer = new RenderItem();
+ private ItemStack draggedItemStack = null;
+ protected int xSize = 176;
+ protected int ySize = 166;
+ protected List inventorySlots = new ArrayList();
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ int var4 = (this.width - this.xSize) / 2;
+ int var5 = (this.height - this.ySize) / 2;
+ this.drawGuiContainerBackgroundLayer(var3);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var4, (float)var5, 0.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+
+ for(int var6 = 0; var6 < this.inventorySlots.size(); ++var6) {
+ Slot var7 = (Slot)this.inventorySlots.get(var6);
+ this.drawSlotInventory(var7);
+ if(var7.getIsMouseOverSlot(var1, var2)) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ int var8 = var7.xDisplayPosition;
+ int var9 = var7.yDisplayPosition;
+ this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ }
+ }
+
+ if(this.draggedItemStack != null) {
+ GL11.glTranslatef(0.0F, 0.0F, 32.0F);
+ itemRenderer.drawItemIntoGui(this.fontRenderer, this.mc.renderEngine, this.draggedItemStack, var1 - var4 - 8, var2 - var5 - 8);
+ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, this.draggedItemStack, var1 - var4 - 8, var2 - var5 - 8);
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ this.drawGuiContainerForegroundLayer();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glPopMatrix();
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ }
+
+ protected abstract void drawGuiContainerBackgroundLayer(float var1);
+
+ private void drawSlotInventory(Slot var1) {
+ IInventory var2 = var1.inventory;
+ int var3 = var1.slotIndex;
+ int var4 = var1.xDisplayPosition;
+ int var5 = var1.yDisplayPosition;
+ ItemStack var6 = var2.getStackInSlot(var3);
+ if(var6 == null) {
+ int var7 = var1.getBackgroundIconIndex();
+ if(var7 >= 0) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/items.png"));
+ this.drawTexturedModalRect(var4, var5, var7 % 16 * 16, var7 / 16 * 16, 16, 16);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ return;
+ }
+ }
+
+ itemRenderer.drawItemIntoGui(this.fontRenderer, this.mc.renderEngine, var6, var4, var5);
+ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var6, var4, var5);
+ }
+
+ private Slot getSlotAtPosition(int var1, int var2) {
+ for(int var3 = 0; var3 < this.inventorySlots.size(); ++var3) {
+ Slot var4 = (Slot)this.inventorySlots.get(var3);
+ if(var4.getIsMouseOverSlot(var1, var2)) {
+ return var4;
+ }
+ }
+
+ return null;
+ }
+
+ protected void mouseClicked(int var1, int var2, int var3) {
+ if(var3 == 0 || var3 == 1) {
+ Slot var4 = this.getSlotAtPosition(var1, var2);
+ int var6;
+ if(var4 != null) {
+ var4.onSlotChanged();
+ ItemStack var5 = var4.getStack();
+ if(var5 != null || this.draggedItemStack != null) {
+ if(var5 != null && this.draggedItemStack == null) {
+ var6 = var3 == 0 ? var5.stackSize : (var5.stackSize + 1) / 2;
+ this.draggedItemStack = var4.inventory.decrStackSize(var4.slotIndex, var6);
+ if(var5.stackSize == 0) {
+ var4.putStack((ItemStack)null);
+ }
+
+ var4.onPickupFromSlot();
+ } else if(var5 == null && this.draggedItemStack != null && var4.isItemValid(this.draggedItemStack)) {
+ var6 = var3 == 0 ? this.draggedItemStack.stackSize : 1;
+ if(var6 > var4.inventory.getInventoryStackLimit()) {
+ var6 = var4.inventory.getInventoryStackLimit();
+ }
+
+ var4.putStack(this.draggedItemStack.splitStack(var6));
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+ } else if(var5 != null && this.draggedItemStack != null) {
+ if(var4.isItemValid(this.draggedItemStack)) {
+ if(var5.itemID != this.draggedItemStack.itemID) {
+ if(this.draggedItemStack.stackSize <= var4.inventory.getInventoryStackLimit()) {
+ var4.putStack(this.draggedItemStack);
+ this.draggedItemStack = var5;
+ }
+ } else if(var5.itemID == this.draggedItemStack.itemID) {
+ if(var3 == 0) {
+ var6 = this.draggedItemStack.stackSize;
+ if(var6 > var4.inventory.getInventoryStackLimit() - var5.stackSize) {
+ var6 = var4.inventory.getInventoryStackLimit() - var5.stackSize;
+ }
+
+ if(var6 > this.draggedItemStack.getMaxStackSize() - var5.stackSize) {
+ var6 = this.draggedItemStack.getMaxStackSize() - var5.stackSize;
+ }
+
+ this.draggedItemStack.splitStack(var6);
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+
+ var5.stackSize += var6;
+ } else if(var3 == 1) {
+ var6 = 1;
+ if(var6 > var4.inventory.getInventoryStackLimit() - var5.stackSize) {
+ var6 = var4.inventory.getInventoryStackLimit() - var5.stackSize;
+ }
+
+ if(var6 > this.draggedItemStack.getMaxStackSize() - var5.stackSize) {
+ var6 = this.draggedItemStack.getMaxStackSize() - var5.stackSize;
+ }
+
+ this.draggedItemStack.splitStack(var6);
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+
+ var5.stackSize += var6;
+ }
+ }
+ } else if(var5.itemID == this.draggedItemStack.itemID && this.draggedItemStack.getMaxStackSize() > 1) {
+ var6 = var5.stackSize;
+ if(var6 > 0 && var6 + this.draggedItemStack.stackSize <= this.draggedItemStack.getMaxStackSize()) {
+ this.draggedItemStack.stackSize += var6;
+ var5.splitStack(var6);
+ if(var5.stackSize == 0) {
+ var4.putStack((ItemStack)null);
+ }
+
+ var4.onPickupFromSlot();
+ }
+ }
+ }
+ }
+ } else if(this.draggedItemStack != null) {
+ int var8 = (this.width - this.xSize) / 2;
+ var6 = (this.height - this.ySize) / 2;
+ if(var1 < var8 || var2 < var6 || var1 >= var8 + this.xSize || var2 >= var6 + this.xSize) {
+ EntityPlayerSP var7 = this.mc.thePlayer;
+ if(var3 == 0) {
+ var7.dropPlayerItem(this.draggedItemStack);
+ this.draggedItemStack = null;
+ }
+
+ if(var3 == 1) {
+ var7.dropPlayerItem(this.draggedItemStack.splitStack(1));
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ protected void mouseMovedOrUp(int var1, int var2, int var3) {
+ if(var3 == 0) {
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(var2 == 1 || var2 == this.mc.gameSettings.keyBindInventory.keyCode) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+
+ }
+
+ public void onGuiClosed() {
+ if(this.draggedItemStack != null) {
+ this.mc.thePlayer.dropPlayerItem(this.draggedItemStack);
+ }
+
+ }
+
+ public void onCraftMatrixChanged(IInventory var1) {
+ }
+
+ public boolean doesGuiPauseGame() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/GuiControls.java b/source/net/minecraft/src/GuiControls.java
new file mode 100644
index 0000000..0d185df
--- /dev/null
+++ b/source/net/minecraft/src/GuiControls.java
@@ -0,0 +1,52 @@
+package net.minecraft.src;
+
+public class GuiControls extends GuiScreen {
+ private GuiScreen parentScreen;
+ protected String screenTitle = "Controls";
+ private GameSettings options;
+ private int buttonId = -1;
+
+ public GuiControls(GuiScreen var1, GameSettings var2) {
+ this.parentScreen = var1;
+ this.options = var2;
+ }
+
+ public void initGui() {
+ for(int var1 = 0; var1 < this.options.keyBindings.length; ++var1) {
+ this.controlList.add(new GuiSmallButton(var1, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), this.options.getOptionDisplayString(var1)));
+ }
+
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, "Done"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ for(int var2 = 0; var2 < this.options.keyBindings.length; ++var2) {
+ ((GuiButton)this.controlList.get(var2)).displayString = this.options.getOptionDisplayString(var2);
+ }
+
+ if(var1.id == 200) {
+ this.mc.displayGuiScreen(this.parentScreen);
+ } else {
+ this.buttonId = var1.id;
+ var1.displayString = "> " + this.options.getOptionDisplayString(var1.id) + " <";
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(this.buttonId >= 0) {
+ this.options.setKeyBinding(this.buttonId, var2);
+ ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
+ this.buttonId = -1;
+ } else {
+ super.keyTyped(var1, var2);
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/GuiCrafting.java b/source/net/minecraft/src/GuiCrafting.java
new file mode 100644
index 0000000..81fe8aa
--- /dev/null
+++ b/source/net/minecraft/src/GuiCrafting.java
@@ -0,0 +1,75 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiCrafting extends GuiContainer {
+ private InventoryCrafting inventoryCrafting = new InventoryCrafting(this, 3, 3);
+ private IInventory iInventory = new InventoryCraftResult();
+
+ public GuiCrafting(InventoryPlayer var1) {
+ this.inventorySlots.add(new SlotCrafting(this, this.inventoryCrafting, this.iInventory, 0, 124, 35));
+
+ int var2;
+ int var3;
+ for(var2 = 0; var2 < 3; ++var2) {
+ for(var3 = 0; var3 < 3; ++var3) {
+ this.inventorySlots.add(new Slot(this, this.inventoryCrafting, var3 + var2 * 3, 30 + var3 * 18, 17 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 3; ++var2) {
+ for(var3 = 0; var3 < 9; ++var3) {
+ this.inventorySlots.add(new Slot(this, var1, var3 + (var2 + 1) * 9, 8 + var3 * 18, 84 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 9; ++var2) {
+ this.inventorySlots.add(new Slot(this, var1, var2, 8 + var2 * 18, 142));
+ }
+
+ }
+
+ public void onGuiClosed() {
+ super.onGuiClosed();
+
+ for(int var1 = 0; var1 < 9; ++var1) {
+ ItemStack var2 = this.inventoryCrafting.getStackInSlot(var1);
+ if(var2 != null) {
+ this.mc.thePlayer.dropPlayerItem(var2);
+ }
+ }
+
+ }
+
+ public void onCraftMatrixChanged(IInventory var1) {
+ int[] var2 = new int[9];
+
+ for(int var3 = 0; var3 < 3; ++var3) {
+ for(int var4 = 0; var4 < 3; ++var4) {
+ int var5 = var3 + var4 * 3;
+ ItemStack var6 = this.inventoryCrafting.getStackInSlot(var5);
+ if(var6 == null) {
+ var2[var5] = -1;
+ } else {
+ var2[var5] = var6.itemID;
+ }
+ }
+ }
+
+ this.iInventory.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(var2));
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString("Crafting", 28, 6, 4210752);
+ this.fontRenderer.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/crafting.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/source/net/minecraft/src/GuiCreateWorld.java b/source/net/minecraft/src/GuiCreateWorld.java
new file mode 100644
index 0000000..9b49486
--- /dev/null
+++ b/source/net/minecraft/src/GuiCreateWorld.java
@@ -0,0 +1,69 @@
+package net.minecraft.src;
+
+import java.io.File;
+
+public class GuiCreateWorld extends GuiScreen {
+ protected GuiScreen parentGuiScreen;
+ protected String screenHeader = "Select world";
+ private boolean createClicked = false;
+
+ public GuiCreateWorld(GuiScreen var1) {
+ this.parentGuiScreen = var1;
+ }
+
+ public void initGui() {
+ File var1 = Minecraft.getMinecraftDir();
+
+ for(int var2 = 0; var2 < 5; ++var2) {
+ NBTTagCompound var3 = World.getLevelData(var1, "World" + (var2 + 1));
+ if(var3 == null) {
+ this.controlList.add(new GuiButton(var2, this.width / 2 - 100, this.height / 6 + 24 * var2, "- empty -"));
+ } else {
+ String var4 = "World " + (var2 + 1);
+ long var5 = var3.getLong("SizeOnDisk");
+ var4 = var4 + " (" + (float)(var5 / 1024L * 100L / 1024L) / 100.0F + " MB)";
+ this.controlList.add(new GuiButton(var2, this.width / 2 - 100, this.height / 6 + 24 * var2, var4));
+ }
+ }
+
+ this.initButtons();
+ }
+
+ protected String getSaveFileName(int var1) {
+ File var2 = Minecraft.getMinecraftDir();
+ return World.getLevelData(var2, "World" + var1) != null ? "World" + var1 : null;
+ }
+
+ public void initButtons() {
+ this.controlList.add(new GuiButton(5, this.width / 2 - 100, this.height / 6 + 120 + 12, "Delete world..."));
+ this.controlList.add(new GuiButton(6, this.width / 2 - 100, this.height / 6 + 168, "Cancel"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.enabled) {
+ if(var1.id < 5) {
+ this.actionPerformed(var1.id + 1);
+ } else if(var1.id == 5) {
+ this.mc.displayGuiScreen(new GuiDeleteWorld(this));
+ } else if(var1.id == 6) {
+ this.mc.displayGuiScreen(this.parentGuiScreen);
+ }
+
+ }
+ }
+
+ public void actionPerformed(int var1) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ if(!this.createClicked) {
+ this.createClicked = true;
+ this.mc.startWorld("World" + var1);
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenHeader, this.width / 2, 20, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/GuiDeleteWorld.java b/source/net/minecraft/src/GuiDeleteWorld.java
new file mode 100644
index 0000000..979aad5
--- /dev/null
+++ b/source/net/minecraft/src/GuiDeleteWorld.java
@@ -0,0 +1,31 @@
+package net.minecraft.src;
+
+import java.io.File;
+
+public class GuiDeleteWorld extends GuiCreateWorld {
+ public GuiDeleteWorld(GuiScreen var1) {
+ super(var1);
+ this.screenHeader = "Delete world";
+ }
+
+ public void initButtons() {
+ this.controlList.add(new GuiButton(6, this.width / 2 - 100, this.height / 6 + 168, "Cancel"));
+ }
+
+ public void actionPerformed(int var1) {
+ String var2 = this.getSaveFileName(var1);
+ if(var2 != null) {
+ this.mc.displayGuiScreen(new GuiYesNo(this, "Are you sure you want to delete this world?", "\'" + var2 + "\' will be lost forever!", var1));
+ }
+
+ }
+
+ public void deleteWorld(boolean var1, int var2) {
+ if(var1) {
+ File var3 = Minecraft.getMinecraftDir();
+ World.deleteWorld(var3, this.getSaveFileName(var2));
+ }
+
+ this.mc.displayGuiScreen(this.parentGuiScreen);
+ }
+}
diff --git a/source/net/minecraft/src/GuiEditSign.java b/source/net/minecraft/src/GuiEditSign.java
new file mode 100644
index 0000000..9ecea6d
--- /dev/null
+++ b/source/net/minecraft/src/GuiEditSign.java
@@ -0,0 +1,77 @@
+package net.minecraft.src;
+
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
+
+public class GuiEditSign extends GuiScreen {
+ protected String screenTitle = "Edit sign message:";
+ private TileEntitySign entitySign;
+ private int updateCounter;
+ private int editLine = 0;
+
+ public GuiEditSign(TileEntitySign var1) {
+ this.entitySign = var1;
+ }
+
+ public void initGui() {
+ this.controlList.clear();
+ Keyboard.enableRepeatEvents(true);
+ this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done"));
+ }
+
+ public void onGuiClosed() {
+ Keyboard.enableRepeatEvents(false);
+ }
+
+ public void updateScreen() {
+ ++this.updateCounter;
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.enabled) {
+ if(var1.id == 0) {
+ this.entitySign.onInventoryChanged();
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+
+ }
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(var2 == 200) {
+ this.editLine = this.editLine - 1 & 3;
+ }
+
+ if(var2 == 208 || var2 == 28) {
+ this.editLine = this.editLine + 1 & 3;
+ }
+
+ if(var2 == 14 && this.entitySign.signText[this.editLine].length() > 0) {
+ this.entitySign.signText[this.editLine] = this.entitySign.signText[this.editLine].substring(0, this.entitySign.signText[this.editLine].length() - 1);
+ }
+
+ if("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_\'*!\"#%/()=+?[]{}<>".indexOf(var1) >= 0 && this.entitySign.signText[this.editLine].length() < 15) {
+ this.entitySign.signText[this.editLine] = this.entitySign.signText[this.editLine] + var1;
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 40, 16777215);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(this.width / 2), (float)(this.height / 2), 50.0F);
+ float var4 = 60.0F;
+ GL11.glScalef(-var4, -var4, -var4);
+ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
+ if(this.updateCounter / 6 % 2 == 0) {
+ this.entitySign.lineBeingEdited = this.editLine;
+ }
+
+ GL11.glRotatef((float)(this.entitySign.getBlockMetadata() * 360) / 16.0F, 0.0F, 1.0F, 0.0F);
+ TileEntityRenderer.instance.renderTileEntityAt(this.entitySign, -0.5D, -0.75D, -0.5D, 0.0F);
+ this.entitySign.lineBeingEdited = -1;
+ GL11.glPopMatrix();
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/GuiErrorScreen.java b/source/net/minecraft/src/GuiErrorScreen.java
new file mode 100644
index 0000000..6707b98
--- /dev/null
+++ b/source/net/minecraft/src/GuiErrorScreen.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class GuiErrorScreen extends GuiScreen {
+ private String title;
+ private String text;
+
+ public void initGui() {
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224);
+ this.drawCenteredString(this.fontRenderer, this.title, this.width / 2, 90, 16777215);
+ this.drawCenteredString(this.fontRenderer, this.text, this.width / 2, 110, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ }
+}
diff --git a/source/net/minecraft/src/GuiFurnace.java b/source/net/minecraft/src/GuiFurnace.java
new file mode 100644
index 0000000..922342d
--- /dev/null
+++ b/source/net/minecraft/src/GuiFurnace.java
@@ -0,0 +1,48 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiFurnace extends GuiContainer {
+ private TileEntityFurnace furnaceInventory;
+
+ public GuiFurnace(InventoryPlayer var1, TileEntityFurnace var2) {
+ this.furnaceInventory = var2;
+ this.inventorySlots.add(new Slot(this, var2, 0, 56, 17));
+ this.inventorySlots.add(new Slot(this, var2, 1, 56, 53));
+ this.inventorySlots.add(new Slot(this, var2, 2, 116, 35));
+
+ int var3;
+ for(var3 = 0; var3 < 3; ++var3) {
+ for(int var4 = 0; var4 < 9; ++var4) {
+ this.inventorySlots.add(new Slot(this, var1, var4 + (var3 + 1) * 9, 8 + var4 * 18, 84 + var3 * 18));
+ }
+ }
+
+ for(var3 = 0; var3 < 9; ++var3) {
+ this.inventorySlots.add(new Slot(this, var1, var3, 8 + var3 * 18, 142));
+ }
+
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString("Furnace", 60, 6, 4210752);
+ this.fontRenderer.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/furnace.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
+ int var5;
+ if(this.furnaceInventory.isBurning()) {
+ var5 = this.furnaceInventory.getBurnTimeRemainingScaled(12);
+ this.drawTexturedModalRect(var3 + 56, var4 + 36 + 12 - var5, 176, 12 - var5, 14, var5 + 2);
+ }
+
+ var5 = this.furnaceInventory.getCookProgressScaled(24);
+ this.drawTexturedModalRect(var3 + 79, var4 + 34, 176, 14, var5 + 1, 16);
+ }
+}
diff --git a/source/net/minecraft/src/GuiGameOver.java b/source/net/minecraft/src/GuiGameOver.java
new file mode 100644
index 0000000..1eb64b0
--- /dev/null
+++ b/source/net/minecraft/src/GuiGameOver.java
@@ -0,0 +1,48 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiGameOver extends GuiScreen {
+ public void initGui() {
+ this.controlList.clear();
+ this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, "Respawn"));
+ this.controlList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, "Title menu"));
+ if(this.mc.session == null) {
+ ((GuiButton)this.controlList.get(1)).enabled = false;
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.id == 0) {
+ }
+
+ if(var1.id == 1) {
+ this.mc.respawn();
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+
+ if(var1.id == 2) {
+ this.mc.changeWorld1((World)null);
+ this.mc.displayGuiScreen(new GuiMainMenu());
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792);
+ GL11.glPushMatrix();
+ GL11.glScalef(2.0F, 2.0F, 2.0F);
+ this.drawCenteredString(this.fontRenderer, "Game over!", this.width / 2 / 2, 30, 16777215);
+ GL11.glPopMatrix();
+ this.drawCenteredString(this.fontRenderer, "Score: &e" + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+
+ public boolean doesGuiPauseGame() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/GuiIngame.java b/source/net/minecraft/src/GuiIngame.java
new file mode 100644
index 0000000..f08a0db
--- /dev/null
+++ b/source/net/minecraft/src/GuiIngame.java
@@ -0,0 +1,222 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class GuiIngame extends Gui {
+ private static RenderItem itemRenderer = new RenderItem();
+ private List chatMessageList = new ArrayList();
+ private Random rand = new Random();
+ private Minecraft mc;
+ public String testMessage = null;
+ private int updateCounter = 0;
+ public float damageGuiPartialTime;
+ float prevVignetteBrightness = 1.0F;
+
+ public GuiIngame(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void renderGameOverlay(float var1, boolean var2, int var3, int var4) {
+ ScaledResolution var5 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var6 = var5.getScaledWidth();
+ int var7 = var5.getScaledHeight();
+ FontRenderer var8 = this.mc.fontRenderer;
+ this.mc.entityRenderer.setupOverlayRendering();
+ GL11.glEnable(GL11.GL_BLEND);
+ if(this.mc.gameSettings.fancyGraphics) {
+ this.renderVignette(this.mc.thePlayer.getEntityBrightness(var1), var6, var7);
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/gui.png"));
+ InventoryPlayer var9 = 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 + var9.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/icons.png"));
+ 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);
+ boolean var10 = this.mc.thePlayer.heartsLife / 3 % 2 == 1;
+ if(this.mc.thePlayer.heartsLife < 10) {
+ var10 = false;
+ }
+
+ int var11 = this.mc.thePlayer.health;
+ int var12 = this.mc.thePlayer.prevHealth;
+ this.rand.setSeed((long)(this.updateCounter * 312871));
+ int var13;
+ int var14;
+ int var15;
+ if(this.mc.playerController.shouldDrawHUD()) {
+ var13 = this.mc.thePlayer.getPlayerArmorValue();
+
+ int var16;
+ for(var14 = 0; var14 < 10; ++var14) {
+ var15 = var7 - 32;
+ if(var13 > 0) {
+ var16 = var6 / 2 + 91 - var14 * 8 - 9;
+ if(var14 * 2 + 1 < var13) {
+ this.drawTexturedModalRect(var16, var15, 34, 9, 9, 9);
+ }
+
+ if(var14 * 2 + 1 == var13) {
+ this.drawTexturedModalRect(var16, var15, 25, 9, 9, 9);
+ }
+
+ if(var14 * 2 + 1 > var13) {
+ this.drawTexturedModalRect(var16, var15, 16, 9, 9, 9);
+ }
+ }
+
+ byte var25 = 0;
+ if(var10) {
+ var25 = 1;
+ }
+
+ int var17 = var6 / 2 - 91 + var14 * 8;
+ if(var11 <= 4) {
+ var15 += this.rand.nextInt(2);
+ }
+
+ this.drawTexturedModalRect(var17, var15, 16 + var25 * 9, 0, 9, 9);
+ if(var10) {
+ if(var14 * 2 + 1 < var12) {
+ this.drawTexturedModalRect(var17, var15, 70, 0, 9, 9);
+ }
+
+ if(var14 * 2 + 1 == var12) {
+ this.drawTexturedModalRect(var17, var15, 79, 0, 9, 9);
+ }
+ }
+
+ if(var14 * 2 + 1 < var11) {
+ this.drawTexturedModalRect(var17, var15, 52, 0, 9, 9);
+ }
+
+ if(var14 * 2 + 1 == var11) {
+ this.drawTexturedModalRect(var17, var15, 61, 0, 9, 9);
+ }
+ }
+
+ if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
+ var14 = (int)Math.ceil((double)(this.mc.thePlayer.air - 2) * 10.0D / 300.0D);
+ var15 = (int)Math.ceil((double)this.mc.thePlayer.air * 10.0D / 300.0D) - var14;
+
+ for(var16 = 0; var16 < var14 + var15; ++var16) {
+ if(var16 < var14) {
+ this.drawTexturedModalRect(var6 / 2 - 91 + var16 * 8, var7 - 32 - 9, 16, 18, 9, 9);
+ } else {
+ this.drawTexturedModalRect(var6 / 2 - 91 + var16 * 8, var7 - 32 - 9, 25, 18, 9, 9);
+ }
+ }
+ }
+ }
+
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glPopMatrix();
+
+ for(var13 = 0; var13 < 9; ++var13) {
+ var14 = var6 / 2 - 90 + var13 * 20 + 2;
+ var15 = var7 - 16 - 3;
+ this.renderInventorySlot(var13, var14, var15, var1);
+ }
+
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ if(this.mc.gameSettings.showFPS) {
+ var8.drawStringWithShadow("Minecraft Infdev (" + this.mc.debug + ")", 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);
+ long var22 = Runtime.getRuntime().maxMemory();
+ long var26 = Runtime.getRuntime().totalMemory();
+ long var27 = Runtime.getRuntime().freeMemory();
+ long var19 = var26 - var27;
+ String var21 = "Used memory: " + var19 * 100L / var22 + "% (" + var19 / 1024L / 1024L + "MB) of " + var22 / 1024L / 1024L + "MB";
+ this.drawString(var8, var21, var6 - var8.getStringWidth(var21) - 2, 2, 14737632);
+ var21 = "Allocated memory: " + var26 * 100L / var22 + "% (" + var26 / 1024L / 1024L + "MB)";
+ this.drawString(var8, var21, var6 - var8.getStringWidth(var21) - 2, 12, 14737632);
+ } else {
+ var8.drawStringWithShadow("Minecraft Infdev", 2, 2, 16777215);
+ }
+
+ byte var23 = 10;
+ boolean var24 = false;
+
+ for(var15 = 0; var15 < this.chatMessageList.size() && var15 < var23; ++var15) {
+ if(((ChatLine)this.chatMessageList.get(var15)).updateCounter < 200 || var24) {
+ var8.drawStringWithShadow(((ChatLine)this.chatMessageList.get(var15)).message, 2, var7 - 8 - var15 * 9 - 20, 16777215);
+ }
+ }
+
+ }
+
+ 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);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDepthMask(false);
+ GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
+ GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/misc/vignette.png"));
+ 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, 0.0D, -90.0D, 0.0D, 0.0D);
+ var4.draw();
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ }
+
+ 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) {
+ GL11.glPushMatrix();
+ float var7 = 1.0F + var6 / 5.0F;
+ GL11.glTranslatef((float)(var2 + 8), (float)(var3 + 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);
+ }
+
+ itemRenderer.drawItemIntoGui(this.mc.fontRenderer, this.mc.renderEngine, var5, var2, var3);
+ if(var6 > 0.0F) {
+ GL11.glPopMatrix();
+ }
+
+ itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.renderEngine, var5, var2, var3);
+ }
+ }
+
+ public void updateTick() {
+ ++this.updateCounter;
+
+ for(int var1 = 0; var1 < this.chatMessageList.size(); ++var1) {
+ ++((ChatLine)this.chatMessageList.get(var1)).updateCounter;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/GuiIngameMenu.java b/source/net/minecraft/src/GuiIngameMenu.java
new file mode 100644
index 0000000..a6b46fe
--- /dev/null
+++ b/source/net/minecraft/src/GuiIngameMenu.java
@@ -0,0 +1,50 @@
+package net.minecraft.src;
+
+public class GuiIngameMenu extends GuiScreen {
+ private int updateCounter2 = 0;
+ private int updateCounter = 0;
+
+ public void initGui() {
+ this.updateCounter2 = 0;
+ this.controlList.clear();
+ this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 48, "Save and quit to title.."));
+ this.controlList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24, "Back to game"));
+ this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96, "Options..."));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.id == 0) {
+ this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
+ }
+
+ if(var1.id == 1) {
+ this.mc.changeWorld1((World)null);
+ this.mc.displayGuiScreen(new GuiMainMenu());
+ }
+
+ if(var1.id == 4) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ this.mc.setIngameFocus();
+ }
+
+ }
+
+ public void updateScreen() {
+ super.updateScreen();
+ ++this.updateCounter;
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ boolean var4 = !this.mc.theWorld.saveWorld(this.updateCounter2++);
+ if(var4 || this.updateCounter < 20) {
+ float var5 = ((float)(this.updateCounter % 10) + var3) / 10.0F;
+ var5 = MathHelper.sin(var5 * (float)Math.PI * 2.0F) * 0.2F + 0.8F;
+ int var6 = (int)(255.0F * var5);
+ this.drawString(this.fontRenderer, "Saving level..", 8, this.height - 16, var6 << 16 | var6 << 8 | var6);
+ }
+
+ this.drawCenteredString(this.fontRenderer, "Game menu", this.width / 2, 40, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/GuiInventory.java b/source/net/minecraft/src/GuiInventory.java
new file mode 100644
index 0000000..a145409
--- /dev/null
+++ b/source/net/minecraft/src/GuiInventory.java
@@ -0,0 +1,117 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class GuiInventory extends GuiContainer {
+ private InventoryCrafting craftingInventory = new InventoryCrafting(this, 2, 2);
+ private IInventory craftingResultInventory = new InventoryCraftResult();
+ private float xSize_lo;
+ private float ySize_lo;
+
+ public GuiInventory(IInventory var1) {
+ this.allowUserInput = true;
+ this.inventorySlots.add(new SlotCrafting(this, this.craftingInventory, this.craftingResultInventory, 0, 144, 36));
+
+ int var2;
+ int var3;
+ for(var2 = 0; var2 < 2; ++var2) {
+ for(var3 = 0; var3 < 2; ++var3) {
+ this.inventorySlots.add(new Slot(this, this.craftingInventory, var3 + var2 * 2, 88 + var3 * 18, 26 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 4; ++var2) {
+ this.inventorySlots.add(new SlotArmor(this, this, var1, var1.getSizeInventory() - 1 - var2, 8, 8 + var2 * 18, var2));
+ }
+
+ for(var2 = 0; var2 < 3; ++var2) {
+ for(var3 = 0; var3 < 9; ++var3) {
+ this.inventorySlots.add(new Slot(this, var1, var3 + (var2 + 1) * 9, 8 + var3 * 18, 84 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 9; ++var2) {
+ this.inventorySlots.add(new Slot(this, var1, var2, 8 + var2 * 18, 142));
+ }
+
+ }
+
+ public void onGuiClosed() {
+ super.onGuiClosed();
+
+ for(int var1 = 0; var1 < this.craftingInventory.getSizeInventory(); ++var1) {
+ ItemStack var2 = this.craftingInventory.getStackInSlot(var1);
+ if(var2 != null) {
+ this.mc.thePlayer.dropPlayerItem(var2);
+ }
+ }
+
+ }
+
+ public void onCraftMatrixChanged(IInventory var1) {
+ int[] var2 = new int[9];
+
+ for(int var3 = 0; var3 < 3; ++var3) {
+ for(int var4 = 0; var4 < 3; ++var4) {
+ int var5 = -1;
+ if(var3 < 2 && var4 < 2) {
+ ItemStack var6 = this.craftingInventory.getStackInSlot(var3 + var4 * 2);
+ if(var6 != null) {
+ var5 = var6.itemID;
+ }
+ }
+
+ var2[var3 + var4 * 3] = var5;
+ }
+ }
+
+ this.craftingResultInventory.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(var2));
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString("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;
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/inventory.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(var3 + 51), (float)(var4 + 75), 50.0F);
+ float var5 = 30.0F;
+ GL11.glScalef(-var5, var5, var5);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ float var6 = this.mc.thePlayer.renderYawOffset;
+ float var7 = this.mc.thePlayer.rotationYaw;
+ float var8 = this.mc.thePlayer.rotationPitch;
+ float var9 = (float)(var3 + 51) - this.xSize_lo;
+ float var10 = (float)(var4 + 75 - 50) - this.ySize_lo;
+ 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)(var10 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
+ this.mc.thePlayer.renderYawOffset = (float)Math.atan((double)(var9 / 40.0F)) * 20.0F;
+ this.mc.thePlayer.rotationYaw = (float)Math.atan((double)(var9 / 40.0F)) * 40.0F;
+ this.mc.thePlayer.rotationPitch = -((float)Math.atan((double)(var10 / 40.0F))) * 20.0F;
+ GL11.glTranslatef(0.0F, this.mc.thePlayer.yOffset, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(this.mc.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ this.mc.thePlayer.renderYawOffset = var6;
+ this.mc.thePlayer.rotationYaw = var7;
+ this.mc.thePlayer.rotationPitch = var8;
+ GL11.glPopMatrix();
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ }
+}
diff --git a/source/net/minecraft/src/GuiMainMenu.java b/source/net/minecraft/src/GuiMainMenu.java
new file mode 100644
index 0000000..2b4f8ad
--- /dev/null
+++ b/source/net/minecraft/src/GuiMainMenu.java
@@ -0,0 +1,71 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiMainMenu extends GuiScreen {
+ private float updateCounter = 0.0F;
+ private String[] splashes = new String[]{"Pre-beta!", "As seen on TV!", "Awesome!", "100% pure!", "May contain nuts!", "Better than Prey!", "More polygons!", "Sexy!", "Limited edition!", "Flashing letters!", "Made by Notch!", "Coming soon!", "Best in class!", "When it\'s finished!", "Absolutely dragon free!", "Excitement!", "More than 5000 sold!", "One of a kind!", "700+ hits on YouTube!", "Indev!", "Spiders everywhere!", "Check it out!", "Holy cow, man!", "It\'s a game!", "Made in Sweden!", "Uses LWJGL!", "Reticulating splines!", "Minecraft!", "Yaaay!", "Alpha version!", "Singleplayer!", "Keyboard compatible!", "Undocumented!", "Ingots!", "Exploding creepers!", "That\'s not a moon!", "l33t!", "Create!", "Survive!", "Dungeon!", "Exclusive!", "The bee\'s knees!", "Down with O.P.P.!", "Closed source!", "Classy!", "Wow!", "Not on steam!", "9.95 euro!", "Half price!", "Oh man!", "Check it out!", "Awesome community!", "Pixels!", "Teetsuuuuoooo!", "Kaaneeeedaaaa!", "Now with difficulty!", "Enhanced!", "90% bug free!", "Pretty!", "12 herbs and spices!", "Fat free!", "Absolutely no memes!", "Free dental!", "Ask your doctor!", "Minors welcome!", "Cloud computing!", "Legal in Finland!", "Hard to label!", "Technically good!", "Bringing home the bacon!", "Indie!", "GOTY!", "Ceci n\'est pas une title screen!", "Euclidian!", "Now in 3D!", "Inspirational!", "Herregud!", "Complex cellular automata!", "Yes, sir!", "Played by cowboys!", "OpenGL 1.1!", "Thousands of colors!", "Try it!", "Age of Wonders is better!", "Try the mushroom stew!", "Sensational!", "Hot tamale, hot hot tamale!", "Play him off, keyboard cat!", "Guaranteed!", "Macroscopic!", "Bring it on!", "Random splash!", "Call your mother!", "Monster infighting!", "Loved by millions!", "Ultimate edition!", "Freaky!", "You\'ve got a brand new key!", "Water proof!", "Uninflammable!", "Whoa, dude!", "All inclusive!", "Tell your friends!", "NP is not in P!", "Notch <3 Ez!", "Music by C418!"};
+ private String splashString = this.splashes[(int)(Math.random() * (double)this.splashes.length)];
+
+ public void updateScreen() {
+ this.updateCounter += 0.01F;
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ }
+
+ public void initGui() {
+ this.controlList.clear();
+ this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 48, "Single player"));
+ this.controlList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 72, "Multi player"));
+ this.controlList.add(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 96, "Play tutorial level"));
+ this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Options..."));
+ ((GuiButton)this.controlList.get(1)).enabled = false;
+ ((GuiButton)this.controlList.get(2)).enabled = false;
+ if(this.mc.session == null) {
+ ((GuiButton)this.controlList.get(1)).enabled = false;
+ }
+
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.id == 0) {
+ this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
+ }
+
+ if(var1.id == 1) {
+ this.mc.displayGuiScreen(new GuiCreateWorld(this));
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ Tessellator var4 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/logo.png"));
+ short var5 = 256;
+ byte var6 = 49;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ var4.setColorOpaque_I(16777215);
+ this.drawTexturedModalRect((this.width - var5) / 2, 30, 0, 0, var5, var6);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
+ GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
+ float var7 = 1.8F - MathHelper.abs(MathHelper.sin((float)(System.currentTimeMillis() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
+ var7 = var7 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashString) + 32);
+ GL11.glScalef(var7, var7, var7);
+ this.drawCenteredString(this.fontRenderer, this.splashString, 0, -8, 16776960);
+ GL11.glPopMatrix();
+ String var8 = "Copyright Mojang Specifications. Do not distribute.";
+ this.drawString(this.fontRenderer, var8, this.width - this.fontRenderer.getStringWidth(var8) - 2, this.height - 10, 16777215);
+ long var9 = Runtime.getRuntime().maxMemory();
+ long var11 = Runtime.getRuntime().totalMemory();
+ long var13 = Runtime.getRuntime().freeMemory();
+ long var15 = var9 - var13;
+ var8 = "Free memory: " + var15 * 100L / var9 + "% of " + var9 / 1024L / 1024L + "MB";
+ this.drawString(this.fontRenderer, var8, this.width - this.fontRenderer.getStringWidth(var8) - 2, 2, 8421504);
+ var8 = "Allocated memory: " + var11 * 100L / var9 + "% (" + var11 / 1024L / 1024L + "MB)";
+ this.drawString(this.fontRenderer, var8, this.width - this.fontRenderer.getStringWidth(var8) - 2, 12, 8421504);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/GuiOptions.java b/source/net/minecraft/src/GuiOptions.java
new file mode 100644
index 0000000..a6b73eb
--- /dev/null
+++ b/source/net/minecraft/src/GuiOptions.java
@@ -0,0 +1,45 @@
+package net.minecraft.src;
+
+public class GuiOptions extends GuiScreen {
+ private GuiScreen parentScreen;
+ protected String screenTitle = "Options";
+ private GameSettings options;
+
+ public GuiOptions(GuiScreen var1, GameSettings var2) {
+ this.parentScreen = var1;
+ this.options = var2;
+ }
+
+ public void initGui() {
+ for(int var1 = 0; var1 < this.options.numberOfOptions; ++var1) {
+ this.controlList.add(new GuiSmallButton(var1, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), this.options.getKeyBinding(var1)));
+ }
+
+ this.controlList.add(new GuiButton(100, this.width / 2 - 100, this.height / 6 + 120 + 12, "Controls..."));
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, "Done"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.enabled) {
+ if(var1.id < 100) {
+ this.options.setOptionFloatValue(var1.id, 1);
+ var1.displayString = this.options.getKeyBinding(var1.id);
+ }
+
+ if(var1.id == 100) {
+ this.mc.displayGuiScreen(new GuiControls(this, this.options));
+ }
+
+ if(var1.id == 200) {
+ this.mc.displayGuiScreen(this.parentScreen);
+ }
+
+ }
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/GuiScreen.java b/source/net/minecraft/src/GuiScreen.java
new file mode 100644
index 0000000..392f9fc
--- /dev/null
+++ b/source/net/minecraft/src/GuiScreen.java
@@ -0,0 +1,138 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.GL11;
+
+public class GuiScreen extends Gui {
+ protected Minecraft mc;
+ public int width;
+ public int height;
+ protected List controlList = new ArrayList();
+ public boolean allowUserInput = false;
+ protected FontRenderer fontRenderer;
+
+ public void drawScreen(int var1, int var2, float var3) {
+ for(int var4 = 0; var4 < this.controlList.size(); ++var4) {
+ GuiButton var5 = (GuiButton)this.controlList.get(var4);
+ var5.drawButton(this.mc, var1, var2);
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(var2 == 1) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ this.mc.setIngameFocus();
+ }
+
+ }
+
+ protected void mouseClicked(int var1, int var2, int var3) {
+ if(var3 == 0) {
+ for(int var4 = 0; var4 < this.controlList.size(); ++var4) {
+ GuiButton var5 = (GuiButton)this.controlList.get(var4);
+ if(var5.mousePressed(var1, var2)) {
+ this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
+ this.actionPerformed(var5);
+ }
+ }
+ }
+
+ }
+
+ protected void mouseMovedOrUp(int var1, int var2, int var3) {
+ }
+
+ 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.initGui();
+ }
+
+ public void initGui() {
+ }
+
+ public void handleInput() {
+ while(Mouse.next()) {
+ this.handleMouseInput();
+ }
+
+ while(Keyboard.next()) {
+ this.handleKeyboardInput();
+ }
+
+ }
+
+ public void handleMouseInput() {
+ int var1;
+ int var2;
+ if(Mouse.getEventButtonState()) {
+ var1 = Mouse.getEventX() * this.width / this.mc.displayWidth;
+ var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
+ this.mouseClicked(var1, var2, Mouse.getEventButton());
+ } else {
+ var1 = Mouse.getEventX() * this.width / this.mc.displayWidth;
+ var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
+ this.mouseMovedOrUp(var1, var2, Mouse.getEventButton());
+ }
+
+ }
+
+ public void handleKeyboardInput() {
+ if(Keyboard.getEventKeyState()) {
+ if(Keyboard.getEventKey() == Keyboard.KEY_F11) {
+ this.mc.toggleFullscreen();
+ return;
+ }
+
+ this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
+ }
+
+ }
+
+ public void updateScreen() {
+ }
+
+ public void onGuiClosed() {
+ }
+
+ public void drawDefaultBackground() {
+ this.drawWorldBackground(0);
+ }
+
+ public void drawWorldBackground(int var1) {
+ if(this.mc.theWorld != null) {
+ this.drawGradientRect(0, 0, this.width, this.height, 1610941696, -1607454656);
+ } else {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_FOG);
+ Tessellator var2 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/dirt.png"));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ 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)(0 + var1));
+ var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)(0 + var1));
+ var2.draw();
+ }
+
+ }
+
+ public boolean doesGuiPauseGame() {
+ return true;
+ }
+
+ public void deleteWorld(boolean var1, int var2) {
+ }
+}
diff --git a/source/net/minecraft/src/GuiSmallButton.java b/source/net/minecraft/src/GuiSmallButton.java
new file mode 100644
index 0000000..e64c277
--- /dev/null
+++ b/source/net/minecraft/src/GuiSmallButton.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+public class GuiSmallButton extends GuiButton {
+ public GuiSmallButton(int var1, int var2, int var3, String var4) {
+ super(var1, var2, var3, 150, 20, var4);
+ }
+}
diff --git a/source/net/minecraft/src/GuiYesNo.java b/source/net/minecraft/src/GuiYesNo.java
new file mode 100644
index 0000000..3c22273
--- /dev/null
+++ b/source/net/minecraft/src/GuiYesNo.java
@@ -0,0 +1,31 @@
+package net.minecraft.src;
+
+public class GuiYesNo extends GuiScreen {
+ private GuiScreen parentScreen;
+ private String message1;
+ private String message2;
+ private int worldNumber;
+
+ public GuiYesNo(GuiScreen var1, String var2, String var3, int var4) {
+ this.parentScreen = var1;
+ this.message1 = var2;
+ this.message2 = var3;
+ this.worldNumber = var4;
+ }
+
+ public void initGui() {
+ this.controlList.add(new GuiSmallButton(0, this.width / 2 - 155 + 0, this.height / 6 + 96, "Yes"));
+ this.controlList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, "No"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ this.parentScreen.deleteWorld(var1.id == 0, this.worldNumber);
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 70, 16777215);
+ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 90, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/IBlockAccess.java b/source/net/minecraft/src/IBlockAccess.java
new file mode 100644
index 0000000..007ce98
--- /dev/null
+++ b/source/net/minecraft/src/IBlockAccess.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public interface IBlockAccess {
+ int getBlockId(int var1, int var2, int var3);
+
+ TileEntity getBlockTileEntity(int var1, int var2, int var3);
+
+ float getBrightness(int var1, int var2, int var3);
+
+ int getBlockMetadata(int var1, int var2, int var3);
+
+ Material getBlockMaterial(int var1, int var2, int var3);
+
+ boolean isBlockNormalCube(int var1, int var2, int var3);
+}
diff --git a/source/net/minecraft/src/ICamera.java b/source/net/minecraft/src/ICamera.java
new file mode 100644
index 0000000..fb186f4
--- /dev/null
+++ b/source/net/minecraft/src/ICamera.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+public interface ICamera {
+ boolean isBoundingBoxInFrustum(AxisAlignedBB var1);
+
+ void setPosition(double var1, double var3, double var5);
+}
diff --git a/source/net/minecraft/src/IChunkLoader.java b/source/net/minecraft/src/IChunkLoader.java
new file mode 100644
index 0000000..c197feb
--- /dev/null
+++ b/source/net/minecraft/src/IChunkLoader.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+import java.io.IOException;
+
+public interface IChunkLoader {
+ Chunk loadChunk(World var1, int var2, int var3) throws IOException;
+
+ void saveChunk(World var1, Chunk var2) throws IOException;
+
+ void saveExtraChunkData(World var1, Chunk var2);
+
+ void chunkTick();
+
+ void saveExtraData();
+}
diff --git a/source/net/minecraft/src/IChunkProvider.java b/source/net/minecraft/src/IChunkProvider.java
new file mode 100644
index 0000000..37743c9
--- /dev/null
+++ b/source/net/minecraft/src/IChunkProvider.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public interface IChunkProvider {
+ boolean chunkExists(int var1, int var2);
+
+ Chunk provideChunk(int var1, int var2);
+
+ void populate(IChunkProvider var1, int var2, int var3);
+
+ boolean saveChunks(boolean var1, IProgressUpdate var2);
+
+ boolean unload100OldestChunks();
+
+ boolean canSave();
+}
diff --git a/source/net/minecraft/src/IInventory.java b/source/net/minecraft/src/IInventory.java
new file mode 100644
index 0000000..b4564c7
--- /dev/null
+++ b/source/net/minecraft/src/IInventory.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public interface IInventory {
+ int getSizeInventory();
+
+ ItemStack getStackInSlot(int var1);
+
+ ItemStack decrStackSize(int var1, int var2);
+
+ void setInventorySlotContents(int var1, ItemStack var2);
+
+ String getInvName();
+
+ int getInventoryStackLimit();
+
+ void onInventoryChanged();
+}
diff --git a/source/net/minecraft/src/IProgressUpdate.java b/source/net/minecraft/src/IProgressUpdate.java
new file mode 100644
index 0000000..1fb3c60
--- /dev/null
+++ b/source/net/minecraft/src/IProgressUpdate.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+public interface IProgressUpdate {
+ void displayProgressMessage(String var1);
+
+ void displayLoadingString(String var1);
+
+ void setLoadingProgress(int var1);
+}
diff --git a/source/net/minecraft/src/IWorldAccess.java b/source/net/minecraft/src/IWorldAccess.java
new file mode 100644
index 0000000..abcfcea
--- /dev/null
+++ b/source/net/minecraft/src/IWorldAccess.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public interface IWorldAccess {
+ void markBlockAndNeighborsNeedsUpdate(int var1, int var2, int var3);
+
+ void markBlockRangeNeedsUpdate(int var1, int var2, int var3, int var4, int var5, int var6);
+
+ void playSound(String var1, double var2, double var4, double var6, float var8, float var9);
+
+ void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12);
+
+ void obtainEntitySkin(Entity var1);
+
+ void releaseEntitySkin(Entity var1);
+
+ void updateAllRenderers();
+}
diff --git a/source/net/minecraft/src/ImageBuffer.java b/source/net/minecraft/src/ImageBuffer.java
new file mode 100644
index 0000000..149f101
--- /dev/null
+++ b/source/net/minecraft/src/ImageBuffer.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+
+public interface ImageBuffer {
+ BufferedImage parseUserSkin(BufferedImage var1);
+}
diff --git a/source/net/minecraft/src/ImageBufferDownload.java b/source/net/minecraft/src/ImageBufferDownload.java
new file mode 100644
index 0000000..39d9761
--- /dev/null
+++ b/source/net/minecraft/src/ImageBufferDownload.java
@@ -0,0 +1,88 @@
+package net.minecraft.src;
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferInt;
+import java.awt.image.ImageObserver;
+
+public class ImageBufferDownload implements ImageBuffer {
+ private int[] imageData;
+ private int imageWidth;
+ private int imageHeight;
+
+ public BufferedImage parseUserSkin(BufferedImage var1) {
+ if(var1 == 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.dispose();
+ this.imageData = ((DataBufferInt)var2.getRaster().getDataBuffer()).getData();
+ this.setAreaOpaque(0, 0, 32, 16);
+ this.setAreaTransparent(32, 0, 64, 32);
+ this.setAreaOpaque(0, 16, 64, 32);
+ boolean var4 = false;
+
+ int var5;
+ int var6;
+ int var7;
+ for(var5 = 32; var5 < 64; ++var5) {
+ for(var6 = 0; var6 < 16; ++var6) {
+ var7 = this.imageData[var5 + var6 * 64];
+ if((var7 >> 24 & 255) < 128) {
+ var4 = true;
+ }
+ }
+ }
+
+ if(!var4) {
+ for(var5 = 32; var5 < 64; ++var5) {
+ for(var6 = 0; var6 < 16; ++var6) {
+ var7 = this.imageData[var5 + var6 * 64];
+ if((var7 >> 24 & 255) < 128) {
+ var4 = true;
+ }
+ }
+ }
+ }
+
+ return var2;
+ }
+ }
+
+ 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) {
+ 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) {
+ 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) {
+ int var7 = this.imageData[var5 + var6 * this.imageWidth];
+ if((var7 >> 24 & 255) < 128) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/InventoryCraftResult.java b/source/net/minecraft/src/InventoryCraftResult.java
new file mode 100644
index 0000000..de21b2a
--- /dev/null
+++ b/source/net/minecraft/src/InventoryCraftResult.java
@@ -0,0 +1,38 @@
+package net.minecraft.src;
+
+public class InventoryCraftResult implements IInventory {
+ private ItemStack[] stackResult = new ItemStack[1];
+
+ public int getSizeInventory() {
+ return 1;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.stackResult[var1];
+ }
+
+ public String getInvName() {
+ return "Result";
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.stackResult[var1] != null) {
+ ItemStack var3 = this.stackResult[var1];
+ this.stackResult[var1] = null;
+ return var3;
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ this.stackResult[var1] = var2;
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public void onInventoryChanged() {
+ }
+}
diff --git a/source/net/minecraft/src/InventoryCrafting.java b/source/net/minecraft/src/InventoryCrafting.java
new file mode 100644
index 0000000..b5b78c3
--- /dev/null
+++ b/source/net/minecraft/src/InventoryCrafting.java
@@ -0,0 +1,59 @@
+package net.minecraft.src;
+
+public class InventoryCrafting implements IInventory {
+ private ItemStack[] stackList;
+ private int gridSize;
+ private GuiContainer craftingInventory;
+
+ public InventoryCrafting(GuiContainer var1, int var2, int var3) {
+ this.gridSize = var2 * var3;
+ this.stackList = new ItemStack[this.gridSize];
+ this.craftingInventory = var1;
+ }
+
+ public int getSizeInventory() {
+ return this.gridSize;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.stackList[var1];
+ }
+
+ public String getInvName() {
+ return "Crafting";
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.stackList[var1] != null) {
+ ItemStack var3;
+ if(this.stackList[var1].stackSize <= var2) {
+ var3 = this.stackList[var1];
+ this.stackList[var1] = null;
+ this.craftingInventory.onCraftMatrixChanged(this);
+ return var3;
+ } else {
+ var3 = this.stackList[var1].splitStack(var2);
+ if(this.stackList[var1].stackSize == 0) {
+ this.stackList[var1] = null;
+ }
+
+ this.craftingInventory.onCraftMatrixChanged(this);
+ return var3;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ this.stackList[var1] = var2;
+ this.craftingInventory.onCraftMatrixChanged(this);
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public void onInventoryChanged() {
+ }
+}
diff --git a/source/net/minecraft/src/InventoryLargeChest.java b/source/net/minecraft/src/InventoryLargeChest.java
new file mode 100644
index 0000000..daced98
--- /dev/null
+++ b/source/net/minecraft/src/InventoryLargeChest.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class InventoryLargeChest implements IInventory {
+ private String name;
+ private IInventory upperChest;
+ private IInventory lowerChest;
+
+ public InventoryLargeChest(String var1, IInventory var2, IInventory var3) {
+ this.name = var1;
+ this.upperChest = var2;
+ this.lowerChest = var3;
+ }
+
+ public int getSizeInventory() {
+ return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory();
+ }
+
+ public String getInvName() {
+ return this.name;
+ }
+
+ 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 void setInventorySlotContents(int var1, ItemStack var2) {
+ if(var1 >= this.upperChest.getSizeInventory()) {
+ this.lowerChest.setInventorySlotContents(var1 - this.upperChest.getSizeInventory(), var2);
+ } else {
+ this.upperChest.setInventorySlotContents(var1, var2);
+ }
+
+ }
+
+ public int getInventoryStackLimit() {
+ return this.upperChest.getInventoryStackLimit();
+ }
+
+ public void onInventoryChanged() {
+ this.upperChest.onInventoryChanged();
+ this.lowerChest.onInventoryChanged();
+ }
+}
diff --git a/source/net/minecraft/src/InventoryPlayer.java b/source/net/minecraft/src/InventoryPlayer.java
new file mode 100644
index 0000000..3c5e832
--- /dev/null
+++ b/source/net/minecraft/src/InventoryPlayer.java
@@ -0,0 +1,329 @@
+package net.minecraft.src;
+
+public class InventoryPlayer implements IInventory {
+ public ItemStack[] mainInventory = new ItemStack[36];
+ public ItemStack[] armorInventory = new ItemStack[4];
+ public int currentItem = 0;
+ private EntityPlayer player;
+
+ public InventoryPlayer(EntityPlayer var1) {
+ this.player = var1;
+ }
+
+ public ItemStack getCurrentItem() {
+ return this.mainInventory[this.currentItem];
+ }
+
+ private int getInventorySlotContainItem(int var1) {
+ for(int var2 = 0; var2 < this.mainInventory.length; ++var2) {
+ if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1) {
+ return var2;
+ }
+ }
+
+ return -1;
+ }
+
+ private int storeItemStack(int var1) {
+ for(int var2 = 0; var2 < this.mainInventory.length; ++var2) {
+ if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1 && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit()) {
+ return var2;
+ }
+ }
+
+ return -1;
+ }
+
+ private int getFirstEmptyStack() {
+ for(int var1 = 0; var1 < this.mainInventory.length; ++var1) {
+ if(this.mainInventory[var1] == null) {
+ return var1;
+ }
+ }
+
+ return -1;
+ }
+
+ public void setCurrentItem(int var1, boolean var2) {
+ int var3 = this.getInventorySlotContainItem(var1);
+ if(var3 >= 0 && var3 < 9) {
+ this.currentItem = var3;
+ }
+ }
+
+ 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) {
+ this.currentItem -= 9;
+ }
+
+ }
+
+ private int storePartialItemStack(int var1, int var2) {
+ int var3 = this.storeItemStack(var1);
+ if(var3 < 0) {
+ var3 = this.getFirstEmptyStack();
+ }
+
+ if(var3 < 0) {
+ return var2;
+ } else {
+ if(this.mainInventory[var3] == null) {
+ this.mainInventory[var3] = new ItemStack(var1, 0);
+ }
+
+ int var4 = var2;
+ if(var2 > this.mainInventory[var3].getMaxStackSize() - this.mainInventory[var3].stackSize) {
+ var4 = this.mainInventory[var3].getMaxStackSize() - this.mainInventory[var3].stackSize;
+ }
+
+ if(var4 > this.getInventoryStackLimit() - this.mainInventory[var3].stackSize) {
+ var4 = this.getInventoryStackLimit() - this.mainInventory[var3].stackSize;
+ }
+
+ if(var4 == 0) {
+ return var2;
+ } else {
+ var2 -= var4;
+ this.mainInventory[var3].stackSize += var4;
+ this.mainInventory[var3].animationsToGo = 5;
+ return var2;
+ }
+ }
+ }
+
+ public void decrementAnimations() {
+ for(int var1 = 0; var1 < this.mainInventory.length; ++var1) {
+ if(this.mainInventory[var1] != null && this.mainInventory[var1].animationsToGo > 0) {
+ --this.mainInventory[var1].animationsToGo;
+ }
+ }
+
+ }
+
+ public boolean consumeInventoryItem(int var1) {
+ int var2 = this.getInventorySlotContainItem(var1);
+ if(var2 < 0) {
+ return false;
+ } else {
+ if(--this.mainInventory[var2].stackSize <= 0) {
+ this.mainInventory[var2] = null;
+ }
+
+ return true;
+ }
+ }
+
+ public boolean addItemStackToInventory(ItemStack var1) {
+ if(var1.itemDmg == 0) {
+ var1.stackSize = this.storePartialItemStack(var1.itemID, var1.stackSize);
+ if(var1.stackSize == 0) {
+ return true;
+ }
+ }
+
+ int var2 = this.getFirstEmptyStack();
+ if(var2 >= 0) {
+ this.mainInventory[var2] = var1;
+ this.mainInventory[var2].animationsToGo = 5;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ ItemStack[] var3 = this.mainInventory;
+ if(var1 >= this.mainInventory.length) {
+ var3 = this.armorInventory;
+ var1 -= this.mainInventory.length;
+ }
+
+ if(var3[var1] != null) {
+ ItemStack var4;
+ if(var3[var1].stackSize <= var2) {
+ var4 = var3[var1];
+ var3[var1] = null;
+ return var4;
+ } else {
+ var4 = var3[var1].splitStack(var2);
+ if(var3[var1].stackSize == 0) {
+ var3[var1] = null;
+ }
+
+ return var4;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ ItemStack[] var3 = this.mainInventory;
+ if(var1 >= this.mainInventory.length) {
+ var3 = this.armorInventory;
+ var1 -= this.mainInventory.length;
+ }
+
+ var3[var1] = var2;
+ }
+
+ public float getStrVsBlock(Block var1) {
+ float var2 = 1.0F;
+ if(this.mainInventory[this.currentItem] != null) {
+ var2 *= this.mainInventory[this.currentItem].getStrVsBlock(var1);
+ }
+
+ return var2;
+ }
+
+ public NBTTagList writeToNBT(NBTTagList var1) {
+ int var2;
+ NBTTagCompound var3;
+ 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.setTag(var3);
+ }
+ }
+
+ 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.setTag(var3);
+ }
+ }
+
+ return var1;
+ }
+
+ public void readFromNBT(NBTTagList var1) {
+ this.mainInventory = new ItemStack[36];
+ this.armorInventory = new ItemStack[4];
+
+ for(int var2 = 0; var2 < var1.tagCount(); ++var2) {
+ NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2);
+ int var4 = var3.getByte("Slot") & 255;
+ if(var4 >= 0 && var4 < this.mainInventory.length) {
+ this.mainInventory[var4] = new ItemStack(var3);
+ }
+
+ if(var4 >= 100 && var4 < this.armorInventory.length + 100) {
+ this.armorInventory[var4 - 100] = new ItemStack(var3);
+ }
+ }
+
+ }
+
+ public int getSizeInventory() {
+ return this.mainInventory.length + 4;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ ItemStack[] var2 = this.mainInventory;
+ if(var1 >= this.mainInventory.length) {
+ var2 = this.armorInventory;
+ var1 -= this.mainInventory.length;
+ }
+
+ return var2[var1];
+ }
+
+ public String getInvName() {
+ return "Inventory";
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ ItemStack var2 = this.getStackInSlot(this.currentItem);
+ return var2 != null ? var2.getDamageVsEntity(var1) : 1;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ if(var1.blockMaterial != Material.rock && var1.blockMaterial != Material.iron) {
+ return true;
+ } else {
+ ItemStack var2 = this.getStackInSlot(this.currentItem);
+ return var2 != null ? var2.canHarvestBlock(var1) : false;
+ }
+ }
+
+ public ItemStack armorItemInSlot(int var1) {
+ return this.armorInventory[var1];
+ }
+
+ public int getTotalArmorValue() {
+ int var1 = 0;
+ int var2 = 0;
+ int var3 = 0;
+
+ for(int var4 = 0; var4 < this.armorInventory.length; ++var4) {
+ if(this.armorInventory[var4] != null && this.armorInventory[var4].getItem() instanceof ItemArmor) {
+ int var5 = this.armorInventory[var4].getMaxDamage();
+ int var6 = this.armorInventory[var4].itemDmg;
+ int var7 = var5 - var6;
+ var2 += var7;
+ var3 += var5;
+ int var8 = ((ItemArmor)this.armorInventory[var4].getItem()).damageReduceAmount;
+ var1 += var8;
+ }
+ }
+
+ if(var3 == 0) {
+ return 0;
+ } else {
+ return (var1 - 1) * var2 / var3 + 1;
+ }
+ }
+
+ public void damageArmor(int var1) {
+ for(int var2 = 0; var2 < this.armorInventory.length; ++var2) {
+ if(this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) {
+ this.armorInventory[var2].damageItem(var1);
+ if(this.armorInventory[var2].stackSize == 0) {
+ this.armorInventory[var2].onItemDestroyedByUse(this.player);
+ this.armorInventory[var2] = null;
+ }
+ }
+ }
+
+ }
+
+ public void dropAllItems() {
+ int var1;
+ 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) {
+ this.player.dropPlayerItemWithRandomChoice(this.armorInventory[var1], true);
+ this.armorInventory[var1] = null;
+ }
+ }
+
+ }
+
+ public void onInventoryChanged() {
+ }
+}
diff --git a/source/net/minecraft/src/IsoImageBuffer.java b/source/net/minecraft/src/IsoImageBuffer.java
new file mode 100644
index 0000000..51bd4c2
--- /dev/null
+++ b/source/net/minecraft/src/IsoImageBuffer.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+
+public class IsoImageBuffer {
+ public BufferedImage image;
+ public World level;
+ public int chunkX;
+ public int chunkZ;
+ public boolean rendered = false;
+ public boolean noContent = false;
+ public int lastVisible = 0;
+ public boolean addedToRenderQueue = false;
+
+ public IsoImageBuffer(World var1, int var2, int var3) {
+ this.level = var1;
+ this.setChunkPosition(var2, var3);
+ }
+
+ public void setChunkPosition(int var1, int var2) {
+ this.rendered = false;
+ this.chunkX = var1;
+ this.chunkZ = var2;
+ this.lastVisible = 0;
+ this.addedToRenderQueue = false;
+ }
+
+ public void setWorldAndChunkPosition(World var1, int var2, int var3) {
+ this.level = var1;
+ this.setChunkPosition(var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/Item.java b/source/net/minecraft/src/Item.java
new file mode 100644
index 0000000..5f953d1
--- /dev/null
+++ b/source/net/minecraft/src/Item.java
@@ -0,0 +1,141 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class Item {
+ protected static Random itemRand = new Random();
+ public static Item[] itemsList = new Item[1024];
+ public static Item shovel = (new ItemSpade(0, 2)).setIconIndex(82);
+ public static Item pickaxeSteel = (new ItemPickaxe(1, 2)).setIconIndex(98);
+ public static Item axeSteel = (new ItemAxe(2, 2)).setIconIndex(114);
+ public static Item striker = (new ItemFlintAndSteel(3)).setIconIndex(5);
+ public static Item appleRed = (new ItemFood(4, 4)).setIconIndex(10);
+ public static Item bow = (new ItemBow(5)).setIconIndex(21);
+ public static Item arrow = (new Item(6)).setIconIndex(37);
+ public static Item coal = (new Item(7)).setIconIndex(7);
+ public static Item diamond = (new Item(8)).setIconIndex(55);
+ public static Item ingotIron = (new Item(9)).setIconIndex(23);
+ public static Item ingotGold = (new Item(10)).setIconIndex(39);
+ public static Item swordSteel = (new ItemSword(11, 2)).setIconIndex(66);
+ public static Item swordWood = (new ItemSword(12, 0)).setIconIndex(64);
+ public static Item shovelWood = (new ItemSpade(13, 0)).setIconIndex(80);
+ public static Item pickaxeWood = (new ItemPickaxe(14, 0)).setIconIndex(96);
+ public static Item axeWood = (new ItemAxe(15, 0)).setIconIndex(112);
+ public static Item swordStone = (new ItemSword(16, 1)).setIconIndex(65);
+ public static Item shovelStone = (new ItemSpade(17, 1)).setIconIndex(81);
+ public static Item pickaxeStone = (new ItemPickaxe(18, 1)).setIconIndex(97);
+ public static Item axeStone = (new ItemAxe(19, 1)).setIconIndex(113);
+ public static Item swordDiamond = (new ItemSword(20, 3)).setIconIndex(67);
+ public static Item shovelDiamond = (new ItemSpade(21, 3)).setIconIndex(83);
+ public static Item pickaxeDiamond = (new ItemPickaxe(22, 3)).setIconIndex(99);
+ public static Item axeDiamond = (new ItemAxe(23, 3)).setIconIndex(115);
+ public static Item stick = (new Item(24)).setIconIndex(53);
+ public static Item bowlEmpty = (new Item(25)).setIconIndex(71);
+ public static Item bowlSoup = (new ItemSoup(26, 10)).setIconIndex(72);
+ public static Item swordGold = (new ItemSword(27, 0)).setIconIndex(68);
+ public static Item shovelGold = (new ItemSpade(28, 0)).setIconIndex(84);
+ public static Item pickaxeGold = (new ItemPickaxe(29, 0)).setIconIndex(100);
+ public static Item axeGold = (new ItemAxe(30, 0)).setIconIndex(116);
+ public static Item silk = (new Item(31)).setIconIndex(8);
+ public static Item feather = (new Item(32)).setIconIndex(24);
+ public static Item gunpowder = (new Item(33)).setIconIndex(40);
+ public static Item hoeWood = (new ItemHoe(34, 0)).setIconIndex(128);
+ public static Item hoeStone = (new ItemHoe(35, 1)).setIconIndex(129);
+ public static Item hoeSteel = (new ItemHoe(36, 2)).setIconIndex(130);
+ public static Item hoeDiamond = (new ItemHoe(37, 3)).setIconIndex(131);
+ public static Item hoeGold = (new ItemHoe(38, 4)).setIconIndex(132);
+ public static Item seeds = (new ItemSeeds(39, Block.crops.blockID)).setIconIndex(9);
+ public static Item wheat = (new Item(40)).setIconIndex(25);
+ public static Item bread = (new ItemFood(41, 5)).setIconIndex(41);
+ public static Item helmetLeather = (new ItemArmor(42, 0, 0, 0)).setIconIndex(0);
+ public static Item plateLeather = (new ItemArmor(43, 0, 0, 1)).setIconIndex(16);
+ public static Item legsLeather = (new ItemArmor(44, 0, 0, 2)).setIconIndex(32);
+ public static Item bootsLeather = (new ItemArmor(45, 0, 0, 3)).setIconIndex(48);
+ public static Item helmetChain = (new ItemArmor(46, 1, 1, 0)).setIconIndex(1);
+ public static Item plateChain = (new ItemArmor(47, 1, 1, 1)).setIconIndex(17);
+ public static Item legsChain = (new ItemArmor(48, 1, 1, 2)).setIconIndex(33);
+ public static Item bootsChain = (new ItemArmor(49, 1, 1, 3)).setIconIndex(49);
+ public static Item helmetSteel = (new ItemArmor(50, 2, 2, 0)).setIconIndex(2);
+ public static Item plateSteel = (new ItemArmor(51, 2, 2, 1)).setIconIndex(18);
+ public static Item legsSteel = (new ItemArmor(52, 2, 2, 2)).setIconIndex(34);
+ public static Item bootsSteel = (new ItemArmor(53, 2, 2, 3)).setIconIndex(50);
+ public static Item helmetDiamond = (new ItemArmor(54, 3, 3, 0)).setIconIndex(3);
+ public static Item plateDiamonhd = (new ItemArmor(55, 3, 3, 1)).setIconIndex(19);
+ public static Item legsDiamond = (new ItemArmor(56, 3, 3, 2)).setIconIndex(35);
+ public static Item bootsDiamond = (new ItemArmor(57, 3, 3, 3)).setIconIndex(51);
+ public static Item helmetGold = (new ItemArmor(58, 1, 4, 0)).setIconIndex(4);
+ public static Item plateGold = (new ItemArmor(59, 1, 4, 1)).setIconIndex(20);
+ public static Item legsGold = (new ItemArmor(60, 1, 4, 2)).setIconIndex(36);
+ public static Item bootsGold = (new ItemArmor(61, 1, 4, 3)).setIconIndex(52);
+ public static Item flint = (new Item(62)).setIconIndex(6);
+ public static Item porkRaw = (new ItemFood(63, 3)).setIconIndex(87);
+ public static Item porkCooked = (new ItemFood(64, 8)).setIconIndex(88);
+ public static Item painting = (new ItemPainting(65)).setIconIndex(26);
+ public static Item appleGold = (new ItemFood(66, 42)).setIconIndex(11);
+ public static Item sign = (new ItemSign(67)).setIconIndex(42);
+ public static Item door = (new ItemDoor(68)).setIconIndex(43);
+ public static Item bucketEmpty = (new ItemBucket(69, 0)).setIconIndex(74);
+ public static Item bucketWater = (new ItemBucket(70, Block.waterMoving.blockID)).setIconIndex(75);
+ public static Item bucketLava = (new ItemBucket(71, Block.lavaMoving.blockID)).setIconIndex(76);
+ public static Item minecart = (new ItemMinecart(72)).setIconIndex(135);
+ public static Item saddle = (new ItemSaddle(73)).setIconIndex(104);
+ public final int shiftedIndex;
+ protected int maxStackSize = 64;
+ protected int maxDamage = 32;
+ protected int iconIndex;
+
+ protected Item(int var1) {
+ this.shiftedIndex = 256 + var1;
+ if(itemsList[256 + var1] != null) {
+ System.out.println("CONFLICT @ " + var1);
+ }
+
+ itemsList[256 + var1] = this;
+ }
+
+ public Item setIconIndex(int var1) {
+ this.iconIndex = var1;
+ return this;
+ }
+
+ public int getIconFromDamage(ItemStack var1) {
+ return this.iconIndex;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ return false;
+ }
+
+ public float getStrVsBlock(ItemStack var1, Block var2) {
+ return 1.0F;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ return var1;
+ }
+
+ public int getItemStackLimit() {
+ return this.maxStackSize;
+ }
+
+ public int getMaxDamage() {
+ return this.maxDamage;
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ }
+
+ public void onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5) {
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return 1;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return false;
+ }
+
+ public void saddleEntity(ItemStack var1, EntityLiving var2) {
+ }
+}
diff --git a/source/net/minecraft/src/ItemArmor.java b/source/net/minecraft/src/ItemArmor.java
new file mode 100644
index 0000000..e267b4d
--- /dev/null
+++ b/source/net/minecraft/src/ItemArmor.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+public class ItemArmor extends Item {
+ private static final int[] damageReduceAmountArray = new int[]{3, 8, 6, 3};
+ private static final int[] maxDamageArray = new int[]{11, 16, 15, 13};
+ public final int armorLevel;
+ public final int armorType;
+ public final int damageReduceAmount;
+ public final int renderIndex;
+
+ public ItemArmor(int var1, int var2, int var3, int var4) {
+ super(var1);
+ this.armorLevel = var2;
+ this.armorType = var4;
+ this.renderIndex = var3;
+ this.damageReduceAmount = damageReduceAmountArray[var4];
+ this.maxDamage = maxDamageArray[var4] * 3 << var2;
+ this.maxStackSize = 1;
+ }
+}
diff --git a/source/net/minecraft/src/ItemAxe.java b/source/net/minecraft/src/ItemAxe.java
new file mode 100644
index 0000000..69fdc7d
--- /dev/null
+++ b/source/net/minecraft/src/ItemAxe.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+public class ItemAxe extends ItemTool {
+ private static Block[] blocksEffectiveAgainst = new Block[]{Block.planks, Block.bookshelf, Block.wood, Block.chest};
+
+ public ItemAxe(int var1, int var2) {
+ super(var1, 3, var2, blocksEffectiveAgainst);
+ }
+}
diff --git a/source/net/minecraft/src/ItemBlock.java b/source/net/minecraft/src/ItemBlock.java
new file mode 100644
index 0000000..5d15793
--- /dev/null
+++ b/source/net/minecraft/src/ItemBlock.java
@@ -0,0 +1,52 @@
+package net.minecraft.src;
+
+public class ItemBlock extends Item {
+ private int blockID;
+
+ public ItemBlock(int var1) {
+ super(var1);
+ this.blockID = var1 + 256;
+ this.setIconIndex(Block.blocksList[var1 + 256].getBlockTextureFromSide(2));
+ }
+
+ public boolean onItemUse(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;
+ }
+
+ if(var1.stackSize == 0) {
+ return false;
+ } else {
+ if(var3.canBlockBePlacedAt(this.blockID, var4, var5, var6, false)) {
+ Block var8 = Block.blocksList[this.blockID];
+ if(var3.setBlockWithNotify(var4, var5, var6, this.blockID)) {
+ Block.blocksList[this.blockID].onBlockPlaced(var3, var4, var5, var6, var7);
+ var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var8.stepSound.getStepSound(), (var8.stepSound.getVolume() + 1.0F) / 2.0F, var8.stepSound.getPitch() * 0.8F);
+ --var1.stackSize;
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemBow.java b/source/net/minecraft/src/ItemBow.java
new file mode 100644
index 0000000..3b7d240
--- /dev/null
+++ b/source/net/minecraft/src/ItemBow.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class ItemBow extends Item {
+ public ItemBow(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ if(var3.inventory.consumeInventoryItem(Item.arrow.shiftedIndex)) {
+ var2.playSoundAtEntity(var3, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F));
+ var2.spawnEntityInWorld(new EntityArrow(var2, var3));
+ }
+
+ return var1;
+ }
+}
diff --git a/source/net/minecraft/src/ItemBucket.java b/source/net/minecraft/src/ItemBucket.java
new file mode 100644
index 0000000..47af484
--- /dev/null
+++ b/source/net/minecraft/src/ItemBucket.java
@@ -0,0 +1,82 @@
+package net.minecraft.src;
+
+public class ItemBucket extends Item {
+ private int isFull;
+
+ public ItemBucket(int var1, int var2) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 64;
+ this.isFull = var2;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ 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;
+ double var11 = var3.prevPosZ + (var3.posZ - var3.prevPosZ) * (double)var4;
+ Vec3D var13 = Vec3D.createVector(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 var18 = var15 * var16;
+ float var20 = var14 * var16;
+ double var21 = 5.0D;
+ Vec3D var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
+ MovingObjectPosition var24 = var2.rayTraceBlocks_do(var13, var23, this.isFull == 0);
+ if(var24 == null) {
+ return var1;
+ } else {
+ if(var24.typeOfHit == 0) {
+ int var25 = var24.blockX;
+ int var26 = var24.blockY;
+ int var27 = var24.blockZ;
+ if(this.isFull == 0) {
+ if(var2.getBlockMaterial(var25, var26, var27) == Material.water && var2.getBlockMetadata(var25, var26, var27) == 0) {
+ var2.setBlockWithNotify(var25, var26, var27, 0);
+ return new ItemStack(Item.bucketWater);
+ }
+
+ if(var2.getBlockMaterial(var25, var26, var27) == Material.lava && var2.getBlockMetadata(var25, var26, var27) == 0) {
+ var2.setBlockWithNotify(var25, var26, var27, 0);
+ return new ItemStack(Item.bucketLava);
+ }
+ } else {
+ if(var24.sideHit == 0) {
+ --var26;
+ }
+
+ if(var24.sideHit == 1) {
+ ++var26;
+ }
+
+ if(var24.sideHit == 2) {
+ --var27;
+ }
+
+ if(var24.sideHit == 3) {
+ ++var27;
+ }
+
+ if(var24.sideHit == 4) {
+ --var25;
+ }
+
+ if(var24.sideHit == 5) {
+ ++var25;
+ }
+
+ if(var2.getBlockId(var25, var26, var27) == 0 || !var2.getBlockMaterial(var25, var26, var27).isSolid()) {
+ var2.setBlockAndMetadataWithNotify(var25, var26, var27, this.isFull, 0);
+ return new ItemStack(Item.bucketEmpty);
+ }
+ }
+ }
+
+ return var1;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemDoor.java b/source/net/minecraft/src/ItemDoor.java
new file mode 100644
index 0000000..95d9d03
--- /dev/null
+++ b/source/net/minecraft/src/ItemDoor.java
@@ -0,0 +1,62 @@
+package net.minecraft.src;
+
+public class ItemDoor extends Item {
+ public ItemDoor(int var1) {
+ super(var1);
+ this.maxDamage = 64;
+ this.maxStackSize = 1;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 != 1) {
+ return false;
+ } else {
+ ++var5;
+ if(!Block.doorWood.canPlaceBlockAt(var3, var4, var5, var6)) {
+ return false;
+ } else {
+ int var8 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
+ byte var9 = 0;
+ byte var10 = 0;
+ if(var8 == 0) {
+ var10 = 1;
+ }
+
+ if(var8 == 1) {
+ var9 = -1;
+ }
+
+ if(var8 == 2) {
+ var10 = -1;
+ }
+
+ if(var8 == 3) {
+ var9 = 1;
+ }
+
+ int var11 = (var3.isBlockNormalCube(var4 - var9, var5, var6 - var10) ? 1 : 0) + (var3.isBlockNormalCube(var4 - var9, var5 + 1, var6 - var10) ? 1 : 0);
+ int var12 = (var3.isBlockNormalCube(var4 + var9, var5, var6 + var10) ? 1 : 0) + (var3.isBlockNormalCube(var4 + var9, var5 + 1, var6 + var10) ? 1 : 0);
+ boolean var13 = var3.getBlockId(var4 - var9, var5, var6 - var10) == Block.doorWood.blockID || var3.getBlockId(var4 - var9, var5 + 1, var6 - var10) == Block.doorWood.blockID;
+ boolean var14 = var3.getBlockId(var4 + var9, var5, var6 + var10) == Block.doorWood.blockID || var3.getBlockId(var4 + var9, var5 + 1, var6 + var10) == Block.doorWood.blockID;
+ boolean var15 = false;
+ if(var13 && !var14) {
+ var15 = true;
+ } else if(var12 > var11) {
+ var15 = true;
+ }
+
+ if(var15) {
+ var8 = var8 - 1 & 3;
+ var8 += 4;
+ }
+
+ var3.setBlockWithNotify(var4, var5, var6, Block.doorWood.blockID);
+ var3.setBlockMetadataWithNotify(var4, var5, var6, var8);
+ var3.setBlockWithNotify(var4, var5 + 1, var6, Block.doorWood.blockID);
+ var3.setBlockMetadataWithNotify(var4, var5 + 1, var6, var8 + 8);
+ --var1.stackSize;
+ return true;
+ }
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemFlintAndSteel.java b/source/net/minecraft/src/ItemFlintAndSteel.java
new file mode 100644
index 0000000..cd682fc
--- /dev/null
+++ b/source/net/minecraft/src/ItemFlintAndSteel.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class ItemFlintAndSteel extends Item {
+ public ItemFlintAndSteel(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 64;
+ }
+
+ public boolean onItemUse(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);
+ if(var8 == 0) {
+ var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
+ var3.setBlockWithNotify(var4, var5, var6, Block.fire.blockID);
+ }
+
+ var1.damageItem(1);
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/ItemFood.java b/source/net/minecraft/src/ItemFood.java
new file mode 100644
index 0000000..d0b8bf9
--- /dev/null
+++ b/source/net/minecraft/src/ItemFood.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class ItemFood extends Item {
+ private int healAmount;
+
+ public ItemFood(int var1, int var2) {
+ super(var1);
+ this.healAmount = var2;
+ this.maxStackSize = 1;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ --var1.stackSize;
+ var3.heal(this.healAmount);
+ return var1;
+ }
+}
diff --git a/source/net/minecraft/src/ItemHoe.java b/source/net/minecraft/src/ItemHoe.java
new file mode 100644
index 0000000..6e2a795
--- /dev/null
+++ b/source/net/minecraft/src/ItemHoe.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public class ItemHoe extends Item {
+ public ItemHoe(int var1, int var2) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 32 << var2;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ int var8 = var3.getBlockId(var4, var5, var6);
+ Material var9 = var3.getBlockMaterial(var4, var5 + 1, var6);
+ if((var9.isSolid() || var8 != Block.grass.blockID) && var8 != Block.dirt.blockID) {
+ return false;
+ } else {
+ Block var10 = Block.tilledField;
+ var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var10.stepSound.getStepSound(), (var10.stepSound.getVolume() + 1.0F) / 2.0F, var10.stepSound.getPitch() * 0.8F);
+ var3.setBlockWithNotify(var4, var5, var6, var10.blockID);
+ var1.damageItem(1);
+ if(var3.rand.nextInt(8) == 0 && var8 == Block.grass.blockID) {
+ byte var11 = 1;
+
+ for(int var12 = 0; var12 < var11; ++var12) {
+ float var13 = 0.7F;
+ float var14 = var3.rand.nextFloat() * var13 + (1.0F - var13) * 0.5F;
+ float var15 = 1.2F;
+ float var16 = var3.rand.nextFloat() * var13 + (1.0F - var13) * 0.5F;
+ EntityItem var17 = new EntityItem(var3, (double)((float)var4 + var14), (double)((float)var5 + var15), (double)((float)var6 + var16), new ItemStack(Item.seeds));
+ var17.delayBeforeCanPickup = 10;
+ var3.spawnEntityInWorld(var17);
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemMinecart.java b/source/net/minecraft/src/ItemMinecart.java
new file mode 100644
index 0000000..2aa4d3f
--- /dev/null
+++ b/source/net/minecraft/src/ItemMinecart.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class ItemMinecart extends Item {
+ public ItemMinecart(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ int var8 = var3.getBlockId(var4, var5, var6);
+ if(var8 == Block.minecartTrack.blockID) {
+ var3.spawnEntityInWorld(new EntityMinecart(var3, (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F)));
+ --var1.stackSize;
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemPainting.java b/source/net/minecraft/src/ItemPainting.java
new file mode 100644
index 0000000..8cfa711
--- /dev/null
+++ b/source/net/minecraft/src/ItemPainting.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public class ItemPainting extends Item {
+ public ItemPainting(int var1) {
+ super(var1);
+ this.maxDamage = 64;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 == 0) {
+ return false;
+ } else if(var7 == 1) {
+ return false;
+ } else {
+ byte var8 = 0;
+ if(var7 == 4) {
+ var8 = 1;
+ }
+
+ if(var7 == 3) {
+ var8 = 2;
+ }
+
+ if(var7 == 5) {
+ var8 = 3;
+ }
+
+ EntityPainting var9 = new EntityPainting(var3, var4, var5, var6, var8);
+ if(var9.onValidSurface()) {
+ var3.spawnEntityInWorld(var9);
+ --var1.stackSize;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemPickaxe.java b/source/net/minecraft/src/ItemPickaxe.java
new file mode 100644
index 0000000..a5a9ab6
--- /dev/null
+++ b/source/net/minecraft/src/ItemPickaxe.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class ItemPickaxe extends ItemTool {
+ private static Block[] blocksEffectiveAgainst = new Block[]{Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond};
+ private int getHarvestLevel;
+
+ public ItemPickaxe(int var1, int var2) {
+ super(var1, 2, var2, blocksEffectiveAgainst);
+ this.getHarvestLevel = var2;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return var1 == Block.obsidian ? this.getHarvestLevel == 3 : (var1 != Block.blockDiamond && var1 != Block.oreDiamond ? (var1 != Block.blockGold && var1 != Block.oreGold ? (var1 != Block.blockSteel && var1 != Block.oreIron ? (var1.blockMaterial == Material.rock ? true : var1.blockMaterial == Material.iron) : this.getHarvestLevel >= 1) : this.getHarvestLevel >= 2) : this.getHarvestLevel >= 2);
+ }
+}
diff --git a/source/net/minecraft/src/ItemRenderer.java b/source/net/minecraft/src/ItemRenderer.java
new file mode 100644
index 0000000..1d1a353
--- /dev/null
+++ b/source/net/minecraft/src/ItemRenderer.java
@@ -0,0 +1,361 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class ItemRenderer {
+ private Minecraft mc;
+ private ItemStack itemToRender = null;
+ private float equippedProgress = 0.0F;
+ private float prevEquippedProgress = 0.0F;
+ private int swingProgress = 0;
+ private boolean itemSwingState = false;
+ private RenderBlocks renderBlocksInstance = new RenderBlocks();
+
+ public ItemRenderer(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void renderItemInFirstPerson(float var1) {
+ float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * var1;
+ EntityPlayerSP var3 = this.mc.thePlayer;
+ GL11.glPushMatrix();
+ GL11.glRotatef(var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var1, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var1, 0.0F, 1.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glPopMatrix();
+ float var4 = this.mc.theWorld.getBrightness(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ));
+ GL11.glColor4f(var4, var4, var4, 1.0F);
+ float var5;
+ float var6;
+ float var7;
+ float var8;
+ if(this.itemToRender != null) {
+ GL11.glPushMatrix();
+ var5 = 0.8F;
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glTranslatef(-var8 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI * 2.0F) * 0.2F, -var7 * 0.2F);
+ }
+
+ GL11.glTranslatef(0.7F * var5, -0.65F * var5 - (1.0F - var2) * 0.6F, -0.9F * var5);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glRotatef(-var7 * 20.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var8 * 20.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(-var8 * 80.0F, 1.0F, 0.0F, 0.0F);
+ }
+
+ var6 = 0.4F;
+ GL11.glScalef(var6, var6, var6);
+ if(this.itemToRender.itemID < 256 && Block.blocksList[this.itemToRender.itemID].getRenderType() == 0) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ this.renderBlocksInstance.renderBlockOnInventory(Block.blocksList[this.itemToRender.itemID]);
+ } else {
+ if(this.itemToRender.itemID < 256) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ } else {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
+ }
+
+ Tessellator var22 = Tessellator.instance;
+ var8 = (float)(this.itemToRender.getIconIndex() % 16 * 16 + 0) / 256.0F;
+ float var9 = (float)(this.itemToRender.getIconIndex() % 16 * 16 + 16) / 256.0F;
+ float var10 = (float)(this.itemToRender.getIconIndex() / 16 * 16 + 0) / 256.0F;
+ float var11 = (float)(this.itemToRender.getIconIndex() / 16 * 16 + 16) / 256.0F;
+ float var12 = 1.0F;
+ float var13 = 0.0F;
+ float var14 = 0.3F;
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glTranslatef(-var13, -var14, 0.0F);
+ float var15 = 1.5F;
+ GL11.glScalef(var15, var15, var15);
+ 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);
+ float var16 = 1.0F / 16.0F;
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, 0.0F, 1.0F);
+ var22.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)var9, (double)var11);
+ var22.addVertexWithUV((double)var12, 0.0D, 0.0D, (double)var8, (double)var11);
+ var22.addVertexWithUV((double)var12, 1.0D, 0.0D, (double)var8, (double)var10);
+ var22.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)var9, (double)var10);
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, 0.0F, -1.0F);
+ var22.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - var16), (double)var9, (double)var10);
+ var22.addVertexWithUV((double)var12, 1.0D, (double)(0.0F - var16), (double)var8, (double)var10);
+ var22.addVertexWithUV((double)var12, 0.0D, (double)(0.0F - var16), (double)var8, (double)var11);
+ var22.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - var16), (double)var9, (double)var11);
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(-1.0F, 0.0F, 0.0F);
+
+ int var17;
+ float var18;
+ float var19;
+ float var20;
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var9 + (var8 - var9) * var18 - 0.001953125F;
+ var20 = var12 * var18;
+ var22.addVertexWithUV((double)var20, 0.0D, (double)(0.0F - var16), (double)var19, (double)var11);
+ var22.addVertexWithUV((double)var20, 0.0D, 0.0D, (double)var19, (double)var11);
+ var22.addVertexWithUV((double)var20, 1.0D, 0.0D, (double)var19, (double)var10);
+ var22.addVertexWithUV((double)var20, 1.0D, (double)(0.0F - var16), (double)var19, (double)var10);
+ }
+
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(1.0F, 0.0F, 0.0F);
+
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var9 + (var8 - var9) * var18 - 0.001953125F;
+ var20 = var12 * var18 + 1.0F / 16.0F;
+ var22.addVertexWithUV((double)var20, 1.0D, (double)(0.0F - var16), (double)var19, (double)var10);
+ var22.addVertexWithUV((double)var20, 1.0D, 0.0D, (double)var19, (double)var10);
+ var22.addVertexWithUV((double)var20, 0.0D, 0.0D, (double)var19, (double)var11);
+ var22.addVertexWithUV((double)var20, 0.0D, (double)(0.0F - var16), (double)var19, (double)var11);
+ }
+
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, 1.0F, 0.0F);
+
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var11 + (var10 - var11) * var18 - 0.001953125F;
+ var20 = var12 * var18 + 1.0F / 16.0F;
+ var22.addVertexWithUV(0.0D, (double)var20, 0.0D, (double)var9, (double)var19);
+ var22.addVertexWithUV((double)var12, (double)var20, 0.0D, (double)var8, (double)var19);
+ var22.addVertexWithUV((double)var12, (double)var20, (double)(0.0F - var16), (double)var8, (double)var19);
+ var22.addVertexWithUV(0.0D, (double)var20, (double)(0.0F - var16), (double)var9, (double)var19);
+ }
+
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, -1.0F, 0.0F);
+
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var11 + (var10 - var11) * var18 - 0.001953125F;
+ var20 = var12 * var18;
+ var22.addVertexWithUV((double)var12, (double)var20, 0.0D, (double)var8, (double)var19);
+ var22.addVertexWithUV(0.0D, (double)var20, 0.0D, (double)var9, (double)var19);
+ var22.addVertexWithUV(0.0D, (double)var20, (double)(0.0F - var16), (double)var9, (double)var19);
+ var22.addVertexWithUV((double)var12, (double)var20, (double)(0.0F - var16), (double)var8, (double)var19);
+ }
+
+ var22.draw();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ }
+
+ GL11.glPopMatrix();
+ } else {
+ GL11.glPushMatrix();
+ var5 = 0.8F;
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glTranslatef(-var8 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI * 2.0F) * 0.4F, -var7 * 0.4F);
+ }
+
+ GL11.glTranslatef(0.8F * var5, -(12.0F / 16.0F) * var5 - (1.0F - var2) * 0.6F, -0.9F * var5);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glRotatef(var8 * 70.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var7 * 20.0F, 0.0F, 0.0F, 1.0F);
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTextureForDownloadableImage(this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));
+ GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
+ GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
+ 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);
+ Render var21 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
+ RenderPlayer var23 = (RenderPlayer)var21;
+ var8 = 1.0F;
+ GL11.glScalef(var8, var8, var8);
+ var23.drawFirstPersonHand();
+ GL11.glPopMatrix();
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ RenderHelper.disableStandardItemLighting();
+ }
+
+ public void renderOverlays(float var1) {
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ int var2;
+ if(this.mc.thePlayer.fire > 0) {
+ var2 = this.mc.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
+ this.renderFireInFirstPerson(var1);
+ }
+
+ if(this.mc.theWorld.playerEntity.isEntityInsideOpaqueBlock()) {
+ 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 var5 = this.mc.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var5);
+ int var6 = this.mc.theWorld.getBlockId(var2, var3, var4);
+ if(Block.blocksList[var6] != null) {
+ this.renderInsideOfBlock(var1, Block.blocksList[var6].getBlockTextureFromSide(2));
+ }
+ }
+
+ if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
+ var2 = this.mc.renderEngine.getTexture("/water.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
+ this.renderWarpedTextureOverlay(var1);
+ }
+
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+
+ private void renderInsideOfBlock(float var1, int var2) {
+ Tessellator var3 = Tessellator.instance;
+ this.mc.thePlayer.getEntityBrightness(var1);
+ float var4 = 0.1F;
+ GL11.glColor4f(var4, var4, var4, 0.5F);
+ GL11.glPushMatrix();
+ float var5 = -1.0F;
+ float var6 = 1.0F;
+ float var7 = -1.0F;
+ float var8 = 1.0F;
+ float var9 = -0.5F;
+ float var10 = 0.0078125F;
+ float var11 = (float)(var2 % 16) / 256.0F - var10;
+ float var12 = ((float)(var2 % 16) + 15.99F) / 256.0F + var10;
+ float var13 = (float)(var2 / 16) / 256.0F - var10;
+ float var14 = ((float)(var2 / 16) + 15.99F) / 256.0F + var10;
+ var3.startDrawingQuads();
+ var3.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)var12, (double)var14);
+ var3.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)var11, (double)var14);
+ var3.addVertexWithUV((double)var6, (double)var8, (double)var9, (double)var11, (double)var13);
+ var3.addVertexWithUV((double)var5, (double)var8, (double)var9, (double)var12, (double)var13);
+ var3.draw();
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ private void renderWarpedTextureOverlay(float var1) {
+ Tessellator var2 = Tessellator.instance;
+ float var3 = this.mc.thePlayer.getEntityBrightness(var1);
+ GL11.glColor4f(var3, var3, var3, 0.5F);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glPushMatrix();
+ float var4 = 4.0F;
+ float var5 = -1.0F;
+ float var6 = 1.0F;
+ float var7 = -1.0F;
+ float var8 = 1.0F;
+ float var9 = -0.5F;
+ float var10 = -this.mc.thePlayer.rotationYaw / 64.0F;
+ float var11 = this.mc.thePlayer.rotationPitch / 64.0F;
+ var2.startDrawingQuads();
+ var2.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)(var4 + var10), (double)(var4 + var11));
+ var2.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)(0.0F + var10), (double)(var4 + var11));
+ var2.addVertexWithUV((double)var6, (double)var8, (double)var9, (double)(0.0F + var10), (double)(0.0F + var11));
+ var2.addVertexWithUV((double)var5, (double)var8, (double)var9, (double)(var4 + var10), (double)(0.0F + var11));
+ var2.draw();
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ private void renderFireInFirstPerson(float var1) {
+ 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) {
+ GL11.glPushMatrix();
+ int var5 = Block.fire.blockIndexInTexture + var4 * 16;
+ int var6 = (var5 & 15) << 4;
+ int var7 = var5 & 240;
+ float var8 = (float)var6 / 256.0F;
+ float var9 = ((float)var6 + 15.99F) / 256.0F;
+ float var10 = (float)var7 / 256.0F;
+ float var11 = ((float)var7 + 15.99F) / 256.0F;
+ float var12 = (0.0F - var3) / 2.0F;
+ float var13 = var12 + var3;
+ float var14 = 0.0F - var3 / 2.0F;
+ float var15 = var14 + var3;
+ float var16 = -0.5F;
+ GL11.glTranslatef((float)(-(var4 * 2 - 1)) * 0.24F, -0.3F, 0.0F);
+ GL11.glRotatef((float)(var4 * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
+ var2.startDrawingQuads();
+ var2.addVertexWithUV((double)var12, (double)var14, (double)var16, (double)var9, (double)var11);
+ var2.addVertexWithUV((double)var13, (double)var14, (double)var16, (double)var8, (double)var11);
+ var2.addVertexWithUV((double)var13, (double)var15, (double)var16, (double)var8, (double)var10);
+ var2.addVertexWithUV((double)var12, (double)var15, (double)var16, (double)var9, (double)var10);
+ var2.draw();
+ GL11.glPopMatrix();
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public void updateEquippedItem() {
+ this.prevEquippedProgress = this.equippedProgress;
+ if(this.itemSwingState) {
+ ++this.swingProgress;
+ if(this.swingProgress == 8) {
+ this.swingProgress = 0;
+ this.itemSwingState = false;
+ }
+ }
+
+ EntityPlayerSP var1 = this.mc.thePlayer;
+ ItemStack var2 = var1.inventory.getCurrentItem();
+ float var4 = 0.4F;
+ float var5 = var2 == this.itemToRender ? 1.0F : 0.0F;
+ float var6 = var5 - this.equippedProgress;
+ if(var6 < -var4) {
+ var6 = -var4;
+ }
+
+ if(var6 > var4) {
+ var6 = var4;
+ }
+
+ this.equippedProgress += var6;
+ if(this.equippedProgress < 0.1F) {
+ this.itemToRender = var2;
+ }
+
+ }
+
+ public void resetEquippedProgress() {
+ this.equippedProgress = 0.0F;
+ }
+
+ public void swing() {
+ this.swingProgress = -1;
+ this.itemSwingState = true;
+ }
+
+ public void resetEquippedProgress2() {
+ this.equippedProgress = 0.0F;
+ }
+}
diff --git a/source/net/minecraft/src/ItemSaddle.java b/source/net/minecraft/src/ItemSaddle.java
new file mode 100644
index 0000000..9bb552f
--- /dev/null
+++ b/source/net/minecraft/src/ItemSaddle.java
@@ -0,0 +1,24 @@
+package net.minecraft.src;
+
+public class ItemSaddle extends Item {
+ public ItemSaddle(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 64;
+ }
+
+ public void saddleEntity(ItemStack var1, EntityLiving var2) {
+ if(var2 instanceof EntityPig) {
+ EntityPig var3 = (EntityPig)var2;
+ if(!var3.saddled) {
+ var3.saddled = true;
+ --var1.stackSize;
+ }
+ }
+
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ this.saddleEntity(var1, var2);
+ }
+}
diff --git a/source/net/minecraft/src/ItemSeeds.java b/source/net/minecraft/src/ItemSeeds.java
new file mode 100644
index 0000000..91ad225
--- /dev/null
+++ b/source/net/minecraft/src/ItemSeeds.java
@@ -0,0 +1,25 @@
+package net.minecraft.src;
+
+public class ItemSeeds extends Item {
+ private int blockType;
+
+ public ItemSeeds(int var1, int var2) {
+ super(var1);
+ this.blockType = var2;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 != 1) {
+ return false;
+ } else {
+ int var8 = var3.getBlockId(var4, var5, var6);
+ if(var8 == Block.tilledField.blockID) {
+ var3.setBlockWithNotify(var4, var5 + 1, var6, this.blockType);
+ --var1.stackSize;
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemSign.java b/source/net/minecraft/src/ItemSign.java
new file mode 100644
index 0000000..f760b3e
--- /dev/null
+++ b/source/net/minecraft/src/ItemSign.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ItemSign extends Item {
+ public ItemSign(int var1) {
+ super(var1);
+ this.maxDamage = 64;
+ this.maxStackSize = 1;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 != 1) {
+ return false;
+ } else {
+ ++var5;
+ if(!Block.signStanding.canPlaceBlockAt(var3, var4, var5, var6)) {
+ return false;
+ } else {
+ var3.setBlockWithNotify(var4, var5, var6, Block.signStanding.blockID);
+ var3.setBlockMetadataWithNotify(var4, var5, var6, MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 16.0F / 360.0F) - 0.5D) & 15);
+ --var1.stackSize;
+ var2.displayGUIEditSign((TileEntitySign)var3.getBlockTileEntity(var4, var5, var6));
+ return true;
+ }
+ }
+ }
+}
diff --git a/source/net/minecraft/src/ItemSoup.java b/source/net/minecraft/src/ItemSoup.java
new file mode 100644
index 0000000..7143549
--- /dev/null
+++ b/source/net/minecraft/src/ItemSoup.java
@@ -0,0 +1,12 @@
+package net.minecraft.src;
+
+public class ItemSoup extends ItemFood {
+ public ItemSoup(int var1, int var2) {
+ super(var1, var2);
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ super.onItemRightClick(var1, var2, var3);
+ return new ItemStack(Item.bowlEmpty);
+ }
+}
diff --git a/source/net/minecraft/src/ItemSpade.java b/source/net/minecraft/src/ItemSpade.java
new file mode 100644
index 0000000..5328e68
--- /dev/null
+++ b/source/net/minecraft/src/ItemSpade.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+public class ItemSpade extends ItemTool {
+ private static Block[] blocksEffectiveAgainst = new Block[]{Block.grass, Block.dirt, Block.sand, Block.gravel};
+
+ public ItemSpade(int var1, int var2) {
+ super(var1, 1, var2, blocksEffectiveAgainst);
+ }
+}
diff --git a/source/net/minecraft/src/ItemStack.java b/source/net/minecraft/src/ItemStack.java
new file mode 100644
index 0000000..83d7a12
--- /dev/null
+++ b/source/net/minecraft/src/ItemStack.java
@@ -0,0 +1,128 @@
+package net.minecraft.src;
+
+public final class ItemStack {
+ public int stackSize;
+ public int animationsToGo;
+ public int itemID;
+ public int itemDmg;
+
+ public ItemStack(Block var1) {
+ this((Block)var1, 1);
+ }
+
+ public ItemStack(Block var1, int var2) {
+ this(var1.blockID, var2);
+ }
+
+ public ItemStack(Item var1) {
+ this((Item)var1, 1);
+ }
+
+ public ItemStack(Item var1, int var2) {
+ this(var1.shiftedIndex, var2);
+ }
+
+ public ItemStack(int var1) {
+ this(var1, 1);
+ }
+
+ public ItemStack(int var1, int var2) {
+ this.stackSize = 0;
+ this.itemID = var1;
+ this.stackSize = var2;
+ }
+
+ public ItemStack(int var1, int var2, int var3) {
+ this.stackSize = 0;
+ this.itemID = var1;
+ this.stackSize = var2;
+ this.itemDmg = var3;
+ }
+
+ public ItemStack(NBTTagCompound var1) {
+ this.stackSize = 0;
+ this.readFromNBT(var1);
+ }
+
+ public ItemStack splitStack(int var1) {
+ this.stackSize -= var1;
+ return new ItemStack(this.itemID, var1, this.itemDmg);
+ }
+
+ public Item getItem() {
+ return Item.itemsList[this.itemID];
+ }
+
+ public int getIconIndex() {
+ return this.getItem().getIconFromDamage(this);
+ }
+
+ public boolean useItem(EntityPlayer var1, World var2, int var3, int var4, int var5, int var6) {
+ return this.getItem().onItemUse(this, var1, var2, var3, var4, var5, var6);
+ }
+
+ 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 NBTTagCompound writeToNBT(NBTTagCompound var1) {
+ var1.setShort("id", (short)this.itemID);
+ var1.setByte("Count", (byte)this.stackSize);
+ var1.setShort("Damage", (short)this.itemDmg);
+ return var1;
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ this.itemID = var1.getShort("id");
+ this.stackSize = var1.getByte("Count");
+ this.itemDmg = var1.getShort("Damage");
+ }
+
+ public int getMaxStackSize() {
+ return this.getItem().getItemStackLimit();
+ }
+
+ public int getMaxDamage() {
+ return Item.itemsList[this.itemID].getMaxDamage();
+ }
+
+ public void damageItem(int var1) {
+ this.itemDmg += var1;
+ if(this.itemDmg > this.getMaxDamage()) {
+ --this.stackSize;
+ if(this.stackSize < 0) {
+ this.stackSize = 0;
+ }
+
+ this.itemDmg = 0;
+ }
+
+ }
+
+ public void hitEntity(EntityLiving var1) {
+ Item.itemsList[this.itemID].hitEntity(this, var1);
+ }
+
+ public void onDestroyBlock(int var1, int var2, int var3, int var4) {
+ Item.itemsList[this.itemID].onBlockDestroyed(this, var1, var2, var3, var4);
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return Item.itemsList[this.itemID].getDamageVsEntity(var1);
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return Item.itemsList[this.itemID].canHarvestBlock(var1);
+ }
+
+ public void onItemDestroyedByUse(EntityPlayer var1) {
+ }
+
+ public void useItemOnEntity(EntityLiving var1) {
+ Item.itemsList[this.itemID].saddleEntity(this, var1);
+ }
+}
diff --git a/source/net/minecraft/src/ItemSword.java b/source/net/minecraft/src/ItemSword.java
new file mode 100644
index 0000000..a7c1046
--- /dev/null
+++ b/source/net/minecraft/src/ItemSword.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+public class ItemSword extends Item {
+ private int weaponDamage;
+
+ public ItemSword(int var1, int var2) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 32 << var2;
+ this.weaponDamage = 4 + var2 * 2;
+ }
+
+ public float getStrVsBlock(ItemStack var1, Block var2) {
+ return 1.5F;
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ var1.damageItem(1);
+ }
+
+ public void onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5) {
+ var1.damageItem(2);
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return this.weaponDamage;
+ }
+}
diff --git a/source/net/minecraft/src/ItemTool.java b/source/net/minecraft/src/ItemTool.java
new file mode 100644
index 0000000..9c231e1
--- /dev/null
+++ b/source/net/minecraft/src/ItemTool.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class ItemTool extends Item {
+ private Block[] blocksEffectiveAgainst;
+ private float efficiencyOnProperMaterial = 4.0F;
+ private int damageVsEntity;
+ protected int toolMaterial;
+
+ public ItemTool(int var1, int var2, int var3, Block[] var4) {
+ super(var1);
+ this.toolMaterial = var3;
+ this.blocksEffectiveAgainst = var4;
+ this.maxStackSize = 1;
+ this.maxDamage = 32 << var3;
+ if(var3 == 3) {
+ this.maxDamage *= 2;
+ }
+
+ this.efficiencyOnProperMaterial = (float)((var3 + 1) * 2);
+ this.damageVsEntity = var2 + var3;
+ }
+
+ public float getStrVsBlock(ItemStack var1, Block var2) {
+ for(int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3) {
+ if(this.blocksEffectiveAgainst[var3] == var2) {
+ return this.efficiencyOnProperMaterial;
+ }
+ }
+
+ return 1.0F;
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ var1.damageItem(2);
+ }
+
+ public void onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5) {
+ var1.damageItem(1);
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return this.damageVsEntity;
+ }
+}
diff --git a/source/net/minecraft/src/KeyBinding.java b/source/net/minecraft/src/KeyBinding.java
new file mode 100644
index 0000000..6d27b38
--- /dev/null
+++ b/source/net/minecraft/src/KeyBinding.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class KeyBinding {
+ public String keyDescription;
+ public int keyCode;
+
+ public KeyBinding(String var1, int var2) {
+ this.keyDescription = var1;
+ this.keyCode = var2;
+ }
+}
diff --git a/source/net/minecraft/src/LoadingScreenRenderer.java b/source/net/minecraft/src/LoadingScreenRenderer.java
new file mode 100644
index 0000000..435c9ac
--- /dev/null
+++ b/source/net/minecraft/src/LoadingScreenRenderer.java
@@ -0,0 +1,124 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+
+public class LoadingScreenRenderer implements IProgressUpdate {
+ private String currentlyDisplayedProgress = "";
+ private Minecraft mc;
+ private String currentlyDisplayedText = "";
+ private long systemTime = System.currentTimeMillis();
+ private boolean printText = false;
+
+ public LoadingScreenRenderer(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void printText(String var1) {
+ this.printText = false;
+ this.drawScreen(var1);
+ }
+
+ public void displayProgressMessage(String var1) {
+ this.printText = true;
+ this.drawScreen(this.currentlyDisplayedText);
+ }
+
+ public void drawScreen(String var1) {
+ if(!this.mc.running) {
+ if(!this.printText) {
+ throw new MinecraftError();
+ }
+ } else {
+ this.currentlyDisplayedText = var1;
+ ScaledResolution var2 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var3 = var2.getScaledWidth();
+ int var4 = var2.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var3, (double)var4, 0.0D, 100.0D, 300.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -200.0F);
+ }
+ }
+
+ public void displayLoadingString(String var1) {
+ if(!this.mc.running) {
+ if(!this.printText) {
+ throw new MinecraftError();
+ }
+ } else {
+ this.systemTime = 0L;
+ this.currentlyDisplayedProgress = var1;
+ this.setLoadingProgress(-1);
+ this.systemTime = 0L;
+ }
+ }
+
+ public void setLoadingProgress(int var1) {
+ if(!this.mc.running) {
+ if(!this.printText) {
+ throw new MinecraftError();
+ }
+ } else {
+ long var2 = System.currentTimeMillis();
+ if(var2 - this.systemTime >= 20L) {
+ this.systemTime = var2;
+ ScaledResolution var4 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var5 = var4.getScaledWidth();
+ int var6 = var4.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var5, (double)var6, 0.0D, 100.0D, 300.0D);
+ 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);
+ Tessellator var7 = Tessellator.instance;
+ int var8 = this.mc.renderEngine.getTexture("/dirt.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var8);
+ float var9 = 32.0F;
+ var7.startDrawingQuads();
+ var7.setColorOpaque_I(4210752);
+ var7.addVertexWithUV(0.0D, (double)var6, 0.0D, 0.0D, (double)((float)var6 / var9));
+ var7.addVertexWithUV((double)var5, (double)var6, 0.0D, (double)((float)var5 / var9), (double)((float)var6 / var9));
+ var7.addVertexWithUV((double)var5, 0.0D, 0.0D, (double)((float)var5 / var9), 0.0D);
+ var7.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
+ var7.draw();
+ if(var1 >= 0) {
+ byte var10 = 100;
+ byte var11 = 2;
+ int var12 = var5 / 2 - var10 / 2;
+ int var13 = var6 / 2 + 16;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ var7.startDrawingQuads();
+ var7.setColorOpaque_I(8421504);
+ var7.addVertex((double)var12, (double)var13, 0.0D);
+ var7.addVertex((double)var12, (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var10), (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var10), (double)var13, 0.0D);
+ var7.setColorOpaque_I(8454016);
+ var7.addVertex((double)var12, (double)var13, 0.0D);
+ var7.addVertex((double)var12, (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var1), (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var1), (double)var13, 0.0D);
+ var7.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, var6 / 2 - 4 - 16, 16777215);
+ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedProgress, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedProgress)) / 2, var6 / 2 - 4 + 8, 16777215);
+ Display.update();
+
+ try {
+ Thread.yield();
+ } catch (Exception var14) {
+ }
+
+ }
+ }
+ }
+}
diff --git a/source/net/minecraft/src/Material.java b/source/net/minecraft/src/Material.java
new file mode 100644
index 0000000..1f1bf08
--- /dev/null
+++ b/source/net/minecraft/src/Material.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public class Material {
+ public static final Material air = new MaterialTransparent();
+ public static final Material ground = new Material();
+ public static final Material wood = new Material();
+ public static final Material rock = new Material();
+ public static final Material iron = new Material();
+ public static final Material water = new MaterialLiquid();
+ public static final Material lava = new MaterialLiquid();
+ public static final Material leaves = new Material();
+ public static final Material plants = new MaterialLogic();
+ public static final Material sponge = new Material();
+ public static final Material cloth = new Material();
+ public static final Material fire = new MaterialTransparent();
+ public static final Material sand = new Material();
+ public static final Material circuits = new MaterialLogic();
+ public static final Material glass = new Material();
+ public static final Material tnt = new Material();
+ public static final Material unused = new Material();
+
+ public boolean getIsLiquid() {
+ return false;
+ }
+
+ public boolean isSolid() {
+ return true;
+ }
+
+ public boolean getCanBlockGrass() {
+ return true;
+ }
+
+ public boolean getIsSolid() {
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/MaterialLiquid.java b/source/net/minecraft/src/MaterialLiquid.java
new file mode 100644
index 0000000..54efda3
--- /dev/null
+++ b/source/net/minecraft/src/MaterialLiquid.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class MaterialLiquid extends Material {
+ public boolean getIsLiquid() {
+ return true;
+ }
+
+ public boolean isSolid() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/MaterialLogic.java b/source/net/minecraft/src/MaterialLogic.java
new file mode 100644
index 0000000..19d5b0d
--- /dev/null
+++ b/source/net/minecraft/src/MaterialLogic.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class MaterialLogic extends Material {
+ public boolean isSolid() {
+ return false;
+ }
+
+ public boolean getCanBlockGrass() {
+ return false;
+ }
+
+ public boolean getIsSolid() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/MaterialTransparent.java b/source/net/minecraft/src/MaterialTransparent.java
new file mode 100644
index 0000000..a475877
--- /dev/null
+++ b/source/net/minecraft/src/MaterialTransparent.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class MaterialTransparent extends Material {
+ public boolean isSolid() {
+ return false;
+ }
+
+ public boolean getCanBlockGrass() {
+ return false;
+ }
+
+ public boolean getIsSolid() {
+ return false;
+ }
+}
diff --git a/source/net/minecraft/src/MathHelper.java b/source/net/minecraft/src/MathHelper.java
new file mode 100644
index 0000000..bd32d54
--- /dev/null
+++ b/source/net/minecraft/src/MathHelper.java
@@ -0,0 +1,58 @@
+package net.minecraft.src;
+
+public class MathHelper {
+ 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 floor_double(double var0) {
+ int var2 = (int)var0;
+ return var0 < (double)var2 ? var2 - 1 : var2;
+ }
+
+ public static float abs(float var0) {
+ return var0 >= 0.0F ? var0 : -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;
+ }
+
+ static {
+ for(int var0 = 0; var0 < 65536; ++var0) {
+ SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D);
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/MetadataChunkBlock.java b/source/net/minecraft/src/MetadataChunkBlock.java
new file mode 100644
index 0000000..6f9e4d9
--- /dev/null
+++ b/source/net/minecraft/src/MetadataChunkBlock.java
@@ -0,0 +1,153 @@
+package net.minecraft.src;
+
+public class MetadataChunkBlock {
+ public final EnumSkyBlock skyBlock;
+ public int x;
+ public int y;
+ public int z;
+ public int maxX;
+ public int maxY;
+ public int maxZ;
+
+ public MetadataChunkBlock(EnumSkyBlock var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ this.skyBlock = var1;
+ this.x = var2;
+ this.y = var3;
+ this.z = var4;
+ this.maxX = var5;
+ this.maxY = var6;
+ this.maxZ = var7;
+ }
+
+ public void updateLight(World var1) {
+ for(int var2 = this.x; var2 <= this.maxX; ++var2) {
+ for(int var3 = this.z; var3 <= this.maxZ; ++var3) {
+ if(var1.blockExists(var2, 0, var3)) {
+ for(int var4 = this.y; var4 <= this.maxY; ++var4) {
+ if(var4 >= 0 && var4 < 128) {
+ int var5 = var1.getSavedLightValue(this.skyBlock, var2, var4, var3);
+ boolean var6 = false;
+ int var7 = var1.getBlockId(var2, var4, var3);
+ int var8 = Block.lightOpacity[var7];
+ if(var8 == 0) {
+ var8 = 1;
+ }
+
+ int var9 = 0;
+ if(this.skyBlock == EnumSkyBlock.Sky) {
+ if(var1.canExistingBlockSeeTheSky(var2, var4, var3)) {
+ var9 = 15;
+ }
+ } else if(this.skyBlock == EnumSkyBlock.Block) {
+ var9 = Block.lightValue[var7];
+ }
+
+ int var10;
+ int var16;
+ if(var8 >= 15 && var9 == 0) {
+ var16 = 0;
+ } else {
+ var10 = var1.getSavedLightValue(this.skyBlock, var2 - 1, var4, var3);
+ int var11 = var1.getSavedLightValue(this.skyBlock, var2 + 1, var4, var3);
+ int var12 = var1.getSavedLightValue(this.skyBlock, var2, var4 - 1, var3);
+ int var13 = var1.getSavedLightValue(this.skyBlock, var2, var4 + 1, var3);
+ int var14 = var1.getSavedLightValue(this.skyBlock, var2, var4, var3 - 1);
+ int var15 = var1.getSavedLightValue(this.skyBlock, var2, var4, var3 + 1);
+ var16 = var10;
+ if(var11 > var10) {
+ var16 = var11;
+ }
+
+ if(var12 > var16) {
+ var16 = var12;
+ }
+
+ if(var13 > var16) {
+ var16 = var13;
+ }
+
+ if(var14 > var16) {
+ var16 = var14;
+ }
+
+ if(var15 > var16) {
+ var16 = var15;
+ }
+
+ var16 -= var8;
+ if(var16 < 0) {
+ var16 = 0;
+ }
+
+ if(var9 > var16) {
+ var16 = var9;
+ }
+ }
+
+ if(var5 != var16) {
+ var1.setLightValue(this.skyBlock, var2, var4, var3, var16);
+ var10 = var16 - 1;
+ if(var10 < 0) {
+ var10 = 0;
+ }
+
+ var1.neighborLightPropagationChanged(this.skyBlock, var2 - 1, var4, var3, var10);
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4 - 1, var3, var10);
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4, var3 - 1, var10);
+ if(var2 + 1 >= this.maxX) {
+ var1.neighborLightPropagationChanged(this.skyBlock, var2 + 1, var4, var3, var10);
+ }
+
+ if(var4 + 1 >= this.maxY) {
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4 + 1, var3, var10);
+ }
+
+ if(var3 + 1 >= this.maxZ) {
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4, var3 + 1, var10);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ public boolean getLightUpdated(int var1, int var2, int var3, int var4, int var5, int var6) {
+ if(var1 >= this.x && var2 >= this.y && var3 >= this.z && var4 <= this.maxX && var5 <= this.maxY && var6 <= this.maxZ) {
+ return true;
+ } else {
+ byte var7 = 1;
+ if(var1 >= this.x - var7 && var2 >= this.y - var7 && var3 >= this.z - var7 && var4 <= this.maxX + var7 && var5 <= this.maxY + var7 && var6 <= this.maxZ + var7) {
+ if(var1 < this.x) {
+ this.x = var1;
+ }
+
+ if(var2 < this.y) {
+ this.y = var2;
+ }
+
+ if(var3 < this.z) {
+ this.z = var3;
+ }
+
+ if(var4 > this.maxX) {
+ this.maxX = var4;
+ }
+
+ if(var5 > this.maxY) {
+ this.maxY = var5;
+ }
+
+ if(var6 > this.maxZ) {
+ this.maxZ = var6;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+}
diff --git a/source/net/minecraft/src/MinecartTrackLogic.java b/source/net/minecraft/src/MinecartTrackLogic.java
new file mode 100644
index 0000000..87e209a
--- /dev/null
+++ b/source/net/minecraft/src/MinecartTrackLogic.java
@@ -0,0 +1,250 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class MinecartTrackLogic {
+ private World worldObj;
+ private int trackX;
+ private int trackY;
+ private int trackZ;
+ private int trackMetadata;
+ private List connectedTracks;
+ final BlockMinecartTrack minecartTrack;
+
+ public MinecartTrackLogic(BlockMinecartTrack var1, World var2, int var3, int var4, int var5) {
+ this.minecartTrack = var1;
+ this.connectedTracks = new ArrayList();
+ this.worldObj = var2;
+ this.trackX = var3;
+ this.trackY = var4;
+ this.trackZ = var5;
+ this.trackMetadata = var2.getBlockMetadata(var3, var4, var5);
+ this.calculateConnectedTracks();
+ }
+
+ private void calculateConnectedTracks() {
+ this.connectedTracks.clear();
+ if(this.trackMetadata == 0) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 1) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ } else if(this.trackMetadata == 2) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY + 1, this.trackZ));
+ } else if(this.trackMetadata == 3) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY + 1, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ } else if(this.trackMetadata == 4) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY + 1, this.trackZ - 1));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 5) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY + 1, this.trackZ + 1));
+ } else if(this.trackMetadata == 6) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 7) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 8) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ } else if(this.trackMetadata == 9) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ }
+
+ }
+
+ private void refreshConnectedTracks() {
+ for(int var1 = 0; var1 < this.connectedTracks.size(); ++var1) {
+ MinecartTrackLogic var2 = this.getMinecartTrackLogic((ChunkPosition)this.connectedTracks.get(var1));
+ if(var2 != null && var2.isConnectedTo(this)) {
+ this.connectedTracks.set(var1, new ChunkPosition(var2.trackX, var2.trackY, var2.trackZ));
+ } else {
+ this.connectedTracks.remove(var1--);
+ }
+ }
+
+ }
+
+ private MinecartTrackLogic getMinecartTrackLogic(ChunkPosition var1) {
+ return this.worldObj.getBlockId(var1.x, var1.y, var1.z) == this.minecartTrack.blockID ? new MinecartTrackLogic(this.minecartTrack, this.worldObj, var1.x, var1.y, var1.z) : (this.worldObj.getBlockId(var1.x, var1.y + 1, var1.z) == this.minecartTrack.blockID ? new MinecartTrackLogic(this.minecartTrack, this.worldObj, var1.x, var1.y + 1, var1.z) : (this.worldObj.getBlockId(var1.x, var1.y - 1, var1.z) == this.minecartTrack.blockID ? new MinecartTrackLogic(this.minecartTrack, this.worldObj, var1.x, var1.y - 1, var1.z) : null));
+ }
+
+ private boolean isConnectedTo(MinecartTrackLogic var1) {
+ for(int var2 = 0; var2 < this.connectedTracks.size(); ++var2) {
+ ChunkPosition var3 = (ChunkPosition)this.connectedTracks.get(var2);
+ if(var3.x == var1.trackX && var3.z == var1.trackZ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean isInTrack(int var1, int var2, int var3) {
+ for(int var4 = 0; var4 < this.connectedTracks.size(); ++var4) {
+ ChunkPosition var5 = (ChunkPosition)this.connectedTracks.get(var4);
+ if(var5.x == var1 && var5.z == var3) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean handleKeyPress(MinecartTrackLogic var1) {
+ if(this.isConnectedTo(var1)) {
+ return true;
+ } else if(this.connectedTracks.size() == 2) {
+ return false;
+ } else if(this.connectedTracks.size() == 0) {
+ return true;
+ } else {
+ ChunkPosition var2 = (ChunkPosition)this.connectedTracks.get(0);
+ return var1.trackY == this.trackY && var2.y == this.trackY ? true : true;
+ }
+ }
+
+ private void connectToNeighbor(MinecartTrackLogic var1) {
+ this.connectedTracks.add(new ChunkPosition(var1.trackX, var1.trackY, var1.trackZ));
+ boolean var2 = this.isInTrack(this.trackX, this.trackY, this.trackZ - 1);
+ boolean var3 = this.isInTrack(this.trackX, this.trackY, this.trackZ + 1);
+ boolean var4 = this.isInTrack(this.trackX - 1, this.trackY, this.trackZ);
+ boolean var5 = this.isInTrack(this.trackX + 1, this.trackY, this.trackZ);
+ byte var6 = -1;
+ if(var2 || var3) {
+ var6 = 0;
+ }
+
+ if(var4 || var5) {
+ var6 = 1;
+ }
+
+ if(var3 && var5 && !var2 && !var4) {
+ var6 = 6;
+ }
+
+ if(var3 && var4 && !var2 && !var5) {
+ var6 = 7;
+ }
+
+ if(var2 && var4 && !var3 && !var5) {
+ var6 = 8;
+ }
+
+ if(var2 && var5 && !var3 && !var4) {
+ var6 = 9;
+ }
+
+ if(var6 == 0) {
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ - 1) == this.minecartTrack.blockID) {
+ var6 = 4;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ + 1) == this.minecartTrack.blockID) {
+ var6 = 5;
+ }
+ }
+
+ if(var6 == 1) {
+ if(this.worldObj.getBlockId(this.trackX + 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var6 = 2;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX - 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var6 = 3;
+ }
+ }
+
+ if(var6 < 0) {
+ var6 = 0;
+ }
+
+ this.worldObj.setBlockMetadataWithNotify(this.trackX, this.trackY, this.trackZ, var6);
+ }
+
+ private boolean canConnectFrom(int var1, int var2, int var3) {
+ MinecartTrackLogic var4 = this.getMinecartTrackLogic(new ChunkPosition(var1, var2, var3));
+ if(var4 == null) {
+ return false;
+ } else {
+ var4.refreshConnectedTracks();
+ return var4.handleKeyPress(this);
+ }
+ }
+
+ public void place() {
+ boolean var1 = this.canConnectFrom(this.trackX, this.trackY, this.trackZ - 1);
+ boolean var2 = this.canConnectFrom(this.trackX, this.trackY, this.trackZ + 1);
+ boolean var3 = this.canConnectFrom(this.trackX - 1, this.trackY, this.trackZ);
+ boolean var4 = this.canConnectFrom(this.trackX + 1, this.trackY, this.trackZ);
+ byte var5 = -1;
+ if(var1 || var2) {
+ var5 = 0;
+ }
+
+ if(var3 || var4) {
+ var5 = 1;
+ }
+
+ if(var2 && var4 && !var1 && !var3) {
+ var5 = 6;
+ }
+
+ if(var2 && var3 && !var1 && !var4) {
+ var5 = 7;
+ }
+
+ if(var1 && var3 && !var2 && !var4) {
+ var5 = 8;
+ }
+
+ if(var1 && var4 && !var2 && !var3) {
+ var5 = 9;
+ }
+
+ if(var5 == 0) {
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ - 1) == this.minecartTrack.blockID) {
+ var5 = 4;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ + 1) == this.minecartTrack.blockID) {
+ var5 = 5;
+ }
+ }
+
+ if(var5 == 1) {
+ if(this.worldObj.getBlockId(this.trackX + 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var5 = 2;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX - 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var5 = 3;
+ }
+ }
+
+ if(var5 < 0) {
+ var5 = 0;
+ }
+
+ this.trackMetadata = var5;
+ this.calculateConnectedTracks();
+ this.worldObj.setBlockMetadataWithNotify(this.trackX, this.trackY, this.trackZ, var5);
+
+ for(int var6 = 0; var6 < this.connectedTracks.size(); ++var6) {
+ MinecartTrackLogic var7 = this.getMinecartTrackLogic((ChunkPosition)this.connectedTracks.get(var6));
+ if(var7 != null) {
+ var7.refreshConnectedTracks();
+ if(var7.handleKeyPress(this)) {
+ var7.connectToNeighbor(this);
+ }
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/Minecraft.java b/source/net/minecraft/src/Minecraft.java
new file mode 100644
index 0000000..b16dd43
--- /dev/null
+++ b/source/net/minecraft/src/Minecraft.java
@@ -0,0 +1,1025 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.io.File;
+import net.minecraft.client.MinecraftApplet;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Controllers;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+
+public abstract class Minecraft implements Runnable {
+ public PlayerController playerController = new PlayerControllerSP(this);
+ private boolean fullscreen = false;
+ public int displayWidth;
+ public int displayHeight;
+ private OpenGlCapsChecker glCapabilities;
+ private Timer timer = new Timer(20.0F);
+ public World theWorld;
+ public RenderGlobal renderGlobal;
+ public EntityPlayerSP thePlayer;
+ public EffectRenderer effectRenderer;
+ public Session session = null;
+ public String minecraftUri;
+ public Canvas mcCanvas;
+ public boolean appletMode = true;
+ public volatile boolean isGamePaused = false;
+ public RenderEngine renderEngine;
+ public FontRenderer fontRenderer;
+ public GuiScreen currentScreen = null;
+ public LoadingScreenRenderer loadingScreen = new LoadingScreenRenderer(this);
+ public EntityRenderer entityRenderer = new EntityRenderer(this);
+ private ThreadDownloadResources downloadResourcesThread;
+ private int ticksRan = 0;
+ private int leftClickCounter = 0;
+ private int tempDisplayWidth;
+ private int tempDisplayHeight;
+ public String objectMouseOverString = null;
+ public int rightClickDelayTimer = 0;
+ public GuiIngame ingameGUI;
+ public boolean skipRenderWorld = false;
+ public ModelBiped playerModelBiped = new ModelBiped(0.0F);
+ public MovingObjectPosition objectMouseOver = null;
+ public GameSettings gameSettings;
+ protected MinecraftApplet mcApplet;
+ public SoundManager sndManager = new SoundManager();
+ public MouseHelper mouseHelper;
+ public File mcDataDir;
+ public static long[] tickTimes = new long[512];
+ public static int numRecordedFrameTimes = 0;
+ private TextureWaterFX textureWaterFX = new TextureWaterFX();
+ private TextureLavaFX textureLavaFX = new TextureLavaFX();
+ private static File minecraftDir = null;
+ volatile boolean running = true;
+ public String debug = "";
+ long prevFrameTime = -1L;
+ public boolean inGameHasFocus = false;
+ private int mouseTicksRan = 0;
+ public boolean isRaining = false;
+ long systemTime = System.currentTimeMillis();
+
+ public Minecraft(Component var1, Canvas var2, MinecraftApplet var3, int var4, int var5, boolean var6) {
+ this.tempDisplayWidth = var4;
+ this.tempDisplayHeight = var5;
+ this.fullscreen = var6;
+ this.mcApplet = var3;
+ new ThreadSleepForever(this, "Timer hack thread");
+ this.mcCanvas = var2;
+ this.displayWidth = var4;
+ this.displayHeight = var5;
+ this.fullscreen = var6;
+ }
+
+ public abstract void displayUnexpectedThrowable(UnexpectedThrowable var1);
+
+ public void setServer(String var1, int var2) {
+ }
+
+ public void startGame() throws LWJGLException {
+ if(this.mcCanvas != null) {
+ Graphics var1 = this.mcCanvas.getGraphics();
+ if(var1 != null) {
+ var1.setColor(Color.BLACK);
+ var1.fillRect(0, 0, this.displayWidth, this.displayHeight);
+ var1.dispose();
+ }
+
+ Display.setParent(this.mcCanvas);
+ } else if(this.fullscreen) {
+ Display.setFullscreen(true);
+ this.displayWidth = Display.getDisplayMode().getWidth();
+ this.displayHeight = Display.getDisplayMode().getHeight();
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+ } else {
+ Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight));
+ }
+
+ Display.setTitle("Minecraft Minecraft Infdev");
+
+ try {
+ Display.create();
+ } catch (LWJGLException var6) {
+ var6.printStackTrace();
+
+ try {
+ Thread.sleep(1000L);
+ } catch (InterruptedException var5) {
+ }
+
+ Display.create();
+ }
+
+ this.mcDataDir = getMinecraftDir();
+ this.gameSettings = new GameSettings(this, this.mcDataDir);
+ this.renderEngine = new RenderEngine(this.gameSettings);
+ this.fontRenderer = new FontRenderer(this.gameSettings, "/default.png", this.renderEngine);
+ this.loadScreen();
+ Keyboard.create();
+ Mouse.create();
+ this.mouseHelper = new MouseHelper(this.mcCanvas);
+
+ try {
+ Controllers.create();
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ }
+
+ this.checkGLError("Pre startup");
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+ GL11.glClearDepth(1.0D);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
+ GL11.glCullFace(GL11.GL_BACK);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ this.checkGLError("Startup");
+ this.glCapabilities = new OpenGlCapsChecker();
+ this.sndManager.loadSoundSettings(this.gameSettings);
+ this.renderEngine.registerTextureFX(this.textureLavaFX);
+ this.renderEngine.registerTextureFX(this.textureWaterFX);
+ this.renderEngine.registerTextureFX(new TextureWaterFlowFX());
+ this.renderEngine.registerTextureFX(new TextureLavaFlowFX());
+ this.renderEngine.registerTextureFX(new TextureFlamesFX(0));
+ this.renderEngine.registerTextureFX(new TextureFlamesFX(1));
+ this.renderEngine.registerTextureFX(new TextureGearsFX(0));
+ this.renderEngine.registerTextureFX(new TextureGearsFX(1));
+ this.renderGlobal = new RenderGlobal(this, this.renderEngine);
+ GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
+ this.displayGuiScreen(new GuiMainMenu());
+ this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
+
+ try {
+ this.downloadResourcesThread = new ThreadDownloadResources(this.mcDataDir, this);
+ this.downloadResourcesThread.start();
+ } catch (Exception var3) {
+ }
+
+ this.checkGLError("Post startup");
+ this.ingameGUI = new GuiIngame(this);
+ this.playerController.init();
+ }
+
+ private void loadScreen() throws LWJGLException {
+ ScaledResolution var1 = new ScaledResolution(this.displayWidth, this.displayHeight);
+ int var2 = var1.getScaledWidth();
+ int var3 = var1.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var2, (double)var3, 0.0D, 1000.0D, 3000.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
+ GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
+ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_FOG);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ Tessellator var4 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/dirt.png"));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ float var5 = 32.0F;
+ var4.startDrawingQuads();
+ var4.setColorOpaque_I(4210752);
+ var4.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, (double)((float)this.displayHeight / var5 + 0.0F));
+ var4.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, (double)((float)this.displayWidth / var5), (double)((float)this.displayHeight / var5 + 0.0F));
+ var4.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, (double)((float)this.displayWidth / var5), 0.0D);
+ var4.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
+ var4.draw();
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
+ this.fontRenderer.drawStringWithShadow("Loading...", 8, this.displayHeight / 2 - 16, -1);
+ Display.swapBuffers();
+ }
+
+ public static File getMinecraftDir() {
+ if(minecraftDir == null) {
+ minecraftDir = getAppDir("minecraft");
+ }
+
+ return minecraftDir;
+ }
+
+ public static File getAppDir(String var0) {
+ String var1 = System.getProperty("user.home", ".");
+ File var2;
+ switch(OSMap.osValues[getOs().ordinal()]) {
+ case 1:
+ case 2:
+ var2 = new File(var1, '.' + var0 + '/');
+ break;
+ case 3:
+ String var3 = System.getenv("APPDATA");
+ if(var3 != null) {
+ var2 = new File(var3, "." + var0 + '/');
+ } else {
+ var2 = new File(var1, '.' + var0 + '/');
+ }
+ break;
+ case 4:
+ var2 = new File(var1, "Library/Application Support/" + var0);
+ break;
+ default:
+ var2 = new File(var1, var0 + '/');
+ }
+
+ if(!var2.exists() && !var2.mkdirs()) {
+ throw new RuntimeException("The working directory could not be created: " + var2);
+ } else {
+ return var2;
+ }
+ }
+
+ private static EnumOS getOs() {
+ String var0 = System.getProperty("os.name").toLowerCase();
+ return var0.contains("win") ? EnumOS.windows : (var0.contains("mac") ? EnumOS.macos : (var0.contains("solaris") ? EnumOS.solaris : (var0.contains("sunos") ? EnumOS.solaris : (var0.contains("linux") ? EnumOS.linux : (var0.contains("unix") ? EnumOS.linux : EnumOS.unknown)))));
+ }
+
+ public void displayGuiScreen(GuiScreen var1) {
+ if(!(this.currentScreen instanceof GuiErrorScreen)) {
+ if(this.currentScreen != null) {
+ this.currentScreen.onGuiClosed();
+ }
+
+ if(var1 == null && this.theWorld == null) {
+ var1 = new GuiMainMenu();
+ } else if(var1 == null && this.thePlayer.health <= 0) {
+ var1 = new GuiGameOver();
+ }
+
+ this.currentScreen = (GuiScreen)var1;
+ if(var1 != null) {
+ this.setIngameNotInFocus();
+ ScaledResolution var2 = new ScaledResolution(this.displayWidth, this.displayHeight);
+ int var3 = var2.getScaledWidth();
+ int var4 = var2.getScaledHeight();
+ ((GuiScreen)var1).setWorldAndResolution(this, var3, var4);
+ this.skipRenderWorld = false;
+ } else {
+ this.setIngameFocus();
+ }
+
+ }
+ }
+
+ private void checkGLError(String var1) {
+ int var2 = GL11.glGetError();
+ if(var2 != 0) {
+ String var3 = GLU.gluErrorString(var2);
+ System.out.println("########## GL ERROR ##########");
+ System.out.println("@ " + var1);
+ System.out.println(var2 + ": " + var3);
+ System.exit(0);
+ }
+
+ }
+
+ public void shutdownMinecraftApplet() {
+ if(this.mcApplet != null) {
+ this.mcApplet.clearApplet();
+ }
+
+ try {
+ if(this.downloadResourcesThread != null) {
+ this.downloadResourcesThread.closeMinecraft();
+ }
+ } catch (Exception var8) {
+ }
+
+ try {
+ System.out.println("Stopping!");
+ this.changeWorld1((World)null);
+
+ try {
+ GLAllocation.deleteTexturesAndDisplayLists();
+ } catch (Exception var6) {
+ }
+
+ this.sndManager.closeMinecraft();
+ Mouse.destroy();
+ Keyboard.destroy();
+ } finally {
+ Display.destroy();
+ }
+
+ System.gc();
+ }
+
+ public void run() {
+ this.running = true;
+
+ try {
+ this.startGame();
+ } catch (Exception var10) {
+ var10.printStackTrace();
+ this.displayUnexpectedThrowable(new UnexpectedThrowable("Failed to start game", var10));
+ return;
+ }
+
+ try {
+ long var1 = System.currentTimeMillis();
+ int var3 = 0;
+
+ while(this.running && (this.mcApplet == null || this.mcApplet.isActive())) {
+ AxisAlignedBB.clearBoundingBoxPool();
+ Vec3D.initialize();
+ if(this.mcCanvas == null && Display.isCloseRequested()) {
+ this.shutdown();
+ }
+
+ if(this.isGamePaused) {
+ float var4 = this.timer.renderPartialTicks;
+ this.timer.updateTimer();
+ this.timer.renderPartialTicks = var4;
+ } else {
+ this.timer.updateTimer();
+ }
+
+ for(int var14 = 0; var14 < this.timer.elapsedTicks; ++var14) {
+ ++this.ticksRan;
+ this.runTick();
+ }
+
+ this.checkGLError("Pre render");
+ if(this.isGamePaused) {
+ this.timer.renderPartialTicks = 1.0F;
+ }
+
+ this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ if(this.theWorld != null) {
+ while(this.theWorld.updatingLighting()) {
+ }
+ }
+
+ if(!this.skipRenderWorld) {
+ this.playerController.setPartialTime(this.timer.renderPartialTicks);
+ this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
+ }
+
+ if(!Display.isActive() && this.fullscreen) {
+ this.toggleFullscreen();
+ }
+
+ if(Keyboard.isKeyDown(Keyboard.KEY_F6)) {
+ this.displayDebugInfo();
+ } else {
+ this.prevFrameTime = System.nanoTime();
+ }
+
+ Thread.yield();
+ Display.update();
+ if(this.mcCanvas != null && !this.fullscreen && (this.mcCanvas.getWidth() != this.displayWidth || this.mcCanvas.getHeight() != this.displayHeight)) {
+ this.displayWidth = this.mcCanvas.getWidth();
+ this.displayHeight = this.mcCanvas.getHeight();
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+
+ this.resize(this.displayWidth, this.displayHeight);
+ }
+
+ if(this.gameSettings.limitFramerate) {
+ Thread.sleep(5L);
+ }
+
+ this.checkGLError("Post render");
+ ++var3;
+
+ for(this.isGamePaused = !this.isMultiplayerWorld() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame(); System.currentTimeMillis() >= var1 + 1000L; var3 = 0) {
+ this.debug = var3 + " fps, " + WorldRenderer.chunksUpdated + " chunk updates";
+ WorldRenderer.chunksUpdated = 0;
+ var1 += 1000L;
+ }
+ }
+ } catch (MinecraftError var11) {
+ } catch (Exception var12) {
+ var12.printStackTrace();
+ this.displayUnexpectedThrowable(new UnexpectedThrowable("Unexpected error", var12));
+ } finally {
+ this.shutdownMinecraftApplet();
+ }
+
+ }
+
+ private void displayDebugInfo() {
+ if(this.prevFrameTime == -1L) {
+ this.prevFrameTime = System.nanoTime();
+ }
+
+ long var1 = System.nanoTime();
+ tickTimes[numRecordedFrameTimes++ & tickTimes.length - 1] = var1 - this.prevFrameTime;
+ this.prevFrameTime = var1;
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
+ GL11.glLineWidth(1.0F);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Tessellator var3 = Tessellator.instance;
+ var3.startDrawing(7);
+ var3.setColorOpaque_I(538968064);
+ var3.addVertex(0.0D, (double)(this.displayHeight - 100), 0.0D);
+ var3.addVertex(0.0D, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)(this.displayHeight - 100), 0.0D);
+ var3.draw();
+ long var4 = 0L;
+
+ int var6;
+ for(var6 = 0; var6 < tickTimes.length; ++var6) {
+ var4 += tickTimes[var6];
+ }
+
+ var6 = (int)(var4 / 200000L / (long)tickTimes.length);
+ var3.startDrawing(7);
+ var3.setColorOpaque_I(541065216);
+ var3.addVertex(0.0D, (double)(this.displayHeight - var6), 0.0D);
+ var3.addVertex(0.0D, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)(this.displayHeight - var6), 0.0D);
+ var3.draw();
+ var3.startDrawing(1);
+
+ for(int var7 = 0; var7 < tickTimes.length; ++var7) {
+ int var8 = (var7 - numRecordedFrameTimes & tickTimes.length - 1) * 255 / tickTimes.length;
+ int var9 = var8 * var8 / 255;
+ var9 = var9 * var9 / 255;
+ int var10 = var9 * var9 / 255;
+ var10 = var10 * var10 / 255;
+ var3.setColorOpaque_I(-16777216 + var10 + var9 * 256 + var8 * 65536);
+ long var11 = tickTimes[var7] / 200000L;
+ var3.addVertex((double)((float)var7 + 0.5F), (double)((float)((long)this.displayHeight - var11) + 0.5F), 0.0D);
+ var3.addVertex((double)((float)var7 + 0.5F), (double)((float)this.displayHeight + 0.5F), 0.0D);
+ }
+
+ var3.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ public void shutdown() {
+ this.running = false;
+ }
+
+ public void setIngameFocus() {
+ if(Display.isActive()) {
+ if(!this.inGameHasFocus) {
+ this.inGameHasFocus = true;
+ this.mouseHelper.grabMouseCursor();
+ this.displayGuiScreen((GuiScreen)null);
+ this.mouseTicksRan = this.ticksRan + 10000;
+ }
+ }
+ }
+
+ public void setIngameNotInFocus() {
+ if(this.inGameHasFocus) {
+ if(this.thePlayer != null) {
+ this.thePlayer.resetPlayerKeyState();
+ }
+
+ this.inGameHasFocus = false;
+ this.mouseHelper.ungrabMouseCursor();
+ }
+ }
+
+ public void displayInGameMenu() {
+ if(this.currentScreen == null) {
+ this.displayGuiScreen(new GuiIngameMenu());
+ }
+ }
+
+ private void sendClickBlockToController(int var1, boolean var2) {
+ if(!this.playerController.isInTestMode) {
+ if(var1 != 0 || this.leftClickCounter <= 0) {
+ if(var2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == 0 && var1 == 0) {
+ int var3 = this.objectMouseOver.blockX;
+ int var4 = this.objectMouseOver.blockY;
+ int var5 = this.objectMouseOver.blockZ;
+ this.playerController.sendBlockRemoving(var3, var4, var5, this.objectMouseOver.sideHit);
+ this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit);
+ } else {
+ this.playerController.resetBlockRemoving();
+ }
+
+ }
+ }
+ }
+
+ private void clickMouse(int var1) {
+ if(var1 != 0 || this.leftClickCounter <= 0) {
+ if(var1 == 0) {
+ this.entityRenderer.itemRenderer.swing();
+ }
+
+ int var3;
+ if(this.objectMouseOver == null) {
+ if(var1 == 0 && !(this.playerController instanceof PlayerControllerCreative)) {
+ this.leftClickCounter = 10;
+ }
+ } else if(this.objectMouseOver.typeOfHit == 1) {
+ if(var1 == 0) {
+ this.thePlayer.attackEntity(this.objectMouseOver.entityHit);
+ }
+
+ if(var1 == 1) {
+ this.thePlayer.interactWithEntity(this.objectMouseOver.entityHit);
+ }
+ } else if(this.objectMouseOver.typeOfHit == 0) {
+ int var2 = this.objectMouseOver.blockX;
+ var3 = this.objectMouseOver.blockY;
+ int var4 = this.objectMouseOver.blockZ;
+ int var5 = this.objectMouseOver.sideHit;
+ Block var6 = Block.blocksList[this.theWorld.getBlockId(var2, var3, var4)];
+ if(var1 == 0) {
+ this.theWorld.extinguishFire(var2, var3, var4, this.objectMouseOver.sideHit);
+ if(var6 != Block.bedrock || this.thePlayer.unusedMiningCooldown >= 100) {
+ this.playerController.clickBlock(var2, var3, var4);
+ }
+ } else {
+ ItemStack var7 = this.thePlayer.inventory.getCurrentItem();
+ int var8 = this.theWorld.getBlockId(var2, var3, var4);
+ if(var8 > 0 && Block.blocksList[var8].blockActivated(this.theWorld, var2, var3, var4, this.thePlayer)) {
+ return;
+ }
+
+ if(var7 == null) {
+ return;
+ }
+
+ int var9 = var7.stackSize;
+ if(var7.useItem(this.thePlayer, this.theWorld, var2, var3, var4, var5)) {
+ this.entityRenderer.itemRenderer.swing();
+ }
+
+ if(var7.stackSize == 0) {
+ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null;
+ } else if(var7.stackSize != var9) {
+ this.entityRenderer.itemRenderer.resetEquippedProgress();
+ }
+ }
+ }
+
+ if(var1 == 1) {
+ ItemStack var10 = this.thePlayer.inventory.getCurrentItem();
+ if(var10 != null) {
+ var3 = var10.stackSize;
+ ItemStack var11 = var10.useItemRightClick(this.theWorld, this.thePlayer);
+ if(var11 != var10 || var11 != null && var11.stackSize != var3) {
+ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = var11;
+ this.entityRenderer.itemRenderer.resetEquippedProgress2();
+ if(var11.stackSize == 0) {
+ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null;
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ public void toggleFullscreen() {
+ try {
+ this.fullscreen = !this.fullscreen;
+ System.out.println("Toggle fullscreen!");
+ if(this.fullscreen) {
+ Display.setDisplayMode(Display.getDesktopDisplayMode());
+ this.displayWidth = Display.getDisplayMode().getWidth();
+ this.displayHeight = Display.getDisplayMode().getHeight();
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+ } else {
+ if(this.mcCanvas != null) {
+ this.displayWidth = this.mcCanvas.getWidth();
+ this.displayHeight = this.mcCanvas.getHeight();
+ } else {
+ this.displayWidth = this.tempDisplayWidth;
+ this.displayHeight = this.tempDisplayHeight;
+ }
+
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+
+ Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight));
+ }
+
+ this.setIngameNotInFocus();
+ Display.setFullscreen(this.fullscreen);
+ Display.update();
+ Thread.sleep(1000L);
+ if(this.fullscreen) {
+ this.setIngameFocus();
+ }
+
+ if(this.currentScreen != null) {
+ this.setIngameNotInFocus();
+ this.resize(this.displayWidth, this.displayHeight);
+ }
+
+ System.out.println("Size: " + this.displayWidth + ", " + this.displayHeight);
+ } catch (Exception var2) {
+ var2.printStackTrace();
+ }
+
+ }
+
+ private void resize(int var1, int var2) {
+ if(var1 <= 0) {
+ var1 = 1;
+ }
+
+ if(var2 <= 0) {
+ var2 = 1;
+ }
+
+ this.displayWidth = var1;
+ this.displayHeight = var2;
+ if(this.currentScreen != null) {
+ ScaledResolution var3 = new ScaledResolution(var1, var2);
+ int var4 = var3.getScaledWidth();
+ int var5 = var3.getScaledHeight();
+ this.currentScreen.setWorldAndResolution(this, var4, var5);
+ }
+
+ }
+
+ private void clickMiddleMouseButton() {
+ if(this.objectMouseOver != null) {
+ int var1 = this.theWorld.getBlockId(this.objectMouseOver.blockX, this.objectMouseOver.blockY, this.objectMouseOver.blockZ);
+ if(var1 == Block.grass.blockID) {
+ var1 = Block.dirt.blockID;
+ }
+
+ if(var1 == Block.stairDouble.blockID) {
+ var1 = Block.stairSingle.blockID;
+ }
+
+ if(var1 == Block.bedrock.blockID) {
+ var1 = Block.stone.blockID;
+ }
+
+ this.thePlayer.inventory.setCurrentItem(var1, this.playerController instanceof PlayerControllerCreative);
+ }
+
+ }
+
+ public void runTick() {
+ this.ingameGUI.updateTick();
+ if(!this.isGamePaused && this.theWorld != null) {
+ this.playerController.onUpdate();
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain.png"));
+ if(!this.isGamePaused) {
+ this.renderEngine.updateDynamicTextures();
+ }
+
+ if(this.currentScreen == null && this.thePlayer != null && this.thePlayer.health <= 0) {
+ this.displayGuiScreen((GuiScreen)null);
+ }
+
+ if(this.currentScreen == null || this.currentScreen.allowUserInput) {
+ label226:
+ while(true) {
+ while(true) {
+ while(true) {
+ long var1;
+ do {
+ if(!Mouse.next()) {
+ if(this.leftClickCounter > 0) {
+ --this.leftClickCounter;
+ }
+
+ while(true) {
+ while(true) {
+ do {
+ if(!Keyboard.next()) {
+ if(this.currentScreen == null) {
+ if(Mouse.isButtonDown(0) && (float)(this.ticksRan - this.mouseTicksRan) >= this.timer.ticksPerSecond / 4.0F && this.inGameHasFocus) {
+ this.clickMouse(0);
+ this.mouseTicksRan = this.ticksRan;
+ }
+
+ if(Mouse.isButtonDown(1) && (float)(this.ticksRan - this.mouseTicksRan) >= this.timer.ticksPerSecond / 4.0F && this.inGameHasFocus) {
+ this.clickMouse(1);
+ this.mouseTicksRan = this.ticksRan;
+ }
+ }
+
+ this.sendClickBlockToController(0, this.currentScreen == null && Mouse.isButtonDown(0) && this.inGameHasFocus);
+ break label226;
+ }
+
+ this.thePlayer.handleKeyPress(Keyboard.getEventKey(), Keyboard.getEventKeyState());
+ } while(!Keyboard.getEventKeyState());
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_F11) {
+ this.toggleFullscreen();
+ } else {
+ if(this.currentScreen != null) {
+ this.currentScreen.handleKeyboardInput();
+ } else {
+ if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
+ this.displayInGameMenu();
+ }
+
+ if(this.playerController instanceof PlayerControllerCreative) {
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindLoad.keyCode) {
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindSave.keyCode) {
+ }
+ }
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_F5) {
+ this.gameSettings.thirdPersonView = !this.gameSettings.thirdPersonView;
+ this.isRaining = !this.isRaining;
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindInventory.keyCode) {
+ this.displayGuiScreen(new GuiInventory(this.thePlayer.inventory));
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindDrop.keyCode) {
+ this.thePlayer.dropPlayerItemWithRandomChoice(this.thePlayer.inventory.decrStackSize(this.thePlayer.inventory.currentItem, 1), false);
+ }
+ }
+
+ for(int var4 = 0; var4 < 9; ++var4) {
+ if(Keyboard.getEventKey() == Keyboard.KEY_1 + var4) {
+ this.thePlayer.inventory.currentItem = var4;
+ }
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindToggleFog.keyCode) {
+ this.gameSettings.setOptionFloatValue(4, !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) ? 1 : -1);
+ }
+ }
+ }
+ }
+ }
+
+ var1 = System.currentTimeMillis() - this.systemTime;
+ } while(var1 > 200L);
+
+ int var3 = Mouse.getEventDWheel();
+ if(var3 != 0) {
+ this.thePlayer.inventory.changeCurrentItem(var3);
+ }
+
+ if(this.currentScreen == null) {
+ if(!this.inGameHasFocus && Mouse.getEventButtonState()) {
+ this.setIngameFocus();
+ } else {
+ if(Mouse.getEventButton() == 0 && Mouse.getEventButtonState()) {
+ this.clickMouse(0);
+ this.mouseTicksRan = this.ticksRan;
+ }
+
+ if(Mouse.getEventButton() == 1 && Mouse.getEventButtonState()) {
+ this.clickMouse(1);
+ this.mouseTicksRan = this.ticksRan;
+ }
+
+ if(Mouse.getEventButton() == 2 && Mouse.getEventButtonState()) {
+ this.clickMiddleMouseButton();
+ }
+ }
+ } else if(this.currentScreen != null) {
+ this.currentScreen.handleMouseInput();
+ }
+ }
+ }
+ }
+ }
+
+ if(this.currentScreen != null) {
+ this.mouseTicksRan = this.ticksRan + 10000;
+ }
+
+ if(this.currentScreen != null) {
+ this.currentScreen.handleInput();
+ if(this.currentScreen != null) {
+ this.currentScreen.updateScreen();
+ }
+ }
+
+ if(this.theWorld != null) {
+ this.theWorld.difficultySetting = this.gameSettings.difficulty;
+ if(!this.isGamePaused) {
+ this.entityRenderer.updateRenderer();
+ }
+
+ if(!this.isGamePaused) {
+ this.renderGlobal.updateClouds();
+ }
+
+ if(!this.isGamePaused) {
+ this.theWorld.updateEntities();
+ }
+
+ if(!this.isGamePaused && !this.isMultiplayerWorld()) {
+ this.theWorld.tick();
+ }
+
+ if(!this.isGamePaused) {
+ this.theWorld.randomDisplayUpdates(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ));
+ }
+
+ if(!this.isGamePaused) {
+ this.effectRenderer.updateEffects();
+ }
+ }
+
+ this.systemTime = System.currentTimeMillis();
+ }
+
+ public boolean isMultiplayerWorld() {
+ return false;
+ }
+
+ public void startWorld(String var1) {
+ this.changeWorld1((World)null);
+ System.gc();
+ World var2 = new World(new File(getMinecraftDir(), "saves"), var1);
+ if(var2.isNewWorld) {
+ this.changeWorld2(var2, "Generating level");
+ } else {
+ this.changeWorld2(var2, "Loading level");
+ }
+
+ }
+
+ public void changeWorld1(World var1) {
+ this.changeWorld2(var1, "");
+ }
+
+ public void changeWorld2(World var1, String var2) {
+ if(this.theWorld != null) {
+ this.theWorld.saveWorldIndirectly(this.loadingScreen);
+ }
+
+ this.theWorld = var1;
+ if(var1 != null) {
+ this.playerController.onWorldChange(var1);
+ var1.fontRenderer = this.fontRenderer;
+ if(!this.isMultiplayerWorld()) {
+ this.thePlayer = (EntityPlayerSP)var1.createDebugPlayer(EntityPlayerSP.class);
+ var1.playerEntity = this.thePlayer;
+ } else if(this.thePlayer != null) {
+ this.thePlayer.preparePlayerToSpawn();
+ if(var1 != null) {
+ var1.playerEntity = this.thePlayer;
+ var1.spawnEntityInWorld(this.thePlayer);
+ }
+ }
+
+ this.preloadWorld(var2);
+ if(this.thePlayer == null) {
+ this.thePlayer = new EntityPlayerSP(this, var1, this.session);
+ this.thePlayer.preparePlayerToSpawn();
+ this.playerController.flipPlayer(this.thePlayer);
+ }
+
+ this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
+ if(this.renderGlobal != null) {
+ this.renderGlobal.changeWorld(var1);
+ }
+
+ if(this.effectRenderer != null) {
+ this.effectRenderer.clearEffects(var1);
+ }
+
+ this.playerController.onRespawn(this.thePlayer);
+ var1.playerEntity = this.thePlayer;
+ var1.spawnPlayerWithLoadedChunks();
+ if(var1.isNewWorld) {
+ var1.saveWorldIndirectly(this.loadingScreen);
+ }
+ }
+
+ System.gc();
+ this.systemTime = 0L;
+ }
+
+ private void preloadWorld(String var1) {
+ this.loadingScreen.printText(var1);
+ this.loadingScreen.displayLoadingString("Building terrain");
+ short var2 = 128;
+ int var3 = 0;
+ int var4 = var2 * 2 / 16 + 1;
+ var4 *= var4;
+
+ int var5;
+ for(var5 = -var2; var5 <= var2; var5 += 16) {
+ int var6 = this.theWorld.spawnX;
+ int var7 = this.theWorld.spawnZ;
+ if(this.theWorld.playerEntity != null) {
+ var6 = (int)this.theWorld.playerEntity.posX;
+ var7 = (int)this.theWorld.playerEntity.posZ;
+ }
+
+ for(int var8 = -var2; var8 <= var2; var8 += 16) {
+ this.loadingScreen.setLoadingProgress(var3++ * 100 / var4);
+ this.theWorld.getBlockId(var6 + var5, 64, var7 + var8);
+
+ while(this.theWorld.updatingLighting()) {
+ }
+ }
+ }
+
+ this.loadingScreen.displayLoadingString("Simulating world for a bit");
+ short var9 = 2000;
+ BlockSand.fallInstantly = true;
+
+ for(var5 = 0; var5 < var9; ++var5) {
+ this.theWorld.tickUpdates(true);
+ }
+
+ this.theWorld.dropOldChunks();
+ BlockSand.fallInstantly = false;
+ }
+
+ public void installResource(String var1, File var2) {
+ int var3 = var1.indexOf("/");
+ String var4 = var1.substring(0, var3);
+ var1 = var1.substring(var3 + 1);
+ if(var4.equalsIgnoreCase("sound")) {
+ this.sndManager.addSound(var1, var2);
+ } else if(var4.equalsIgnoreCase("newsound")) {
+ this.sndManager.addSound(var1, var2);
+ } else if(var4.equalsIgnoreCase("music")) {
+ this.sndManager.addMusic(var1, var2);
+ }
+
+ }
+
+ public OpenGlCapsChecker getOpenGlCapsChecker() {
+ return this.glCapabilities;
+ }
+
+ public String debugInfoRenders() {
+ return this.renderGlobal.getDebugInfoRenders();
+ }
+
+ public String getEntityDebug() {
+ return this.renderGlobal.getDebugInfoEntities();
+ }
+
+ public String debugInfoEntities() {
+ return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities();
+ }
+
+ public void respawn() {
+ if(this.thePlayer != null && this.theWorld != null) {
+ this.theWorld.setEntityDead(this.thePlayer);
+ }
+
+ this.theWorld.setSpawnLocation();
+ this.thePlayer = new EntityPlayerSP(this, this.theWorld, this.session);
+ this.thePlayer.preparePlayerToSpawn();
+ this.playerController.flipPlayer(this.thePlayer);
+ if(this.theWorld != null) {
+ this.theWorld.playerEntity = this.thePlayer;
+ this.theWorld.spawnPlayerWithLoadedChunks();
+ }
+
+ this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
+ this.playerController.onRespawn(this.thePlayer);
+ this.preloadWorld("Respawning");
+ }
+}
diff --git a/source/net/minecraft/src/MinecraftAppletImpl.java b/source/net/minecraft/src/MinecraftAppletImpl.java
new file mode 100644
index 0000000..647fd9b
--- /dev/null
+++ b/source/net/minecraft/src/MinecraftAppletImpl.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Component;
+import net.minecraft.client.MinecraftApplet;
+
+public class MinecraftAppletImpl extends Minecraft {
+ final MinecraftApplet mainFrame;
+
+ public MinecraftAppletImpl(MinecraftApplet var1, Component var2, Canvas var3, MinecraftApplet var4, int var5, int var6, boolean var7) {
+ super(var2, var3, var4, var5, var6, var7);
+ this.mainFrame = var1;
+ }
+
+ public void displayUnexpectedThrowable(UnexpectedThrowable var1) {
+ this.mainFrame.removeAll();
+ this.mainFrame.add(new PanelCrashReport(var1), "Center");
+ this.mainFrame.validate();
+ }
+}
diff --git a/source/net/minecraft/src/MinecraftError.java b/source/net/minecraft/src/MinecraftError.java
new file mode 100644
index 0000000..9a75dec
--- /dev/null
+++ b/source/net/minecraft/src/MinecraftError.java
@@ -0,0 +1,4 @@
+package net.minecraft.src;
+
+public class MinecraftError extends Error {
+}
diff --git a/source/net/minecraft/src/ModelBase.java b/source/net/minecraft/src/ModelBase.java
new file mode 100644
index 0000000..06d3a6f
--- /dev/null
+++ b/source/net/minecraft/src/ModelBase.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public abstract class ModelBase {
+ public float swingProgress;
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ }
+}
diff --git a/source/net/minecraft/src/ModelBiped.java b/source/net/minecraft/src/ModelBiped.java
new file mode 100644
index 0000000..5a2b40b
--- /dev/null
+++ b/source/net/minecraft/src/ModelBiped.java
@@ -0,0 +1,73 @@
+package net.minecraft.src;
+
+public class ModelBiped extends ModelBase {
+ public ModelRenderer bipedHead;
+ public ModelRenderer bipedHeadwear;
+ public ModelRenderer bipedBody;
+ public ModelRenderer bipedRightArm;
+ public ModelRenderer bipedLeftArm;
+ public ModelRenderer bipedRightLeg;
+ public ModelRenderer bipedLeftLeg;
+
+ public ModelBiped() {
+ this(0.0F);
+ }
+
+ public ModelBiped(float var1) {
+ this(var1, 0.0F);
+ }
+
+ public ModelBiped(float var1, float var2) {
+ this.bipedHead = new ModelRenderer(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.bipedHeadwear = new ModelRenderer(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.bipedBody = new ModelRenderer(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.bipedRightArm = new ModelRenderer(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.bipedLeftArm = new ModelRenderer(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.bipedRightLeg = new ModelRenderer(0, 16);
+ this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1);
+ this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + var2, 0.0F);
+ this.bipedLeftLeg = new ModelRenderer(0, 16);
+ this.bipedLeftLeg.mirror = true;
+ this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1);
+ this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var2, 0.0F);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.bipedHead.render(var6);
+ this.bipedBody.render(var6);
+ this.bipedRightArm.render(var6);
+ this.bipedLeftArm.render(var6);
+ this.bipedRightLeg.render(var6);
+ this.bipedLeftLeg.render(var6);
+ this.bipedHeadwear.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.bipedHead.rotateAngleY = var4 / (180.0F / (float)Math.PI);
+ this.bipedHead.rotateAngleX = var5 / (180.0F / (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;
+ this.bipedRightArm.rotateAngleZ = (MathHelper.cos(var1 * 0.2312F) + 1.0F) * 1.0F * var2;
+ this.bipedLeftArm.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 2.0F * var2;
+ this.bipedLeftArm.rotateAngleZ = (MathHelper.cos(var1 * 0.2812F) - 1.0F) * 1.0F * var2;
+ 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.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;
+ }
+}
diff --git a/source/net/minecraft/src/ModelCreeper.java b/source/net/minecraft/src/ModelCreeper.java
new file mode 100644
index 0000000..eac89c4
--- /dev/null
+++ b/source/net/minecraft/src/ModelCreeper.java
@@ -0,0 +1,56 @@
+package net.minecraft.src;
+
+public class ModelCreeper extends ModelBase {
+ public ModelRenderer head;
+ public ModelRenderer headwear;
+ public ModelRenderer body;
+ public ModelRenderer leg1;
+ public ModelRenderer leg2;
+ public ModelRenderer leg3;
+ public ModelRenderer leg4;
+
+ public ModelCreeper() {
+ float var1 = 0.0F;
+ byte var2 = 4;
+ this.head = new ModelRenderer(0, 0);
+ this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1);
+ this.head.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.headwear = new ModelRenderer(32, 0);
+ this.headwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1 + 0.5F);
+ this.headwear.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.body = new ModelRenderer(16, 16);
+ this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var1);
+ this.body.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.leg1 = new ModelRenderer(0, 16);
+ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg1.setRotationPoint(-2.0F, (float)(12 + var2), 4.0F);
+ this.leg2 = new ModelRenderer(0, 16);
+ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg2.setRotationPoint(2.0F, (float)(12 + var2), 4.0F);
+ this.leg3 = new ModelRenderer(0, 16);
+ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg3.setRotationPoint(-2.0F, (float)(12 + var2), -4.0F);
+ this.leg4 = new ModelRenderer(0, 16);
+ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg4.setRotationPoint(2.0F, (float)(12 + var2), -4.0F);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.head.render(var6);
+ this.body.render(var6);
+ this.leg1.render(var6);
+ this.leg2.render(var6);
+ this.leg3.render(var6);
+ this.leg4.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ 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;
+ }
+}
diff --git a/source/net/minecraft/src/ModelMinecart.java b/source/net/minecraft/src/ModelMinecart.java
new file mode 100644
index 0000000..68425ee
--- /dev/null
+++ b/source/net/minecraft/src/ModelMinecart.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class ModelMinecart extends ModelBase {
+ public ModelRenderer[] sideModels = new ModelRenderer[7];
+
+ public ModelMinecart() {
+ this.sideModels[0] = new ModelRenderer(0, 10);
+ this.sideModels[1] = new ModelRenderer(0, 0);
+ this.sideModels[2] = new ModelRenderer(0, 0);
+ this.sideModels[3] = new ModelRenderer(0, 0);
+ this.sideModels[4] = new ModelRenderer(0, 0);
+ this.sideModels[5] = new ModelRenderer(44, 10);
+ byte var1 = 20;
+ byte var2 = 8;
+ byte var3 = 16;
+ byte var4 = 4;
+ this.sideModels[0].addBox((float)(-var1 / 2), (float)(-var3 / 2), -1.0F, var1, var3, 2, 0.0F);
+ this.sideModels[0].setRotationPoint(0.0F, (float)(0 + var4), 0.0F);
+ this.sideModels[5].addBox((float)(-var1 / 2 + 1), (float)(-var3 / 2 + 1), -1.0F, var1 - 2, var3 - 2, 1, 0.0F);
+ this.sideModels[5].setRotationPoint(0.0F, (float)(0 + var4), 0.0F);
+ this.sideModels[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
+ this.sideModels[1].setRotationPoint((float)(-var1 / 2 + 1), (float)(0 + var4), 0.0F);
+ this.sideModels[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
+ this.sideModels[2].setRotationPoint((float)(var1 / 2 - 1), (float)(0 + var4), 0.0F);
+ this.sideModels[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
+ this.sideModels[3].setRotationPoint(0.0F, (float)(0 + 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)(0 + 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[3].rotateAngleY = (float)Math.PI;
+ this.sideModels[5].rotateAngleX = (float)Math.PI * -0.5F;
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.sideModels[5].rotationPointY = 4.0F - var3;
+
+ for(int var7 = 0; var7 < 6; ++var7) {
+ this.sideModels[var7].render(var6);
+ }
+
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ }
+}
diff --git a/source/net/minecraft/src/ModelPig.java b/source/net/minecraft/src/ModelPig.java
new file mode 100644
index 0000000..c300bd4
--- /dev/null
+++ b/source/net/minecraft/src/ModelPig.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class ModelPig extends ModelQuadruped {
+ public ModelPig() {
+ super(6, 0.0F);
+ }
+
+ public ModelPig(float var1) {
+ super(6, var1);
+ }
+}
diff --git a/source/net/minecraft/src/ModelQuadruped.java b/source/net/minecraft/src/ModelQuadruped.java
new file mode 100644
index 0000000..d37c549
--- /dev/null
+++ b/source/net/minecraft/src/ModelQuadruped.java
@@ -0,0 +1,49 @@
+package net.minecraft.src;
+
+public class ModelQuadruped extends ModelBase {
+ public ModelRenderer head = new ModelRenderer(0, 0);
+ public ModelRenderer body;
+ public ModelRenderer leg1;
+ public ModelRenderer leg2;
+ public ModelRenderer leg3;
+ public ModelRenderer leg4;
+
+ 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);
+ this.body = new ModelRenderer(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.leg1 = new ModelRenderer(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.leg2 = new ModelRenderer(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.leg3 = new ModelRenderer(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.leg4 = new ModelRenderer(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);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.head.render(var6);
+ this.body.render(var6);
+ this.leg1.render(var6);
+ this.leg2.render(var6);
+ this.leg3.render(var6);
+ this.leg4.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ 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;
+ }
+}
diff --git a/source/net/minecraft/src/ModelRenderer.java b/source/net/minecraft/src/ModelRenderer.java
new file mode 100644
index 0000000..20b1eb0
--- /dev/null
+++ b/source/net/minecraft/src/ModelRenderer.java
@@ -0,0 +1,131 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class ModelRenderer {
+ private PositionTextureVertex[] corners;
+ private TexturedQuad[] faces;
+ private int textureOffsetX;
+ private int textureOffsetY;
+ public float rotationPointX;
+ public float rotationPointY;
+ public float rotationPointZ;
+ public float rotateAngleX;
+ public float rotateAngleY;
+ public float rotateAngleZ;
+ private boolean compiled = false;
+ private int displayList = 0;
+ public boolean mirror = false;
+ public boolean showModel = true;
+ public boolean isHidden = false;
+
+ public ModelRenderer(int var1, int var2) {
+ this.textureOffsetX = var1;
+ this.textureOffsetY = var2;
+ }
+
+ public void addBox(float var1, float var2, float var3, int var4, int var5, int var6, float var7) {
+ this.corners = new PositionTextureVertex[8];
+ this.faces = new TexturedQuad[6];
+ float var8 = var1 + (float)var4;
+ float var9 = var2 + (float)var5;
+ float var10 = var3 + (float)var6;
+ var1 -= var7;
+ var2 -= var7;
+ var3 -= var7;
+ var8 += var7;
+ var9 += var7;
+ var10 += var7;
+ if(this.mirror) {
+ float var11 = var8;
+ var8 = var1;
+ var1 = var11;
+ }
+
+ PositionTextureVertex var20 = new PositionTextureVertex(var1, var2, var3, 0.0F, 0.0F);
+ PositionTextureVertex var12 = new PositionTextureVertex(var8, var2, var3, 0.0F, 8.0F);
+ PositionTextureVertex var13 = new PositionTextureVertex(var8, var9, var3, 8.0F, 8.0F);
+ PositionTextureVertex var14 = new PositionTextureVertex(var1, var9, var3, 8.0F, 0.0F);
+ PositionTextureVertex var15 = new PositionTextureVertex(var1, var2, var10, 0.0F, 0.0F);
+ PositionTextureVertex var16 = new PositionTextureVertex(var8, var2, var10, 0.0F, 8.0F);
+ PositionTextureVertex var17 = new PositionTextureVertex(var8, var9, var10, 8.0F, 8.0F);
+ PositionTextureVertex var18 = new PositionTextureVertex(var1, var9, var10, 8.0F, 0.0F);
+ this.corners[0] = var20;
+ this.corners[1] = var12;
+ this.corners[2] = var13;
+ this.corners[3] = var14;
+ this.corners[4] = var15;
+ this.corners[5] = var16;
+ this.corners[6] = var17;
+ this.corners[7] = var18;
+ this.faces[0] = new TexturedQuad(new PositionTextureVertex[]{var16, var12, var13, var17}, this.textureOffsetX + var6 + var4, this.textureOffsetY + var6, this.textureOffsetX + var6 + var4 + var6, this.textureOffsetY + var6 + var5);
+ this.faces[1] = new TexturedQuad(new PositionTextureVertex[]{var20, var15, var18, var14}, this.textureOffsetX + 0, this.textureOffsetY + var6, this.textureOffsetX + var6, this.textureOffsetY + var6 + var5);
+ this.faces[2] = new TexturedQuad(new PositionTextureVertex[]{var16, var15, var20, var12}, this.textureOffsetX + var6, this.textureOffsetY + 0, this.textureOffsetX + var6 + var4, this.textureOffsetY + var6);
+ this.faces[3] = new TexturedQuad(new PositionTextureVertex[]{var13, var14, var18, var17}, this.textureOffsetX + var6 + var4, this.textureOffsetY + 0, this.textureOffsetX + var6 + var4 + var4, this.textureOffsetY + var6);
+ this.faces[4] = new TexturedQuad(new PositionTextureVertex[]{var12, var20, var14, var13}, this.textureOffsetX + var6, this.textureOffsetY + var6, this.textureOffsetX + var6 + var4, this.textureOffsetY + var6 + var5);
+ this.faces[5] = new TexturedQuad(new PositionTextureVertex[]{var15, var16, var17, var18}, this.textureOffsetX + var6 + var4 + var6, this.textureOffsetY + var6, this.textureOffsetX + var6 + var4 + var6 + var4, this.textureOffsetY + var6 + var5);
+ if(this.mirror) {
+ for(int var19 = 0; var19 < this.faces.length; ++var19) {
+ this.faces[var19].flipFace();
+ }
+ }
+
+ }
+
+ 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);
+ }
+
+ 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);
+ } else {
+ GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1);
+ GL11.glCallList(this.displayList);
+ GL11.glTranslatef(-this.rotationPointX * var1, -this.rotationPointY * var1, -this.rotationPointZ * var1);
+ }
+ } 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.glCallList(this.displayList);
+ GL11.glPopMatrix();
+ }
+
+ }
+ }
+ }
+
+ private void compileDisplayList(float var1) {
+ this.displayList = GLAllocation.generateDisplayLists(1);
+ GL11.glNewList(this.displayList, GL11.GL_COMPILE);
+ Tessellator var2 = Tessellator.instance;
+
+ for(int var3 = 0; var3 < this.faces.length; ++var3) {
+ this.faces[var3].draw(var2, var1);
+ }
+
+ GL11.glEndList();
+ this.compiled = true;
+ }
+}
diff --git a/source/net/minecraft/src/ModelSheep.java b/source/net/minecraft/src/ModelSheep.java
new file mode 100644
index 0000000..df1c1c4
--- /dev/null
+++ b/source/net/minecraft/src/ModelSheep.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+public class ModelSheep extends ModelQuadruped {
+ public ModelSheep() {
+ super(12, 0.0F);
+ this.head = new ModelRenderer(0, 0);
+ this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F);
+ this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
+ this.body = new ModelRenderer(28, 8);
+ this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F);
+ this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
+ }
+}
diff --git a/source/net/minecraft/src/ModelSheepFur.java b/source/net/minecraft/src/ModelSheepFur.java
new file mode 100644
index 0000000..55bc761
--- /dev/null
+++ b/source/net/minecraft/src/ModelSheepFur.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ModelSheepFur extends ModelQuadruped {
+ public ModelSheepFur() {
+ super(12, 0.0F);
+ this.head = new ModelRenderer(0, 0);
+ this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F);
+ this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
+ this.body = new ModelRenderer(28, 8);
+ this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F);
+ this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
+ float var1 = 0.5F;
+ this.leg1 = new ModelRenderer(0, 16);
+ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F);
+ this.leg2 = new ModelRenderer(0, 16);
+ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F);
+ this.leg3 = new ModelRenderer(0, 16);
+ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F);
+ this.leg4 = new ModelRenderer(0, 16);
+ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F);
+ }
+}
diff --git a/source/net/minecraft/src/ModelSkeleton.java b/source/net/minecraft/src/ModelSkeleton.java
new file mode 100644
index 0000000..e9447b8
--- /dev/null
+++ b/source/net/minecraft/src/ModelSkeleton.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+public class ModelSkeleton extends ModelZombie {
+ public ModelSkeleton() {
+ float var1 = 0.0F;
+ this.bipedRightArm = new ModelRenderer(40, 16);
+ this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
+ this.bipedLeftArm = new ModelRenderer(40, 16);
+ this.bipedLeftArm.mirror = true;
+ this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
+ this.bipedRightLeg = new ModelRenderer(0, 16);
+ this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
+ this.bipedLeftLeg = new ModelRenderer(0, 16);
+ this.bipedLeftLeg.mirror = true;
+ this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
+ }
+}
diff --git a/source/net/minecraft/src/ModelSpider.java b/source/net/minecraft/src/ModelSpider.java
new file mode 100644
index 0000000..ee7e099
--- /dev/null
+++ b/source/net/minecraft/src/ModelSpider.java
@@ -0,0 +1,116 @@
+package net.minecraft.src;
+
+public class ModelSpider extends ModelBase {
+ public ModelRenderer spiderHead;
+ public ModelRenderer spiderNeck;
+ public ModelRenderer spiderBody;
+ public ModelRenderer spiderLeg1;
+ public ModelRenderer spiderLeg2;
+ public ModelRenderer spiderLeg3;
+ public ModelRenderer spiderLeg4;
+ public ModelRenderer spiderLeg5;
+ public ModelRenderer spiderLeg6;
+ public ModelRenderer spiderLeg7;
+ public ModelRenderer spiderLeg8;
+
+ public ModelSpider() {
+ float var1 = 0.0F;
+ byte var2 = 15;
+ this.spiderHead = new ModelRenderer(32, 4);
+ this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, var1);
+ this.spiderHead.setRotationPoint(0.0F, (float)(0 + var2), -3.0F);
+ this.spiderNeck = new ModelRenderer(0, 0);
+ this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1);
+ this.spiderNeck.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.spiderBody = new ModelRenderer(0, 12);
+ this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1);
+ this.spiderBody.setRotationPoint(0.0F, (float)(0 + var2), 9.0F);
+ this.spiderLeg1 = new ModelRenderer(18, 0);
+ this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg1.setRotationPoint(-4.0F, (float)(0 + var2), 2.0F);
+ this.spiderLeg2 = new ModelRenderer(18, 0);
+ this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg2.setRotationPoint(4.0F, (float)(0 + var2), 2.0F);
+ this.spiderLeg3 = new ModelRenderer(18, 0);
+ this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg3.setRotationPoint(-4.0F, (float)(0 + var2), 1.0F);
+ this.spiderLeg4 = new ModelRenderer(18, 0);
+ this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg4.setRotationPoint(4.0F, (float)(0 + var2), 1.0F);
+ this.spiderLeg5 = new ModelRenderer(18, 0);
+ this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg5.setRotationPoint(-4.0F, (float)(0 + var2), 0.0F);
+ this.spiderLeg6 = new ModelRenderer(18, 0);
+ this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg6.setRotationPoint(4.0F, (float)(0 + var2), 0.0F);
+ this.spiderLeg7 = new ModelRenderer(18, 0);
+ this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg7.setRotationPoint(-4.0F, (float)(0 + var2), -1.0F);
+ this.spiderLeg8 = new ModelRenderer(18, 0);
+ this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg8.setRotationPoint(4.0F, (float)(0 + var2), -1.0F);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.spiderHead.render(var6);
+ this.spiderNeck.render(var6);
+ this.spiderBody.render(var6);
+ this.spiderLeg1.render(var6);
+ this.spiderLeg2.render(var6);
+ this.spiderLeg3.render(var6);
+ this.spiderLeg4.render(var6);
+ this.spiderLeg5.render(var6);
+ this.spiderLeg6.render(var6);
+ this.spiderLeg7.render(var6);
+ this.spiderLeg8.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.spiderHead.rotateAngleY = var4 / (180.0F / (float)Math.PI);
+ this.spiderHead.rotateAngleX = var5 / (180.0F / (float)Math.PI);
+ float var7 = (float)Math.PI * 0.25F;
+ this.spiderLeg1.rotateAngleZ = -var7;
+ this.spiderLeg2.rotateAngleZ = var7;
+ this.spiderLeg3.rotateAngleZ = -var7 * 0.74F;
+ this.spiderLeg4.rotateAngleZ = var7 * 0.74F;
+ this.spiderLeg5.rotateAngleZ = -var7 * 0.74F;
+ this.spiderLeg6.rotateAngleZ = var7 * 0.74F;
+ this.spiderLeg7.rotateAngleZ = -var7;
+ this.spiderLeg8.rotateAngleZ = var7;
+ float var8 = -0.0F;
+ float var9 = (float)Math.PI * 0.125F;
+ this.spiderLeg1.rotateAngleY = var9 * 2.0F + var8;
+ this.spiderLeg2.rotateAngleY = -var9 * 2.0F - var8;
+ this.spiderLeg3.rotateAngleY = var9 * 1.0F + var8;
+ this.spiderLeg4.rotateAngleY = -var9 * 1.0F - var8;
+ this.spiderLeg5.rotateAngleY = -var9 * 1.0F + var8;
+ this.spiderLeg6.rotateAngleY = var9 * 1.0F - var8;
+ this.spiderLeg7.rotateAngleY = -var9 * 2.0F + var8;
+ this.spiderLeg8.rotateAngleY = var9 * 2.0F - var8;
+ float var10 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * var2;
+ float var11 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * var2;
+ float var12 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 0.5F) * 0.4F) * var2;
+ float var13 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2;
+ float var14 = Math.abs(MathHelper.sin(var1 * 0.6662F + 0.0F) * 0.4F) * var2;
+ float var15 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI) * 0.4F) * var2;
+ float var16 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 0.5F) * 0.4F) * var2;
+ float var17 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2;
+ this.spiderLeg1.rotateAngleY += var10;
+ this.spiderLeg2.rotateAngleY += -var10;
+ this.spiderLeg3.rotateAngleY += var11;
+ this.spiderLeg4.rotateAngleY += -var11;
+ this.spiderLeg5.rotateAngleY += var12;
+ this.spiderLeg6.rotateAngleY += -var12;
+ this.spiderLeg7.rotateAngleY += var13;
+ this.spiderLeg8.rotateAngleY += -var13;
+ this.spiderLeg1.rotateAngleZ += var14;
+ this.spiderLeg2.rotateAngleZ += -var14;
+ this.spiderLeg3.rotateAngleZ += var15;
+ this.spiderLeg4.rotateAngleZ += -var15;
+ this.spiderLeg5.rotateAngleZ += var16;
+ this.spiderLeg6.rotateAngleZ += -var16;
+ this.spiderLeg7.rotateAngleZ += var17;
+ this.spiderLeg8.rotateAngleZ += -var17;
+ }
+}
diff --git a/source/net/minecraft/src/ModelZombie.java b/source/net/minecraft/src/ModelZombie.java
new file mode 100644
index 0000000..b0e93e1
--- /dev/null
+++ b/source/net/minecraft/src/ModelZombie.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+public class ModelZombie extends ModelBiped {
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ super.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ float var7 = MathHelper.sin(this.swingProgress * (float)Math.PI);
+ float var8 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
+ this.bipedRightArm.rotateAngleZ = 0.0F;
+ this.bipedLeftArm.rotateAngleZ = 0.0F;
+ this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F);
+ this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F;
+ this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F;
+ this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F;
+ this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F;
+ this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 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;
+ }
+}
diff --git a/source/net/minecraft/src/MouseHelper.java b/source/net/minecraft/src/MouseHelper.java
new file mode 100644
index 0000000..d1671d3
--- /dev/null
+++ b/source/net/minecraft/src/MouseHelper.java
@@ -0,0 +1,81 @@
+package net.minecraft.src;
+
+import java.awt.AWTException;
+import java.awt.Component;
+import java.awt.MouseInfo;
+import java.awt.Point;
+import java.awt.Robot;
+import java.nio.IntBuffer;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Cursor;
+import org.lwjgl.input.Mouse;
+
+public class MouseHelper {
+ private Component windowComponent;
+ private Robot robot;
+ private int componentWidth;
+ private int componentHeight;
+ private Cursor cursor;
+ public int deltaX;
+ public int deltaY;
+ private int mouseInt = 10;
+
+ public MouseHelper(Component var1) {
+ this.windowComponent = var1;
+
+ try {
+ this.robot = new Robot();
+ } catch (AWTException var6) {
+ var6.printStackTrace();
+ }
+
+ IntBuffer var2 = GLAllocation.createIntBuffer(1);
+ var2.put(0);
+ var2.flip();
+ IntBuffer var3 = GLAllocation.createIntBuffer(1024);
+
+ try {
+ this.cursor = new Cursor(32, 32, 16, 16, 1, var3, var2);
+ } catch (LWJGLException var5) {
+ var5.printStackTrace();
+ }
+
+ }
+
+ public void grabMouseCursor() {
+ try {
+ Mouse.setNativeCursor(this.cursor);
+ } catch (LWJGLException var2) {
+ var2.printStackTrace();
+ }
+
+ this.mouseXYChange();
+ this.deltaX = 0;
+ this.deltaY = 0;
+ }
+
+ public void ungrabMouseCursor() {
+ try {
+ Mouse.setNativeCursor((Cursor)null);
+ } catch (LWJGLException var2) {
+ var2.printStackTrace();
+ }
+
+ }
+
+ public void mouseXYChange() {
+ Point var1 = MouseInfo.getPointerInfo().getLocation();
+ Point var2 = this.windowComponent.getLocationOnScreen();
+ this.robot.mouseMove(this.componentWidth, this.componentHeight);
+ this.componentWidth = var2.x + this.windowComponent.getWidth() / 2;
+ this.componentHeight = var2.y + this.windowComponent.getHeight() / 2;
+ if(this.mouseInt == 0) {
+ this.deltaX = var1.x - this.componentWidth;
+ this.deltaY = var1.y - this.componentHeight;
+ } else {
+ this.deltaX = this.deltaY = 0;
+ --this.mouseInt;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/MovementInput.java b/source/net/minecraft/src/MovementInput.java
new file mode 100644
index 0000000..0b511d4
--- /dev/null
+++ b/source/net/minecraft/src/MovementInput.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class MovementInput {
+ public float moveStrafe = 0.0F;
+ public float moveForward = 0.0F;
+ public boolean unused = false;
+ public boolean jump = false;
+
+ public void updatePlayerMoveState(EntityPlayer var1) {
+ }
+
+ public void resetKeyState() {
+ }
+
+ public void checkKeyForMovementInput(int var1, boolean var2) {
+ }
+}
diff --git a/source/net/minecraft/src/MovementInputFromOptions.java b/source/net/minecraft/src/MovementInputFromOptions.java
new file mode 100644
index 0000000..e92f2ec
--- /dev/null
+++ b/source/net/minecraft/src/MovementInputFromOptions.java
@@ -0,0 +1,67 @@
+package net.minecraft.src;
+
+public class MovementInputFromOptions extends MovementInput {
+ private boolean[] movementKeyStates = new boolean[10];
+ private GameSettings gameSettings;
+
+ public MovementInputFromOptions(GameSettings var1) {
+ this.gameSettings = var1;
+ }
+
+ public void checkKeyForMovementInput(int var1, boolean var2) {
+ byte var3 = -1;
+ if(var1 == this.gameSettings.keyBindForward.keyCode) {
+ var3 = 0;
+ }
+
+ if(var1 == this.gameSettings.keyBindBack.keyCode) {
+ var3 = 1;
+ }
+
+ if(var1 == this.gameSettings.keyBindLeft.keyCode) {
+ var3 = 2;
+ }
+
+ if(var1 == this.gameSettings.keyBindRight.keyCode) {
+ var3 = 3;
+ }
+
+ if(var1 == this.gameSettings.keyBindJump.keyCode) {
+ var3 = 4;
+ }
+
+ if(var3 >= 0) {
+ this.movementKeyStates[var3] = var2;
+ }
+
+ }
+
+ public void resetKeyState() {
+ for(int var1 = 0; var1 < 10; ++var1) {
+ this.movementKeyStates[var1] = false;
+ }
+
+ }
+
+ public void updatePlayerMoveState(EntityPlayer var1) {
+ this.moveStrafe = 0.0F;
+ this.moveForward = 0.0F;
+ if(this.movementKeyStates[0]) {
+ ++this.moveForward;
+ }
+
+ if(this.movementKeyStates[1]) {
+ --this.moveForward;
+ }
+
+ if(this.movementKeyStates[2]) {
+ ++this.moveStrafe;
+ }
+
+ if(this.movementKeyStates[3]) {
+ --this.moveStrafe;
+ }
+
+ this.jump = this.movementKeyStates[4];
+ }
+}
diff --git a/source/net/minecraft/src/MovingObjectPosition.java b/source/net/minecraft/src/MovingObjectPosition.java
new file mode 100644
index 0000000..764010a
--- /dev/null
+++ b/source/net/minecraft/src/MovingObjectPosition.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class MovingObjectPosition {
+ public int typeOfHit;
+ public int blockX;
+ public int blockY;
+ public int blockZ;
+ public int sideHit;
+ public Vec3D hitVec;
+ public Entity entityHit;
+
+ public MovingObjectPosition(int var1, int var2, int var3, int var4, Vec3D var5) {
+ this.typeOfHit = 0;
+ this.blockX = var1;
+ this.blockY = var2;
+ this.blockZ = var3;
+ this.sideHit = var4;
+ this.hitVec = Vec3D.createVector(var5.xCoord, var5.yCoord, var5.zCoord);
+ }
+
+ public MovingObjectPosition(Entity var1) {
+ this.typeOfHit = 1;
+ this.entityHit = var1;
+ this.hitVec = Vec3D.createVector(var1.posX, var1.posY, var1.posZ);
+ }
+}
diff --git a/source/net/minecraft/src/NBTBase.java b/source/net/minecraft/src/NBTBase.java
new file mode 100644
index 0000000..ba02104
--- /dev/null
+++ b/source/net/minecraft/src/NBTBase.java
@@ -0,0 +1,102 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public abstract class NBTBase {
+ private String key = null;
+
+ abstract void writeTagContents(DataOutput var1) throws IOException;
+
+ abstract void readTagContents(DataInput var1) throws IOException;
+
+ public abstract byte getType();
+
+ public String getKey() {
+ return this.key == null ? "" : this.key;
+ }
+
+ public NBTBase setKey(String var1) {
+ this.key = var1;
+ return this;
+ }
+
+ public static NBTBase readNamedTag(DataInput var0) throws IOException {
+ byte var1 = var0.readByte();
+ if(var1 == 0) {
+ return new NBTTagEnd();
+ } else {
+ NBTBase var2 = createTagOfType(var1);
+ var2.key = var0.readUTF();
+ var2.readTagContents(var0);
+ return var2;
+ }
+ }
+
+ public static void writeNamedTag(NBTBase var0, DataOutput var1) throws IOException {
+ var1.writeByte(var0.getType());
+ if(var0.getType() != 0) {
+ var1.writeUTF(var0.getKey());
+ var0.writeTagContents(var1);
+ }
+ }
+
+ public static NBTBase createTagOfType(byte var0) {
+ switch(var0) {
+ case 0:
+ return new NBTTagEnd();
+ case 1:
+ return new NBTTagByte();
+ case 2:
+ return new NBTTagShort();
+ case 3:
+ return new NBTTagInt();
+ case 4:
+ return new NBTTagLong();
+ case 5:
+ return new NBTTagFloat();
+ case 6:
+ return new NBTTagDouble();
+ case 7:
+ return new NBTTagByteArray();
+ case 8:
+ return new NBTTagString();
+ case 9:
+ return new NBTTagList();
+ case 10:
+ return new NBTTagCompound();
+ 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";
+ default:
+ return "UNKNOWN";
+ }
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagByte.java b/source/net/minecraft/src/NBTTagByte.java
new file mode 100644
index 0000000..3260724
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagByte.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagByte extends NBTBase {
+ public byte byteValue;
+
+ public NBTTagByte() {
+ }
+
+ public NBTTagByte(byte var1) {
+ this.byteValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeByte(this.byteValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.byteValue = var1.readByte();
+ }
+
+ public byte getType() {
+ return (byte)1;
+ }
+
+ public String toString() {
+ return "" + this.byteValue;
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagByteArray.java b/source/net/minecraft/src/NBTTagByteArray.java
new file mode 100644
index 0000000..0f58fe1
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagByteArray.java
@@ -0,0 +1,35 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagByteArray extends NBTBase {
+ public byte[] byteArray;
+
+ public NBTTagByteArray() {
+ }
+
+ public NBTTagByteArray(byte[] var1) {
+ this.byteArray = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeInt(this.byteArray.length);
+ var1.write(this.byteArray);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ int var2 = var1.readInt();
+ this.byteArray = new byte[var2];
+ var1.readFully(this.byteArray);
+ }
+
+ public byte getType() {
+ return (byte)7;
+ }
+
+ public String toString() {
+ return "[" + this.byteArray.length + " bytes]";
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagCompound.java b/source/net/minecraft/src/NBTTagCompound.java
new file mode 100644
index 0000000..a7fa2f8
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagCompound.java
@@ -0,0 +1,128 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+public class NBTTagCompound extends NBTBase {
+ private Map tagMap = new HashMap();
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ Iterator var2 = this.tagMap.values().iterator();
+
+ while(var2.hasNext()) {
+ NBTBase var3 = (NBTBase)var2.next();
+ NBTBase.writeNamedTag(var3, var1);
+ }
+
+ var1.writeByte(0);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.tagMap.clear();
+
+ while(true) {
+ NBTBase var2 = NBTBase.readNamedTag(var1);
+ if(var2.getType() == 0) {
+ return;
+ }
+
+ this.tagMap.put(var2.getKey(), var2);
+ }
+ }
+
+ public byte getType() {
+ return (byte)10;
+ }
+
+ public void setTag(String var1, NBTBase var2) {
+ this.tagMap.put(var1, var2.setKey(var1));
+ }
+
+ public void setByte(String var1, byte var2) {
+ this.tagMap.put(var1, (new NBTTagByte(var2)).setKey(var1));
+ }
+
+ public void setShort(String var1, short var2) {
+ this.tagMap.put(var1, (new NBTTagShort(var2)).setKey(var1));
+ }
+
+ public void setInteger(String var1, int var2) {
+ this.tagMap.put(var1, (new NBTTagInt(var2)).setKey(var1));
+ }
+
+ public void setLong(String var1, long var2) {
+ this.tagMap.put(var1, (new NBTTagLong(var2)).setKey(var1));
+ }
+
+ public void setFloat(String var1, float var2) {
+ this.tagMap.put(var1, (new NBTTagFloat(var2)).setKey(var1));
+ }
+
+ public void setString(String var1, String var2) {
+ this.tagMap.put(var1, (new NBTTagString(var2)).setKey(var1));
+ }
+
+ public void setByteArray(String var1, byte[] var2) {
+ this.tagMap.put(var1, (new NBTTagByteArray(var2)).setKey(var1));
+ }
+
+ public void setCompoundTag(String var1, NBTTagCompound var2) {
+ this.tagMap.put(var1, var2.setKey(var1));
+ }
+
+ public void setBoolean(String var1, boolean var2) {
+ this.setByte(var1, (byte)(var2 ? 1 : 0));
+ }
+
+ public boolean hasKey(String var1) {
+ return this.tagMap.containsKey(var1);
+ }
+
+ public byte getByte(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0 : ((NBTTagByte)this.tagMap.get(var1)).byteValue;
+ }
+
+ public short getShort(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0 : ((NBTTagShort)this.tagMap.get(var1)).shortValue;
+ }
+
+ public int getInteger(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0 : ((NBTTagInt)this.tagMap.get(var1)).intValue;
+ }
+
+ public long getLong(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0L : ((NBTTagLong)this.tagMap.get(var1)).longValue;
+ }
+
+ public float getFloat(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0.0F : ((NBTTagFloat)this.tagMap.get(var1)).floatValue;
+ }
+
+ public String getString(String var1) {
+ return !this.tagMap.containsKey(var1) ? "" : ((NBTTagString)this.tagMap.get(var1)).stringValue;
+ }
+
+ public byte[] getByteArray(String var1) {
+ return !this.tagMap.containsKey(var1) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(var1)).byteArray;
+ }
+
+ public NBTTagCompound getCompoundTag(String var1) {
+ return !this.tagMap.containsKey(var1) ? new NBTTagCompound() : (NBTTagCompound)this.tagMap.get(var1);
+ }
+
+ public NBTTagList getTagList(String var1) {
+ return !this.tagMap.containsKey(var1) ? new NBTTagList() : (NBTTagList)this.tagMap.get(var1);
+ }
+
+ public boolean getBoolean(String var1) {
+ return this.getByte(var1) != 0;
+ }
+
+ public String toString() {
+ return "" + this.tagMap.size() + " entries";
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagDouble.java b/source/net/minecraft/src/NBTTagDouble.java
new file mode 100644
index 0000000..cd00968
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagDouble.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagDouble extends NBTBase {
+ public double doubleValue;
+
+ public NBTTagDouble() {
+ }
+
+ public NBTTagDouble(double var1) {
+ this.doubleValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeDouble(this.doubleValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.doubleValue = var1.readDouble();
+ }
+
+ public byte getType() {
+ return (byte)6;
+ }
+
+ public String toString() {
+ return "" + this.doubleValue;
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagEnd.java b/source/net/minecraft/src/NBTTagEnd.java
new file mode 100644
index 0000000..a04e7d6
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagEnd.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagEnd extends NBTBase {
+ void readTagContents(DataInput var1) throws IOException {
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ }
+
+ public byte getType() {
+ return (byte)0;
+ }
+
+ public String toString() {
+ return "END";
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagFloat.java b/source/net/minecraft/src/NBTTagFloat.java
new file mode 100644
index 0000000..cf59c93
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagFloat.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagFloat extends NBTBase {
+ public float floatValue;
+
+ public NBTTagFloat() {
+ }
+
+ public NBTTagFloat(float var1) {
+ this.floatValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeFloat(this.floatValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.floatValue = var1.readFloat();
+ }
+
+ public byte getType() {
+ return (byte)5;
+ }
+
+ public String toString() {
+ return "" + this.floatValue;
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagInt.java b/source/net/minecraft/src/NBTTagInt.java
new file mode 100644
index 0000000..6dfdfe6
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagInt.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagInt extends NBTBase {
+ public int intValue;
+
+ public NBTTagInt() {
+ }
+
+ public NBTTagInt(int var1) {
+ this.intValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeInt(this.intValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.intValue = var1.readInt();
+ }
+
+ public byte getType() {
+ return (byte)3;
+ }
+
+ public String toString() {
+ return "" + this.intValue;
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagList.java b/source/net/minecraft/src/NBTTagList.java
new file mode 100644
index 0000000..3ee8caf
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagList.java
@@ -0,0 +1,62 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class NBTTagList extends NBTBase {
+ private List tagList = new ArrayList();
+ private byte tagType;
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ if(this.tagList.size() > 0) {
+ this.tagType = ((NBTBase)this.tagList.get(0)).getType();
+ } else {
+ this.tagType = 1;
+ }
+
+ var1.writeByte(this.tagType);
+ var1.writeInt(this.tagList.size());
+
+ for(int var2 = 0; var2 < this.tagList.size(); ++var2) {
+ ((NBTBase)this.tagList.get(var2)).writeTagContents(var1);
+ }
+
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.tagType = var1.readByte();
+ int var2 = var1.readInt();
+ this.tagList = new ArrayList();
+
+ for(int var3 = 0; var3 < var2; ++var3) {
+ NBTBase var4 = NBTBase.createTagOfType(this.tagType);
+ var4.readTagContents(var1);
+ this.tagList.add(var4);
+ }
+
+ }
+
+ public byte getType() {
+ return (byte)9;
+ }
+
+ public String toString() {
+ return "" + this.tagList.size() + " entries of type " + NBTBase.getTagName(this.tagType);
+ }
+
+ public void setTag(NBTBase var1) {
+ this.tagType = var1.getType();
+ this.tagList.add(var1);
+ }
+
+ public NBTBase tagAt(int var1) {
+ return (NBTBase)this.tagList.get(var1);
+ }
+
+ public int tagCount() {
+ return this.tagList.size();
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagLong.java b/source/net/minecraft/src/NBTTagLong.java
new file mode 100644
index 0000000..646f80d
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagLong.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagLong extends NBTBase {
+ public long longValue;
+
+ public NBTTagLong() {
+ }
+
+ public NBTTagLong(long var1) {
+ this.longValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeLong(this.longValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.longValue = var1.readLong();
+ }
+
+ public byte getType() {
+ return (byte)4;
+ }
+
+ public String toString() {
+ return "" + this.longValue;
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagShort.java b/source/net/minecraft/src/NBTTagShort.java
new file mode 100644
index 0000000..3345229
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagShort.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagShort extends NBTBase {
+ public short shortValue;
+
+ public NBTTagShort() {
+ }
+
+ public NBTTagShort(short var1) {
+ this.shortValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeShort(this.shortValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.shortValue = var1.readShort();
+ }
+
+ public byte getType() {
+ return (byte)2;
+ }
+
+ public String toString() {
+ return "" + this.shortValue;
+ }
+}
diff --git a/source/net/minecraft/src/NBTTagString.java b/source/net/minecraft/src/NBTTagString.java
new file mode 100644
index 0000000..93fca6e
--- /dev/null
+++ b/source/net/minecraft/src/NBTTagString.java
@@ -0,0 +1,35 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagString extends NBTBase {
+ public String stringValue;
+
+ public NBTTagString() {
+ }
+
+ public NBTTagString(String var1) {
+ this.stringValue = var1;
+ if(var1 == null) {
+ throw new IllegalArgumentException("Empty string not allowed");
+ }
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeUTF(this.stringValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.stringValue = var1.readUTF();
+ }
+
+ public byte getType() {
+ return (byte)8;
+ }
+
+ public String toString() {
+ return "" + this.stringValue;
+ }
+}
diff --git a/source/net/minecraft/src/NextTickListEntry.java b/source/net/minecraft/src/NextTickListEntry.java
new file mode 100644
index 0000000..3870d49
--- /dev/null
+++ b/source/net/minecraft/src/NextTickListEntry.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class NextTickListEntry implements Comparable {
+ private static long nextTickEntryID = 0L;
+ public int xCoord;
+ public int yCoord;
+ public int zCoord;
+ public int blockID;
+ public long scheduledTime;
+ 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;
+ }
+
+ public boolean equals(Object var1) {
+ if(!(var1 instanceof NextTickListEntry)) {
+ return false;
+ } else {
+ NextTickListEntry var2 = (NextTickListEntry)var1;
+ return this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord && this.blockID == var2.blockID;
+ }
+ }
+
+ public int hashCode() {
+ return (this.xCoord * 128 * 1024 + this.zCoord * 128 + this.yCoord) * 256 + this.blockID;
+ }
+
+ public NextTickListEntry setScheduledTime(long var1) {
+ this.scheduledTime = var1;
+ return this;
+ }
+
+ public int a(NextTickListEntry var1) {
+ return this.scheduledTime < var1.scheduledTime ? -1 : (this.scheduledTime > var1.scheduledTime ? 1 : (this.tickEntryID < var1.tickEntryID ? -1 : (this.tickEntryID > var1.tickEntryID ? 1 : 0)));
+ }
+
+ public int compareTo(Object var1) {
+ return this.a((NextTickListEntry)var1);
+ }
+}
diff --git a/source/net/minecraft/src/NibbleArray.java b/source/net/minecraft/src/NibbleArray.java
new file mode 100644
index 0000000..56a0293
--- /dev/null
+++ b/source/net/minecraft/src/NibbleArray.java
@@ -0,0 +1,36 @@
+package net.minecraft.src;
+
+public class NibbleArray {
+ public final byte[] data;
+
+ public NibbleArray(int var1) {
+ this.data = new byte[var1 >> 1];
+ }
+
+ public NibbleArray(byte[] var1) {
+ this.data = var1;
+ }
+
+ public int get(int var1, int var2, int var3) {
+ int var4 = var1 << 11 | var3 << 7 | var2;
+ 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 = var1 << 11 | var3 << 7 | var2;
+ int var6 = var5 >> 1;
+ int var7 = var5 & 1;
+ if(var7 == 0) {
+ this.data[var6] = (byte)(this.data[var6] & 240 | var4 & 15);
+ } else {
+ this.data[var6] = (byte)(this.data[var6] & 15 | (var4 & 15) << 4);
+ }
+
+ }
+
+ public boolean isValid() {
+ return this.data != null;
+ }
+}
diff --git a/source/net/minecraft/src/NoiseGenerator.java b/source/net/minecraft/src/NoiseGenerator.java
new file mode 100644
index 0000000..53e6d05
--- /dev/null
+++ b/source/net/minecraft/src/NoiseGenerator.java
@@ -0,0 +1,4 @@
+package net.minecraft.src;
+
+public abstract class NoiseGenerator {
+}
diff --git a/source/net/minecraft/src/NoiseGeneratorOctaves.java b/source/net/minecraft/src/NoiseGeneratorOctaves.java
new file mode 100644
index 0000000..b58f601
--- /dev/null
+++ b/source/net/minecraft/src/NoiseGeneratorOctaves.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class NoiseGeneratorOctaves extends NoiseGenerator {
+ private NoiseGeneratorPerlin[] generatorCollection;
+ private int octaves;
+
+ public NoiseGeneratorOctaves(Random var1, int var2) {
+ this.octaves = var2;
+ this.generatorCollection = new NoiseGeneratorPerlin[var2];
+
+ for(int var3 = 0; var3 < var2; ++var3) {
+ this.generatorCollection[var3] = new NoiseGeneratorPerlin(var1);
+ }
+
+ }
+
+ public double generateNoiseOctaves(double var1, double var3) {
+ double var5 = 0.0D;
+ double var7 = 1.0D;
+
+ for(int var9 = 0; var9 < this.octaves; ++var9) {
+ var5 += this.generatorCollection[var9].generateNoise(var1 * var7, var3 * var7) / var7;
+ var7 /= 2.0D;
+ }
+
+ return var5;
+ }
+
+ public double a(double var1, double var3, double var5) {
+ double var7 = 0.0D;
+ double var9 = 1.0D;
+
+ for(int var11 = 0; var11 < this.octaves; ++var11) {
+ var7 += this.generatorCollection[var11].c(var1 * var9, var3 * var9, var5 * var9) / var9;
+ var9 /= 2.0D;
+ }
+
+ return var7;
+ }
+
+ public double[] a(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];
+ } else {
+ for(int var14 = 0; var14 < var1.length; ++var14) {
+ var1[var14] = 0.0D;
+ }
+ }
+
+ double var17 = 1.0D;
+
+ for(int var16 = 0; var16 < this.octaves; ++var16) {
+ this.generatorCollection[var16].a(var1, var2, var3, var4, var5, var6, var7, var8 * var17, var10 * var17, var12 * var17, var17);
+ var17 /= 2.0D;
+ }
+
+ return var1;
+ }
+}
diff --git a/source/net/minecraft/src/NoiseGeneratorPerlin.java b/source/net/minecraft/src/NoiseGeneratorPerlin.java
new file mode 100644
index 0000000..29fb064
--- /dev/null
+++ b/source/net/minecraft/src/NoiseGeneratorPerlin.java
@@ -0,0 +1,162 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class NoiseGeneratorPerlin extends NoiseGenerator {
+ private int[] permutations;
+ public double xCoord;
+ public double yCoord;
+ public double zCoord;
+
+ public NoiseGeneratorPerlin() {
+ this(new Random());
+ }
+
+ public NoiseGeneratorPerlin(Random var1) {
+ this.permutations = new int[512];
+ this.xCoord = var1.nextDouble() * 256.0D;
+ this.yCoord = var1.nextDouble() * 256.0D;
+ this.zCoord = var1.nextDouble() * 256.0D;
+
+ int var2;
+ for(var2 = 0; var2 < 256; this.permutations[var2] = var2++) {
+ }
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ int var3 = var1.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 double generateNoise(double var1, double var3, double var5) {
+ double var7 = var1 + this.xCoord;
+ double var9 = var3 + this.yCoord;
+ double var11 = var5 + this.zCoord;
+ int var13 = (int)var7;
+ int var14 = (int)var9;
+ int var15 = (int)var11;
+ if(var7 < (double)var13) {
+ --var13;
+ }
+
+ if(var9 < (double)var14) {
+ --var14;
+ }
+
+ if(var11 < (double)var15) {
+ --var15;
+ }
+
+ int var16 = var13 & 255;
+ int var17 = var14 & 255;
+ int var18 = var15 & 255;
+ var7 -= (double)var13;
+ var9 -= (double)var14;
+ var11 -= (double)var15;
+ double var19 = var7 * var7 * var7 * (var7 * (var7 * 6.0D - 15.0D) + 10.0D);
+ double var21 = var9 * var9 * var9 * (var9 * (var9 * 6.0D - 15.0D) + 10.0D);
+ double var23 = var11 * var11 * var11 * (var11 * (var11 * 6.0D - 15.0D) + 10.0D);
+ int var25 = this.permutations[var16] + var17;
+ int var26 = this.permutations[var25] + var18;
+ int var27 = this.permutations[var25 + 1] + var18;
+ int var28 = this.permutations[var16 + 1] + var17;
+ int var29 = this.permutations[var28] + var18;
+ int var30 = this.permutations[var28 + 1] + var18;
+ return this.lerp(var23, this.lerp(var21, this.lerp(var19, this.grad(this.permutations[var26], var7, var9, var11), this.grad(this.permutations[var29], var7 - 1.0D, var9, var11)), this.lerp(var19, this.grad(this.permutations[var27], var7, var9 - 1.0D, var11), this.grad(this.permutations[var30], var7 - 1.0D, var9 - 1.0D, var11))), this.lerp(var21, this.lerp(var19, this.grad(this.permutations[var26 + 1], var7, var9, var11 - 1.0D), this.grad(this.permutations[var29 + 1], var7 - 1.0D, var9, var11 - 1.0D)), this.lerp(var19, this.grad(this.permutations[var27 + 1], var7, var9 - 1.0D, var11 - 1.0D), this.grad(this.permutations[var30 + 1], var7 - 1.0D, var9 - 1.0D, var11 - 1.0D))));
+ }
+
+ public double lerp(double var1, double var3, double var5) {
+ return var3 + var1 * (var5 - var3);
+ }
+
+ public 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);
+ return ((var8 & 1) == 0 ? var9 : -var9) + ((var8 & 2) == 0 ? var11 : -var11);
+ }
+
+ public double generateNoise(double var1, double var3) {
+ return this.generateNoise(var1, var3, 0.0D);
+ }
+
+ public double c(double var1, double var3, double var5) {
+ return this.generateNoise(var1, var3, var5);
+ }
+
+ public void a(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7, double var8, double var10, double var12, double var14) {
+ int var16 = 0;
+ double var17 = 1.0D / var14;
+ int var19 = -1;
+ boolean var20 = false;
+ boolean var21 = false;
+ boolean var22 = false;
+ boolean var23 = false;
+ boolean var24 = false;
+ boolean var25 = false;
+ double var26 = 0.0D;
+ double var28 = 0.0D;
+ double var30 = 0.0D;
+ double var32 = 0.0D;
+
+ for(int var34 = 0; var34 < var5; ++var34) {
+ double var35 = (double)(var2 + var34) * var8 + this.xCoord;
+ int var37 = (int)var35;
+ if(var35 < (double)var37) {
+ --var37;
+ }
+
+ int var38 = var37 & 255;
+ var35 -= (double)var37;
+ double var39 = var35 * var35 * var35 * (var35 * (var35 * 6.0D - 15.0D) + 10.0D);
+
+ for(int var41 = 0; var41 < var7; ++var41) {
+ double var42 = (double)(var4 + var41) * var12 + this.zCoord;
+ int var44 = (int)var42;
+ if(var42 < (double)var44) {
+ --var44;
+ }
+
+ int var45 = var44 & 255;
+ var42 -= (double)var44;
+ double var46 = var42 * var42 * var42 * (var42 * (var42 * 6.0D - 15.0D) + 10.0D);
+
+ for(int var48 = 0; var48 < var6; ++var48) {
+ double var49 = (double)(var3 + var48) * var10 + this.yCoord;
+ int var51 = (int)var49;
+ if(var49 < (double)var51) {
+ --var51;
+ }
+
+ int var52 = var51 & 255;
+ var49 -= (double)var51;
+ double var53 = var49 * var49 * var49 * (var49 * (var49 * 6.0D - 15.0D) + 10.0D);
+ if(var48 == 0 || var52 != var19) {
+ var19 = var52;
+ int var61 = this.permutations[var38] + var52;
+ int var62 = this.permutations[var61] + var45;
+ int var63 = this.permutations[var61 + 1] + var45;
+ int var64 = this.permutations[var38 + 1] + var52;
+ int var65 = this.permutations[var64] + var45;
+ int var66 = this.permutations[var64 + 1] + var45;
+ var26 = this.lerp(var39, this.grad(this.permutations[var62], var35, var49, var42), this.grad(this.permutations[var65], var35 - 1.0D, var49, var42));
+ var28 = this.lerp(var39, this.grad(this.permutations[var63], var35, var49 - 1.0D, var42), this.grad(this.permutations[var66], var35 - 1.0D, var49 - 1.0D, var42));
+ var30 = this.lerp(var39, this.grad(this.permutations[var62 + 1], var35, var49, var42 - 1.0D), this.grad(this.permutations[var65 + 1], var35 - 1.0D, var49, var42 - 1.0D));
+ var32 = this.lerp(var39, this.grad(this.permutations[var63 + 1], var35, var49 - 1.0D, var42 - 1.0D), this.grad(this.permutations[var66 + 1], var35 - 1.0D, var49 - 1.0D, var42 - 1.0D));
+ }
+
+ double var55 = this.lerp(var53, var26, var28);
+ double var57 = this.lerp(var53, var30, var32);
+ double var59 = this.lerp(var46, var55, var57);
+ int var10001 = var16++;
+ var1[var10001] += var59 * var17;
+ }
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/OSMap.java b/source/net/minecraft/src/OSMap.java
new file mode 100644
index 0000000..c183c05
--- /dev/null
+++ b/source/net/minecraft/src/OSMap.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+class OSMap {
+ static final int[] osValues = new int[EnumOS.values().length];
+
+ static {
+ try {
+ osValues[EnumOS.linux.ordinal()] = 1;
+ } catch (NoSuchFieldError var4) {
+ }
+
+ try {
+ osValues[EnumOS.solaris.ordinal()] = 2;
+ } catch (NoSuchFieldError var3) {
+ }
+
+ try {
+ osValues[EnumOS.windows.ordinal()] = 3;
+ } catch (NoSuchFieldError var2) {
+ }
+
+ try {
+ osValues[EnumOS.macos.ordinal()] = 4;
+ } catch (NoSuchFieldError var1) {
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/OSMapIsom.java b/source/net/minecraft/src/OSMapIsom.java
new file mode 100644
index 0000000..16687c5
--- /dev/null
+++ b/source/net/minecraft/src/OSMapIsom.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+class OSMapIsom {
+ static final int[] osValues = new int[EnumOSIsom.values().length];
+
+ static {
+ try {
+ osValues[EnumOSIsom.linux.ordinal()] = 1;
+ } catch (NoSuchFieldError var4) {
+ }
+
+ try {
+ osValues[EnumOSIsom.solaris.ordinal()] = 2;
+ } catch (NoSuchFieldError var3) {
+ }
+
+ try {
+ osValues[EnumOSIsom.windows.ordinal()] = 3;
+ } catch (NoSuchFieldError var2) {
+ }
+
+ try {
+ osValues[EnumOSIsom.macos.ordinal()] = 4;
+ } catch (NoSuchFieldError var1) {
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/OpenGlCapsChecker.java b/source/net/minecraft/src/OpenGlCapsChecker.java
new file mode 100644
index 0000000..eaf1238
--- /dev/null
+++ b/source/net/minecraft/src/OpenGlCapsChecker.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GLContext;
+
+public class OpenGlCapsChecker {
+ public boolean checkARBOcclusion() {
+ return false & GLContext.getCapabilities().GL_ARB_occlusion_query;
+ }
+}
diff --git a/source/net/minecraft/src/PanelCrashReport.java b/source/net/minecraft/src/PanelCrashReport.java
new file mode 100644
index 0000000..59d6613
--- /dev/null
+++ b/source/net/minecraft/src/PanelCrashReport.java
@@ -0,0 +1,85 @@
+package net.minecraft.src;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Panel;
+import java.awt.TextArea;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.GL11;
+
+public class PanelCrashReport extends Panel {
+ public PanelCrashReport(UnexpectedThrowable var1) {
+ this.setBackground(new Color(3028036));
+ this.setLayout(new BorderLayout());
+ StringWriter var2 = new StringWriter();
+ var1.exception.printStackTrace(new PrintWriter(var2));
+ String var3 = var2.toString();
+ String var4 = "";
+ String var5 = "";
+
+ try {
+ var5 = var5 + "Generated " + (new SimpleDateFormat()).format(new Date()) + "\n";
+ var5 = var5 + "\n";
+ var5 = var5 + "Minecraft: Minecraft Infdev\n";
+ var5 = var5 + "OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n";
+ var5 = var5 + "Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n";
+ var5 = var5 + "VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor") + "\n";
+ var5 = var5 + "LWJGL: " + Sys.getVersion() + "\n";
+ var4 = GL11.glGetString(GL11.GL_VENDOR);
+ var5 = var5 + "OpenGL: " + GL11.glGetString(GL11.GL_RENDERER) + " version " + GL11.glGetString(GL11.GL_VERSION) + ", " + GL11.glGetString(GL11.GL_VENDOR) + "\n";
+ } catch (Throwable var8) {
+ var5 = var5 + "[failed to get system properties]\n";
+ }
+
+ var5 = var5 + "\n";
+ var5 = var5 + var3;
+ String var6 = "";
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ if(var3.contains("Pixel format not accelerated")) {
+ var6 = var6 + " Bad video card drivers! \n";
+ var6 = var6 + " ----------------------- \n";
+ var6 = var6 + "\n";
+ var6 = var6 + "Minecraft was unable to start because it failed to find an accelerated OpenGL mode.\n";
+ var6 = var6 + "This can usually be fixed by updating the video card drivers.\n";
+ if(var4.toLowerCase().contains("nvidia")) {
+ var6 = var6 + "\n";
+ var6 = var6 + "You might be able to find drivers for your video card here:\n";
+ var6 = var6 + " http://www.nvidia.com/\n";
+ } else if(var4.toLowerCase().contains("ati")) {
+ var6 = var6 + "\n";
+ var6 = var6 + "You might be able to find drivers for your video card here:\n";
+ var6 = var6 + " http://www.amd.com/\n";
+ }
+ } else {
+ var6 = var6 + " Minecraft has crashed! \n";
+ var6 = var6 + " ---------------------- \n";
+ var6 = var6 + "\n";
+ var6 = var6 + "Minecraft has stopped running because it encountered a problem.\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "If you wish to report this, please copy this entire text and email it to support@mojang.com.\n";
+ var6 = var6 + "Please include a description of what you did when the error occured.\n";
+ }
+
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "--- BEGIN ERROR REPORT " + Integer.toHexString(var6.hashCode()) + " --------\n";
+ var6 = var6 + var5;
+ var6 = var6 + "--- END ERROR REPORT " + Integer.toHexString(var6.hashCode()) + " ----------\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ TextArea var7 = new TextArea(var6, 0, 0, 1);
+ var7.setFont(new Font("Monospaced", 0, 12));
+ this.add(new CanvasMojangLogo(), "North");
+ this.add(new CanvasCrashReport(80), "East");
+ this.add(new CanvasCrashReport(80), "West");
+ this.add(new CanvasCrashReport(100), "South");
+ this.add(var7, "Center");
+ }
+}
diff --git a/source/net/minecraft/src/Path.java b/source/net/minecraft/src/Path.java
new file mode 100644
index 0000000..ce289f0
--- /dev/null
+++ b/source/net/minecraft/src/Path.java
@@ -0,0 +1,119 @@
+package net.minecraft.src;
+
+public class Path {
+ private PathPoint[] pathPoints = new PathPoint[1024];
+ private int count = 0;
+
+ public PathPoint addPoint(PathPoint var1) {
+ if(var1.index >= 0) {
+ throw new IllegalStateException("OW KNOWS!");
+ } else {
+ 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.sortBack(this.count++);
+ return var1;
+ }
+ }
+
+ public void clearPath() {
+ this.count = 0;
+ }
+
+ public PathPoint dequeue() {
+ PathPoint var1 = this.pathPoints[0];
+ this.pathPoints[0] = this.pathPoints[--this.count];
+ this.pathPoints[this.count] = null;
+ if(this.count > 0) {
+ this.sortForward(0);
+ }
+
+ var1.index = -1;
+ return var1;
+ }
+
+ public void changeDistance(PathPoint var1, float var2) {
+ float var3 = var1.distanceToTarget;
+ var1.distanceToTarget = var2;
+ if(var2 < var3) {
+ this.sortBack(var1.index);
+ } else {
+ this.sortForward(var1.index);
+ }
+
+ }
+
+ private void sortBack(int var1) {
+ PathPoint var2 = this.pathPoints[var1];
+
+ int var4;
+ for(float var3 = var2.distanceToTarget; var1 > 0; var1 = var4) {
+ var4 = var1 - 1 >> 1;
+ PathPoint var5 = this.pathPoints[var4];
+ if(var3 >= var5.distanceToTarget) {
+ break;
+ }
+
+ this.pathPoints[var1] = var5;
+ var5.index = var1;
+ }
+
+ this.pathPoints[var1] = var2;
+ var2.index = var1;
+ }
+
+ private void sortForward(int var1) {
+ PathPoint var2 = this.pathPoints[var1];
+ float var3 = var2.distanceToTarget;
+
+ while(true) {
+ int var4 = 1 + (var1 << 1);
+ int var5 = var4 + 1;
+ if(var4 >= this.count) {
+ break;
+ }
+
+ PathPoint var6 = this.pathPoints[var4];
+ float var7 = var6.distanceToTarget;
+ PathPoint var8;
+ float var9;
+ if(var5 >= this.count) {
+ var8 = null;
+ var9 = Float.POSITIVE_INFINITY;
+ } else {
+ var8 = this.pathPoints[var5];
+ var9 = var8.distanceToTarget;
+ }
+
+ if(var7 < var9) {
+ if(var7 >= var3) {
+ break;
+ }
+
+ this.pathPoints[var1] = var6;
+ var6.index = var1;
+ var1 = var4;
+ } else {
+ if(var9 >= var3) {
+ break;
+ }
+
+ this.pathPoints[var1] = var8;
+ var8.index = var1;
+ var1 = var5;
+ }
+ }
+
+ this.pathPoints[var1] = var2;
+ var2.index = var1;
+ }
+
+ public boolean isPathEmpty() {
+ return this.count == 0;
+ }
+}
diff --git a/source/net/minecraft/src/PathEntity.java b/source/net/minecraft/src/PathEntity.java
new file mode 100644
index 0000000..e1994b1
--- /dev/null
+++ b/source/net/minecraft/src/PathEntity.java
@@ -0,0 +1,27 @@
+package net.minecraft.src;
+
+public class PathEntity {
+ private final PathPoint[] points;
+ public final int pathLength;
+ private int pathIndex;
+
+ public PathEntity(PathPoint[] var1) {
+ this.points = var1;
+ this.pathLength = var1.length;
+ }
+
+ public void incrementPathIndex() {
+ ++this.pathIndex;
+ }
+
+ public boolean isFinished() {
+ return this.pathIndex >= this.points.length;
+ }
+
+ public Vec3D getPosition(Entity var1) {
+ float var2 = (float)this.points[this.pathIndex].xCoord + (float)((int)(var1.width + 1.0F)) * 0.5F;
+ float var3 = (float)this.points[this.pathIndex].yCoord;
+ float var4 = (float)this.points[this.pathIndex].zCoord + (float)((int)(var1.width + 1.0F)) * 0.5F;
+ return Vec3D.createVector((double)var2, (double)var3, (double)var4);
+ }
+}
diff --git a/source/net/minecraft/src/PathPoint.java b/source/net/minecraft/src/PathPoint.java
new file mode 100644
index 0000000..7df70dd
--- /dev/null
+++ b/source/net/minecraft/src/PathPoint.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class PathPoint {
+ public final int xCoord;
+ public final int yCoord;
+ public final int zCoord;
+ public final int hash;
+ int index = -1;
+ float totalPathDistance;
+ float distanceToNext;
+ float distanceToTarget;
+ PathPoint previous;
+ public boolean isFirst = false;
+
+ public PathPoint(int var1, int var2, int var3) {
+ this.xCoord = var1;
+ this.yCoord = var2;
+ this.zCoord = var3;
+ this.hash = var1 | var2 << 10 | var3 << 20;
+ }
+
+ 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);
+ return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4);
+ }
+
+ public boolean equals(Object var1) {
+ return ((PathPoint)var1).hash == this.hash;
+ }
+
+ public int hashCode() {
+ return this.hash;
+ }
+
+ public boolean isAssigned() {
+ return this.index >= 0;
+ }
+
+ public String toString() {
+ return this.xCoord + ", " + this.yCoord + ", " + this.zCoord;
+ }
+}
diff --git a/source/net/minecraft/src/Pathfinder.java b/source/net/minecraft/src/Pathfinder.java
new file mode 100644
index 0000000..7887c4f
--- /dev/null
+++ b/source/net/minecraft/src/Pathfinder.java
@@ -0,0 +1,205 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Pathfinder {
+ private IBlockAccess worldMap;
+ private Path path = new Path();
+ private Map pointMap = new HashMap();
+ private PathPoint[] pathOptions = new PathPoint[32];
+
+ public Pathfinder(IBlockAccess var1) {
+ this.worldMap = var1;
+ }
+
+ 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) {
+ this.path.clearPath();
+ this.pointMap.clear();
+ PathPoint var9 = this.openPoint(MathHelper.floor_double(var1.boundingBox.minX), MathHelper.floor_double(var1.boundingBox.minY), MathHelper.floor_double(var1.boundingBox.minZ));
+ PathPoint var10 = 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 var11 = new PathPoint(MathHelper.floor_float(var1.width + 1.0F), MathHelper.floor_float(var1.height + 1.0F), MathHelper.floor_float(var1.width + 1.0F));
+ PathEntity var12 = this.addToPath(var1, var9, var10, var11, var8);
+ return var12;
+ }
+
+ private PathEntity addToPath(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) {
+ var2.totalPathDistance = 0.0F;
+ var2.distanceToNext = var2.distanceTo(var3);
+ var2.distanceToTarget = var2.distanceToNext;
+ this.path.clearPath();
+ this.path.addPoint(var2);
+ PathPoint var6 = var2;
+
+ while(!this.path.isPathEmpty()) {
+ PathPoint var7 = this.path.dequeue();
+ if(var7.hash == var3.hash) {
+ return this.createEntityPath(var2, var3);
+ }
+
+ if(var7.distanceTo(var3) < var6.distanceTo(var3)) {
+ var6 = var7;
+ }
+
+ var7.isFirst = true;
+ int var8 = this.findPathOptions(var1, var7, var4, var3, var5);
+
+ for(int var9 = 0; var9 < var8; ++var9) {
+ PathPoint var10 = this.pathOptions[var9];
+ float var11 = var7.totalPathDistance + var7.distanceTo(var10);
+ if(!var10.isAssigned() || var11 < var10.totalPathDistance) {
+ var10.previous = var7;
+ var10.totalPathDistance = var11;
+ var10.distanceToNext = var10.distanceTo(var3);
+ if(var10.isAssigned()) {
+ this.path.changeDistance(var10, var10.totalPathDistance + var10.distanceToNext);
+ } else {
+ var10.distanceToTarget = var10.totalPathDistance + var10.distanceToNext;
+ this.path.addPoint(var10);
+ }
+ }
+ }
+ }
+
+ if(var6 == var2) {
+ return null;
+ } else {
+ return this.createEntityPath(var2, var6);
+ }
+ }
+
+ private int findPathOptions(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) {
+ int var6 = 0;
+ byte var7 = 0;
+ if(this.getVerticalOffset(var1, var2.xCoord, var2.yCoord + 1, var2.zCoord, var3) > 0) {
+ 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) {
+ this.pathOptions[var6++] = var8;
+ }
+
+ if(var9 != null && !var9.isFirst && var9.distanceTo(var4) < var5) {
+ this.pathOptions[var6++] = var9;
+ }
+
+ if(var10 != null && !var10.isFirst && var10.distanceTo(var4) < var5) {
+ this.pathOptions[var6++] = var10;
+ }
+
+ if(var11 != null && !var11.isFirst && var11.distanceTo(var4) < var5) {
+ this.pathOptions[var6++] = var11;
+ }
+
+ return var6;
+ }
+
+ private PathPoint getSafePoint(Entity var1, int var2, int var3, int var4, PathPoint var5, int var6) {
+ PathPoint var7 = null;
+ if(this.getVerticalOffset(var1, var2, var3, var4, var5) > 0) {
+ var7 = this.openPoint(var2, var3, var4);
+ }
+
+ if(var7 == null && this.getVerticalOffset(var1, var2, var3 + var6, var4, var5) > 0) {
+ var7 = this.openPoint(var2, var3 + var6, var4);
+ }
+
+ if(var7 != null) {
+ int var8 = 0;
+ boolean var9 = false;
+
+ while(true) {
+ if(var3 > 0) {
+ int var11 = this.getVerticalOffset(var1, var2, var3 - 1, var4, var5);
+ if(var11 > 0) {
+ if(var11 < 0) {
+ return null;
+ }
+
+ ++var8;
+ if(var8 >= 4) {
+ return null;
+ }
+
+ --var3;
+ continue;
+ }
+ }
+
+ if(var3 > 0) {
+ var7 = this.openPoint(var2, var3, var4);
+ }
+
+ Material var10 = this.worldMap.getBlockMaterial(var2, var3 - 1, var4);
+ if(var10 == Material.water || var10 == Material.lava) {
+ return null;
+ }
+ break;
+ }
+ }
+
+ return var7;
+ }
+
+ private final PathPoint openPoint(int var1, int var2, int var3) {
+ int var4 = var1 | var2 << 10 | var3 << 20;
+ PathPoint var5 = (PathPoint)this.pointMap.get(Integer.valueOf(var4));
+ if(var5 == null) {
+ var5 = new PathPoint(var1, var2, var3);
+ this.pointMap.put(Integer.valueOf(var4), var5);
+ }
+
+ return var5;
+ }
+
+ private int getVerticalOffset(Entity var1, int var2, int var3, int var4, PathPoint var5) {
+ for(int var6 = var2; var6 < var2 + var5.xCoord; ++var6) {
+ for(int var7 = var3; var7 < var3 + var5.yCoord; ++var7) {
+ for(int var8 = var4; var8 < var4 + var5.zCoord; ++var8) {
+ Material var9 = this.worldMap.getBlockMaterial(var2, var3, var4);
+ if(var9.getIsSolid()) {
+ return 0;
+ }
+
+ if(var9 == Material.water || var9 == Material.lava) {
+ return -1;
+ }
+ }
+ }
+ }
+
+ return 1;
+ }
+
+ private PathEntity createEntityPath(PathPoint var1, PathPoint var2) {
+ int var3 = 1;
+
+ PathPoint var4;
+ for(var4 = var2; var4.previous != null; var4 = var4.previous) {
+ ++var3;
+ }
+
+ PathPoint[] var5 = new PathPoint[var3];
+ var4 = var2;
+ --var3;
+
+ for(var5[var3] = var2; var4.previous != null; var5[var3] = var4) {
+ var4 = var4.previous;
+ --var3;
+ }
+
+ return new PathEntity(var5);
+ }
+}
diff --git a/source/net/minecraft/src/PlayerController.java b/source/net/minecraft/src/PlayerController.java
new file mode 100644
index 0000000..4abc7dc
--- /dev/null
+++ b/source/net/minecraft/src/PlayerController.java
@@ -0,0 +1,60 @@
+package net.minecraft.src;
+
+public class PlayerController {
+ protected final Minecraft mc;
+ public boolean isInTestMode = false;
+
+ public PlayerController(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void init() {
+ }
+
+ public void onWorldChange(World var1) {
+ }
+
+ public void clickBlock(int var1, int var2, int var3) {
+ this.sendBlockRemoved(var1, var2, var3);
+ }
+
+ public boolean sendBlockRemoved(int var1, int var2, int var3) {
+ this.mc.effectRenderer.addBlockDestroyEffects(var1, var2, var3);
+ World var4 = this.mc.theWorld;
+ Block var5 = Block.blocksList[var4.getBlockId(var1, var2, var3)];
+ int var6 = var4.getBlockMetadata(var1, var2, var3);
+ boolean var7 = var4.setBlockWithNotify(var1, var2, var3, 0);
+ if(var5 != null && var7) {
+ this.mc.sndManager.playSound(var5.stepSound.getBreakSound(), (float)var1 + 0.5F, (float)var2 + 0.5F, (float)var3 + 0.5F, (var5.stepSound.getVolume() + 1.0F) / 2.0F, var5.stepSound.getPitch() * 0.8F);
+ var5.onBlockDestroyedByPlayer(var4, var1, var2, var3, var6);
+ }
+
+ return var7;
+ }
+
+ public void sendBlockRemoving(int var1, int var2, int var3, int var4) {
+ }
+
+ public void resetBlockRemoving() {
+ }
+
+ public void setPartialTime(float var1) {
+ }
+
+ public float getBlockReachDistance() {
+ return 5.0F;
+ }
+
+ public void flipPlayer(EntityPlayer var1) {
+ }
+
+ public void onUpdate() {
+ }
+
+ public boolean shouldDrawHUD() {
+ return true;
+ }
+
+ public void onRespawn(EntityPlayer var1) {
+ }
+}
diff --git a/source/net/minecraft/src/PlayerControllerCreative.java b/source/net/minecraft/src/PlayerControllerCreative.java
new file mode 100644
index 0000000..960d62a
--- /dev/null
+++ b/source/net/minecraft/src/PlayerControllerCreative.java
@@ -0,0 +1,33 @@
+package net.minecraft.src;
+
+public class PlayerControllerCreative extends PlayerController {
+ public PlayerControllerCreative(Minecraft var1) {
+ super(var1);
+ this.isInTestMode = true;
+ }
+
+ public void init() {
+ }
+
+ public void onRespawn(EntityPlayer var1) {
+ for(int var2 = 0; var2 < 9; ++var2) {
+ if(var1.inventory.mainInventory[var2] == null) {
+ this.mc.thePlayer.inventory.mainInventory[var2] = new ItemStack(((Block)Session.registeredBlocksList.get(var2)).blockID);
+ } else {
+ this.mc.thePlayer.inventory.mainInventory[var2].stackSize = 1;
+ }
+ }
+
+ }
+
+ public boolean shouldDrawHUD() {
+ return false;
+ }
+
+ public void onWorldChange(World var1) {
+ super.onWorldChange(var1);
+ }
+
+ public void onUpdate() {
+ }
+}
diff --git a/source/net/minecraft/src/PlayerControllerSP.java b/source/net/minecraft/src/PlayerControllerSP.java
new file mode 100644
index 0000000..845c644
--- /dev/null
+++ b/source/net/minecraft/src/PlayerControllerSP.java
@@ -0,0 +1,124 @@
+package net.minecraft.src;
+
+public class PlayerControllerSP extends PlayerController {
+ private int curBlockX = -1;
+ private int curBlockY = -1;
+ private int curBlockZ = -1;
+ private float curBlockDamage = 0.0F;
+ private float prevBlockDamage = 0.0F;
+ private float blockDestroySoundCounter = 0.0F;
+ private int blockHitWait = 0;
+ private SpawnerAnimals monsterSpawner = new SpawnerMonsters(this, 100, EntityMonster.class, new Class[]{EntityZombie.class, EntitySkeleton.class, EntityCreeper.class, EntitySpider.class});
+ private SpawnerAnimals animalSpawner = new SpawnerAnimals(20, EntityAnimal.class, new Class[]{EntitySheep.class, EntityPig.class});
+
+ public PlayerControllerSP(Minecraft var1) {
+ super(var1);
+ }
+
+ public void flipPlayer(EntityPlayer var1) {
+ var1.rotationYaw = -180.0F;
+ }
+
+ public void init() {
+ }
+
+ public boolean sendBlockRemoved(int var1, int var2, int var3) {
+ int var4 = this.mc.theWorld.getBlockId(var1, var2, var3);
+ int var5 = this.mc.theWorld.getBlockMetadata(var1, var2, var3);
+ boolean var6 = super.sendBlockRemoved(var1, var2, var3);
+ ItemStack var7 = this.mc.thePlayer.getCurrentEquippedItem();
+ if(var7 != null) {
+ var7.onDestroyBlock(var4, var1, var2, var3);
+ if(var7.stackSize == 0) {
+ var7.onItemDestroyedByUse(this.mc.thePlayer);
+ this.mc.thePlayer.displayGUIInventory();
+ }
+ }
+
+ if(var6 && this.mc.thePlayer.canHarvestBlock(Block.blocksList[var4])) {
+ Block.blocksList[var4].dropBlockAsItem(this.mc.theWorld, var1, var2, var3, var5);
+ }
+
+ return var6;
+ }
+
+ public void clickBlock(int var1, int var2, int var3) {
+ int var4 = this.mc.theWorld.getBlockId(var1, var2, var3);
+ if(var4 > 0 && this.curBlockDamage == 0.0F) {
+ Block.blocksList[var4].onBlockClicked(this.mc.theWorld, var1, var2, var3, this.mc.thePlayer);
+ }
+
+ if(var4 > 0 && Block.blocksList[var4].blockStrength(this.mc.thePlayer) >= 1.0F) {
+ this.sendBlockRemoved(var1, var2, var3);
+ }
+
+ }
+
+ public void resetBlockRemoving() {
+ this.curBlockDamage = 0.0F;
+ this.blockHitWait = 0;
+ }
+
+ public void sendBlockRemoving(int var1, int var2, int var3, int var4) {
+ if(this.blockHitWait > 0) {
+ --this.blockHitWait;
+ } else {
+ super.sendBlockRemoving(var1, var2, var3, var4);
+ if(var1 == this.curBlockX && var2 == this.curBlockY && var3 == this.curBlockZ) {
+ int var5 = this.mc.theWorld.getBlockId(var1, var2, var3);
+ if(var5 == 0) {
+ return;
+ }
+
+ Block var6 = Block.blocksList[var5];
+ this.curBlockDamage += var6.blockStrength(this.mc.thePlayer);
+ if(this.blockDestroySoundCounter % 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);
+ }
+
+ ++this.blockDestroySoundCounter;
+ if(this.curBlockDamage >= 1.0F) {
+ this.sendBlockRemoved(var1, var2, var3);
+ this.curBlockDamage = 0.0F;
+ this.prevBlockDamage = 0.0F;
+ this.blockDestroySoundCounter = 0.0F;
+ this.blockHitWait = 5;
+ }
+ } else {
+ this.curBlockDamage = 0.0F;
+ this.prevBlockDamage = 0.0F;
+ this.blockDestroySoundCounter = 0.0F;
+ this.curBlockX = var1;
+ this.curBlockY = var2;
+ this.curBlockZ = var3;
+ }
+
+ }
+ }
+
+ public void setPartialTime(float var1) {
+ if(this.curBlockDamage <= 0.0F) {
+ this.mc.ingameGUI.damageGuiPartialTime = 0.0F;
+ this.mc.renderGlobal.damagePartialTime = 0.0F;
+ } else {
+ float var2 = this.prevBlockDamage + (this.curBlockDamage - this.prevBlockDamage) * var1;
+ this.mc.ingameGUI.damageGuiPartialTime = var2;
+ this.mc.renderGlobal.damagePartialTime = var2;
+ }
+
+ }
+
+ public float getBlockReachDistance() {
+ return 4.0F;
+ }
+
+ public void onWorldChange(World var1) {
+ super.onWorldChange(var1);
+ }
+
+ public void onUpdate() {
+ this.prevBlockDamage = this.curBlockDamage;
+ this.monsterSpawner.onUpdate(this.mc.theWorld);
+ this.animalSpawner.onUpdate(this.mc.theWorld);
+ }
+}
diff --git a/source/net/minecraft/src/PositionTextureVertex.java b/source/net/minecraft/src/PositionTextureVertex.java
new file mode 100644
index 0000000..767c8bf
--- /dev/null
+++ b/source/net/minecraft/src/PositionTextureVertex.java
@@ -0,0 +1,27 @@
+package net.minecraft.src;
+
+public class PositionTextureVertex {
+ public Vec3D vector3D;
+ public float texturePositionX;
+ public float texturePositionY;
+
+ public PositionTextureVertex(float var1, float var2, float var3, float var4, float var5) {
+ this(Vec3D.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(Vec3D var1, float var2, float var3) {
+ this.vector3D = var1;
+ this.texturePositionX = var2;
+ this.texturePositionY = var3;
+ }
+}
diff --git a/source/net/minecraft/src/RecipeSorter.java b/source/net/minecraft/src/RecipeSorter.java
new file mode 100644
index 0000000..e74a04e
--- /dev/null
+++ b/source/net/minecraft/src/RecipeSorter.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+import java.util.Comparator;
+
+class RecipeSorter implements Comparator {
+ final CraftingManager craftingManager;
+
+ RecipeSorter(CraftingManager var1) {
+ this.craftingManager = var1;
+ }
+
+ public int a(CraftingRecipe var1, CraftingRecipe var2) {
+ return var2.getRecipeSize() < var1.getRecipeSize() ? -1 : (var2.getRecipeSize() > var1.getRecipeSize() ? 1 : 0);
+ }
+
+ public int compare(Object var1, Object var2) {
+ return this.a((CraftingRecipe)var1, (CraftingRecipe)var2);
+ }
+}
diff --git a/source/net/minecraft/src/RecipesArmor.java b/source/net/minecraft/src/RecipesArmor.java
new file mode 100644
index 0000000..5393870
--- /dev/null
+++ b/source/net/minecraft/src/RecipesArmor.java
@@ -0,0 +1,18 @@
+package net.minecraft.src;
+
+public class RecipesArmor {
+ private String[][] recipePatterns = new String[][]{{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}};
+ private Object[][] recipeItems = new Object[][]{{Block.cloth, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetSteel, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateSteel, Item.plateDiamonhd, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsSteel, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsSteel, Item.bootsDiamond, Item.bootsGold}};
+
+ public void addRecipes(CraftingManager var1) {
+ 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];
+ var1.addRecipe(new ItemStack(var5), new Object[]{this.recipePatterns[var4], Character.valueOf('X'), var3});
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/RecipesCrafting.java b/source/net/minecraft/src/RecipesCrafting.java
new file mode 100644
index 0000000..85015bd
--- /dev/null
+++ b/source/net/minecraft/src/RecipesCrafting.java
@@ -0,0 +1,9 @@
+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.stoneOvenIdle), new Object[]{"###", "# #", "###", Character.valueOf('#'), Block.cobblestone});
+ var1.addRecipe(new ItemStack(Block.workbench), new Object[]{"##", "##", Character.valueOf('#'), Block.planks});
+ }
+}
diff --git a/source/net/minecraft/src/RecipesFood.java b/source/net/minecraft/src/RecipesFood.java
new file mode 100644
index 0000000..b4adb74
--- /dev/null
+++ b/source/net/minecraft/src/RecipesFood.java
@@ -0,0 +1,8 @@
+package net.minecraft.src;
+
+public class RecipesFood {
+ public void addRecipes(CraftingManager var1) {
+ var1.addRecipe(new ItemStack(Item.bowlSoup), new Object[]{"Y", "X", "#", Character.valueOf('X'), Block.mushroomBrown, Character.valueOf('Y'), Block.mushroomRed, Character.valueOf('#'), Item.bowlEmpty});
+ var1.addRecipe(new ItemStack(Item.bowlSoup), new Object[]{"Y", "X", "#", Character.valueOf('X'), Block.mushroomRed, Character.valueOf('Y'), Block.mushroomBrown, Character.valueOf('#'), Item.bowlEmpty});
+ }
+}
diff --git a/source/net/minecraft/src/RecipesIngots.java b/source/net/minecraft/src/RecipesIngots.java
new file mode 100644
index 0000000..22802d6
--- /dev/null
+++ b/source/net/minecraft/src/RecipesIngots.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class RecipesIngots {
+ private Object[][] recipeItems = new Object[][]{{Block.blockGold, Item.ingotGold}, {Block.blockSteel, Item.ingotIron}, {Block.blockDiamond, Item.diamond}};
+
+ public void addRecipes(CraftingManager var1) {
+ for(int var2 = 0; var2 < this.recipeItems.length; ++var2) {
+ Block var3 = (Block)this.recipeItems[var2][0];
+ Item var4 = (Item)this.recipeItems[var2][1];
+ var1.addRecipe(new ItemStack(var3), new Object[]{"###", "###", "###", Character.valueOf('#'), var4});
+ var1.addRecipe(new ItemStack(var4, 9), new Object[]{"#", Character.valueOf('#'), var3});
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/RecipesTools.java b/source/net/minecraft/src/RecipesTools.java
new file mode 100644
index 0000000..d011907
--- /dev/null
+++ b/source/net/minecraft/src/RecipesTools.java
@@ -0,0 +1,18 @@
+package net.minecraft.src;
+
+public class RecipesTools {
+ private String[][] recipePatterns = new String[][]{{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}};
+ private Object[][] recipeItems = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeSteel, Item.pickaxeDiamond, Item.pickaxeGold}, {Item.shovelWood, Item.shovelStone, Item.shovel, Item.shovelDiamond, Item.shovelGold}, {Item.axeWood, Item.axeStone, Item.axeSteel, Item.axeDiamond, Item.axeGold}, {Item.hoeWood, Item.hoeStone, Item.hoeSteel, Item.hoeDiamond, Item.hoeGold}};
+
+ public void addRecipes(CraftingManager var1) {
+ 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];
+ var1.addRecipe(new ItemStack(var5), new Object[]{this.recipePatterns[var4], Character.valueOf('#'), Item.stick, Character.valueOf('X'), var3});
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/RecipesWeapons.java b/source/net/minecraft/src/RecipesWeapons.java
new file mode 100644
index 0000000..34d76c0
--- /dev/null
+++ b/source/net/minecraft/src/RecipesWeapons.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+public class RecipesWeapons {
+ private String[][] recipePatterns = new String[][]{{"X", "X", "#"}};
+ private Object[][] recipeItems = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordSteel, Item.swordDiamond, Item.swordGold}};
+
+ public void addRecipe(CraftingManager var1) {
+ 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];
+ var1.addRecipe(new ItemStack(var5), new Object[]{this.recipePatterns[var4], Character.valueOf('#'), Item.stick, Character.valueOf('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.ingotIron, Character.valueOf('#'), Item.stick});
+ }
+}
diff --git a/source/net/minecraft/src/Render.java b/source/net/minecraft/src/Render.java
new file mode 100644
index 0000000..df43848
--- /dev/null
+++ b/source/net/minecraft/src/Render.java
@@ -0,0 +1,224 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public abstract class Render {
+ protected RenderManager renderManager;
+ private ModelBase modelBase = new ModelBiped();
+ private RenderBlocks renderBlocksVar = new RenderBlocks();
+ protected float shadowSize = 0.0F;
+ protected float shadowOpaque = 1.0F;
+
+ public abstract void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9);
+
+ protected void loadTexture(String var1) {
+ RenderEngine var2 = this.renderManager.renderEngine;
+ var2.bindTexture(var2.getTexture(var1));
+ }
+
+ protected void loadDownloadableImageTexture(String var1, String var2) {
+ RenderEngine var3 = this.renderManager.renderEngine;
+ var3.bindTexture(var3.getTextureForDownloadableImage(var1, var2));
+ }
+
+ private void renderEntityOnFire(Entity var1, double var2, double var4, double var6, float var8) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ int var9 = Block.fire.blockIndexInTexture;
+ int var10 = (var9 & 15) << 4;
+ int var11 = var9 & 240;
+ float var12 = (float)var10 / 256.0F;
+ float var13 = ((float)var10 + 15.99F) / 256.0F;
+ float var14 = (float)var11 / 256.0F;
+ float var15 = ((float)var11 + 15.99F) / 256.0F;
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ float var16 = var1.width * 1.4F;
+ GL11.glScalef(var16, var16, var16);
+ this.loadTexture("/terrain.png");
+ Tessellator var17 = Tessellator.instance;
+ float var18 = 1.0F;
+ float var19 = 0.5F;
+ float var20 = 0.0F;
+ float var21 = var1.height / var1.width;
+ GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(0.0F, 0.0F, 0.4F + (float)((int)var21) * 0.02F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ var17.startDrawingQuads();
+
+ while(var21 > 0.0F) {
+ var17.addVertexWithUV((double)(var18 - var19), (double)(0.0F - var20), 0.0D, (double)var13, (double)var15);
+ var17.addVertexWithUV((double)(0.0F - var19), (double)(0.0F - var20), 0.0D, (double)var12, (double)var15);
+ var17.addVertexWithUV((double)(0.0F - var19), (double)(1.4F - var20), 0.0D, (double)var12, (double)var14);
+ var17.addVertexWithUV((double)(var18 - var19), (double)(1.4F - var20), 0.0D, (double)var13, (double)var14);
+ --var21;
+ --var20;
+ var18 *= 0.9F;
+ GL11.glTranslatef(0.0F, 0.0F, -0.04F);
+ }
+
+ var17.draw();
+ GL11.glPopMatrix();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ }
+
+ private void renderShadow(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ RenderEngine var10 = this.renderManager.renderEngine;
+ var10.bindTexture(var10.getTexture("%%/shadow.png"));
+ World var11 = this.getWorldFromRenderManager();
+ GL11.glDepthMask(false);
+ float var12 = this.shadowSize;
+ double var13 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9;
+ double var15 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9;
+ double var17 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9;
+ int var19 = MathHelper.floor_double(var13 - (double)var12);
+ int var20 = MathHelper.floor_double(var13 + (double)var12);
+ int var21 = MathHelper.floor_double(var15 - (double)var12);
+ int var22 = MathHelper.floor_double(var15);
+ int var23 = MathHelper.floor_double(var17 - (double)var12);
+ int var24 = MathHelper.floor_double(var17 + (double)var12);
+ double var25 = var2 - var13;
+ double var27 = var4 - var15;
+ double var29 = var6 - var17;
+ Tessellator var31 = Tessellator.instance;
+ var31.startDrawingQuads();
+
+ for(int var32 = var19; var32 <= var20; ++var32) {
+ for(int var33 = var21; var33 <= var22; ++var33) {
+ for(int var34 = var23; var34 <= var24; ++var34) {
+ int var35 = var11.getBlockId(var32, var33 - 1, var34);
+ if(var35 > 0 && var11.getBlockLightValue(var32, var33, var34) > 3) {
+ this.renderShadowOnBlock(Block.blocksList[var35], var2, var4, var6, var32, var33, var34, var8, var12, var25, var27, var29);
+ }
+ }
+ }
+ }
+
+ var31.draw();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDepthMask(true);
+ }
+
+ 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) {
+ Tessellator var19 = Tessellator.instance;
+ if(var1.renderAsNormalBlock()) {
+ double var20 = ((double)var11 - (var4 - ((double)var9 + var15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getBrightness(var8, var9, var10);
+ 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.minX + var13;
+ double var24 = (double)var8 + var1.maxX + var13;
+ double var26 = (double)var9 + var1.minY + var15 + 1.0D / 64.0D;
+ double var28 = (double)var10 + var1.minZ + var17;
+ double var30 = (double)var10 + var1.maxZ + 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);
+ 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);
+ var19.addVertexWithUV(var24, var26, var28, (double)var33, (double)var34);
+ }
+ }
+ }
+
+ public static void renderOffsetAABB(AxisAlignedBB var0, double var1, double var3, double var5) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Tessellator var7 = Tessellator.instance;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ var7.startDrawingQuads();
+ var7.setTranslationD(var1, var3, var5);
+ 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.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.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.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.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.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.setTranslationD(0.0D, 0.0D, 0.0D);
+ var7.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ public static void renderAABB(AxisAlignedBB var0) {
+ 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.draw();
+ }
+
+ public void setRenderManager(RenderManager var1) {
+ this.renderManager = var1;
+ }
+
+ public void doRenderShadowAndFire(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ if(this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F) {
+ double var10 = this.renderManager.getDistanceToCamera(var1.posX, var1.posY, var1.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(var1.fire > 0) {
+ this.renderEntityOnFire(var1, var2, var4, var6, var9);
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/RenderArrow.java b/source/net/minecraft/src/RenderArrow.java
new file mode 100644
index 0000000..6a50043
--- /dev/null
+++ b/source/net/minecraft/src/RenderArrow.java
@@ -0,0 +1,67 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderArrow extends Render {
+ public void a(EntityArrow var1, double var2, double var4, double var6, float var8, float var9) {
+ this.loadTexture("/item/arrows.png");
+ 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);
+ Tessellator var10 = Tessellator.instance;
+ byte var11 = 0;
+ float var12 = 0.0F;
+ float var13 = 0.5F;
+ float var14 = (float)(0 + var11 * 10) / 32.0F;
+ float var15 = (float)(5 + var11 * 10) / 32.0F;
+ float var16 = 0.0F;
+ float var17 = 0.15625F;
+ float var18 = (float)(5 + var11 * 10) / 32.0F;
+ 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 var22 = -MathHelper.sin(var21 * 3.0F) * var21;
+ GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F);
+ }
+
+ GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
+ GL11.glScalef(var20, var20, var20);
+ GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
+ GL11.glNormal3f(var20, 0.0F, 0.0F);
+ var10.startDrawingQuads();
+ var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18);
+ var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18);
+ var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19);
+ var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19);
+ var10.draw();
+ GL11.glNormal3f(-var20, 0.0F, 0.0F);
+ var10.startDrawingQuads();
+ var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18);
+ var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18);
+ var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19);
+ var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19);
+ var10.draw();
+
+ 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();
+ var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14);
+ var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14);
+ var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15);
+ var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15);
+ var10.draw();
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityArrow)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderBlocks.java b/source/net/minecraft/src/RenderBlocks.java
new file mode 100644
index 0000000..2c17d6d
--- /dev/null
+++ b/source/net/minecraft/src/RenderBlocks.java
@@ -0,0 +1,1401 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderBlocks {
+ private IBlockAccess blockAccess;
+ private int overrideBlockTexture = -1;
+ private boolean flipTexture = false;
+ private boolean renderAllFaces = false;
+
+ public RenderBlocks(IBlockAccess var1) {
+ this.blockAccess = var1;
+ }
+
+ public RenderBlocks() {
+ }
+
+ public void renderBlockUsingTexture(Block var1, int var2, int var3, int var4, int var5) {
+ this.overrideBlockTexture = var5;
+ this.renderBlockByRenderType(var1, var2, var3, var4);
+ this.overrideBlockTexture = -1;
+ }
+
+ public boolean renderBlockByRenderType(Block var1, int var2, int var3, int var4) {
+ int var5 = var1.getRenderType();
+ var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4);
+ return var5 == 0 ? this.renderStandardBlock(var1, var2, var3, var4) : (var5 == 4 ? this.renderBlockFluids(var1, var2, var3, var4) : (var5 == 1 ? this.renderBlockReed(var1, var2, var3, var4) : (var5 == 6 ? this.renderBlockCrops(var1, var2, var3, var4) : (var5 == 2 ? this.renderBlockTorch(var1, var2, var3, var4) : (var5 == 3 ? this.renderBlockFire(var1, var2, var3, var4) : (var5 == 5 ? this.renderBlockGears(var1, var2, var3, var4) : (var5 == 8 ? this.renderBlockLadder(var1, var2, var3, var4) : (var5 == 7 ? this.renderBlockDoor(var1, var2, var3, var4) : (var5 == 9 ? this.renderBlockMinecartTrack(var1, var2, var3, var4) : (var5 == 10 ? this.renderBlockStairs(var1, var2, var3, var4) : (var5 == 11 ? this.renderBlockFence(var1, var2, var3, var4) : false)))))))))));
+ }
+
+ public boolean renderBlockTorch(Block var1, int var2, int var3, int var4) {
+ int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ Tessellator var6 = Tessellator.instance;
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ if(Block.lightValue[var1.blockID] > 0) {
+ var7 = 1.0F;
+ }
+
+ var6.setColorOpaque_F(var7, var7, var7);
+ double var8 = (double)0.4F;
+ double var10 = 0.5D - var8;
+ double var12 = (double)0.2F;
+ if(var5 == 1) {
+ this.renderTorchAtAngle(var1, (double)var2 - var10, (double)var3 + var12, (double)var4, -var8, 0.0D);
+ } else if(var5 == 2) {
+ this.renderTorchAtAngle(var1, (double)var2 + var10, (double)var3 + var12, (double)var4, var8, 0.0D);
+ } else if(var5 == 3) {
+ this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var12, (double)var4 - var10, 0.0D, -var8);
+ } else if(var5 == 4) {
+ this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var12, (double)var4 + var10, 0.0D, var8);
+ } else {
+ this.renderTorchAtAngle(var1, (double)var2, (double)var3, (double)var4, 0.0D, 0.0D);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockFire(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var6 = this.overrideBlockTexture;
+ }
+
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var7, var7, var7);
+ int var8 = (var6 & 15) << 4;
+ int var9 = var6 & 240;
+ double var10 = (double)((float)var8 / 256.0F);
+ double var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ double var14 = (double)((float)var9 / 256.0F);
+ double var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ float var18 = 1.4F;
+ double var21;
+ double var23;
+ double var25;
+ double var27;
+ double var29;
+ double var31;
+ double var33;
+ if(!this.blockAccess.isBlockNormalCube(var2, var3 - 1, var4) && !Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 - 1, var4)) {
+ float var37 = 0.2F;
+ float var20 = 1.0F / 16.0F;
+ if((var2 + var3 + var4 & 1) == 1) {
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ }
+
+ if((var2 / 2 + var3 / 2 + var4 / 2 & 1) == 1) {
+ var21 = var12;
+ var12 = var10;
+ var10 = var21;
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2 - 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2 + 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 - 1)) {
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var12, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 + 1)) {
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var10, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 + 1, var4)) {
+ var21 = (double)var2 + 0.5D + 0.5D;
+ var23 = (double)var2 + 0.5D - 0.5D;
+ var25 = (double)var4 + 0.5D + 0.5D;
+ var27 = (double)var4 + 0.5D - 0.5D;
+ var29 = (double)var2 + 0.5D - 0.5D;
+ var31 = (double)var2 + 0.5D + 0.5D;
+ var33 = (double)var4 + 0.5D - 0.5D;
+ double var35 = (double)var4 + 0.5D + 0.5D;
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)var9 / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ ++var3;
+ var18 = -0.2F;
+ if((var2 + var3 + var4 & 1) == 0) {
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 0), var12, var14);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 1), var10, var16);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 1), var10, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ var5.addVertexWithUV(var31, (double)((float)var3 + var18), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV(var23, (double)(var3 + 0), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV(var23, (double)(var3 + 0), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV(var31, (double)((float)var3 + var18), (double)(var4 + 0), var10, var14);
+ } else {
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var35, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var27, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var27, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var35, var10, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var33, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var25, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var25, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var33, var10, var14);
+ }
+ }
+ } else {
+ double var19 = (double)var2 + 0.5D + 0.2D;
+ var21 = (double)var2 + 0.5D - 0.2D;
+ var23 = (double)var4 + 0.5D + 0.2D;
+ var25 = (double)var4 + 0.5D - 0.2D;
+ var27 = (double)var2 + 0.5D - 0.3D;
+ var29 = (double)var2 + 0.5D + 0.3D;
+ var31 = (double)var4 + 0.5D - 0.3D;
+ var33 = (double)var4 + 0.5D + 0.3D;
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 0), var12, var14);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 1), var10, var16);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 1), var10, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var33, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var25, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var25, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var33, var10, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var31, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var23, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var23, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var31, var10, var14);
+ var19 = (double)var2 + 0.5D - 0.5D;
+ var21 = (double)var2 + 0.5D + 0.5D;
+ var23 = (double)var4 + 0.5D - 0.5D;
+ var25 = (double)var4 + 0.5D + 0.5D;
+ var27 = (double)var2 + 0.5D - 0.4D;
+ var29 = (double)var2 + 0.5D + 0.4D;
+ var31 = (double)var4 + 0.5D - 0.4D;
+ var33 = (double)var4 + 0.5D + 0.4D;
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 1), var10, var14);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 1), var10, var16);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 0), var12, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)var9 / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var33, var10, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var25, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var25, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var33, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var31, var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var23, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var23, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var31, var12, var14);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockGears(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var6 = this.overrideBlockTexture;
+ }
+
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var7, var7, var7);
+ int var8 = ((var6 & 15) << 4) + 16;
+ int var9 = (var6 & 15) << 4;
+ int var10 = var6 & 240;
+ if((var2 + var3 + var4 & 1) == 1) {
+ var8 = (var6 & 15) << 4;
+ var9 = ((var6 & 15) << 4) + 16;
+ }
+
+ double var11 = (double)((float)var8 / 256.0F);
+ double var13 = (double)(((float)var8 + 15.99F) / 256.0F);
+ double var15 = (double)((float)var10 / 256.0F);
+ double var17 = (double)(((float)var10 + 15.99F) / 256.0F);
+ double var19 = (double)((float)var9 / 256.0F);
+ double var21 = (double)(((float)var9 + 15.99F) / 256.0F);
+ double var23 = (double)((float)var10 / 256.0F);
+ double var25 = (double)(((float)var10 + 15.99F) / 256.0F);
+ float var27 = 2.0F / 16.0F;
+ float var28 = 0.05F;
+ if(this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) + var27), var11, var15);
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) + var27), var11, var17);
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 0) - var27), var13, var17);
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 0) - var27), var13, var15);
+ }
+
+ if(this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) + var27), var13, var17);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) + var27), var13, var15);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 0) - var27), var11, var15);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 0) - var27), var11, var17);
+ }
+
+ if(this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 0) - var27), (double)((float)var4 + var28), var21, var25);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 1) + var27), (double)((float)var4 + var28), var21, var23);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 1) + var27), (double)((float)var4 + var28), var19, var23);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 0) - var27), (double)((float)var4 + var28), var19, var25);
+ }
+
+ if(this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) - var28), var19, var23);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) - var28), var19, var25);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) - var28), var21, var25);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) - var28), var21, var23);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockMinecartTrack(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ int var7 = var1.getBlockTextureFromSideAndMetadata(0, var6);
+ if(this.overrideBlockTexture >= 0) {
+ var7 = this.overrideBlockTexture;
+ }
+
+ float var8 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var8, var8, var8);
+ int var9 = (var7 & 15) << 4;
+ int var10 = var7 & 240;
+ double var11 = (double)((float)var9 / 256.0F);
+ double var13 = (double)(((float)var9 + 15.99F) / 256.0F);
+ double var15 = (double)((float)var10 / 256.0F);
+ double var17 = (double)(((float)var10 + 15.99F) / 256.0F);
+ float var19 = 1.0F / 16.0F;
+ float var20 = (float)(var2 + 1);
+ float var21 = (float)(var2 + 1);
+ float var22 = (float)(var2 + 0);
+ float var23 = (float)(var2 + 0);
+ float var24 = (float)(var4 + 0);
+ float var25 = (float)(var4 + 1);
+ float var26 = (float)(var4 + 1);
+ float var27 = (float)(var4 + 0);
+ float var28 = (float)var3 + var19;
+ float var29 = (float)var3 + var19;
+ float var30 = (float)var3 + var19;
+ float var31 = (float)var3 + var19;
+ if(var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) {
+ if(var6 == 8) {
+ var21 = (float)(var2 + 0);
+ var20 = var21;
+ var23 = (float)(var2 + 1);
+ var22 = var23;
+ var27 = (float)(var4 + 1);
+ var24 = var27;
+ var26 = (float)(var4 + 0);
+ var25 = var26;
+ } else if(var6 == 9) {
+ var23 = (float)(var2 + 0);
+ var20 = var23;
+ var22 = (float)(var2 + 1);
+ var21 = var22;
+ var25 = (float)(var4 + 0);
+ var24 = var25;
+ var27 = (float)(var4 + 1);
+ var26 = var27;
+ }
+ } else {
+ var23 = (float)(var2 + 1);
+ var20 = var23;
+ var22 = (float)(var2 + 0);
+ var21 = var22;
+ var25 = (float)(var4 + 1);
+ var24 = var25;
+ var27 = (float)(var4 + 0);
+ var26 = var27;
+ }
+
+ if(var6 != 2 && var6 != 4) {
+ if(var6 == 3 || var6 == 5) {
+ ++var29;
+ ++var30;
+ }
+ } else {
+ ++var28;
+ ++var31;
+ }
+
+ var5.addVertexWithUV((double)var20, (double)var28, (double)var24, var13, var15);
+ var5.addVertexWithUV((double)var21, (double)var29, (double)var25, var13, var17);
+ var5.addVertexWithUV((double)var22, (double)var30, (double)var26, var11, var17);
+ var5.addVertexWithUV((double)var23, (double)var31, (double)var27, var11, var15);
+ var5.addVertexWithUV((double)var23, (double)var31, (double)var27, var11, var15);
+ var5.addVertexWithUV((double)var22, (double)var30, (double)var26, var11, var17);
+ var5.addVertexWithUV((double)var21, (double)var29, (double)var25, var13, var17);
+ var5.addVertexWithUV((double)var20, (double)var28, (double)var24, var13, var15);
+ return true;
+ }
+
+ public boolean renderBlockLadder(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var6 = this.overrideBlockTexture;
+ }
+
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var7, var7, var7);
+ int var8 = (var6 & 15) << 4;
+ int var9 = var6 & 240;
+ double var10 = (double)((float)var8 / 256.0F);
+ double var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ double var14 = (double)((float)var9 / 256.0F);
+ double var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ int var18 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ float var19 = 0.0F;
+ float var20 = 0.05F;
+ if(var18 == 5) {
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) + var19), var10, var14);
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) + var19), var10, var16);
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 0) - var19), var12, var16);
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 0) - var19), var12, var14);
+ }
+
+ if(var18 == 4) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) + var19), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) + var19), var12, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 0) - var19), var10, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 0) - var19), var10, var16);
+ }
+
+ if(var18 == 3) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 0) - var19), (double)((float)var4 + var20), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 1) + var19), (double)((float)var4 + var20), var12, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 1) + var19), (double)((float)var4 + var20), var10, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 0) - var19), (double)((float)var4 + var20), var10, var16);
+ }
+
+ if(var18 == 2) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) - var20), var10, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) - var20), var10, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) - var20), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) - var20), var12, var14);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockReed(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ float var6 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var6, var6, var6);
+ this.renderCrossedSquares(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), (double)var2, (double)var3, (double)var4);
+ return true;
+ }
+
+ public boolean renderBlockCrops(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ float var6 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var6, var6, var6);
+ this.renderBlockCropsImpl(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4);
+ return true;
+ }
+
+ public void renderTorchAtAngle(Block var1, double var2, double var4, double var6, double var8, double var10) {
+ Tessellator var12 = Tessellator.instance;
+ int var13 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var13 = this.overrideBlockTexture;
+ }
+
+ int var14 = (var13 & 15) << 4;
+ int var15 = var13 & 240;
+ float var16 = (float)var14 / 256.0F;
+ float var17 = ((float)var14 + 15.99F) / 256.0F;
+ float var18 = (float)var15 / 256.0F;
+ float var19 = ((float)var15 + 15.99F) / 256.0F;
+ double var20 = (double)var16 + 1.75D / 64.0D;
+ double var22 = (double)var18 + 6.0D / 256.0D;
+ double var24 = (double)var16 + 9.0D / 256.0D;
+ double var26 = (double)var18 + 1.0D / 32.0D;
+ var2 += 0.5D;
+ var6 += 0.5D;
+ double var28 = var2 - 0.5D;
+ double var30 = var2 + 0.5D;
+ double var32 = var6 - 0.5D;
+ double var34 = var6 + 0.5D;
+ double var36 = 1.0D / 16.0D;
+ double var38 = 0.625D;
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) - var36, var4 + var38, var6 + var10 * (1.0D - var38) - var36, var20, var22);
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) - var36, var4 + var38, var6 + var10 * (1.0D - var38) + var36, var20, var26);
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) + var36, var4 + var38, var6 + var10 * (1.0D - var38) + var36, var24, var26);
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) + var36, var4 + var38, var6 + var10 * (1.0D - var38) - var36, var24, var22);
+ var12.addVertexWithUV(var2 - var36, var4 + 1.0D, var32, (double)var16, (double)var18);
+ var12.addVertexWithUV(var2 - var36 + var8, var4 + 0.0D, var32 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var2 - var36 + var8, var4 + 0.0D, var34 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var2 - var36, var4 + 1.0D, var34, (double)var17, (double)var18);
+ var12.addVertexWithUV(var2 + var36, var4 + 1.0D, var34, (double)var16, (double)var18);
+ var12.addVertexWithUV(var2 + var8 + var36, var4 + 0.0D, var34 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var2 + var8 + var36, var4 + 0.0D, var32 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var2 + var36, var4 + 1.0D, var32, (double)var17, (double)var18);
+ var12.addVertexWithUV(var28, var4 + 1.0D, var6 + var36, (double)var16, (double)var18);
+ var12.addVertexWithUV(var28 + var8, var4 + 0.0D, var6 + var36 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var30 + var8, var4 + 0.0D, var6 + var36 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var30, var4 + 1.0D, var6 + var36, (double)var17, (double)var18);
+ var12.addVertexWithUV(var30, var4 + 1.0D, var6 - var36, (double)var16, (double)var18);
+ var12.addVertexWithUV(var30 + var8, var4 + 0.0D, var6 - var36 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var28 + var8, var4 + 0.0D, var6 - var36 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var28, var4 + 1.0D, var6 - var36, (double)var17, (double)var18);
+ }
+
+ public void renderCrossedSquares(Block var1, int var2, double var3, double var5, double var7) {
+ Tessellator var9 = Tessellator.instance;
+ int var10 = var1.getBlockTextureFromSideAndMetadata(0, var2);
+ if(this.overrideBlockTexture >= 0) {
+ var10 = this.overrideBlockTexture;
+ }
+
+ int var11 = (var10 & 15) << 4;
+ int var12 = var10 & 240;
+ double var13 = (double)((float)var11 / 256.0F);
+ double var15 = (double)(((float)var11 + 15.99F) / 256.0F);
+ double var17 = (double)((float)var12 / 256.0F);
+ double var19 = (double)(((float)var12 + 15.99F) / 256.0F);
+ double var21 = var3 + 0.5D - (double)0.45F;
+ double var23 = var3 + 0.5D + (double)0.45F;
+ double var25 = var7 + 0.5D - (double)0.45F;
+ double var27 = var7 + 0.5D + (double)0.45F;
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var15, var17);
+ }
+
+ public void renderBlockCropsImpl(Block var1, int var2, double var3, double var5, double var7) {
+ Tessellator var9 = Tessellator.instance;
+ int var10 = var1.getBlockTextureFromSideAndMetadata(0, var2);
+ if(this.overrideBlockTexture >= 0) {
+ var10 = this.overrideBlockTexture;
+ }
+
+ int var11 = (var10 & 15) << 4;
+ int var12 = var10 & 240;
+ double var13 = (double)((float)var11 / 256.0F);
+ double var15 = (double)(((float)var11 + 15.99F) / 256.0F);
+ double var17 = (double)((float)var12 / 256.0F);
+ double var19 = (double)(((float)var12 + 15.99F) / 256.0F);
+ double var21 = var3 + 0.5D - 0.25D;
+ double var23 = var3 + 0.5D + 0.25D;
+ double var25 = var7 + 0.5D - 0.5D;
+ double var27 = var7 + 0.5D + 0.5D;
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var15, var17);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var15, var17);
+ var21 = var3 + 0.5D - 0.5D;
+ var23 = var3 + 0.5D + 0.5D;
+ var25 = var7 + 0.5D - 0.25D;
+ var27 = var7 + 0.5D + 0.25D;
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var15, var17);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var15, var17);
+ }
+
+ public boolean renderBlockFluids(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ boolean var6 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1);
+ boolean var7 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0);
+ boolean[] var8 = 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(!var6 && !var7 && !var8[0] && !var8[1] && !var8[2] && !var8[3]) {
+ return false;
+ } else {
+ boolean var9 = false;
+ float var10 = 0.5F;
+ float var11 = 1.0F;
+ float var12 = 0.8F;
+ float var13 = 0.6F;
+ double var14 = 0.0D;
+ double var16 = 1.0D;
+ Material var18 = var1.blockMaterial;
+ int var19 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ float var20 = this.getFluidHeight(var2, var3, var4, var18);
+ float var21 = this.getFluidHeight(var2, var3, var4 + 1, var18);
+ float var22 = this.getFluidHeight(var2 + 1, var3, var4 + 1, var18);
+ float var23 = this.getFluidHeight(var2 + 1, var3, var4, var18);
+ int var24;
+ int var27;
+ float var32;
+ float var33;
+ float var34;
+ if(this.renderAllFaces || var6) {
+ var9 = true;
+ var24 = var1.getBlockTextureFromSideAndMetadata(1, var19);
+ float var25 = (float)BlockFluid.getFlowDirection(this.blockAccess, var2, var3, var4, var18);
+ if(var25 > -999.0F) {
+ var24 = var1.getBlockTextureFromSideAndMetadata(2, var19);
+ }
+
+ int var26 = (var24 & 15) << 4;
+ var27 = var24 & 240;
+ double var28 = ((double)var26 + 8.0D) / 256.0D;
+ double var30 = ((double)var27 + 8.0D) / 256.0D;
+ if(var25 < -999.0F) {
+ var25 = 0.0F;
+ } else {
+ var28 = (double)((float)(var26 + 16) / 256.0F);
+ var30 = (double)((float)(var27 + 16) / 256.0F);
+ }
+
+ var32 = MathHelper.sin(var25) * 8.0F / 256.0F;
+ var33 = MathHelper.cos(var25) * 8.0F / 256.0F;
+ var34 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var11 * var34, var11 * var34, var11 * var34);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var20), (double)(var4 + 0), var28 - (double)var33 - (double)var32, var30 - (double)var33 + (double)var32);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var21), (double)(var4 + 1), var28 - (double)var33 + (double)var32, var30 + (double)var33 + (double)var32);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var22), (double)(var4 + 1), var28 + (double)var33 + (double)var32, var30 + (double)var33 - (double)var32);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var23), (double)(var4 + 0), var28 + (double)var33 - (double)var32, var30 - (double)var33 - (double)var32);
+ }
+
+ if(this.renderAllFaces || var7) {
+ float var48 = var1.getBlockBrightness(this.blockAccess, var2, var3 - 1, var4);
+ var5.setColorOpaque_F(var10 * var48, var10 * var48, var10 * var48);
+ this.renderBottomFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureFromSide(0));
+ var9 = true;
+ }
+
+ for(var24 = 0; var24 < 4; ++var24) {
+ int var49 = var2;
+ var27 = var4;
+ if(var24 == 0) {
+ var27 = var4 - 1;
+ }
+
+ if(var24 == 1) {
+ ++var27;
+ }
+
+ if(var24 == 2) {
+ var49 = var2 - 1;
+ }
+
+ if(var24 == 3) {
+ ++var49;
+ }
+
+ int var50 = var1.getBlockTextureFromSideAndMetadata(var24 + 2, var19);
+ int var29 = (var50 & 15) << 4;
+ int var51 = var50 & 240;
+ if(this.renderAllFaces || var8[var24]) {
+ float var31;
+ float var35;
+ float var36;
+ if(var24 == 0) {
+ var31 = var20;
+ var32 = var23;
+ var33 = (float)var2;
+ var35 = (float)(var2 + 1);
+ var34 = (float)var4;
+ var36 = (float)var4;
+ } else if(var24 == 1) {
+ var31 = var22;
+ var32 = var21;
+ var33 = (float)(var2 + 1);
+ var35 = (float)var2;
+ var34 = (float)(var4 + 1);
+ var36 = (float)(var4 + 1);
+ } else if(var24 == 2) {
+ var31 = var21;
+ var32 = var20;
+ var33 = (float)var2;
+ var35 = (float)var2;
+ var34 = (float)(var4 + 1);
+ var36 = (float)var4;
+ } else {
+ var31 = var23;
+ var32 = var22;
+ var33 = (float)(var2 + 1);
+ var35 = (float)(var2 + 1);
+ var34 = (float)var4;
+ var36 = (float)(var4 + 1);
+ }
+
+ var9 = true;
+ double var37 = (double)((float)(var29 + 0) / 256.0F);
+ double var39 = ((double)(var29 + 16) - 0.01D) / 256.0D;
+ double var41 = (double)(((float)var51 + (1.0F - var31) * 16.0F) / 256.0F);
+ double var43 = (double)(((float)var51 + (1.0F - var32) * 16.0F) / 256.0F);
+ double var45 = ((double)(var51 + 16) - 0.01D) / 256.0D;
+ float var47 = var1.getBlockBrightness(this.blockAccess, var49, var3, var27);
+ if(var24 < 2) {
+ var47 *= var12;
+ } else {
+ var47 *= var13;
+ }
+
+ var5.setColorOpaque_F(var11 * var47, var11 * var47, var11 * var47);
+ var5.addVertexWithUV((double)var33, (double)((float)var3 + var31), (double)var34, var37, var41);
+ var5.addVertexWithUV((double)var35, (double)((float)var3 + var32), (double)var36, var39, var43);
+ var5.addVertexWithUV((double)var35, (double)(var3 + 0), (double)var36, var39, var45);
+ var5.addVertexWithUV((double)var33, (double)(var3 + 0), (double)var34, var37, var45);
+ }
+ }
+
+ var1.minY = var14;
+ var1.maxY = var16;
+ return var9;
+ }
+ }
+
+ private float getFluidHeight(int var1, int var2, int var3, Material var4) {
+ 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) {
+ 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) {
+ var6 += BlockFluid.getPercentAir(var12) * 10.0F;
+ var5 += 10;
+ }
+
+ var6 += BlockFluid.getPercentAir(var12);
+ ++var5;
+ }
+ }
+
+ return 1.0F - var6 / (float)var5;
+ }
+
+ public void renderBlockFallingSand(Block var1, World var2, int var3, int var4, int var5) {
+ float var6 = 0.5F;
+ float var7 = 1.0F;
+ float var8 = 0.8F;
+ float var9 = 0.6F;
+ Tessellator var10 = Tessellator.instance;
+ var10.startDrawingQuads();
+ float var11 = var1.getBlockBrightness(var2, var3, var4, var5);
+ float var12 = var1.getBlockBrightness(var2, var3, var4 - 1, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var6 * var12, var6 * var12, var6 * var12);
+ this.renderBottomFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(0));
+ var12 = var1.getBlockBrightness(var2, var3, var4 + 1, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var7 * var12, var7 * var12, var7 * var12);
+ this.renderTopFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(1));
+ var12 = var1.getBlockBrightness(var2, var3, var4, var5 - 1);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var8 * var12, var8 * var12, var8 * var12);
+ this.renderEastFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(2));
+ var12 = var1.getBlockBrightness(var2, var3, var4, var5 + 1);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var8 * var12, var8 * var12, var8 * var12);
+ this.renderWestFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(3));
+ var12 = var1.getBlockBrightness(var2, var3 - 1, var4, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var9 * var12, var9 * var12, var9 * var12);
+ this.renderNorthFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(4));
+ var12 = var1.getBlockBrightness(var2, var3 + 1, var4, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var9 * var12, var9 * var12, var9 * var12);
+ this.renderSouthFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(5));
+ var10.draw();
+ }
+
+ public boolean renderStandardBlock(Block var1, int var2, int var3, int var4) {
+ int var5 = var1.getRenderColor(this.blockAccess, var2, var3, var4);
+ float var6 = (float)(var5 >> 16 & 255) / 255.0F;
+ float var7 = (float)(var5 >> 8 & 255) / 255.0F;
+ float var8 = (float)(var5 & 255) / 255.0F;
+ return this.renderStandardBlockWithColorMultiplier(var1, var2, var3, var4, var6, var7, var8);
+ }
+
+ public boolean renderStandardBlockWithColorMultiplier(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) {
+ 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 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ float var27;
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3 - 1, var4);
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var14 * var27, var18 * var27, var22 * var27);
+ this.renderBottomFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 0));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3 + 1, var4);
+ if(var1.maxY != 1.0D && !var1.blockMaterial.getIsLiquid()) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var15 * var27, var19 * var27, var23 * var27);
+ this.renderTopFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 1));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 - 1);
+ if(var1.minZ > 0.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var16 * var27, var20 * var27, var24 * var27);
+ this.renderEastFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 2));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 + 1);
+ if(var1.maxZ < 1.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var16 * var27, var20 * var27, var24 * var27);
+ this.renderWestFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 3));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2 - 1, var3, var4);
+ if(var1.minX > 0.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var17 * var27, var21 * var27, var25 * var27);
+ this.renderNorthFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 4));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2 + 1, var3, var4);
+ if(var1.maxX < 1.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var17 * var27, var21 * var27, var25 * var27);
+ this.renderSouthFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 5));
+ var9 = true;
+ }
+
+ return var9;
+ }
+
+ public boolean renderBlockFence(Block var1, int var2, int var3, int var4) {
+ boolean var5 = false;
+ float var6 = 6.0F / 16.0F;
+ float var7 = 10.0F / 16.0F;
+ var1.setBlockBounds(var6, 0.0F, var6, var7, 1.0F, var7);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ boolean var8 = false;
+ boolean var9 = false;
+ if(this.blockAccess.getBlockId(var2 - 1, var3, var4) == var1.blockID || this.blockAccess.getBlockId(var2 + 1, var3, var4) == var1.blockID) {
+ var8 = true;
+ }
+
+ if(this.blockAccess.getBlockId(var2, var3, var4 - 1) == var1.blockID || this.blockAccess.getBlockId(var2, var3, var4 + 1) == var1.blockID) {
+ var9 = true;
+ }
+
+ if(!var8 && !var9) {
+ var8 = true;
+ }
+
+ var6 = 7.0F / 16.0F;
+ var7 = 9.0F / 16.0F;
+ float var10 = 12.0F / 16.0F;
+ float var11 = 15.0F / 16.0F;
+ if(var8) {
+ var1.setBlockBounds(0.0F, var10, var6, 1.0F, var11, var7);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ if(var9) {
+ var1.setBlockBounds(var6, var10, 0.0F, var7, var11, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ var10 = 6.0F / 16.0F;
+ var11 = 9.0F / 16.0F;
+ if(var8) {
+ var1.setBlockBounds(0.0F, var10, var6, 1.0F, var11, var7);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ if(var9) {
+ var1.setBlockBounds(var6, var10, 0.0F, var7, var11, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ return var5;
+ }
+
+ public boolean renderBlockStairs(Block var1, int var2, int var3, int var4) {
+ boolean var5 = false;
+ int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ if(var6 == 0) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ } else if(var6 == 1) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ } else if(var6 == 2) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ } else if(var6 == 3) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ return var5;
+ }
+
+ public boolean renderBlockDoor(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ BlockDoor var6 = (BlockDoor)var1;
+ boolean var7 = false;
+ float var8 = 0.5F;
+ float var9 = 1.0F;
+ float var10 = 0.8F;
+ float var11 = 0.6F;
+ float var12 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ float var13 = var1.getBlockBrightness(this.blockAccess, var2, var3 - 1, var4);
+ if(var6.minY > 0.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var8 * var13, var8 * var13, var8 * var13);
+ this.renderBottomFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 0));
+ var7 = true;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2, var3 + 1, var4);
+ if(var6.maxY < 1.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13);
+ this.renderTopFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 1));
+ var7 = true;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 - 1);
+ if(var6.minZ > 0.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13);
+ int var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 2);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderEastFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 + 1);
+ if(var6.maxZ < 1.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13);
+ var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 3);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderWestFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2 - 1, var3, var4);
+ if(var6.minX > 0.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var11 * var13, var11 * var13, var11 * var13);
+ var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 4);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderNorthFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2 + 1, var3, var4);
+ if(var6.maxX < 1.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var11 * var13, var11 * var13, var11 * var13);
+ var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 5);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderSouthFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ return var7;
+ }
+
+ public void renderBottomFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minZ * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ double var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.minY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var24, var28, var12, var18);
+ var9.addVertexWithUV(var20, var24, var26, var12, var16);
+ var9.addVertexWithUV(var22, var24, var26, var14, var16);
+ var9.addVertexWithUV(var22, var24, var28, var14, var18);
+ }
+
+ public void renderTopFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minZ * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ double var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.maxY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var22, var24, var28, var14, var18);
+ var9.addVertexWithUV(var22, var24, var26, var14, var16);
+ var9.addVertexWithUV(var20, var24, var26, var12, var16);
+ var9.addVertexWithUV(var20, var24, var28, var12, var18);
+ }
+
+ public void renderEastFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.minY;
+ double var26 = var4 + var1.maxY;
+ double var28 = var6 + var1.minZ;
+ var9.addVertexWithUV(var20, var26, var28, var14, var16);
+ var9.addVertexWithUV(var22, var26, var28, var12, var16);
+ var9.addVertexWithUV(var22, var24, var28, var12, var18);
+ var9.addVertexWithUV(var20, var24, var28, var14, var18);
+ }
+
+ public void renderWestFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.minY;
+ double var26 = var4 + var1.maxY;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var26, var28, var12, var16);
+ var9.addVertexWithUV(var20, var24, var28, var12, var18);
+ var9.addVertexWithUV(var22, var24, var28, var14, var18);
+ var9.addVertexWithUV(var22, var26, var28, var14, var16);
+ }
+
+ public void renderNorthFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minZ * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.minX;
+ double var22 = var4 + var1.minY;
+ double var24 = var4 + var1.maxY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var24, var28, var14, var16);
+ var9.addVertexWithUV(var20, var24, var26, var12, var16);
+ var9.addVertexWithUV(var20, var22, var26, var12, var18);
+ var9.addVertexWithUV(var20, var22, var28, var14, var18);
+ }
+
+ public void renderSouthFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minZ * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.maxX;
+ double var22 = var4 + var1.minY;
+ double var24 = var4 + var1.maxY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var22, var28, var12, var18);
+ var9.addVertexWithUV(var20, var22, var26, var14, var18);
+ var9.addVertexWithUV(var20, var24, var26, var14, var16);
+ var9.addVertexWithUV(var20, var24, var28, var12, var16);
+ }
+
+ public void renderBlockOnInventory(Block var1) {
+ byte var2 = -1;
+ Tessellator var3 = Tessellator.instance;
+ int var4 = var1.getRenderType();
+ if(var4 == 0) {
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderBottomFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(0));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, 1.0F, 0.0F);
+ this.renderTopFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(1));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, 0.0F, -1.0F);
+ this.renderEastFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(2));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, 0.0F, 1.0F);
+ this.renderWestFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(3));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(-1.0F, 0.0F, 0.0F);
+ this.renderNorthFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(4));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(1.0F, 0.0F, 0.0F);
+ this.renderSouthFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(5));
+ var3.draw();
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ } else if(var4 == 1) {
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderCrossedSquares(var1, var2, -0.5D, -0.5D, -0.5D);
+ var3.draw();
+ } else if(var4 == 6) {
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderBlockCropsImpl(var1, var2, -0.5D, -0.5D, -0.5D);
+ var3.draw();
+ } else if(var4 == 2) {
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderTorchAtAngle(var1, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D);
+ var3.draw();
+ } else if(var4 != 3 && var4 == 5) {
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/RenderCreeper.java b/source/net/minecraft/src/RenderCreeper.java
new file mode 100644
index 0000000..1790664
--- /dev/null
+++ b/source/net/minecraft/src/RenderCreeper.java
@@ -0,0 +1,56 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderCreeper extends RenderLiving {
+ public RenderCreeper() {
+ super(new ModelCreeper(), 0.5F);
+ }
+
+ protected void a(EntityCreeper var1, float var2) {
+ float var4 = var1.setCreeperFlashTime(var2);
+ float var5 = 1.0F + MathHelper.sin(var4 * 100.0F) * var4 * 0.01F;
+ if(var4 < 0.0F) {
+ var4 = 0.0F;
+ }
+
+ if(var4 > 1.0F) {
+ var4 = 1.0F;
+ }
+
+ var4 *= var4;
+ var4 *= var4;
+ float var6 = (1.0F + var4 * 0.4F) * var5;
+ float var7 = (1.0F + var4 * 0.1F) / var5;
+ GL11.glScalef(var6, var7, var6);
+ }
+
+ protected int a(EntityCreeper var1, float var2, float var3) {
+ float var5 = var1.setCreeperFlashTime(var3);
+ if((int)(var5 * 10.0F) % 2 == 0) {
+ return 0;
+ } else {
+ int var6 = (int)(var5 * 0.2F * 255.0F);
+ if(var6 < 0) {
+ var6 = 0;
+ }
+
+ if(var6 > 255) {
+ var6 = 255;
+ }
+
+ short var7 = 255;
+ short var8 = 255;
+ short var9 = 255;
+ return var6 << 24 | var7 << 16 | var8 << 8 | var9;
+ }
+ }
+
+ protected void preRenderCallback(EntityLiving var1, float var2) {
+ this.a((EntityCreeper)var1, var2);
+ }
+
+ protected int getColorMultiplier(EntityLiving var1, float var2, float var3) {
+ return this.a((EntityCreeper)var1, var2, var3);
+ }
+}
diff --git a/source/net/minecraft/src/RenderEngine.java b/source/net/minecraft/src/RenderEngine.java
new file mode 100644
index 0000000..eacb516
--- /dev/null
+++ b/source/net/minecraft/src/RenderEngine.java
@@ -0,0 +1,254 @@
+package net.minecraft.src;
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import javax.imageio.ImageIO;
+import org.lwjgl.opengl.GL11;
+
+public class RenderEngine {
+ private HashMap textureMap = new HashMap();
+ private HashMap textureContentsMap = new HashMap();
+ private IntBuffer singleIntBuffer = GLAllocation.createIntBuffer(1);
+ private ByteBuffer imageData = GLAllocation.createDirectByteBuffer(262144);
+ private List textureList = new ArrayList();
+ private Map urlToImageDataMap = new HashMap();
+ private GameSettings options;
+ private boolean clampTexture = false;
+
+ public RenderEngine(GameSettings var1) {
+ this.options = var1;
+ }
+
+ public int getTexture(String var1) {
+ Integer var2 = (Integer)this.textureMap.get(var1);
+ if(var2 != null) {
+ return var2.intValue();
+ } else {
+ try {
+ this.singleIntBuffer.clear();
+ GLAllocation.generateDisplayLists(this.singleIntBuffer);
+ int var4 = this.singleIntBuffer.get(0);
+ if(var1.startsWith("##")) {
+ this.setupTexture(this.unwrapImageByColumns(ImageIO.read(RenderEngine.class.getResourceAsStream(var1.substring(2)))), var4);
+ } else if(var1.startsWith("%%")) {
+ this.clampTexture = true;
+ this.setupTexture(ImageIO.read(RenderEngine.class.getResourceAsStream(var1.substring(2))), var4);
+ this.clampTexture = false;
+ } else {
+ this.setupTexture(ImageIO.read(RenderEngine.class.getResourceAsStream(var1)), var4);
+ }
+
+ this.textureMap.put(var1, Integer.valueOf(var4));
+ return var4;
+ } catch (IOException var3) {
+ throw new RuntimeException("!!");
+ }
+ }
+ }
+
+ private BufferedImage unwrapImageByColumns(BufferedImage var1) {
+ int var2 = var1.getWidth() / 16;
+ BufferedImage var3 = new BufferedImage(16, var1.getHeight() * var2, 2);
+ Graphics var4 = var3.getGraphics();
+
+ for(int var5 = 0; var5 < var2; ++var5) {
+ var4.drawImage(var1, -var5 * 16, var5 * var1.getHeight(), (ImageObserver)null);
+ }
+
+ var4.dispose();
+ return var3;
+ }
+
+ public int allocateAndSetupTexture(BufferedImage var1) {
+ this.singleIntBuffer.clear();
+ GLAllocation.generateDisplayLists(this.singleIntBuffer);
+ int var2 = this.singleIntBuffer.get(0);
+ this.setupTexture(var1, var2);
+ this.textureContentsMap.put(Integer.valueOf(var2), var1);
+ return var2;
+ }
+
+ public void setupTexture(BufferedImage var1, int var2) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
+ 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);
+ if(this.clampTexture) {
+ 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);
+ }
+
+ int var3 = var1.getWidth();
+ int var4 = var1.getHeight();
+ int[] var5 = new int[var3 * var4];
+ byte[] var6 = new byte[var3 * var4 * 4];
+ var1.getRGB(0, 0, var3, var4, var5, 0, var3);
+
+ for(int var7 = 0; var7 < var5.length; ++var7) {
+ int var8 = var5[var7] >> 24 & 255;
+ int var9 = var5[var7] >> 16 & 255;
+ int var10 = var5[var7] >> 8 & 255;
+ int var11 = var5[var7] & 255;
+ if(this.options != null && this.options.anaglyph) {
+ int var12 = (var9 * 30 + var10 * 59 + var11 * 11) / 100;
+ int var13 = (var9 * 30 + var10 * 70) / 100;
+ int var14 = (var9 * 30 + var11 * 70) / 100;
+ var9 = var12;
+ var10 = var13;
+ var11 = var14;
+ }
+
+ var6[var7 * 4 + 0] = (byte)var9;
+ var6[var7 * 4 + 1] = (byte)var10;
+ var6[var7 * 4 + 2] = (byte)var11;
+ var6[var7 * 4 + 3] = (byte)var8;
+ }
+
+ this.imageData.clear();
+ this.imageData.put(var6);
+ this.imageData.position(0).limit(var6.length);
+ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, var3, var4, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
+ }
+
+ public void deleteTexture(int var1) {
+ this.textureContentsMap.remove(Integer.valueOf(var1));
+ this.singleIntBuffer.clear();
+ this.singleIntBuffer.put(var1);
+ this.singleIntBuffer.flip();
+ GL11.glDeleteTextures(this.singleIntBuffer);
+ }
+
+ public int getTextureForDownloadableImage(String var1, String var2) {
+ ThreadDownloadImageData var3 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
+ if(var3 != null && var3.image != null && !var3.textureSetupComplete) {
+ if(var3.textureName < 0) {
+ var3.textureName = this.allocateAndSetupTexture(var3.image);
+ } else {
+ this.setupTexture(var3.image, var3.textureName);
+ }
+
+ var3.textureSetupComplete = true;
+ }
+
+ return var3 != null && var3.textureName >= 0 ? var3.textureName : this.getTexture(var2);
+ }
+
+ public ThreadDownloadImageData obtainImageData(String var1, ImageBuffer var2) {
+ ThreadDownloadImageData var3 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
+ if(var3 == null) {
+ this.urlToImageDataMap.put(var1, new ThreadDownloadImageData(var1, var2));
+ } else {
+ ++var3.referenceCount;
+ }
+
+ return var3;
+ }
+
+ public void releaseImageData(String var1) {
+ ThreadDownloadImageData var2 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
+ if(var2 != null) {
+ --var2.referenceCount;
+ if(var2.referenceCount == 0) {
+ if(var2.textureName >= 0) {
+ this.deleteTexture(var2.textureName);
+ }
+
+ this.urlToImageDataMap.remove(var1);
+ }
+ }
+
+ }
+
+ public void registerTextureFX(TextureFX var1) {
+ this.textureList.add(var1);
+ var1.onTick();
+ }
+
+ public void updateDynamicTextures() {
+ int var1;
+ TextureFX var2;
+ for(var1 = 0; var1 < this.textureList.size(); ++var1) {
+ var2 = (TextureFX)this.textureList.get(var1);
+ var2.anaglyphEnabled = this.options.anaglyph;
+ var2.onTick();
+ this.imageData.clear();
+ this.imageData.put(var2.imageData);
+ this.imageData.position(0).limit(var2.imageData.length);
+
+ for(int var3 = 0; var3 < var2.tileSize; ++var3) {
+ for(int var4 = 0; var4 < var2.tileSize; ++var4) {
+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var2.iconIndex % 16 * 16 + var3 * 16, var2.iconIndex / 16 * 16 + var4 * 16, 16, 16, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
+ }
+ }
+ }
+
+ for(var1 = 0; var1 < this.textureList.size(); ++var1) {
+ var2 = (TextureFX)this.textureList.get(var1);
+ if(var2.textureId > 0) {
+ this.imageData.clear();
+ this.imageData.put(var2.imageData);
+ this.imageData.position(0).limit(var2.imageData.length);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2.textureId);
+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 16, 16, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
+ }
+ }
+
+ }
+
+ public void refreshTextures() {
+ Iterator var1 = this.textureContentsMap.keySet().iterator();
+
+ BufferedImage var3;
+ while(var1.hasNext()) {
+ int var2 = ((Integer)var1.next()).intValue();
+ var3 = (BufferedImage)this.textureContentsMap.get(Integer.valueOf(var2));
+ this.setupTexture(var3, var2);
+ }
+
+ ThreadDownloadImageData var6;
+ for(var1 = this.urlToImageDataMap.values().iterator(); var1.hasNext(); var6.textureSetupComplete = false) {
+ var6 = (ThreadDownloadImageData)var1.next();
+ }
+
+ var1 = this.textureMap.keySet().iterator();
+
+ while(var1.hasNext()) {
+ String var7 = (String)var1.next();
+
+ try {
+ if(var7.startsWith("##")) {
+ var3 = this.unwrapImageByColumns(ImageIO.read(RenderEngine.class.getResourceAsStream(var7.substring(2))));
+ } else if(var7.startsWith("%%")) {
+ this.clampTexture = true;
+ var3 = ImageIO.read(RenderEngine.class.getResourceAsStream(var7.substring(2)));
+ this.clampTexture = false;
+ } else {
+ var3 = ImageIO.read(RenderEngine.class.getResourceAsStream(var7));
+ }
+
+ int var4 = ((Integer)this.textureMap.get(var7)).intValue();
+ this.setupTexture(var3, var4);
+ } catch (IOException var5) {
+ var5.printStackTrace();
+ }
+ }
+
+ }
+
+ public void bindTexture(int var1) {
+ if(var1 >= 0) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1);
+ }
+ }
+}
diff --git a/source/net/minecraft/src/RenderEntity.java b/source/net/minecraft/src/RenderEntity.java
new file mode 100644
index 0000000..52836e9
--- /dev/null
+++ b/source/net/minecraft/src/RenderEntity.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+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) {
+ GL11.glPushMatrix();
+ renderOffsetAABB(var1.boundingBox, var2 - var1.lastTickPosX, var4 - var1.lastTickPosY, var6 - var1.lastTickPosZ);
+ GL11.glPopMatrix();
+ }
+}
diff --git a/source/net/minecraft/src/RenderFallingSand.java b/source/net/minecraft/src/RenderFallingSand.java
new file mode 100644
index 0000000..3f633d1
--- /dev/null
+++ b/source/net/minecraft/src/RenderFallingSand.java
@@ -0,0 +1,27 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderFallingSand extends Render {
+ private RenderBlocks sandRenderBlocks = new RenderBlocks();
+
+ public RenderFallingSand() {
+ this.shadowSize = 0.5F;
+ }
+
+ public void a(EntityFallingSand var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ this.loadTexture("/terrain.png");
+ Block var10 = Block.blocksList[var1.blockID];
+ World var11 = var1.getWorld();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.sandRenderBlocks.renderBlockFallingSand(var10, var11, MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ));
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityFallingSand)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderGiantZombie.java b/source/net/minecraft/src/RenderGiantZombie.java
new file mode 100644
index 0000000..b0614da
--- /dev/null
+++ b/source/net/minecraft/src/RenderGiantZombie.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderGiantZombie extends RenderLiving {
+ private float scale;
+
+ public RenderGiantZombie(ModelBase var1, float var2, float var3) {
+ super(var1, var2 * var3);
+ this.scale = var3;
+ }
+
+ protected void a(EntityGiant var1, float var2) {
+ GL11.glScalef(this.scale, this.scale, this.scale);
+ }
+
+ protected void preRenderCallback(EntityLiving var1, float var2) {
+ this.a((EntityGiant)var1, var2);
+ }
+}
diff --git a/source/net/minecraft/src/RenderGlobal.java b/source/net/minecraft/src/RenderGlobal.java
new file mode 100644
index 0000000..2de314c
--- /dev/null
+++ b/source/net/minecraft/src/RenderGlobal.java
@@ -0,0 +1,1083 @@
+package net.minecraft.src;
+
+import java.nio.IntBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+import org.lwjgl.opengl.ARBOcclusionQuery;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL15;
+
+public class RenderGlobal implements IWorldAccess {
+ public List tileEntities = new ArrayList();
+ private World theWorld;
+ private RenderEngine renderEngine;
+ private List worldRenderersToUpdate = new ArrayList();
+ private WorldRenderer[] sortedWorldRenderers;
+ private WorldRenderer[] worldRenderers;
+ private int renderChunksWide;
+ private int renderChunksTall;
+ private int renderChunksDeep;
+ private int glRenderListBase;
+ private Minecraft mc;
+ private RenderBlocks globalRenderBlocks;
+ private IntBuffer glOcclusionQueryBase;
+ private boolean occlusionEnabled = false;
+ private int cloudTickCounter = 0;
+ private int starGLCallList;
+ private int glSkyList;
+ private int glSkyList2;
+ private int minBlockX;
+ private int minBlockY;
+ private int minBlockZ;
+ private int maxBlockX;
+ private int maxBlockY;
+ private int maxBlockZ;
+ private int renderDistance = -1;
+ private int countEntitiesTotal;
+ private int countEntitiesRendered;
+ private int countEntitiesHidden;
+ int[] dummyBuf50k = new int['\uc350'];
+ IntBuffer occlusionResult = GLAllocation.createIntBuffer(64);
+ private int renderersLoaded;
+ private int renderersBeingClipped;
+ private int renderersBeingOccluded;
+ private int renderersBeingRendered;
+ private int renderersSkippingRenderPass;
+ private List glRenderLists = new ArrayList();
+ private RenderList[] allRenderLists = new RenderList[]{new RenderList(), new RenderList(), new RenderList(), new RenderList()};
+ int dummyRenderInt = 0;
+ int unusedGLCallList = GLAllocation.generateDisplayLists(1);
+ double prevSortX = -9999.0D;
+ double prevSortY = -9999.0D;
+ double prevSortZ = -9999.0D;
+ public float damagePartialTime;
+ int frustumCheckOffset = 0;
+
+ public RenderGlobal(Minecraft var1, RenderEngine var2) {
+ this.mc = var1;
+ this.renderEngine = var2;
+ byte var3 = 64;
+ this.glRenderListBase = GLAllocation.generateDisplayLists(var3 * var3 * var3 * 3);
+ this.occlusionEnabled = var1.getOpenGlCapsChecker().checkARBOcclusion();
+ if(this.occlusionEnabled) {
+ this.occlusionResult.clear();
+ this.glOcclusionQueryBase = GLAllocation.createIntBuffer(var3 * var3 * var3);
+ this.glOcclusionQueryBase.clear();
+ this.glOcclusionQueryBase.position(0);
+ this.glOcclusionQueryBase.limit(var3 * var3 * var3);
+ ARBOcclusionQuery.glGenQueriesARB(this.glOcclusionQueryBase);
+ }
+
+ this.starGLCallList = GLAllocation.generateDisplayLists(3);
+ GL11.glPushMatrix();
+ GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
+ this.renderStars();
+ GL11.glEndList();
+ GL11.glPopMatrix();
+ Tessellator var4 = Tessellator.instance;
+ this.glSkyList = this.starGLCallList + 1;
+ GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
+ 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) {
+ var4.startDrawingQuads();
+ var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + 0));
+ var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + 0));
+ var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + var6));
+ var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + var6));
+ var4.draw();
+ }
+ }
+
+ GL11.glEndList();
+ this.glSkyList2 = this.starGLCallList + 2;
+ GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
+ var5 = -16.0F;
+ var4.startDrawingQuads();
+
+ 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));
+ var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + var6));
+ }
+ }
+
+ var4.draw();
+ GL11.glEndList();
+ }
+
+ private void renderStars() {
+ Random var1 = new Random(10842L);
+ Tessellator var2 = Tessellator.instance;
+ var2.startDrawingQuads();
+
+ for(int var3 = 0; var3 < 1500; ++var3) {
+ 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.25F + var1.nextFloat() * 0.25F);
+ double var12 = var4 * var4 + var6 * var6 + var8 * var8;
+ if(var12 < 1.0D && var12 > 0.01D) {
+ var12 = 1.0D / Math.sqrt(var12);
+ var4 *= var12;
+ var6 *= var12;
+ var8 *= var12;
+ double var14 = var4 * 100.0D;
+ double var16 = var6 * 100.0D;
+ double var18 = var8 * 100.0D;
+ double var20 = Math.atan2(var4, var8);
+ double var22 = Math.sin(var20);
+ double var24 = Math.cos(var20);
+ double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6);
+ double var28 = Math.sin(var26);
+ double var30 = Math.cos(var26);
+ double var32 = var1.nextDouble() * Math.PI * 2.0D;
+ double var34 = Math.sin(var32);
+ double var36 = Math.cos(var32);
+
+ 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;
+ double var47 = var41 * var36 - var43 * var34;
+ double var49 = var43 * var36 + var41 * var34;
+ double var53 = var47 * var28 + var39 * var30;
+ double var55 = var39 * var28 - var47 * var30;
+ double var57 = var55 * var22 - var49 * var24;
+ double var61 = var49 * var22 + var55 * var24;
+ var2.addVertex(var14 + var57, var16 + var53, var18 + var61);
+ }
+ }
+ }
+
+ var2.draw();
+ }
+
+ public void changeWorld(World var1) {
+ 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);
+ this.loadRenderers();
+ }
+
+ }
+
+ public void loadRenderers() {
+ Block.leaves.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
+ this.renderDistance = this.mc.gameSettings.renderDistance;
+ int 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) {
+ var1 = 400;
+ }
+
+ this.renderChunksWide = var1 / 16 + 1;
+ this.renderChunksTall = 8;
+ this.renderChunksDeep = var1 / 16 + 1;
+ this.worldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep];
+ this.sortedWorldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep];
+ int var2 = 0;
+ int var3 = 0;
+ this.minBlockX = 0;
+ this.minBlockY = 0;
+ this.minBlockZ = 0;
+ this.maxBlockX = this.renderChunksWide;
+ this.maxBlockY = this.renderChunksTall;
+ this.maxBlockZ = this.renderChunksDeep;
+
+ int var4;
+ for(var4 = 0; var4 < this.worldRenderersToUpdate.size(); ++var4) {
+ ((WorldRenderer)this.worldRenderersToUpdate.get(var4)).needsUpdate = false;
+ }
+
+ this.worldRenderersToUpdate.clear();
+
+ for(var4 = 0; var4 < this.renderChunksWide; ++var4) {
+ for(int var5 = 0; var5 < this.renderChunksTall; ++var5) {
+ for(int var6 = 0; var6 < this.renderChunksDeep; ++var6) {
+ if(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] != null) {
+ this.tileEntities.removeAll(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].tileEntityRenderers);
+ }
+
+ this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] = new WorldRenderer(this.theWorld, this.tileEntities, var4 * 16, var5 * 16, var6 * 16, 16, this.glRenderListBase + var2);
+ if(this.occlusionEnabled) {
+ this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].glOcclusionQuery = this.glOcclusionQueryBase.get(var3);
+ }
+
+ 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.worldRenderersToUpdate.add(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4]);
+ var2 += 3;
+ }
+ }
+ }
+
+ if(this.theWorld != null) {
+ Entity var7 = this.theWorld.playerEntity;
+ this.markRenderersForNewPosition(MathHelper.floor_double(var7.posX), MathHelper.floor_double(var7.posY), MathHelper.floor_double(var7.posZ));
+ Arrays.sort(this.sortedWorldRenderers, new EntitySorter(var7));
+ }
+
+ }
+
+ public void renderEntities(Vec3D var1, ICamera var2, float var3) {
+ TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.thePlayer, var3);
+ RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.thePlayer, this.mc.gameSettings, var3);
+ this.countEntitiesTotal = 0;
+ this.countEntitiesRendered = 0;
+ this.countEntitiesHidden = 0;
+ Entity var4 = this.theWorld.playerEntity;
+ 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;
+ List var5 = this.theWorld.getLoadedEntityList();
+ this.countEntitiesTotal = var5.size();
+
+ int var6;
+ for(var6 = 0; var6 < var5.size(); ++var6) {
+ Entity var7 = (Entity)var5.get(var6);
+ if(var7.isInRangeToRenderVec3D(var1) && var2.isBoundingBoxInFrustum(var7.boundingBox) && (var7 != this.theWorld.playerEntity || this.mc.gameSettings.thirdPersonView)) {
+ ++this.countEntitiesRendered;
+ RenderManager.instance.renderEntity(var7, var3);
+ }
+ }
+
+ for(var6 = 0; var6 < this.tileEntities.size(); ++var6) {
+ TileEntityRenderer.instance.renderTileEntity((TileEntity)this.tileEntities.get(var6), var3);
+ }
+
+ }
+
+ public String getDebugInfoRenders() {
+ return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + ". F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass;
+ }
+
+ 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;
+ this.minBlockX = Integer.MAX_VALUE;
+ this.minBlockY = Integer.MAX_VALUE;
+ this.minBlockZ = Integer.MAX_VALUE;
+ this.maxBlockX = Integer.MIN_VALUE;
+ this.maxBlockY = Integer.MIN_VALUE;
+ this.maxBlockZ = Integer.MIN_VALUE;
+ int var4 = this.renderChunksWide * 16;
+ int var5 = var4 / 2;
+
+ for(int var6 = 0; var6 < this.renderChunksWide; ++var6) {
+ int var7 = var6 * 16;
+ int var8 = var7 + var5 - var1;
+ if(var8 < 0) {
+ var8 -= var4 - 1;
+ }
+
+ var8 /= var4;
+ var7 -= var8 * var4;
+ if(var7 < this.minBlockX) {
+ this.minBlockX = var7;
+ }
+
+ if(var7 > this.maxBlockX) {
+ this.maxBlockX = var7;
+ }
+
+ for(int var9 = 0; var9 < this.renderChunksDeep; ++var9) {
+ int var10 = var9 * 16;
+ int var11 = var10 + var5 - var3;
+ if(var11 < 0) {
+ var11 -= var4 - 1;
+ }
+
+ var11 /= var4;
+ var10 -= var11 * var4;
+ if(var10 < this.minBlockZ) {
+ this.minBlockZ = var10;
+ }
+
+ if(var10 > this.maxBlockZ) {
+ this.maxBlockZ = var10;
+ }
+
+ for(int var12 = 0; var12 < this.renderChunksTall; ++var12) {
+ int var13 = var12 * 16;
+ if(var13 < this.minBlockY) {
+ this.minBlockY = var13;
+ }
+
+ 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.worldRenderersToUpdate.add(var14);
+ }
+ }
+ }
+ }
+
+ }
+
+ public int sortAndRender(EntityPlayer var1, int var2, double var3) {
+ if(this.mc.gameSettings.renderDistance != this.renderDistance) {
+ this.loadRenderers();
+ }
+
+ if(var2 == 0) {
+ this.renderersLoaded = 0;
+ this.renderersBeingClipped = 0;
+ this.renderersBeingOccluded = 0;
+ this.renderersBeingRendered = 0;
+ this.renderersSkippingRenderPass = 0;
+ }
+
+ double var5 = 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));
+ }
+
+ byte var17 = 0;
+ int var33;
+ if(this.occlusionEnabled && !this.mc.gameSettings.anaglyph && var2 == 0) {
+ byte var18 = 0;
+ int var19 = 16;
+ this.checkOcclusionQueryResult(var18, var19);
+
+ for(int var20 = var18; var20 < var19; ++var20) {
+ this.sortedWorldRenderers[var20].isVisible = true;
+ }
+
+ var33 = var17 + this.renderSortedRenderers(var18, var19, var2, var3);
+
+ do {
+ int var34 = var19;
+ var19 *= 2;
+ if(var19 > this.sortedWorldRenderers.length) {
+ var19 = this.sortedWorldRenderers.length;
+ }
+
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glDisable(GL11.GL_FOG);
+ GL11.glColorMask(false, false, false, false);
+ GL11.glDepthMask(false);
+ this.checkOcclusionQueryResult(var34, var19);
+ GL11.glPushMatrix();
+ float var35 = 0.0F;
+ float var21 = 0.0F;
+ float var22 = 0.0F;
+
+ for(int var23 = var34; var23 < var19; ++var23) {
+ if(this.sortedWorldRenderers[var23].skipAllRenderPasses()) {
+ this.sortedWorldRenderers[var23].isInFrustum = false;
+ } else {
+ 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));
+ int var25 = (int)(1.0F + var24 / 128.0F);
+ if(this.cloudTickCounter % var25 == var23 % var25) {
+ WorldRenderer var26 = this.sortedWorldRenderers[var23];
+ float var27 = (float)((double)var26.posXMinus - var5);
+ float var28 = (float)((double)var26.posYMinus - var7);
+ float var29 = (float)((double)var26.posZMinus - var9);
+ float var30 = var27 - var35;
+ float var31 = var28 - var21;
+ float var32 = var29 - var22;
+ if(var30 != 0.0F || var31 != 0.0F || var32 != 0.0F) {
+ GL11.glTranslatef(var30, var31, var32);
+ var35 += var30;
+ var21 += var31;
+ var22 += var32;
+ }
+
+ ARBOcclusionQuery.glBeginQueryARB(GL15.GL_SAMPLES_PASSED, this.sortedWorldRenderers[var23].glOcclusionQuery);
+ this.sortedWorldRenderers[var23].callOcclusionQueryList();
+ ARBOcclusionQuery.glEndQueryARB(GL15.GL_SAMPLES_PASSED);
+ this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery = true;
+ }
+ }
+ }
+ }
+
+ GL11.glPopMatrix();
+ GL11.glColorMask(true, true, true, true);
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_FOG);
+ var33 += this.renderSortedRenderers(var34, var19, var2, var3);
+ } while(var19 < this.sortedWorldRenderers.length);
+ } else {
+ var33 = var17 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, var2, var3);
+ }
+
+ return var33;
+ }
+
+ private void checkOcclusionQueryResult(int var1, int var2) {
+ for(int var3 = var1; var3 < var2; ++var3) {
+ if(this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery) {
+ this.occlusionResult.clear();
+ ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, GL15.GL_QUERY_RESULT_AVAILABLE, this.occlusionResult);
+ if(this.occlusionResult.get(0) != 0) {
+ this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery = false;
+ this.occlusionResult.clear();
+ ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, GL15.GL_QUERY_RESULT, this.occlusionResult);
+ this.sortedWorldRenderers[var3].isVisible = this.occlusionResult.get(0) != 0;
+ }
+ }
+ }
+
+ }
+
+ private int renderSortedRenderers(int var1, int var2, int var3, double var4) {
+ this.glRenderLists.clear();
+ int var6 = 0;
+
+ for(int var7 = var1; var7 < var2; ++var7) {
+ if(var3 == 0) {
+ ++this.renderersLoaded;
+ if(this.sortedWorldRenderers[var7].skipRenderPass[var3]) {
+ ++this.renderersSkippingRenderPass;
+ } else if(!this.sortedWorldRenderers[var7].isInFrustum) {
+ ++this.renderersBeingClipped;
+ } else if(this.occlusionEnabled && !this.sortedWorldRenderers[var7].isVisible) {
+ ++this.renderersBeingOccluded;
+ } else {
+ ++this.renderersBeingRendered;
+ }
+ }
+
+ if(!this.sortedWorldRenderers[var7].skipRenderPass[var3] && this.sortedWorldRenderers[var7].isInFrustum && this.sortedWorldRenderers[var7].isVisible) {
+ int var8 = this.sortedWorldRenderers[var7].getGLCallListForPass(var3);
+ if(var8 >= 0) {
+ this.glRenderLists.add(this.sortedWorldRenderers[var7]);
+ ++var6;
+ }
+ }
+ }
+
+ EntityPlayerSP var19 = this.mc.thePlayer;
+ 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;
+ int var14 = 0;
+
+ int var15;
+ for(var15 = 0; var15 < this.allRenderLists.length; ++var15) {
+ this.allRenderLists[var15].reset();
+ }
+
+ 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].isRenderedAt(var16.posXMinus, var16.posYMinus, var16.posZMinus)) {
+ var17 = var18;
+ }
+ }
+
+ if(var17 < 0) {
+ var17 = var14++;
+ this.allRenderLists[var17].setLocation(var16.posXMinus, var16.posYMinus, var16.posZMinus, var20, var10, var12);
+ }
+
+ this.allRenderLists[var17].render(var16.getGLCallListForPass(var3));
+ }
+
+ this.renderAllRenderLists(var3, var4);
+ return var6;
+ }
+
+ public void renderAllRenderLists(int var1, double var2) {
+ for(int var4 = 0; var4 < this.allRenderLists.length; ++var4) {
+ this.allRenderLists[var4].render();
+ }
+
+ }
+
+ public void updateClouds() {
+ ++this.cloudTickCounter;
+ }
+
+ public void renderSky(float var1) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Vec3D var2 = this.theWorld.getSkyColor(var1);
+ float var3 = (float)var2.xCoord;
+ float var4 = (float)var2.yCoord;
+ float var5 = (float)var2.zCoord;
+ float var7;
+ float var8;
+ if(this.mc.gameSettings.anaglyph) {
+ float var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
+ var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
+ var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
+ var3 = var6;
+ var4 = var7;
+ var5 = var8;
+ }
+
+ GL11.glColor3f(var3, var4, var5);
+ Tessellator var12 = Tessellator.instance;
+ GL11.glDepthMask(false);
+ GL11.glEnable(GL11.GL_FOG);
+ GL11.glColor3f(var3, var4, var5);
+ GL11.glCallList(this.glSkyList);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_FOG);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
+ GL11.glPushMatrix();
+ var7 = 0.0F;
+ var8 = 0.0F;
+ float var9 = 0.0F;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glTranslatef(var7, var8, var9);
+ GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(this.theWorld.getCelestialAngle(var1) * 360.0F, 1.0F, 0.0F, 0.0F);
+ float var10 = 30.0F;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain/sun.png"));
+ var12.startDrawingQuads();
+ var12.addVertexWithUV((double)(-var10), 100.0D, (double)(-var10), 0.0D, 0.0D);
+ var12.addVertexWithUV((double)var10, 100.0D, (double)(-var10), 1.0D, 0.0D);
+ var12.addVertexWithUV((double)var10, 100.0D, (double)var10, 1.0D, 1.0D);
+ var12.addVertexWithUV((double)(-var10), 100.0D, (double)var10, 0.0D, 1.0D);
+ var12.draw();
+ var10 = 20.0F;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain/moon.png"));
+ var12.startDrawingQuads();
+ var12.addVertexWithUV((double)(-var10), -100.0D, (double)var10, 1.0D, 1.0D);
+ var12.addVertexWithUV((double)var10, -100.0D, (double)var10, 0.0D, 1.0D);
+ var12.addVertexWithUV((double)var10, -100.0D, (double)(-var10), 0.0D, 0.0D);
+ var12.addVertexWithUV((double)(-var10), -100.0D, (double)(-var10), 1.0D, 0.0D);
+ var12.draw();
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ float var11 = this.theWorld.getStarBrightness(var1);
+ if(var11 > 0.0F) {
+ GL11.glColor4f(var11, var11, var11, var11);
+ GL11.glCallList(this.starGLCallList);
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_FOG);
+ GL11.glPopMatrix();
+ GL11.glColor3f(var3 * 0.2F + 0.04F, var4 * 0.2F + 0.04F, var5 * 0.6F + 0.1F);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glCallList(this.glSkyList2);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDepthMask(true);
+ }
+
+ public void renderClouds(float var1) {
+ if(this.mc.gameSettings.fancyGraphics) {
+ this.renderCloudsFancy(var1);
+ } else {
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ float var2 = (float)(this.mc.thePlayer.lastTickPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.lastTickPosY) * (double)var1);
+ byte var3 = 32;
+ int var4 = 256 / var3;
+ Tessellator var5 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/clouds.png"));
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Vec3D var6 = this.theWorld.getCloudColor(var1);
+ float var7 = (float)var6.xCoord;
+ float var8 = (float)var6.yCoord;
+ float var9 = (float)var6.zCoord;
+ float var10;
+ 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;
+ var7 = var10;
+ var8 = var11;
+ var9 = var12;
+ }
+
+ var10 = 0.5F / 1024.0F;
+ double var22 = this.theWorld.playerEntity.prevPosX + (this.theWorld.playerEntity.posX - this.theWorld.playerEntity.prevPosX) * (double)var1 + (double)(((float)this.cloudTickCounter + var1) * 0.03F);
+ double var13 = this.theWorld.playerEntity.prevPosZ + (this.theWorld.playerEntity.posZ - this.theWorld.playerEntity.prevPosZ) * (double)var1;
+ int var15 = MathHelper.floor_double(var22 / 2048.0D);
+ int var16 = MathHelper.floor_double(var13 / 2048.0D);
+ var22 -= (double)(var15 * 2048);
+ var13 -= (double)(var16 * 2048);
+ float var17 = 120.0F - var2 + 0.33F;
+ float var18 = (float)(var22 * (double)var10);
+ float var19 = (float)(var13 * (double)var10);
+ var5.startDrawingQuads();
+ var5.setColorRGBA_F(var7, var8, var9, 0.8F);
+
+ for(int var20 = -var3 * var4; var20 < var3 * var4; var20 += var3) {
+ for(int var21 = -var3 * var4; var21 < var3 * var4; var21 += var3) {
+ var5.addVertexWithUV((double)(var20 + 0), (double)var17, (double)(var21 + var3), (double)((float)(var20 + 0) * var10 + var18), (double)((float)(var21 + var3) * var10 + var19));
+ var5.addVertexWithUV((double)(var20 + var3), (double)var17, (double)(var21 + var3), (double)((float)(var20 + var3) * var10 + var18), (double)((float)(var21 + var3) * var10 + var19));
+ var5.addVertexWithUV((double)(var20 + var3), (double)var17, (double)(var21 + 0), (double)((float)(var20 + var3) * var10 + var18), (double)((float)(var21 + 0) * var10 + var19));
+ var5.addVertexWithUV((double)(var20 + 0), (double)var17, (double)(var21 + 0), (double)((float)(var20 + 0) * var10 + var18), (double)((float)(var21 + 0) * var10 + var19));
+ }
+ }
+
+ var5.draw();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ }
+ }
+
+ public void renderCloudsFancy(float var1) {
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ float var2 = (float)(this.mc.thePlayer.lastTickPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.lastTickPosY) * (double)var1);
+ Tessellator var3 = Tessellator.instance;
+ float var4 = 12.0F;
+ float var5 = 4.0F;
+ double var6 = (this.theWorld.playerEntity.prevPosX + (this.theWorld.playerEntity.posX - this.theWorld.playerEntity.prevPosX) * (double)var1 + (double)(((float)this.cloudTickCounter + var1) * 0.03F)) / (double)var4;
+ double var8 = (this.theWorld.playerEntity.prevPosZ + (this.theWorld.playerEntity.posZ - this.theWorld.playerEntity.prevPosZ) * (double)var1) / (double)var4 + (double)0.33F;
+ float var10 = 108.0F - var2 + 0.33F;
+ int var11 = MathHelper.floor_double(var6 / 2048.0D);
+ int var12 = MathHelper.floor_double(var8 / 2048.0D);
+ var6 -= (double)(var11 * 2048);
+ var8 -= (double)(var12 * 2048);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/clouds.png"));
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Vec3D var13 = this.theWorld.getCloudColor(var1);
+ float var14 = (float)var13.xCoord;
+ float var15 = (float)var13.yCoord;
+ float var16 = (float)var13.zCoord;
+ float var17;
+ float var18;
+ float var19;
+ if(this.mc.gameSettings.anaglyph) {
+ var17 = (var14 * 30.0F + var15 * 59.0F + var16 * 11.0F) / 100.0F;
+ var18 = (var14 * 30.0F + var15 * 70.0F) / 100.0F;
+ var19 = (var14 * 30.0F + var16 * 70.0F) / 100.0F;
+ var14 = var17;
+ var15 = var18;
+ var16 = var19;
+ }
+
+ var17 = (float)(var6 * 0.0D);
+ var18 = (float)(var8 * 0.0D);
+ var19 = 0.00390625F;
+ var17 = (float)MathHelper.floor_double(var6) * var19;
+ var18 = (float)MathHelper.floor_double(var8) * var19;
+ float var20 = (float)(var6 - (double)MathHelper.floor_double(var6));
+ float var21 = (float)(var8 - (double)MathHelper.floor_double(var8));
+ byte var22 = 8;
+ byte var23 = 3;
+ float var24 = 1.0F / 1024.0F;
+ GL11.glScalef(var4, 1.0F, var4);
+
+ for(int var25 = 0; var25 < 2; ++var25) {
+ if(var25 == 0) {
+ GL11.glColorMask(false, false, false, false);
+ } else {
+ GL11.glColorMask(true, true, true, true);
+ }
+
+ for(int var26 = -var23 + 1; var26 <= var23; ++var26) {
+ for(int var27 = -var23 + 1; var27 <= var23; ++var27) {
+ var3.startDrawingQuads();
+ float var28 = (float)(var26 * var22);
+ float var29 = (float)(var27 * var22);
+ float var30 = var28 - var20;
+ float var31 = var29 - var21;
+ if(var10 > -var5 - 1.0F) {
+ var3.setColorRGBA_F(var14 * 0.7F, var15 * 0.7F, var16 * 0.7F, 0.8F);
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+
+ if(var10 <= var5 + 1.0F) {
+ var3.setColorRGBA_F(var14, var15, var16, 0.8F);
+ var3.setNormal(0.0F, 1.0F, 0.0F);
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5 - var24), (double)(var31 + (float)var22), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5 - var24), (double)(var31 + (float)var22), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5 - var24), (double)(var31 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5 - var24), (double)(var31 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+
+ var3.setColorRGBA_F(var14 * 0.9F, var15 * 0.9F, var16 * 0.9F, 0.8F);
+ int var32;
+ if(var26 > -1) {
+ var3.setNormal(-1.0F, 0.0F, 0.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + var5), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + var5), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+ }
+
+ if(var26 <= 1) {
+ var3.setNormal(1.0F, 0.0F, 0.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + var5), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + var5), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+ }
+
+ var3.setColorRGBA_F(var14 * 0.8F, var15 * 0.8F, var16 * 0.8F, 0.8F);
+ if(var27 > -1) {
+ var3.setNormal(0.0F, 0.0F, -1.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ }
+ }
+
+ if(var27 <= 1) {
+ var3.setNormal(0.0F, 0.0F, 1.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ }
+ }
+
+ var3.draw();
+ }
+ }
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ }
+
+ public boolean updateRenderers(EntityPlayer var1, boolean var2) {
+ Collections.sort(this.worldRenderersToUpdate, new RenderSorter(var1));
+ int var3 = this.worldRenderersToUpdate.size() - 1;
+ int var4 = this.worldRenderersToUpdate.size();
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ WorldRenderer var6 = (WorldRenderer)this.worldRenderersToUpdate.get(var3 - var5);
+ if(!var2) {
+ if(var6.distanceToEntitySquared(var1) > 1024.0F) {
+ if(var6.isInFrustum) {
+ if(var5 >= 3) {
+ return false;
+ }
+ } else if(var5 >= 1) {
+ return false;
+ }
+ }
+ } else if(!var6.isInFrustum) {
+ continue;
+ }
+
+ var6.updateRenderer();
+ this.worldRenderersToUpdate.remove(var6);
+ var6.needsUpdate = false;
+ }
+
+ return this.worldRenderersToUpdate.size() == 0;
+ }
+
+ public void drawBlockBreaking(EntityPlayer var1, MovingObjectPosition var2, int var3, ItemStack var4, float var5) {
+ Tessellator var6 = Tessellator.instance;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, (MathHelper.sin((float)System.currentTimeMillis() / 100.0F) * 0.2F + 0.4F) * 0.5F);
+ int var8;
+ if(var3 == 0) {
+ if(this.damagePartialTime > 0.0F) {
+ GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR);
+ int var7 = this.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var7);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
+ GL11.glPushMatrix();
+ var8 = this.theWorld.getBlockId(var2.blockX, var2.blockY, var2.blockZ);
+ Block var9 = var8 > 0 ? Block.blocksList[var8] : null;
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glPolygonOffset(-3.0F, -3.0F);
+ GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
+ var6.startDrawingQuads();
+ double var10 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var5;
+ double var12 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var5;
+ double var14 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var5;
+ var6.setTranslationD(-var10, -var12, -var14);
+ var6.disableColor();
+ if(var9 == null) {
+ var9 = Block.stone;
+ }
+
+ this.globalRenderBlocks.renderBlockUsingTexture(var9, var2.blockX, var2.blockY, var2.blockZ, 240 + (int)(this.damagePartialTime * 10.0F));
+ var6.draw();
+ var6.setTranslationD(0.0D, 0.0D, 0.0D);
+ GL11.glPolygonOffset(0.0F, 0.0F);
+ GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glDepthMask(true);
+ GL11.glPopMatrix();
+ }
+ } else if(var4 != null) {
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ float var16 = MathHelper.sin((float)System.currentTimeMillis() / 100.0F) * 0.2F + 0.8F;
+ GL11.glColor4f(var16, var16, var16, MathHelper.sin((float)System.currentTimeMillis() / 200.0F) * 0.2F + 0.5F);
+ var8 = this.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var8);
+ int var17 = var2.blockX;
+ int var18 = var2.blockY;
+ int var11 = var2.blockZ;
+ if(var2.sideHit == 0) {
+ --var18;
+ }
+
+ if(var2.sideHit == 1) {
+ ++var18;
+ }
+
+ if(var2.sideHit == 2) {
+ --var11;
+ }
+
+ if(var2.sideHit == 3) {
+ ++var11;
+ }
+
+ if(var2.sideHit == 4) {
+ --var17;
+ }
+
+ if(var2.sideHit == 5) {
+ ++var17;
+ }
+ }
+
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ }
+
+ public void drawSelectionBox(EntityPlayer var1, MovingObjectPosition var2, int var3, ItemStack var4, float var5) {
+ if(var3 == 0 && var2.typeOfHit == 0) {
+ 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);
+ GL11.glLineWidth(2.0F);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDepthMask(false);
+ float var6 = 0.002F;
+ int var7 = this.theWorld.getBlockId(var2.blockX, var2.blockY, var2.blockZ);
+ if(var7 > 0) {
+ double var8 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var5;
+ double var10 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var5;
+ double var12 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var5;
+ this.drawOutlinedBoundingBox(Block.blocksList[var7].getSelectedBoundingBoxFromPool(this.theWorld, var2.blockX, var2.blockY, var2.blockZ).expand((double)var6, (double)var6, (double)var6).getOffsetBoundingBox(-var8, -var10, -var12));
+ }
+
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ }
+
+ private void drawOutlinedBoundingBox(AxisAlignedBB var1) {
+ 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.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.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.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);
+
+ for(int var13 = var7; var13 <= var10; ++var13) {
+ int var14 = var13 % this.renderChunksWide;
+ if(var14 < 0) {
+ var14 += this.renderChunksWide;
+ }
+
+ for(int var15 = var8; var15 <= var11; ++var15) {
+ int var16 = var15 % this.renderChunksTall;
+ if(var16 < 0) {
+ var16 += this.renderChunksTall;
+ }
+
+ for(int var17 = var9; var17 <= var12; ++var17) {
+ int var18 = var17 % this.renderChunksDeep;
+ if(var18 < 0) {
+ var18 += this.renderChunksDeep;
+ }
+
+ int var19 = (var18 * this.renderChunksTall + var16) * this.renderChunksWide + var14;
+ WorldRenderer var20 = this.worldRenderers[var19];
+ if(!var20.needsUpdate) {
+ this.worldRenderersToUpdate.add(var20);
+ }
+
+ var20.markDirty();
+ }
+ }
+ }
+
+ }
+
+ public void markBlockAndNeighborsNeedsUpdate(int var1, int var2, int var3) {
+ this.markBlocksForUpdate(var1 - 1, var2 - 1, var3 - 1, var1 + 1, var2 + 1, var3 + 1);
+ }
+
+ public void markBlockRangeNeedsUpdate(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 clipRenderersByFrustrum(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].updateInFrustrum(var1);
+ }
+ }
+
+ ++this.frustumCheckOffset;
+ }
+
+ public void playSound(String var1, double var2, double var4, double var6, float var8, float var9) {
+ this.mc.sndManager.playSound(var1, (float)var2, (float)var4, (float)var6, var8, var9);
+ }
+
+ public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) {
+ double var14 = this.theWorld.playerEntity.posX - var2;
+ double var16 = this.theWorld.playerEntity.posY - var4;
+ double var18 = this.theWorld.playerEntity.posZ - var6;
+ if(var14 * var14 + var16 * var16 + var18 * var18 <= 256.0D) {
+ if(var1 == "bubble") {
+ this.mc.effectRenderer.addEffect(new EntityBubbleFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "smoke") {
+ this.mc.effectRenderer.addEffect(new EntitySmokeFX(this.theWorld, var2, var4, var6));
+ } else if(var1 == "explode") {
+ this.mc.effectRenderer.addEffect(new EntityExplodeFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "flame") {
+ this.mc.effectRenderer.addEffect(new EntityFlameFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "lava") {
+ this.mc.effectRenderer.addEffect(new EntityLavaFX(this.theWorld, var2, var4, var6));
+ } else if(var1 == "splash") {
+ this.mc.effectRenderer.addEffect(new EntitySplashFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "largesmoke") {
+ this.mc.effectRenderer.addEffect(new EntitySmokeFX(this.theWorld, var2, var4, var6, 2.5F));
+ }
+
+ }
+ }
+
+ public void obtainEntitySkin(Entity var1) {
+ if(var1.skinUrl != null) {
+ this.renderEngine.obtainImageData(var1.skinUrl, new ImageBufferDownload());
+ }
+
+ }
+
+ public void releaseEntitySkin(Entity var1) {
+ if(var1.skinUrl != null) {
+ this.renderEngine.releaseImageData(var1.skinUrl);
+ }
+
+ }
+
+ public void updateAllRenderers() {
+ for(int var1 = 0; var1 < this.worldRenderers.length; ++var1) {
+ if(this.worldRenderers[var1].isChunkLit) {
+ if(!this.worldRenderers[var1].needsUpdate) {
+ this.worldRenderersToUpdate.add(this.worldRenderers[var1]);
+ }
+
+ this.worldRenderers[var1].markDirty();
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/RenderHelper.java b/source/net/minecraft/src/RenderHelper.java
new file mode 100644
index 0000000..daf49c3
--- /dev/null
+++ b/source/net/minecraft/src/RenderHelper.java
@@ -0,0 +1,49 @@
+package net.minecraft.src;
+
+import java.nio.FloatBuffer;
+import org.lwjgl.opengl.GL11;
+
+public class RenderHelper {
+ private static FloatBuffer colorBuffer = GLAllocation.createFloatBuffer(16);
+
+ public static void disableStandardItemLighting() {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_LIGHT0);
+ GL11.glDisable(GL11.GL_LIGHT1);
+ GL11.glDisable(GL11.GL_COLOR_MATERIAL);
+ }
+
+ public static void enableStandardItemLighting() {
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_LIGHT1);
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glColorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE);
+ float var0 = 0.4F;
+ float var1 = 0.6F;
+ float var2 = 0.0F;
+ Vec3D var3 = Vec3D.createVector((double)0.7F, 1.0D, (double)-0.2F).normalize();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, setColorBuffer(var3.xCoord, var3.yCoord, var3.zCoord, 0.0D));
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, setColorBuffer(var1, var1, var1, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F));
+ var3 = Vec3D.createVector((double)-0.7F, 1.0D, (double)0.2F).normalize();
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, setColorBuffer(var3.xCoord, var3.yCoord, var3.zCoord, 0.0D));
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, setColorBuffer(var1, var1, var1, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F));
+ GL11.glShadeModel(GL11.GL_FLAT);
+ 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) {
+ colorBuffer.clear();
+ colorBuffer.put(var0).put(var1).put(var2).put(var3);
+ colorBuffer.flip();
+ return colorBuffer;
+ }
+}
diff --git a/source/net/minecraft/src/RenderItem.java b/source/net/minecraft/src/RenderItem.java
new file mode 100644
index 0000000..bc50e5c
--- /dev/null
+++ b/source/net/minecraft/src/RenderItem.java
@@ -0,0 +1,193 @@
+package net.minecraft.src;
+
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderItem extends Render {
+ private RenderBlocks renderBlocks = new RenderBlocks();
+ private Random random = new Random();
+
+ public RenderItem() {
+ this.shadowSize = 0.15F;
+ this.shadowOpaque = 12.0F / 16.0F;
+ }
+
+ public void a(EntityItem var1, double var2, double var4, double var6, float var8, float var9) {
+ this.random.setSeed(187L);
+ ItemStack var10 = var1.item;
+ 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);
+ byte var13 = 1;
+ if(var1.item.stackSize > 1) {
+ var13 = 2;
+ }
+
+ if(var1.item.stackSize > 5) {
+ var13 = 3;
+ }
+
+ if(var1.item.stackSize > 20) {
+ var13 = 4;
+ }
+
+ GL11.glTranslatef((float)var2, (float)var4 + var11, (float)var6);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ float var16;
+ float var17;
+ float var18;
+ if(var10.itemID < 256 && Block.blocksList[var10.itemID].getRenderType() == 0) {
+ GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
+ this.loadTexture("/terrain.png");
+ float var27 = 0.25F;
+ if(!Block.blocksList[var10.itemID].renderAsNormalBlock() && var10.itemID != Block.stairSingle.blockID) {
+ var27 = 0.5F;
+ }
+
+ GL11.glScalef(var27, var27, var27);
+
+ for(int var28 = 0; var28 < var13; ++var28) {
+ GL11.glPushMatrix();
+ if(var28 > 0) {
+ var16 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var27;
+ var17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var27;
+ var18 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var27;
+ GL11.glTranslatef(var16, var17, var18);
+ }
+
+ this.renderBlocks.renderBlockOnInventory(Block.blocksList[var10.itemID]);
+ GL11.glPopMatrix();
+ }
+ } else {
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ int var14 = var10.getIconIndex();
+ if(var10.itemID < 256) {
+ this.loadTexture("/terrain.png");
+ } else {
+ this.loadTexture("/gui/items.png");
+ }
+
+ Tessellator var15 = Tessellator.instance;
+ var16 = (float)(var14 % 16 * 16 + 0) / 256.0F;
+ var17 = (float)(var14 % 16 * 16 + 16) / 256.0F;
+ var18 = (float)(var14 / 16 * 16 + 0) / 256.0F;
+ float var19 = (float)(var14 / 16 * 16 + 16) / 256.0F;
+ float var20 = 1.0F;
+ float var21 = 0.5F;
+ float var22 = 0.25F;
+
+ for(int var23 = 0; var23 < var13; ++var23) {
+ GL11.glPushMatrix();
+ if(var23 > 0) {
+ float var24 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
+ float var25 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
+ float var26 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
+ GL11.glTranslatef(var24, var25, var26);
+ }
+
+ GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
+ var15.startDrawingQuads();
+ var15.setNormal(0.0F, 1.0F, 0.0F);
+ var15.addVertexWithUV((double)(0.0F - var21), (double)(0.0F - var22), 0.0D, (double)var16, (double)var19);
+ var15.addVertexWithUV((double)(var20 - var21), (double)(0.0F - var22), 0.0D, (double)var17, (double)var19);
+ var15.addVertexWithUV((double)(var20 - var21), (double)(1.0F - var22), 0.0D, (double)var17, (double)var18);
+ var15.addVertexWithUV((double)(0.0F - var21), (double)(1.0F - var22), 0.0D, (double)var16, (double)var18);
+ var15.draw();
+ GL11.glPopMatrix();
+ }
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ public void drawItemIntoGui(FontRenderer var1, RenderEngine var2, ItemStack var3, int var4, int var5) {
+ if(var3 != null) {
+ if(var3.itemID < 256 && Block.blocksList[var3.itemID].getRenderType() == 0) {
+ int var6 = var3.itemID;
+ var2.bindTexture(var2.getTexture("/terrain.png"));
+ Block var7 = Block.blocksList[var6];
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(var4 - 2), (float)(var5 + 3), 0.0F);
+ GL11.glScalef(10.0F, 10.0F, 10.0F);
+ GL11.glTranslatef(1.0F, 0.5F, 8.0F);
+ GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.renderBlocks.renderBlockOnInventory(var7);
+ GL11.glPopMatrix();
+ } else if(var3.getIconIndex() >= 0) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if(var3.itemID < 256) {
+ var2.bindTexture(var2.getTexture("/terrain.png"));
+ } else {
+ var2.bindTexture(var2.getTexture("/gui/items.png"));
+ }
+
+ this.renderTexturedQuad(var4, var5, var3.getIconIndex() % 16 * 16, var3.getIconIndex() / 16 * 16, 16, 16);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ }
+
+ }
+ }
+
+ public void renderItemOverlayIntoGUI(FontRenderer var1, RenderEngine var2, ItemStack var3, int var4, int var5) {
+ if(var3 != null) {
+ if(var3.stackSize > 1) {
+ String var6 = "" + var3.stackSize;
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ var1.drawStringWithShadow(var6, var4 + 19 - 2 - var1.getStringWidth(var6), var5 + 6 + 3, 16777215);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ }
+
+ if(var3.itemDmg > 0) {
+ int var11 = 13 - var3.itemDmg * 13 / var3.getMaxDamage();
+ int var7 = 255 - var3.itemDmg * 255 / var3.getMaxDamage();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Tessellator var8 = Tessellator.instance;
+ int var9 = 255 - var7 << 16 | var7 << 8;
+ int var10 = (255 - var7) / 4 << 16 | 16128;
+ this.renderQuad(var8, var4 + 2, var5 + 13, 13, 2, 0);
+ this.renderQuad(var8, var4 + 2, var5 + 13, 12, 1, var10);
+ this.renderQuad(var8, var4 + 2, var5 + 13, var11, 1, var9);
+ 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();
+ }
+
+ public void renderTexturedQuad(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((double)(var1 + 0), (double)(var2 + var6), (double)var7, (double)((float)(var3 + 0) * var8), (double)((float)(var4 + var6) * var9));
+ var10.addVertexWithUV((double)(var1 + var5), (double)(var2 + var6), (double)var7, (double)((float)(var3 + var5) * var8), (double)((float)(var4 + var6) * var9));
+ var10.addVertexWithUV((double)(var1 + var5), (double)(var2 + 0), (double)var7, (double)((float)(var3 + var5) * var8), (double)((float)(var4 + 0) * var9));
+ var10.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)var7, (double)((float)(var3 + 0) * var8), (double)((float)(var4 + 0) * var9));
+ var10.draw();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityItem)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderList.java b/source/net/minecraft/src/RenderList.java
new file mode 100644
index 0000000..4688443
--- /dev/null
+++ b/source/net/minecraft/src/RenderList.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import java.nio.IntBuffer;
+import org.lwjgl.opengl.GL11;
+
+public class RenderList {
+ private int posX;
+ private int posY;
+ private int posZ;
+ private float playerPosX;
+ private float playerPosY;
+ private float playerPosZ;
+ private IntBuffer buffer = GLAllocation.createIntBuffer(65536);
+ private boolean render = false;
+ private boolean isCached = false;
+
+ public void setLocation(int var1, int var2, int var3, double var4, double var6, double var8) {
+ this.render = true;
+ this.buffer.clear();
+ this.posX = var1;
+ this.posY = var2;
+ this.posZ = var3;
+ this.playerPosX = (float)var4;
+ this.playerPosY = (float)var6;
+ this.playerPosZ = (float)var8;
+ }
+
+ public boolean isRenderedAt(int var1, int var2, int var3) {
+ return !this.render ? false : var1 == this.posX && var2 == this.posY && var3 == this.posZ;
+ }
+
+ public void render(int var1) {
+ this.buffer.put(var1);
+ if(this.buffer.remaining() == 0) {
+ this.render();
+ }
+
+ }
+
+ public void render() {
+ if(this.render) {
+ if(!this.isCached) {
+ this.buffer.flip();
+ this.isCached = true;
+ }
+
+ if(this.buffer.remaining() > 0) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)this.posX - this.playerPosX, (float)this.posY - this.playerPosY, (float)this.posZ - this.playerPosZ);
+ GL11.glCallLists(this.buffer);
+ GL11.glPopMatrix();
+ }
+
+ }
+ }
+
+ public void reset() {
+ this.render = false;
+ this.isCached = false;
+ }
+}
diff --git a/source/net/minecraft/src/RenderLiving.java b/source/net/minecraft/src/RenderLiving.java
new file mode 100644
index 0000000..564dd4c
--- /dev/null
+++ b/source/net/minecraft/src/RenderLiving.java
@@ -0,0 +1,133 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderLiving extends Render {
+ protected ModelBase mainModel;
+ protected ModelBase renderPassModel;
+
+ public RenderLiving(ModelBase var1, float var2) {
+ this.mainModel = var1;
+ this.shadowSize = var2;
+ }
+
+ public void setRenderPassModel(ModelBase var1) {
+ this.renderPassModel = var1;
+ }
+
+ public void a(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_CULL_FACE);
+
+ try {
+ float var10 = var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var9;
+ float var11 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9;
+ float var12 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9;
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ float var13 = (float)var1.ticksExisted + var9;
+ GL11.glRotatef(180.0F - var10, 0.0F, 1.0F, 0.0F);
+ float var14;
+ if(var1.deathTime > 0) {
+ var14 = ((float)var1.deathTime + var9 - 1.0F) / 20.0F * 1.6F;
+ var14 = MathHelper.sqrt_float(var14);
+ if(var14 > 1.0F) {
+ var14 = 1.0F;
+ }
+
+ GL11.glRotatef(var14 * this.getMaxDeathRotation(var1), 0.0F, 0.0F, 1.0F);
+ }
+
+ var14 = 1.0F / 16.0F;
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glScalef(-1.0F, -1.0F, 1.0F);
+ this.preRenderCallback(var1, var9);
+ GL11.glTranslatef(0.0F, -24.0F * var14 - 0.0078125F, 0.0F);
+ float var15 = var1.prevLimbYaw + (var1.limbYaw - var1.prevLimbYaw) * var9;
+ float var16 = var1.limbSwing - var1.limbYaw * (1.0F - var9);
+ if(var15 > 1.0F) {
+ var15 = 1.0F;
+ }
+
+ this.loadDownloadableImageTexture(var1.skinUrl, var1.getTexture());
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ this.mainModel.render(var16, var15, var13, var11 - var10, var12, var14);
+
+ for(int var17 = 0; var17 < 4; ++var17) {
+ if(this.shouldRenderPass(var1, var17)) {
+ this.renderPassModel.render(var16, var15, var13, var11 - var10, var12, var14);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+ }
+
+ float var25 = var1.getEntityBrightness(var9);
+ int var18 = this.getColorMultiplier(var1, var25, var9);
+ if((var18 >> 24 & 255) > 0 || var1.hurtTime > 0 || var1.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) {
+ GL11.glColor4f(var25, 0.0F, 0.0F, 0.4F);
+ this.mainModel.render(var16, var15, var13, var11 - var10, var12, var14);
+
+ for(int var19 = 0; var19 < 4; ++var19) {
+ if(this.shouldRenderPass(var1, var19)) {
+ GL11.glColor4f(var25, 0.0F, 0.0F, 0.4F);
+ this.renderPassModel.render(var16, var15, var13, var11 - var10, var12, var14);
+ }
+ }
+ }
+
+ if((var18 >> 24 & 255) > 0) {
+ float var26 = (float)(var18 >> 16 & 255) / 255.0F;
+ float var20 = (float)(var18 >> 8 & 255) / 255.0F;
+ float var21 = (float)(var18 & 255) / 255.0F;
+ float var22 = (float)(var18 >> 24 & 255) / 255.0F;
+ GL11.glColor4f(var26, var20, var21, var22);
+ this.mainModel.render(var16, var15, var13, var11 - var10, var12, var14);
+
+ for(int var23 = 0; var23 < 4; ++var23) {
+ if(this.shouldRenderPass(var1, var23)) {
+ GL11.glColor4f(var26, var20, var21, var22);
+ this.renderPassModel.render(var16, var15, var13, var11 - var10, var12, var14);
+ }
+ }
+ }
+
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ } catch (Exception var24) {
+ var24.printStackTrace();
+ }
+
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glPopMatrix();
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return false;
+ }
+
+ protected float getMaxDeathRotation(EntityLiving var1) {
+ return 90.0F;
+ }
+
+ protected int getColorMultiplier(EntityLiving var1, float var2, float var3) {
+ return 0;
+ }
+
+ protected void preRenderCallback(EntityLiving var1, float var2) {
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityLiving)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderManager.java b/source/net/minecraft/src/RenderManager.java
new file mode 100644
index 0000000..8d427a4
--- /dev/null
+++ b/source/net/minecraft/src/RenderManager.java
@@ -0,0 +1,107 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.lwjgl.opengl.GL11;
+
+public class RenderManager {
+ private Map entityRenderMap = new HashMap();
+ public static RenderManager instance = new RenderManager();
+ private FontRenderer fontRenderer;
+ public static double renderPosX;
+ public static double renderPosY;
+ public static double renderPosZ;
+ public RenderEngine renderEngine;
+ public World worldObj;
+ public EntityPlayer player;
+ public float playerViewY;
+ public float playerViewX;
+ public GameSettings options;
+ public double viewerPosX;
+ public double viewerPosY;
+ public double viewerPosZ;
+
+ private RenderManager() {
+ 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 ModelSheep(), new ModelSheepFur(), 0.7F));
+ this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper());
+ this.entityRenderMap.put(EntitySkeleton.class, new RenderLiving(new ModelSkeleton(), 0.5F));
+ this.entityRenderMap.put(EntityZombie.class, new RenderLiving(new ModelZombie(), 0.5F));
+ this.entityRenderMap.put(EntityPlayer.class, new RenderPlayer());
+ this.entityRenderMap.put(EntityGiant.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F));
+ this.entityRenderMap.put(EntityLiving.class, new RenderLiving(new ModelBiped(), 0.5F));
+ this.entityRenderMap.put(Entity.class, new RenderEntity());
+ this.entityRenderMap.put(EntityPainting.class, new RenderPainting());
+ this.entityRenderMap.put(EntityArrow.class, new RenderArrow());
+ this.entityRenderMap.put(EntityItem.class, new RenderItem());
+ this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed());
+ this.entityRenderMap.put(EntityFallingSand.class, new RenderFallingSand());
+ this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart());
+ Iterator var1 = this.entityRenderMap.values().iterator();
+
+ while(var1.hasNext()) {
+ Render var2 = (Render)var1.next();
+ var2.setRenderManager(this);
+ }
+
+ }
+
+ public Render getEntityClassRenderObject(Class var1) {
+ Render var2 = (Render)this.entityRenderMap.get(var1);
+ if(var2 == null && var1 != Entity.class) {
+ var2 = this.getEntityClassRenderObject(var1.getSuperclass());
+ this.entityRenderMap.put(var1, var2);
+ }
+
+ return var2;
+ }
+
+ public Render getEntityRenderObject(Entity var1) {
+ return this.getEntityClassRenderObject(var1.getClass());
+ }
+
+ public void cacheActiveRenderInfo(World var1, RenderEngine var2, FontRenderer var3, EntityPlayer var4, GameSettings var5, float var6) {
+ this.worldObj = var1;
+ this.renderEngine = var2;
+ this.options = var5;
+ this.player = var4;
+ this.fontRenderer = var3;
+ this.playerViewY = var4.prevRotationYaw + (var4.rotationYaw - var4.prevRotationYaw) * var6;
+ this.playerViewX = var4.prevRotationPitch + (var4.rotationPitch - var4.prevRotationPitch) * var6;
+ this.viewerPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var6;
+ this.viewerPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var6;
+ this.viewerPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var6;
+ }
+
+ public void renderEntity(Entity var1, float var2) {
+ 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;
+ float var10 = var1.getEntityBrightness(var2);
+ GL11.glColor3f(var10, var10, var10);
+ this.renderEntityWithPosYaw(var1, var3 - renderPosX, var5 - renderPosY, var7 - renderPosZ, var9, var2);
+ }
+
+ public void renderEntityWithPosYaw(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ Render var10 = this.getEntityRenderObject(var1);
+ if(var10 != null) {
+ var10.doRender(var1, var2, var4, var6, var8, var9);
+ var10.doRenderShadowAndFire(var1, var2, var4, var6, var8, var9);
+ }
+
+ }
+
+ public void set(World var1) {
+ this.worldObj = var1;
+ }
+
+ public double getDistanceToCamera(double var1, double var3, double var5) {
+ double var7 = var1 - this.viewerPosX;
+ double var9 = var3 - this.viewerPosY;
+ double var11 = var5 - this.viewerPosZ;
+ return var7 * var7 + var9 * var9 + var11 * var11;
+ }
+}
diff --git a/source/net/minecraft/src/RenderMinecart.java b/source/net/minecraft/src/RenderMinecart.java
new file mode 100644
index 0000000..a87bf34
--- /dev/null
+++ b/source/net/minecraft/src/RenderMinecart.java
@@ -0,0 +1,70 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderMinecart extends Render {
+ protected ModelBase modelMinecart;
+
+ public RenderMinecart() {
+ this.shadowSize = 0.5F;
+ this.modelMinecart = new ModelMinecart();
+ }
+
+ public void a(EntityMinecart var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ double var10 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9;
+ double var12 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9;
+ double var14 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9;
+ double var16 = (double)0.3F;
+ Vec3D var18 = var1.getPos(var10, var12, var14);
+ float var19 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9;
+ if(var18 != null) {
+ Vec3D var20 = var1.getPosOffset(var10, var12, var14, var16);
+ Vec3D var21 = var1.getPosOffset(var10, var12, var14, -var16);
+ if(var20 == null) {
+ var20 = var18;
+ }
+
+ if(var21 == null) {
+ var21 = var18;
+ }
+
+ var2 += var18.xCoord - var10;
+ var4 += (var20.yCoord + var21.yCoord) / 2.0D - var12;
+ var6 += var18.zCoord - var14;
+ Vec3D var22 = var21.addVector(-var20.xCoord, -var20.yCoord, -var20.zCoord);
+ if(var22.lengthVector() != 0.0D) {
+ var22 = var22.normalize();
+ var8 = (float)(Math.atan2(var22.zCoord, var22.xCoord) * 180.0D / Math.PI);
+ var19 = (float)(Math.atan(var22.yCoord) * 73.0D);
+ }
+ }
+
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var19, 0.0F, 0.0F, 1.0F);
+ float var23 = (float)var1.timeSinceHit - var9;
+ float var24 = (float)var1.damageTaken - var9;
+ if(var24 < 0.0F) {
+ var24 = 0.0F;
+ }
+
+ if(var23 > 0.0F) {
+ GL11.glRotatef(MathHelper.sin(var23) * var23 * var24 / 10.0F * (float)var1.forwardDirection, 1.0F, 0.0F, 0.0F);
+ }
+
+ this.loadTexture("/terrain.png");
+ float var25 = 12.0F / 16.0F;
+ GL11.glScalef(var25, var25, var25);
+ (new RenderBlocks()).renderBlockOnInventory(Block.chest);
+ GL11.glScalef(1.0F / var25, 1.0F / var25, 1.0F / var25);
+ this.loadTexture("/item/cart.png");
+ GL11.glScalef(-1.0F, -1.0F, 1.0F);
+ this.modelMinecart.render(0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F);
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityMinecart)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderPainting.java b/source/net/minecraft/src/RenderPainting.java
new file mode 100644
index 0000000..4545f64
--- /dev/null
+++ b/source/net/minecraft/src/RenderPainting.java
@@ -0,0 +1,119 @@
+package net.minecraft.src;
+
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderPainting extends Render {
+ private Random rand = new Random();
+
+ public void a(EntityPainting var1, double var2, double var4, double var6, float var8, float var9) {
+ this.rand.setSeed(187L);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ GL11.glRotatef(var8, 0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ this.loadTexture("/art/kz.png");
+ EnumArt var10 = var1.art;
+ float var11 = 1.0F / 16.0F;
+ GL11.glScalef(var11, var11, var11);
+ this.setSizes(var1, var10.sizeX, var10.sizeY, var10.offsetX, var10.offsetY);
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ private void setSizes(EntityPainting var1, int var2, int var3, int var4, int var5) {
+ float var6 = (float)(-var2) / 2.0F;
+ float var7 = (float)(-var3) / 2.0F;
+ float var8 = -0.5F;
+ float var9 = 0.5F;
+
+ for(int var10 = 0; var10 < var2 / 16; ++var10) {
+ for(int var11 = 0; var11 < var3 / 16; ++var11) {
+ float var12 = var6 + (float)((var10 + 1) * 16);
+ float var13 = var6 + (float)(var10 * 16);
+ float var14 = var7 + (float)((var11 + 1) * 16);
+ float var15 = var7 + (float)(var11 * 16);
+ this.getOffset(var1, (var12 + var13) / 2.0F, (var14 + var15) / 2.0F);
+ float var16 = (float)(var4 + var2 - var10 * 16) / 256.0F;
+ float var17 = (float)(var4 + var2 - (var10 + 1) * 16) / 256.0F;
+ float var18 = (float)(var5 + var3 - var11 * 16) / 256.0F;
+ float var19 = (float)(var5 + var3 - (var11 + 1) * 16) / 256.0F;
+ float var20 = 12.0F / 16.0F;
+ float var21 = 13.0F / 16.0F;
+ float var22 = 0.0F;
+ float var23 = 1.0F / 16.0F;
+ float var24 = 12.0F / 16.0F;
+ float var25 = 13.0F / 16.0F;
+ float var26 = 0.001953125F;
+ float var27 = 0.001953125F;
+ float var28 = 385.0F / 512.0F;
+ float var29 = 385.0F / 512.0F;
+ float var30 = 0.0F;
+ float var31 = 1.0F / 16.0F;
+ Tessellator var32 = Tessellator.instance;
+ var32.startDrawingQuads();
+ var32.setNormal(0.0F, 0.0F, -1.0F);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var8, (double)var17, (double)var18);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var8, (double)var16, (double)var18);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var8, (double)var16, (double)var19);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var8, (double)var17, (double)var19);
+ var32.setNormal(0.0F, 0.0F, 1.0F);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var9, (double)var20, (double)var22);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var9, (double)var21, (double)var22);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var9, (double)var21, (double)var23);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var9, (double)var20, (double)var23);
+ var32.setNormal(0.0F, -1.0F, 0.0F);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var8, (double)var24, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var8, (double)var25, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var9, (double)var25, (double)var27);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var9, (double)var24, (double)var27);
+ var32.setNormal(0.0F, 1.0F, 0.0F);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var9, (double)var24, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var9, (double)var25, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var8, (double)var25, (double)var27);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var8, (double)var24, (double)var27);
+ var32.setNormal(-1.0F, 0.0F, 0.0F);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var9, (double)var29, (double)var30);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var9, (double)var29, (double)var31);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var8, (double)var28, (double)var31);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var8, (double)var28, (double)var30);
+ var32.setNormal(1.0F, 0.0F, 0.0F);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var8, (double)var29, (double)var30);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var8, (double)var29, (double)var31);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var9, (double)var28, (double)var31);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var9, (double)var28, (double)var30);
+ var32.draw();
+ }
+ }
+
+ }
+
+ private void getOffset(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.direction == 0) {
+ var4 = MathHelper.floor_double(var1.posX + (double)(var2 / 16.0F));
+ }
+
+ if(var1.direction == 1) {
+ var6 = MathHelper.floor_double(var1.posZ - (double)(var2 / 16.0F));
+ }
+
+ if(var1.direction == 2) {
+ var4 = MathHelper.floor_double(var1.posX - (double)(var2 / 16.0F));
+ }
+
+ if(var1.direction == 3) {
+ var6 = MathHelper.floor_double(var1.posZ + (double)(var2 / 16.0F));
+ }
+
+ float var7 = this.renderManager.worldObj.getBrightness(var4, var5, var6);
+ GL11.glColor3f(var7, var7, var7);
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityPainting)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderPig.java b/source/net/minecraft/src/RenderPig.java
new file mode 100644
index 0000000..66a193e
--- /dev/null
+++ b/source/net/minecraft/src/RenderPig.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class RenderPig extends RenderLiving {
+ public RenderPig(ModelBase var1, ModelBase var2, float var3) {
+ super(var1, var3);
+ this.setRenderPassModel(var2);
+ }
+
+ protected boolean a(EntityPig var1, int var2) {
+ this.loadTexture("/mob/saddle.png");
+ return var2 == 0 && var1.saddled;
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntityPig)var1, var2);
+ }
+}
diff --git a/source/net/minecraft/src/RenderPlayer.java b/source/net/minecraft/src/RenderPlayer.java
new file mode 100644
index 0000000..af1ce50
--- /dev/null
+++ b/source/net/minecraft/src/RenderPlayer.java
@@ -0,0 +1,55 @@
+package net.minecraft.src;
+
+public class RenderPlayer extends RenderLiving {
+ private ModelBiped modelBipedMain = (ModelBiped)this.mainModel;
+ private ModelBiped modelArmorChestplate = new ModelBiped(1.0F);
+ private ModelBiped modelArmor = new ModelBiped(0.5F);
+ private static final String[] armorFilenamePrefix = new String[]{"cloth", "chain", "iron", "diamond", "gold"};
+
+ public RenderPlayer() {
+ super(new ModelBiped(0.0F), 0.5F);
+ }
+
+ protected boolean a(EntityPlayer var1, int var2) {
+ ItemStack var3 = var1.inventory.armorItemInSlot(3 - var2);
+ if(var3 != null) {
+ Item var4 = var3.getItem();
+ if(var4 instanceof ItemArmor) {
+ ItemArmor var5 = (ItemArmor)var4;
+ this.loadTexture("/armor/" + armorFilenamePrefix[var5.renderIndex] + "_" + (var2 == 2 ? 2 : 1) + ".png");
+ ModelBiped var6 = var2 == 2 ? this.modelArmor : this.modelArmorChestplate;
+ var6.bipedHead.showModel = var2 == 0;
+ var6.bipedHeadwear.showModel = var2 == 0;
+ var6.bipedBody.showModel = var2 == 1 || var2 == 2;
+ var6.bipedRightArm.showModel = var2 == 1;
+ var6.bipedLeftArm.showModel = var2 == 1;
+ var6.bipedRightLeg.showModel = var2 == 2 || var2 == 3;
+ var6.bipedLeftLeg.showModel = var2 == 2 || var2 == 3;
+ this.setRenderPassModel(var6);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public void a(EntityPlayer var1, double var2, double var4, double var6, float var8, float var9) {
+ super.a(var1, var2, var4 - (double)var1.yOffset, var6, var8, var9);
+ }
+
+ public void drawFirstPersonHand() {
+ this.modelBipedMain.bipedRightArm.render(1.0F / 16.0F);
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntityPlayer)var1, var2);
+ }
+
+ public void a(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityPlayer)var1, var2, var4, var6, var8, var9);
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityPlayer)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/RenderSheep.java b/source/net/minecraft/src/RenderSheep.java
new file mode 100644
index 0000000..e7e8d6f
--- /dev/null
+++ b/source/net/minecraft/src/RenderSheep.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class RenderSheep extends RenderLiving {
+ public RenderSheep(ModelBase var1, ModelBase var2, float var3) {
+ super(var1, var3);
+ this.setRenderPassModel(var2);
+ }
+
+ protected boolean a(EntitySheep var1, int var2) {
+ this.loadTexture("/mob/sheep_fur.png");
+ return var2 == 0 && !var1.sheared;
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntitySheep)var1, var2);
+ }
+}
diff --git a/source/net/minecraft/src/RenderSorter.java b/source/net/minecraft/src/RenderSorter.java
new file mode 100644
index 0000000..04a4d3a
--- /dev/null
+++ b/source/net/minecraft/src/RenderSorter.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+import java.util.Comparator;
+
+public class RenderSorter implements Comparator {
+ private EntityPlayer entity;
+
+ public RenderSorter(EntityPlayer var1) {
+ this.entity = var1;
+ }
+
+ public int a(WorldRenderer var1, WorldRenderer var2) {
+ boolean var3 = var1.isInFrustum;
+ boolean var4 = var2.isInFrustum;
+ return var3 && !var4 ? 1 : (var4 && !var3 ? -1 : (var1.distanceToEntitySquared(this.entity) < var2.distanceToEntitySquared(this.entity) ? 1 : -1));
+ }
+
+ public int compare(Object var1, Object var2) {
+ return this.a((WorldRenderer)var1, (WorldRenderer)var2);
+ }
+}
diff --git a/source/net/minecraft/src/RenderSpider.java b/source/net/minecraft/src/RenderSpider.java
new file mode 100644
index 0000000..18972d7
--- /dev/null
+++ b/source/net/minecraft/src/RenderSpider.java
@@ -0,0 +1,38 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderSpider extends RenderLiving {
+ public RenderSpider() {
+ super(new ModelSpider(), 1.0F);
+ this.setRenderPassModel(new ModelSpider());
+ }
+
+ protected float a(EntitySpider var1) {
+ return 180.0F;
+ }
+
+ protected boolean a(EntitySpider var1, int var2) {
+ if(var2 != 0) {
+ return false;
+ } else if(var2 != 0) {
+ return false;
+ } else {
+ this.loadTexture("/mob/spider_eyes.png");
+ float var3 = (1.0F - var1.getEntityBrightness(1.0F)) * 0.5F;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, var3);
+ return true;
+ }
+ }
+
+ protected float getMaxDeathRotation(EntityLiving var1) {
+ return this.a((EntitySpider)var1);
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntitySpider)var1, var2);
+ }
+}
diff --git a/source/net/minecraft/src/RenderTNTPrimed.java b/source/net/minecraft/src/RenderTNTPrimed.java
new file mode 100644
index 0000000..b93ef70
--- /dev/null
+++ b/source/net/minecraft/src/RenderTNTPrimed.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderTNTPrimed extends Render {
+ private RenderBlocks blockRenderer = new RenderBlocks();
+
+ public RenderTNTPrimed() {
+ this.shadowSize = 0.5F;
+ }
+
+ public void a(EntityTNTPrimed var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ 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) {
+ var10 = 0.0F;
+ }
+
+ if(var10 > 1.0F) {
+ var10 = 1.0F;
+ }
+
+ var10 *= var10;
+ var10 *= var10;
+ float var11 = 1.0F + var10 * 0.3F;
+ GL11.glScalef(var11, var11, var11);
+ }
+
+ var10 = (1.0F - ((float)var1.fuse - var9 + 1.0F) / 100.0F) * 0.8F;
+ this.loadTexture("/terrain.png");
+ this.blockRenderer.renderBlockOnInventory(Block.tnt);
+ if(var1.fuse / 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, var10);
+ this.blockRenderer.renderBlockOnInventory(Block.tnt);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityTNTPrimed)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/source/net/minecraft/src/ScaledResolution.java b/source/net/minecraft/src/ScaledResolution.java
new file mode 100644
index 0000000..7d6ed74
--- /dev/null
+++ b/source/net/minecraft/src/ScaledResolution.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ScaledResolution {
+ private int scaledWidth;
+ private int scaledHeight;
+
+ public ScaledResolution(int var1, int var2) {
+ this.scaledWidth = var1;
+ this.scaledHeight = var2;
+
+ int var3;
+ for(var3 = 1; this.scaledWidth / (var3 + 1) >= 320 && this.scaledHeight / (var3 + 1) >= 240; ++var3) {
+ }
+
+ this.scaledWidth /= var3;
+ this.scaledHeight /= var3;
+ }
+
+ public int getScaledWidth() {
+ return this.scaledWidth;
+ }
+
+ public int getScaledHeight() {
+ return this.scaledHeight;
+ }
+}
diff --git a/source/net/minecraft/src/Session.java b/source/net/minecraft/src/Session.java
new file mode 100644
index 0000000..853aa65
--- /dev/null
+++ b/source/net/minecraft/src/Session.java
@@ -0,0 +1,48 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Session {
+ public static List registeredBlocksList = new ArrayList();
+ public String username;
+ public String sessionId;
+ public String mpPassParameter;
+
+ public Session(String var1, String var2) {
+ this.username = var1;
+ this.sessionId = var2;
+ }
+
+ static {
+ registeredBlocksList.add(Block.stone);
+ registeredBlocksList.add(Block.cobblestone);
+ registeredBlocksList.add(Block.brick);
+ registeredBlocksList.add(Block.dirt);
+ registeredBlocksList.add(Block.planks);
+ registeredBlocksList.add(Block.wood);
+ registeredBlocksList.add(Block.leaves);
+ registeredBlocksList.add(Block.torch);
+ registeredBlocksList.add(Block.stairSingle);
+ registeredBlocksList.add(Block.glass);
+ registeredBlocksList.add(Block.cobblestoneMossy);
+ registeredBlocksList.add(Block.sapling);
+ registeredBlocksList.add(Block.plantYellow);
+ registeredBlocksList.add(Block.plantRed);
+ registeredBlocksList.add(Block.mushroomBrown);
+ registeredBlocksList.add(Block.mushroomRed);
+ registeredBlocksList.add(Block.sand);
+ registeredBlocksList.add(Block.gravel);
+ registeredBlocksList.add(Block.sponge);
+ registeredBlocksList.add(Block.cloth);
+ registeredBlocksList.add(Block.oreCoal);
+ registeredBlocksList.add(Block.oreIron);
+ registeredBlocksList.add(Block.oreGold);
+ registeredBlocksList.add(Block.blockSteel);
+ registeredBlocksList.add(Block.blockGold);
+ registeredBlocksList.add(Block.bookshelf);
+ registeredBlocksList.add(Block.tnt);
+ registeredBlocksList.add(Block.obsidian);
+ System.out.println(registeredBlocksList.size());
+ }
+}
diff --git a/source/net/minecraft/src/SignModel.java b/source/net/minecraft/src/SignModel.java
new file mode 100644
index 0000000..9325b7b
--- /dev/null
+++ b/source/net/minecraft/src/SignModel.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class SignModel {
+ public ModelRenderer signBoard = new ModelRenderer(0, 0);
+ public ModelRenderer signStick;
+
+ public SignModel() {
+ this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F);
+ this.signStick = new ModelRenderer(0, 14);
+ this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F);
+ }
+
+ public void renderSign() {
+ this.signBoard.render(1.0F / 16.0F);
+ this.signStick.render(1.0F / 16.0F);
+ }
+}
diff --git a/source/net/minecraft/src/Slot.java b/source/net/minecraft/src/Slot.java
new file mode 100644
index 0000000..543f4ca
--- /dev/null
+++ b/source/net/minecraft/src/Slot.java
@@ -0,0 +1,50 @@
+package net.minecraft.src;
+
+public class Slot {
+ public final int slotIndex;
+ public final int xDisplayPosition;
+ public final int yDisplayPosition;
+ public final IInventory inventory;
+ private final GuiContainer inventoryGui;
+
+ public Slot(GuiContainer var1, IInventory var2, int var3, int var4, int var5) {
+ this.inventoryGui = var1;
+ this.inventory = var2;
+ this.slotIndex = var3;
+ this.xDisplayPosition = var4;
+ this.yDisplayPosition = var5;
+ }
+
+ public boolean getIsMouseOverSlot(int var1, int var2) {
+ int var3 = (this.inventoryGui.width - this.inventoryGui.xSize) / 2;
+ int var4 = (this.inventoryGui.height - this.inventoryGui.ySize) / 2;
+ var1 -= var3;
+ var2 -= var4;
+ return var1 >= this.xDisplayPosition - 1 && var1 < this.xDisplayPosition + 16 + 1 && var2 >= this.yDisplayPosition - 1 && var2 < this.yDisplayPosition + 16 + 1;
+ }
+
+ public void onPickupFromSlot() {
+ this.onSlotChanged();
+ }
+
+ public boolean isItemValid(ItemStack var1) {
+ return true;
+ }
+
+ public ItemStack getStack() {
+ return this.inventory.getStackInSlot(this.slotIndex);
+ }
+
+ public void putStack(ItemStack var1) {
+ this.inventory.setInventorySlotContents(this.slotIndex, var1);
+ this.onSlotChanged();
+ }
+
+ public int getBackgroundIconIndex() {
+ return -1;
+ }
+
+ public void onSlotChanged() {
+ this.inventory.onInventoryChanged();
+ }
+}
diff --git a/source/net/minecraft/src/SlotArmor.java b/source/net/minecraft/src/SlotArmor.java
new file mode 100644
index 0000000..cf2689f
--- /dev/null
+++ b/source/net/minecraft/src/SlotArmor.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+class SlotArmor extends Slot {
+ final int armorType;
+ final GuiInventory guiInventory;
+
+ SlotArmor(GuiInventory var1, GuiContainer var2, IInventory var3, int var4, int var5, int var6, int var7) {
+ super(var2, var3, var4, var5, var6);
+ this.guiInventory = var1;
+ this.armorType = var7;
+ }
+
+ public boolean isItemValid(ItemStack var1) {
+ return var1.getItem() instanceof ItemArmor ? ((ItemArmor)var1.getItem()).armorType == this.armorType : false;
+ }
+
+ public int getBackgroundIconIndex() {
+ return 15 + this.armorType * 16;
+ }
+}
diff --git a/source/net/minecraft/src/SlotCrafting.java b/source/net/minecraft/src/SlotCrafting.java
new file mode 100644
index 0000000..4a49dc1
--- /dev/null
+++ b/source/net/minecraft/src/SlotCrafting.java
@@ -0,0 +1,23 @@
+package net.minecraft.src;
+
+class SlotCrafting extends Slot {
+ private final IInventory craftMatrix;
+
+ public SlotCrafting(GuiContainer var1, IInventory var2, IInventory var3, int var4, int var5, int var6) {
+ super(var1, var3, var4, var5, var6);
+ this.craftMatrix = var2;
+ }
+
+ public boolean isItemValid(ItemStack var1) {
+ return false;
+ }
+
+ public void onPickupFromSlot() {
+ for(int var1 = 0; var1 < this.craftMatrix.getSizeInventory(); ++var1) {
+ if(this.craftMatrix.getStackInSlot(var1) != null) {
+ this.craftMatrix.decrStackSize(var1, 1);
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/SoundManager.java b/source/net/minecraft/src/SoundManager.java
new file mode 100644
index 0000000..17d5492
--- /dev/null
+++ b/source/net/minecraft/src/SoundManager.java
@@ -0,0 +1,138 @@
+package net.minecraft.src;
+
+import java.io.File;
+import paulscode.sound.SoundSystem;
+import paulscode.sound.SoundSystemConfig;
+import paulscode.sound.codecs.CodecJOrbis;
+import paulscode.sound.codecs.CodecWav;
+import paulscode.sound.libraries.LibraryLWJGLOpenAL;
+
+public class SoundManager {
+ private SoundSystem sndSystem;
+ private SoundPool soundPoolSounds = new SoundPool();
+ private SoundPool soundPoolMusic = new SoundPool();
+ private int latestSoundID = 0;
+ private GameSettings options;
+ private boolean loaded = false;
+
+ public void loadSoundSettings(GameSettings var1) {
+ this.options = var1;
+ if(!this.loaded && (var1.sound || var1.music)) {
+ this.tryToSetLibraryAndCodecs();
+ }
+
+ }
+
+ private void tryToSetLibraryAndCodecs() {
+ try {
+ boolean var1 = this.options.sound;
+ boolean var2 = this.options.music;
+ this.options.sound = false;
+ this.options.music = false;
+ this.options.saveOptions();
+ SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
+ SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
+ SoundSystemConfig.setCodec("wav", CodecWav.class);
+ this.sndSystem = new SoundSystem();
+ this.options.sound = var1;
+ this.options.music = var2;
+ this.options.saveOptions();
+ } catch (Throwable var3) {
+ System.err.println("error linking with the LibraryJavaSound plug-in");
+ }
+
+ this.loaded = true;
+ }
+
+ public void onSoundOptionsChanged() {
+ if(!this.loaded && (this.options.sound || this.options.music)) {
+ this.tryToSetLibraryAndCodecs();
+ }
+
+ if(!this.options.music) {
+ this.sndSystem.stop("BgMusic");
+ }
+
+ }
+
+ public void closeMinecraft() {
+ if(this.loaded) {
+ this.sndSystem.cleanup();
+ }
+
+ }
+
+ public void addSound(String var1, File var2) {
+ this.soundPoolSounds.addSound(var1, var2);
+ }
+
+ public void addMusic(String var1, File var2) {
+ this.soundPoolMusic.addSound(var1, var2);
+ }
+
+ public void setListener(EntityLiving var1, float var2) {
+ if(this.loaded && this.options.sound) {
+ if(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);
+ float var13 = MathHelper.cos(-var3 * ((float)Math.PI / 180.0F));
+ float var14 = MathHelper.sin(-var3 * ((float)Math.PI / 180.0F));
+ float var15 = -var12 * var13;
+ float var17 = -var11 * var13;
+ float var18 = -var12 * var14;
+ float var20 = -var11 * var14;
+ this.sndSystem.setListenerPosition((float)var5, (float)var7, (float)var9);
+ this.sndSystem.setListenerOrientation(var15, var14, var17, var18, var13, var20);
+ }
+ }
+ }
+
+ public void playSound(String var1, float var2, float var3, float var4, float var5, float var6) {
+ if(this.loaded && this.options.sound) {
+ 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.sndSystem.newSource(var5 > 1.0F, var8, var7.soundUrl, var7.soundName, false, var2, var3, var4, 2, var9);
+ this.sndSystem.setPitch(var8, var6);
+ if(var5 > 1.0F) {
+ var5 = 1.0F;
+ }
+
+ this.sndSystem.setVolume(var8, var5);
+ this.sndSystem.play(var8);
+ }
+
+ }
+ }
+
+ public void playSoundFX(String var1, float var2, float var3) {
+ if(this.loaded && this.options.sound) {
+ SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(var1);
+ if(var4 != null) {
+ this.latestSoundID = (this.latestSoundID + 1) % 256;
+ String var5 = "sound_" + this.latestSoundID;
+ this.sndSystem.newSource(false, var5, var4.soundUrl, var4.soundName, false, 0.0F, 0.0F, 0.0F, 0, 0.0F);
+ if(var2 > 1.0F) {
+ var2 = 1.0F;
+ }
+
+ var2 *= 0.25F;
+ this.sndSystem.setPitch(var5, var3);
+ this.sndSystem.setVolume(var5, var2);
+ this.sndSystem.play(var5);
+ }
+
+ }
+ }
+}
diff --git a/source/net/minecraft/src/SoundPool.java b/source/net/minecraft/src/SoundPool.java
new file mode 100644
index 0000000..ab70ae6
--- /dev/null
+++ b/source/net/minecraft/src/SoundPool.java
@@ -0,0 +1,42 @@
+package net.minecraft.src;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+public class SoundPool {
+ private Random rand = new Random();
+ private Map nameToSoundPoolEntriesMapping = new HashMap();
+ public int numberOfSoundPoolEntries = 0;
+
+ public SoundPoolEntry addSound(String var1, File var2) {
+ try {
+ String var3 = var1;
+
+ for(var1 = var1.substring(0, var1.indexOf(".")); Character.isDigit(var1.charAt(var1.length() - 1)); var1 = var1.substring(0, var1.length() - 1)) {
+ }
+
+ var1 = var1.replaceAll("/", ".");
+ if(!this.nameToSoundPoolEntriesMapping.containsKey(var1)) {
+ this.nameToSoundPoolEntriesMapping.put(var1, new ArrayList());
+ }
+
+ SoundPoolEntry var4 = new SoundPoolEntry(var3, var2.toURI().toURL());
+ ((List)this.nameToSoundPoolEntriesMapping.get(var1)).add(var4);
+ ++this.numberOfSoundPoolEntries;
+ return var4;
+ } catch (MalformedURLException var5) {
+ var5.printStackTrace();
+ throw new RuntimeException(var5);
+ }
+ }
+
+ public SoundPoolEntry getRandomSoundFromSoundPool(String var1) {
+ List var2 = (List)this.nameToSoundPoolEntriesMapping.get(var1);
+ return var2 == null ? null : (SoundPoolEntry)var2.get(this.rand.nextInt(var2.size()));
+ }
+}
diff --git a/source/net/minecraft/src/SoundPoolEntry.java b/source/net/minecraft/src/SoundPoolEntry.java
new file mode 100644
index 0000000..341e9ba
--- /dev/null
+++ b/source/net/minecraft/src/SoundPoolEntry.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.net.URL;
+
+public class SoundPoolEntry {
+ public String soundName;
+ public URL soundUrl;
+
+ public SoundPoolEntry(String var1, URL var2) {
+ this.soundName = var1;
+ this.soundUrl = var2;
+ }
+}
diff --git a/source/net/minecraft/src/SpawnerAnimals.java b/source/net/minecraft/src/SpawnerAnimals.java
new file mode 100644
index 0000000..8acc13f
--- /dev/null
+++ b/source/net/minecraft/src/SpawnerAnimals.java
@@ -0,0 +1,97 @@
+package net.minecraft.src;
+
+public class SpawnerAnimals {
+ private int maxSpawns;
+ private Class entityType;
+ private Class[] entities;
+
+ public SpawnerAnimals(int var1, Class var2, Class[] var3) {
+ this.maxSpawns = var1;
+ this.entityType = var2;
+ this.entities = var3;
+ }
+
+ public void onUpdate(World var1) {
+ int var2 = var1.countEntities(this.entityType);
+ if(var2 < this.maxSpawns) {
+ for(int var3 = 0; var3 < 10; ++var3) {
+ this.performSpawning(var1, 1, var1.playerEntity, (IProgressUpdate)null);
+ }
+ }
+
+ }
+
+ protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
+ int var4 = var2 + var1.rand.nextInt(256) - 128;
+ int var5 = var1.rand.nextInt(128);
+ int var6 = var3 + var1.rand.nextInt(256) - 128;
+ return new ChunkPosition(var4, var5, var6);
+ }
+
+ private int performSpawning(World var1, int var2, Entity var3, IProgressUpdate var4) {
+ int var5 = 0;
+ int var6 = MathHelper.floor_double(var3.posX);
+ int var7 = MathHelper.floor_double(var3.posZ);
+ int var8 = var1.rand.nextInt(this.entities.length);
+ ChunkPosition var9 = this.getRandomSpawningPointInChunk(var1, var6, var7);
+ int var10 = var9.x;
+ int var11 = var9.y;
+ int var12 = var9.z;
+ if(var1.isBlockNormalCube(var10, var11, var12)) {
+ return 0;
+ } else if(var1.getBlockMaterial(var10, var11, var12) != Material.air) {
+ return 0;
+ } else {
+ for(int var13 = 0; var13 < 3; ++var13) {
+ int var14 = var10;
+ int var15 = var11;
+ int var16 = var12;
+ byte var17 = 6;
+
+ for(int var18 = 0; var18 < 3; ++var18) {
+ var14 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17);
+ var15 += var1.rand.nextInt(1) - var1.rand.nextInt(1);
+ var16 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17);
+ if(var1.isBlockNormalCube(var14, var15 - 1, var16) && !var1.isBlockNormalCube(var14, var15, var16) && !var1.getBlockMaterial(var14, var15, var16).getIsLiquid() && !var1.isBlockNormalCube(var14, var15 + 1, var16)) {
+ float var19 = (float)var14 + 0.5F;
+ float var20 = (float)var15 + 1.0F;
+ float var21 = (float)var16 + 0.5F;
+ if(var3 != null) {
+ double var22 = (double)var19 - var3.posX;
+ double var24 = (double)var20 - var3.posY;
+ double var26 = (double)var21 - var3.posZ;
+ double var28 = var22 * var22 + var24 * var24 + var26 * var26;
+ if(var28 < 1024.0D) {
+ continue;
+ }
+ } else {
+ float var31 = var19 - (float)var1.spawnX;
+ float var23 = var20 - (float)var1.spawnY;
+ float var33 = var21 - (float)var1.spawnZ;
+ float var25 = var31 * var31 + var23 * var23 + var33 * var33;
+ if(var25 < 1024.0F) {
+ continue;
+ }
+ }
+
+ EntityLiving var32;
+ try {
+ var32 = (EntityLiving)this.entities[var8].getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
+ } catch (Exception var30) {
+ var30.printStackTrace();
+ return var5;
+ }
+
+ var32.setPositionAndRotation((double)var19, (double)var20, (double)var21, var1.rand.nextFloat() * 360.0F, 0.0F);
+ if(var32.getCanSpawnHere((double)var19, (double)var20, (double)var21)) {
+ ++var5;
+ var1.spawnEntityInWorld(var32);
+ }
+ }
+ }
+ }
+
+ return var5;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/SpawnerMonsters.java b/source/net/minecraft/src/SpawnerMonsters.java
new file mode 100644
index 0000000..d253214
--- /dev/null
+++ b/source/net/minecraft/src/SpawnerMonsters.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+class SpawnerMonsters extends SpawnerAnimals {
+ final PlayerControllerSP playerController;
+
+ SpawnerMonsters(PlayerControllerSP var1, int var2, Class var3, Class[] var4) {
+ super(var2, var3, var4);
+ this.playerController = var1;
+ }
+
+ protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
+ int var4 = var2 + var1.rand.nextInt(256) - 128;
+ int var5 = var1.rand.nextInt(var1.rand.nextInt(var1.rand.nextInt(112) + 8) + 8);
+ int var6 = var3 + var1.rand.nextInt(256) - 128;
+ return new ChunkPosition(var4, var5, var6);
+ }
+}
diff --git a/source/net/minecraft/src/StepSound.java b/source/net/minecraft/src/StepSound.java
new file mode 100644
index 0000000..ad50bb0
--- /dev/null
+++ b/source/net/minecraft/src/StepSound.java
@@ -0,0 +1,29 @@
+package net.minecraft.src;
+
+public class StepSound {
+ public final String stepSoundName;
+ public final float stepSoundVolume;
+ public final float stepSoundPitch;
+
+ public StepSound(String var1, float var2, float var3) {
+ this.stepSoundName = var1;
+ this.stepSoundVolume = var2;
+ this.stepSoundPitch = var3;
+ }
+
+ public float getVolume() {
+ return this.stepSoundVolume;
+ }
+
+ public float getPitch() {
+ return this.stepSoundPitch;
+ }
+
+ public String getBreakSound() {
+ return "step." + this.stepSoundName;
+ }
+
+ public String getStepSound() {
+ return "step." + this.stepSoundName;
+ }
+}
diff --git a/source/net/minecraft/src/StepSoundGlass.java b/source/net/minecraft/src/StepSoundGlass.java
new file mode 100644
index 0000000..a7f7d81
--- /dev/null
+++ b/source/net/minecraft/src/StepSoundGlass.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+final class StepSoundGlass extends StepSound {
+ StepSoundGlass(String var1, float var2, float var3) {
+ super(var1, var2, var3);
+ }
+
+ public String getBreakSound() {
+ return "random.glass";
+ }
+}
diff --git a/source/net/minecraft/src/StepSoundSand.java b/source/net/minecraft/src/StepSoundSand.java
new file mode 100644
index 0000000..f1e2705
--- /dev/null
+++ b/source/net/minecraft/src/StepSoundSand.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+final class StepSoundSand extends StepSound {
+ StepSoundSand(String var1, float var2, float var3) {
+ super(var1, var2, var3);
+ }
+
+ public String getBreakSound() {
+ return "step.gravel";
+ }
+}
diff --git a/source/net/minecraft/src/TerrainTextureManager.java b/source/net/minecraft/src/TerrainTextureManager.java
new file mode 100644
index 0000000..e6acf43
--- /dev/null
+++ b/source/net/minecraft/src/TerrainTextureManager.java
@@ -0,0 +1,214 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.Arrays;
+import javax.imageio.ImageIO;
+
+public class TerrainTextureManager {
+ private float[] texCols = new float[768];
+ private int[] pixels = new int[5120];
+ private int[] zBuf = new int[5120];
+ private int[] waterBuf = new int[5120];
+ private int[] waterBr = new int[5120];
+ private int[] yBuf = new int[34];
+ private int[] textures = new int[768];
+
+ public TerrainTextureManager() {
+ try {
+ BufferedImage var1 = ImageIO.read(TerrainTextureManager.class.getResource("/terrain.png"));
+ int[] var2 = new int[65536];
+ var1.getRGB(0, 0, 256, 256, var2, 0, 256);
+
+ for(int var3 = 0; var3 < 256; ++var3) {
+ int var4 = 0;
+ int var5 = 0;
+ int var6 = 0;
+ int var7 = var3 % 16 * 16;
+ int var8 = var3 / 16 * 16;
+ int var9 = 0;
+
+ for(int var10 = 0; var10 < 16; ++var10) {
+ for(int var11 = 0; var11 < 16; ++var11) {
+ int var12 = var2[var11 + var7 + (var10 + var8) * 256];
+ int var13 = var12 >> 24 & 255;
+ if(var13 > 128) {
+ var4 += var12 >> 16 & 255;
+ var5 += var12 >> 8 & 255;
+ var6 += var12 & 255;
+ ++var9;
+ }
+ }
+
+ if(var9 == 0) {
+ ++var9;
+ }
+
+ this.texCols[var3 * 3 + 0] = (float)(var4 / var9);
+ this.texCols[var3 * 3 + 1] = (float)(var5 / var9);
+ this.texCols[var3 * 3 + 2] = (float)(var6 / var9);
+ }
+ }
+ } catch (IOException var14) {
+ var14.printStackTrace();
+ }
+
+ for(int var15 = 0; var15 < 256; ++var15) {
+ if(Block.blocksList[var15] != null) {
+ this.textures[var15 * 3 + 0] = Block.blocksList[var15].getBlockTextureFromSide(1);
+ this.textures[var15 * 3 + 1] = Block.blocksList[var15].getBlockTextureFromSide(2);
+ this.textures[var15 * 3 + 2] = Block.blocksList[var15].getBlockTextureFromSide(3);
+ }
+ }
+
+ }
+
+ public void render(IsoImageBuffer var1) {
+ World var2 = var1.level;
+ if(var2 == null) {
+ var1.noContent = true;
+ var1.rendered = true;
+ } else {
+ int var3 = var1.chunkX * 16;
+ int var4 = var1.chunkZ * 16;
+ int var5 = var3 + 16;
+ int var6 = var4 + 16;
+ Chunk var7 = var2.getChunkFromChunkCoords(var1.chunkX, var1.chunkZ);
+ if(var7.isChunkRendered) {
+ var1.noContent = true;
+ var1.rendered = true;
+ } else {
+ var1.noContent = false;
+ Arrays.fill(this.zBuf, 0);
+ Arrays.fill(this.waterBuf, 0);
+ Arrays.fill(this.yBuf, 160);
+
+ for(int var8 = var6 - 1; var8 >= var4; --var8) {
+ for(int var9 = var5 - 1; var9 >= var3; --var9) {
+ int var10 = var9 - var3;
+ int var11 = var8 - var4;
+ int var12 = var10 + var11;
+ boolean var13 = true;
+
+ for(int var14 = 0; var14 < 128; ++var14) {
+ int var15 = var11 - var10 - var14 + 160 - 16;
+ if(var15 < this.yBuf[var12] || var15 < this.yBuf[var12 + 1]) {
+ Block var16 = Block.blocksList[var2.getBlockId(var9, var14, var8)];
+ if(var16 == null) {
+ var13 = false;
+ } else if(var16.blockMaterial == Material.water) {
+ int var24 = var2.getBlockId(var9, var14 + 1, var8);
+ if(var24 == 0 || Block.blocksList[var24].blockMaterial != Material.water) {
+ float var25 = (float)var14 / 127.0F * 0.6F + 0.4F;
+ float var26 = var2.getBrightness(var9, var14 + 1, var8) * var25;
+ if(var15 >= 0 && var15 < 160) {
+ int var27 = var12 + var15 * 32;
+ if(var12 >= 0 && var12 <= 32 && this.waterBuf[var27] <= var14) {
+ this.waterBuf[var27] = var14;
+ this.waterBr[var27] = (int)(var26 * 127.0F);
+ }
+
+ if(var12 >= -1 && var12 <= 31 && this.waterBuf[var27 + 1] <= var14) {
+ this.waterBuf[var27 + 1] = var14;
+ this.waterBr[var27 + 1] = (int)(var26 * 127.0F);
+ }
+
+ var13 = false;
+ }
+ }
+ } else {
+ if(var13) {
+ if(var15 < this.yBuf[var12]) {
+ this.yBuf[var12] = var15;
+ }
+
+ if(var15 < this.yBuf[var12 + 1]) {
+ this.yBuf[var12 + 1] = var15;
+ }
+ }
+
+ float var17 = (float)var14 / 127.0F * 0.6F + 0.4F;
+ int var18;
+ int var19;
+ float var20;
+ float var22;
+ if(var15 >= 0 && var15 < 160) {
+ var18 = var12 + var15 * 32;
+ var19 = this.textures[var16.blockID * 3 + 0];
+ var20 = (var2.getBrightness(var9, var14 + 1, var8) * 0.8F + 0.2F) * var17;
+ if(var12 >= 0 && this.zBuf[var18] <= var14) {
+ this.zBuf[var18] = var14;
+ this.pixels[var18] = -16777216 | (int)(this.texCols[var19 * 3 + 0] * var20) << 16 | (int)(this.texCols[var19 * 3 + 1] * var20) << 8 | (int)(this.texCols[var19 * 3 + 2] * var20);
+ }
+
+ if(var12 < 31) {
+ var22 = var20 * 0.9F;
+ if(this.zBuf[var18 + 1] <= var14) {
+ this.zBuf[var18 + 1] = var14;
+ this.pixels[var18 + 1] = -16777216 | (int)(this.texCols[var19 * 3 + 0] * var22) << 16 | (int)(this.texCols[var19 * 3 + 1] * var22) << 8 | (int)(this.texCols[var19 * 3 + 2] * var22);
+ }
+ }
+ }
+
+ if(var15 >= -1 && var15 < 159) {
+ var18 = var12 + (var15 + 1) * 32;
+ var19 = this.textures[var16.blockID * 3 + 1];
+ var20 = var2.getBrightness(var9 - 1, var14, var8) * 0.8F + 0.2F;
+ int var21 = this.textures[var16.blockID * 3 + 2];
+ var22 = var2.getBrightness(var9, var14, var8 + 1) * 0.8F + 0.2F;
+ float var23;
+ if(var12 >= 0) {
+ var23 = var20 * var17 * 0.6F;
+ if(this.zBuf[var18] <= var14 - 1) {
+ this.zBuf[var18] = var14 - 1;
+ this.pixels[var18] = -16777216 | (int)(this.texCols[var19 * 3 + 0] * var23) << 16 | (int)(this.texCols[var19 * 3 + 1] * var23) << 8 | (int)(this.texCols[var19 * 3 + 2] * var23);
+ }
+ }
+
+ if(var12 < 31) {
+ var23 = var22 * 0.9F * var17 * 0.4F;
+ if(this.zBuf[var18 + 1] <= var14 - 1) {
+ this.zBuf[var18 + 1] = var14 - 1;
+ this.pixels[var18 + 1] = -16777216 | (int)(this.texCols[var21 * 3 + 0] * var23) << 16 | (int)(this.texCols[var21 * 3 + 1] * var23) << 8 | (int)(this.texCols[var21 * 3 + 2] * var23);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ this.postProcess();
+ if(var1.image == null) {
+ var1.image = new BufferedImage(32, 160, 2);
+ }
+
+ var1.image.setRGB(0, 0, 32, 160, this.pixels, 0, 32);
+ var1.rendered = true;
+ }
+ }
+ }
+
+ private void postProcess() {
+ for(int var1 = 0; var1 < 32; ++var1) {
+ for(int var2 = 0; var2 < 160; ++var2) {
+ int var3 = var1 + var2 * 32;
+ if(this.zBuf[var3] == 0) {
+ this.pixels[var3] = 0;
+ }
+
+ if(this.waterBuf[var3] > this.zBuf[var3]) {
+ int var4 = this.pixels[var3] >> 24 & 255;
+ this.pixels[var3] = ((this.pixels[var3] & 16711422) >> 1) + this.waterBr[var3];
+ if(var4 < 128) {
+ this.pixels[var3] = Integer.MIN_VALUE + this.waterBr[var3] * 2;
+ } else {
+ this.pixels[var3] |= -16777216;
+ }
+ }
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/Tessellator.java b/source/net/minecraft/src/Tessellator.java
new file mode 100644
index 0000000..0ca7e03
--- /dev/null
+++ b/source/net/minecraft/src/Tessellator.java
@@ -0,0 +1,298 @@
+package net.minecraft.src;
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import org.lwjgl.opengl.ARBVertexBufferObject;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL15;
+import org.lwjgl.opengl.GLContext;
+
+public class Tessellator {
+ private static boolean convertQuadsToTriangles = true;
+ private static boolean tryVBO = false;
+ private ByteBuffer byteBuffer;
+ private IntBuffer intBuffer;
+ private FloatBuffer floatBuffer;
+ private int[] rawBuffer;
+ private int vertexCount = 0;
+ private double textureU;
+ private double textureV;
+ private int color;
+ private boolean hasColor = false;
+ private boolean hasTexture = false;
+ private boolean hasNormals = false;
+ private int rawBufferIndex = 0;
+ private int addedVertices = 0;
+ private boolean isColorDisabled = false;
+ private int drawMode;
+ private double xOffset;
+ private double yOffset;
+ private double zOffset;
+ private int normal;
+ public static final Tessellator instance = new Tessellator(2097152);
+ private boolean isDrawing = false;
+ private boolean useVBO = false;
+ private IntBuffer vertexBuffers;
+ private int vboIndex = 0;
+ private int vboCount = 10;
+ private int bufferSize;
+
+ private Tessellator(int var1) {
+ this.bufferSize = var1;
+ this.byteBuffer = GLAllocation.createDirectByteBuffer(var1 * 4);
+ this.intBuffer = this.byteBuffer.asIntBuffer();
+ this.floatBuffer = this.byteBuffer.asFloatBuffer();
+ this.rawBuffer = new int[var1];
+ this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
+ if(this.useVBO) {
+ this.vertexBuffers = GLAllocation.createIntBuffer(this.vboCount);
+ ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers);
+ }
+
+ }
+
+ public void draw() {
+ if(!this.isDrawing) {
+ throw new IllegalStateException("Not tesselating!");
+ } else {
+ this.isDrawing = false;
+ if(this.vertexCount > 0) {
+ 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.vertexBuffers.get(this.vboIndex));
+ ARBVertexBufferObject.glBufferDataARB(GL15.GL_ARRAY_BUFFER, this.byteBuffer, GL15.GL_STREAM_DRAW);
+ }
+
+ if(this.hasTexture) {
+ if(this.useVBO) {
+ GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 32, 12L);
+ } else {
+ this.floatBuffer.position(3);
+ GL11.glTexCoordPointer(2, 32, (FloatBuffer)this.floatBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
+ }
+
+ if(this.hasColor) {
+ if(this.useVBO) {
+ GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 32, 20L);
+ } else {
+ this.byteBuffer.position(20);
+ GL11.glColorPointer(4, true, 32, this.byteBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
+ }
+
+ if(this.hasNormals) {
+ if(this.useVBO) {
+ GL11.glNormalPointer(GL11.GL_BYTE, 32, 24L);
+ } else {
+ this.byteBuffer.position(24);
+ GL11.glNormalPointer(32, (ByteBuffer)this.byteBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
+ }
+
+ if(this.useVBO) {
+ GL11.glVertexPointer(3, GL11.GL_FLOAT, 32, 0L);
+ } else {
+ this.floatBuffer.position(0);
+ GL11.glVertexPointer(3, 32, (FloatBuffer)this.floatBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
+ if(this.drawMode == 7 && convertQuadsToTriangles) {
+ GL11.glDrawArrays(GL11.GL_TRIANGLES, GL11.GL_POINTS, this.vertexCount);
+ } else {
+ GL11.glDrawArrays(this.drawMode, GL11.GL_POINTS, this.vertexCount);
+ }
+
+ GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
+ if(this.hasTexture) {
+ GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
+ }
+
+ if(this.hasColor) {
+ GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
+ }
+
+ if(this.hasNormals) {
+ GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
+ }
+ }
+
+ this.reset();
+ }
+ }
+
+ private void reset() {
+ this.vertexCount = 0;
+ this.byteBuffer.clear();
+ this.rawBufferIndex = 0;
+ this.addedVertices = 0;
+ }
+
+ public void startDrawingQuads() {
+ this.startDrawing(7);
+ }
+
+ public void startDrawing(int var1) {
+ if(this.isDrawing) {
+ throw new IllegalStateException("Already tesselating!");
+ } else {
+ this.isDrawing = true;
+ this.reset();
+ this.drawMode = var1;
+ this.hasNormals = false;
+ this.hasColor = false;
+ this.hasTexture = false;
+ this.isColorDisabled = false;
+ }
+ }
+
+ public void setTextureUV(double var1, double var3) {
+ this.hasTexture = true;
+ this.textureU = var1;
+ this.textureV = var3;
+ }
+
+ 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.hasColor = true;
+ this.color = var4 << 24 | var3 << 16 | var2 << 8 | var1;
+ }
+ }
+
+ public void addVertexWithUV(double var1, double var3, double var5, double var7, double var9) {
+ this.setTextureUV(var7, var9);
+ this.addVertex(var1, var3, var5);
+ }
+
+ public void addVertex(double var1, double var3, double var5) {
+ ++this.addedVertices;
+ if(this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0) {
+ for(int var7 = 0; var7 < 2; ++var7) {
+ int var8 = 8 * (3 - var7);
+ 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.hasColor) {
+ this.rawBuffer[this.rawBufferIndex + 5] = this.rawBuffer[this.rawBufferIndex - var8 + 5];
+ }
+
+ this.rawBuffer[this.rawBufferIndex + 0] = this.rawBuffer[this.rawBufferIndex - var8 + 0];
+ this.rawBuffer[this.rawBufferIndex + 1] = this.rawBuffer[this.rawBufferIndex - var8 + 1];
+ this.rawBuffer[this.rawBufferIndex + 2] = this.rawBuffer[this.rawBufferIndex - var8 + 2];
+ ++this.vertexCount;
+ this.rawBufferIndex += 8;
+ }
+ }
+
+ 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.hasColor) {
+ this.rawBuffer[this.rawBufferIndex + 5] = this.color;
+ }
+
+ 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.rawBufferIndex += 8;
+ ++this.vertexCount;
+ 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;
+ this.setColorOpaque(var2, var3, var4);
+ }
+
+ public void disableColor() {
+ this.isColorDisabled = true;
+ }
+
+ public void setNormal(float var1, float var2, float var3) {
+ if(!this.isDrawing) {
+ System.out.println("But..");
+ }
+
+ this.hasNormals = true;
+ byte var4 = (byte)((int)(var1 * 128.0F));
+ byte var5 = (byte)((int)(var2 * 127.0F));
+ byte var6 = (byte)((int)(var3 * 127.0F));
+ this.normal = var4 | var5 << 8 | var6 << 16;
+ }
+
+ public void setTranslationD(double var1, double var3, double var5) {
+ this.xOffset = var1;
+ this.yOffset = var3;
+ this.zOffset = var5;
+ }
+}
diff --git a/source/net/minecraft/src/TextureFX.java b/source/net/minecraft/src/TextureFX.java
new file mode 100644
index 0000000..0396745
--- /dev/null
+++ b/source/net/minecraft/src/TextureFX.java
@@ -0,0 +1,16 @@
+package net.minecraft.src;
+
+public class TextureFX {
+ public byte[] imageData = new byte[1024];
+ public int iconIndex;
+ public boolean anaglyphEnabled = false;
+ public int textureId = 0;
+ public int tileSize = 1;
+
+ public TextureFX(int var1) {
+ this.iconIndex = var1;
+ }
+
+ public void onTick() {
+ }
+}
diff --git a/source/net/minecraft/src/TextureFlamesFX.java b/source/net/minecraft/src/TextureFlamesFX.java
new file mode 100644
index 0000000..9ddc148
--- /dev/null
+++ b/source/net/minecraft/src/TextureFlamesFX.java
@@ -0,0 +1,77 @@
+package net.minecraft.src;
+
+public class TextureFlamesFX extends TextureFX {
+ protected float[] currentFireFrame = new float[320];
+ protected float[] lastFireFrame = new float[320];
+
+ public TextureFlamesFX(int var1) {
+ super(Block.fire.blockIndexInTexture + var1 * 16);
+ }
+
+ public void onTick() {
+ int var2;
+ float var4;
+ int var5;
+ int var6;
+ for(int var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 20; ++var2) {
+ int var3 = 18;
+ var4 = this.currentFireFrame[var1 + (var2 + 1) % 20 * 16] * (float)var3;
+
+ for(var5 = var1 - 1; var5 <= var1 + 1; ++var5) {
+ for(var6 = var2; var6 <= var2 + 1; ++var6) {
+ if(var5 >= 0 && var6 >= 0 && var5 < 16 && var6 < 20) {
+ var4 += this.currentFireFrame[var5 + var6 * 16];
+ }
+
+ ++var3;
+ }
+ }
+
+ this.lastFireFrame[var1 + var2 * 16] = var4 / ((float)var3 * 1.06F);
+ if(var2 >= 19) {
+ this.lastFireFrame[var1 + var2 * 16] = (float)(Math.random() * Math.random() * Math.random() * 4.0D + Math.random() * (double)0.1F + (double)0.2F);
+ }
+ }
+ }
+
+ float[] var12 = this.lastFireFrame;
+ this.lastFireFrame = this.currentFireFrame;
+ this.currentFireFrame = var12;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ float var13 = this.currentFireFrame[var2] * 1.8F;
+ if(var13 > 1.0F) {
+ var13 = 1.0F;
+ }
+
+ if(var13 < 0.0F) {
+ var13 = 0.0F;
+ }
+
+ var5 = (int)(var13 * 155.0F + 100.0F);
+ var6 = (int)(var13 * var13 * 255.0F);
+ int var7 = (int)(var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * 255.0F);
+ short var8 = 255;
+ if(var13 < 0.5F) {
+ var8 = 0;
+ }
+
+ var4 = (var13 - 0.5F) * 2.0F;
+ if(this.anaglyphEnabled) {
+ int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ int var10 = (var5 * 30 + var6 * 70) / 100;
+ int var11 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var9;
+ var6 = var10;
+ var7 = var11;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = (byte)var8;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TextureGearsFX.java b/source/net/minecraft/src/TextureGearsFX.java
new file mode 100644
index 0000000..17138a5
--- /dev/null
+++ b/source/net/minecraft/src/TextureGearsFX.java
@@ -0,0 +1,65 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+public class TextureGearsFX extends TextureFX {
+ private int gearRotation = 0;
+ private int[] gearColor = new int[1024];
+ private int[] gearMiddleColor = new int[1024];
+ private int gearRotationDir;
+
+ public TextureGearsFX(int var1) {
+ super(Block.cog.blockIndexInTexture + var1);
+ this.gearRotationDir = var1 * 2 - 1;
+ this.gearRotation = 2;
+
+ try {
+ BufferedImage var2 = ImageIO.read(TextureGearsFX.class.getResource("/misc/gear.png"));
+ var2.getRGB(0, 0, 32, 32, this.gearColor, 0, 32);
+ var2 = ImageIO.read(TextureGearsFX.class.getResource("/misc/gearmiddle.png"));
+ var2.getRGB(0, 0, 16, 16, this.gearMiddleColor, 0, 16);
+ } catch (IOException var3) {
+ var3.printStackTrace();
+ }
+
+ }
+
+ public void onTick() {
+ this.gearRotation = this.gearRotation + this.gearRotationDir & 63;
+ float var1 = MathHelper.sin((float)this.gearRotation / 64.0F * (float)Math.PI * 2.0F);
+ float var2 = MathHelper.cos((float)this.gearRotation / 64.0F * (float)Math.PI * 2.0F);
+
+ for(int var3 = 0; var3 < 16; ++var3) {
+ for(int var4 = 0; var4 < 16; ++var4) {
+ float var5 = ((float)var3 / 15.0F - 0.5F) * 31.0F;
+ float var6 = ((float)var4 / 15.0F - 0.5F) * 31.0F;
+ float var7 = var2 * var5 - var1 * var6;
+ float var8 = var2 * var6 + var1 * var5;
+ int var9 = (int)(var7 + 16.0F);
+ int var10 = (int)(var8 + 16.0F);
+ int var11 = 0;
+ int var12;
+ if(var9 >= 0 && var10 >= 0 && var9 < 32 && var10 < 32) {
+ var11 = this.gearColor[var9 + var10 * 32];
+ var12 = this.gearMiddleColor[var3 + var4 * 16];
+ if((var12 >> 24 & 255) > 128) {
+ var11 = var12;
+ }
+ }
+
+ var12 = var11 >> 16 & 255;
+ int var13 = var11 >> 8 & 255;
+ int var14 = var11 & 255;
+ int var15 = (var11 >> 24 & 255) > 128 ? 255 : 0;
+ int var16 = var3 + var4 * 16;
+ this.imageData[var16 * 4 + 0] = (byte)var12;
+ this.imageData[var16 * 4 + 1] = (byte)var13;
+ this.imageData[var16 * 4 + 2] = (byte)var14;
+ this.imageData[var16 * 4 + 3] = (byte)var15;
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TextureLavaFX.java b/source/net/minecraft/src/TextureLavaFX.java
new file mode 100644
index 0000000..c4d9c4c
--- /dev/null
+++ b/source/net/minecraft/src/TextureLavaFX.java
@@ -0,0 +1,81 @@
+package net.minecraft.src;
+
+public class TextureLavaFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+
+ public TextureLavaFX() {
+ super(Block.lavaMoving.blockIndexInTexture);
+ }
+
+ public void onTick() {
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ int var7;
+ int var8;
+ int var9;
+ for(int var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+ int var4 = (int)(MathHelper.sin((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+ var5 = (int)(MathHelper.sin((float)var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+
+ for(var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
+ for(var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
+ var8 = var6 + var4 & 15;
+ var9 = var7 + var5 & 15;
+ var3 += this.red[var8 + var9 * 16];
+ }
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 10.0F + (this.blue[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.blue[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.01F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.06F;
+ if(Math.random() < 0.005D) {
+ this.alpha[var1 + var2 * 16] = 1.5F;
+ }
+ }
+ }
+
+ float[] var11 = this.green;
+ this.green = this.red;
+ this.red = var11;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2] * 2.0F;
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ var5 = (int)(var3 * 100.0F + 155.0F);
+ var6 = (int)(var3 * var3 * 255.0F);
+ var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
+ if(this.anaglyphEnabled) {
+ var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ var9 = (var5 * 30 + var6 * 70) / 100;
+ int var10 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var8;
+ var6 = var9;
+ var7 = var10;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = -1;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TextureLavaFlowFX.java b/source/net/minecraft/src/TextureLavaFlowFX.java
new file mode 100644
index 0000000..8d91375
--- /dev/null
+++ b/source/net/minecraft/src/TextureLavaFlowFX.java
@@ -0,0 +1,85 @@
+package net.minecraft.src;
+
+public class TextureLavaFlowFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+ int tickCounter = 0;
+
+ public TextureLavaFlowFX() {
+ super(Block.lavaMoving.blockIndexInTexture + 1);
+ this.tileSize = 2;
+ }
+
+ public void onTick() {
+ ++this.tickCounter;
+
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ int var7;
+ int var8;
+ int var9;
+ for(int var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+ int var4 = (int)(MathHelper.sin((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+ var5 = (int)(MathHelper.sin((float)var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+
+ for(var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
+ for(var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
+ var8 = var6 + var4 & 15;
+ var9 = var7 + var5 & 15;
+ var3 += this.red[var8 + var9 * 16];
+ }
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 10.0F + (this.blue[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.blue[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.01F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.06F;
+ if(Math.random() < 0.005D) {
+ this.alpha[var1 + var2 * 16] = 1.5F;
+ }
+ }
+ }
+
+ float[] var11 = this.green;
+ this.green = this.red;
+ this.red = var11;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2 - this.tickCounter / 3 * 16 & 255] * 2.0F;
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ var5 = (int)(var3 * 100.0F + 155.0F);
+ var6 = (int)(var3 * var3 * 255.0F);
+ var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
+ if(this.anaglyphEnabled) {
+ var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ var9 = (var5 * 30 + var6 * 70) / 100;
+ int var10 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var8;
+ var6 = var9;
+ var7 = var10;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = -1;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TextureWaterFX.java b/source/net/minecraft/src/TextureWaterFX.java
new file mode 100644
index 0000000..67a5040
--- /dev/null
+++ b/source/net/minecraft/src/TextureWaterFX.java
@@ -0,0 +1,85 @@
+package net.minecraft.src;
+
+public class TextureWaterFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+ private int tickCounter = 0;
+
+ public TextureWaterFX() {
+ super(Block.waterMoving.blockIndexInTexture);
+ }
+
+ public void onTick() {
+ ++this.tickCounter;
+
+ int var1;
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+
+ for(int var4 = var1 - 1; var4 <= var1 + 1; ++var4) {
+ var5 = var4 & 15;
+ var6 = var2 & 15;
+ var3 += this.red[var5 + var6 * 16];
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 3.3F + this.blue[var1 + var2 * 16] * 0.8F;
+ }
+ }
+
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.05F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.1F;
+ if(Math.random() < 0.05D) {
+ this.alpha[var1 + var2 * 16] = 0.5F;
+ }
+ }
+ }
+
+ float[] var12 = this.green;
+ this.green = this.red;
+ this.red = var12;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2];
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ float var13 = var3 * var3;
+ var5 = (int)(32.0F + var13 * 32.0F);
+ var6 = (int)(50.0F + var13 * 64.0F);
+ int var7 = 255;
+ int var8 = (int)(146.0F + var13 * 50.0F);
+ if(this.anaglyphEnabled) {
+ int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ int var10 = (var5 * 30 + var6 * 70) / 100;
+ int var11 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var9;
+ var6 = var10;
+ var7 = var11;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = (byte)var8;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TextureWaterFlowFX.java b/source/net/minecraft/src/TextureWaterFlowFX.java
new file mode 100644
index 0000000..668c17f
--- /dev/null
+++ b/source/net/minecraft/src/TextureWaterFlowFX.java
@@ -0,0 +1,86 @@
+package net.minecraft.src;
+
+public class TextureWaterFlowFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+ private int tickCounter = 0;
+
+ public TextureWaterFlowFX() {
+ super(Block.waterMoving.blockIndexInTexture + 1);
+ this.tileSize = 2;
+ }
+
+ public void onTick() {
+ ++this.tickCounter;
+
+ int var1;
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+
+ for(int var4 = var2 - 2; var4 <= var2; ++var4) {
+ var5 = var1 & 15;
+ var6 = var4 & 15;
+ var3 += this.red[var5 + var6 * 16];
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 3.2F + this.blue[var1 + var2 * 16] * 0.8F;
+ }
+ }
+
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.05F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.3F;
+ if(Math.random() < 0.2D) {
+ this.alpha[var1 + var2 * 16] = 0.5F;
+ }
+ }
+ }
+
+ float[] var12 = this.green;
+ this.green = this.red;
+ this.red = var12;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2 - this.tickCounter * 16 & 255];
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ float var13 = var3 * var3;
+ var5 = (int)(32.0F + var13 * 32.0F);
+ var6 = (int)(50.0F + var13 * 64.0F);
+ int var7 = 255;
+ int var8 = (int)(146.0F + var13 * 50.0F);
+ if(this.anaglyphEnabled) {
+ int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ int var10 = (var5 * 30 + var6 * 70) / 100;
+ int var11 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var9;
+ var6 = var10;
+ var7 = var11;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = (byte)var8;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TexturedQuad.java b/source/net/minecraft/src/TexturedQuad.java
new file mode 100644
index 0000000..60719d0
--- /dev/null
+++ b/source/net/minecraft/src/TexturedQuad.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class TexturedQuad {
+ public PositionTextureVertex[] vertexPositions;
+ public int nVertices;
+
+ public TexturedQuad(PositionTextureVertex[] var1) {
+ this.nVertices = 0;
+ this.vertexPositions = var1;
+ this.nVertices = var1.length;
+ }
+
+ public TexturedQuad(PositionTextureVertex[] var1, int var2, int var3, int var4, int var5) {
+ this(var1);
+ float var6 = 0.0015625F;
+ float var7 = 0.003125F;
+ var1[0] = var1[0].setTexturePosition((float)var4 / 64.0F - var6, (float)var3 / 32.0F + var7);
+ var1[1] = var1[1].setTexturePosition((float)var2 / 64.0F + var6, (float)var3 / 32.0F + var7);
+ var1[2] = var1[2].setTexturePosition((float)var2 / 64.0F + var6, (float)var5 / 32.0F - var7);
+ var1[3] = var1[3].setTexturePosition((float)var4 / 64.0F - var6, (float)var5 / 32.0F - var7);
+ }
+
+ public void flipFace() {
+ PositionTextureVertex[] var1 = new PositionTextureVertex[this.vertexPositions.length];
+
+ 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) {
+ Vec3D var3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D);
+ Vec3D var4 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D);
+ Vec3D var5 = var4.crossProduct(var3).normalize();
+ var1.startDrawingQuads();
+ var1.setNormal((float)var5.xCoord, (float)var5.yCoord, (float)var5.zCoord);
+
+ 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);
+ }
+
+ var1.draw();
+ }
+}
diff --git a/source/net/minecraft/src/ThreadDownloadImage.java b/source/net/minecraft/src/ThreadDownloadImage.java
new file mode 100644
index 0000000..3912dc6
--- /dev/null
+++ b/source/net/minecraft/src/ThreadDownloadImage.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import javax.imageio.ImageIO;
+
+class ThreadDownloadImage extends Thread {
+ final String location;
+ final ImageBuffer buffer;
+ final ThreadDownloadImageData imageData;
+
+ ThreadDownloadImage(ThreadDownloadImageData var1, String var2, ImageBuffer var3) {
+ this.imageData = var1;
+ this.location = var2;
+ this.buffer = var3;
+ }
+
+ public void run() {
+ HttpURLConnection var1 = null;
+
+ try {
+ URL var2 = new URL(this.location);
+ var1 = (HttpURLConnection)var2.openConnection();
+ var1.setDoInput(true);
+ var1.setDoOutput(false);
+ var1.connect();
+ if(var1.getResponseCode() != 404) {
+ if(this.buffer == null) {
+ this.imageData.image = ImageIO.read(var1.getInputStream());
+ } else {
+ this.imageData.image = this.buffer.parseUserSkin(ImageIO.read(var1.getInputStream()));
+ }
+
+ return;
+ }
+ } catch (Exception var6) {
+ var6.printStackTrace();
+ return;
+ } finally {
+ var1.disconnect();
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/ThreadDownloadImageData.java b/source/net/minecraft/src/ThreadDownloadImageData.java
new file mode 100644
index 0000000..13ac4e6
--- /dev/null
+++ b/source/net/minecraft/src/ThreadDownloadImageData.java
@@ -0,0 +1,14 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+
+public class ThreadDownloadImageData {
+ public BufferedImage image;
+ public int referenceCount = 1;
+ public int textureName = -1;
+ public boolean textureSetupComplete = false;
+
+ public ThreadDownloadImageData(String var1, ImageBuffer var2) {
+ (new ThreadDownloadImage(this, var1, var2)).start();
+ }
+}
diff --git a/source/net/minecraft/src/ThreadDownloadResources.java b/source/net/minecraft/src/ThreadDownloadResources.java
new file mode 100644
index 0000000..6bcdb12
--- /dev/null
+++ b/source/net/minecraft/src/ThreadDownloadResources.java
@@ -0,0 +1,117 @@
+package net.minecraft.src;
+
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+
+public class ThreadDownloadResources extends Thread {
+ public File resourcesFolder;
+ private Minecraft mc;
+ private boolean closing = false;
+
+ public ThreadDownloadResources(File var1, Minecraft var2) {
+ this.mc = var2;
+ this.setName("Resource download thread");
+ this.setDaemon(true);
+ this.resourcesFolder = new File(var1, "resources/");
+ if(!this.resourcesFolder.exists() && !this.resourcesFolder.mkdirs()) {
+ throw new RuntimeException("The working directory could not be created: " + this.resourcesFolder);
+ }
+ }
+
+ public void run() {
+ try {
+ ArrayList var1 = new ArrayList();
+ URL var2 = new URL("http://www.minecraft.net/resources/");
+ BufferedReader var3 = new BufferedReader(new InputStreamReader(var2.openStream()));
+ String var4 = "";
+
+ while(true) {
+ var4 = var3.readLine();
+ if(var4 == null) {
+ var3.close();
+
+ for(int var5 = 0; var5 < var1.size(); ++var5) {
+ this.downloadAndInstallResource(var2, (String)var1.get(var5));
+ if(this.closing) {
+ return;
+ }
+ }
+ break;
+ }
+
+ var1.add(var4);
+ }
+ } catch (IOException var6) {
+ this.loadResource(this.resourcesFolder, "");
+ var6.printStackTrace();
+ }
+
+ }
+
+ private void loadResource(File var1, String var2) {
+ File[] var3 = var1.listFiles();
+
+ for(int var4 = 0; var4 < var3.length; ++var4) {
+ if(var3[var4].isDirectory()) {
+ this.loadResource(var3[var4], var2 + var3[var4].getName() + "/");
+ } else {
+ this.mc.installResource(var2 + var3[var4].getName(), var3[var4]);
+ }
+ }
+
+ }
+
+ private void downloadAndInstallResource(URL var1, String var2) {
+ try {
+ String[] var3 = var2.split(",");
+ String var4 = var3[0];
+ int var5 = Integer.parseInt(var3[1]);
+ long var6 = Long.parseLong(var3[2]);
+ var6 /= 2L;
+ File var8 = new File(this.resourcesFolder, var4);
+ if(!var8.exists() || var8.length() != (long)var5) {
+ var8.getParentFile().mkdirs();
+ String var9 = var4.replaceAll(" ", "%20");
+ this.downloadResource(new URL(var1, var9), var8, var5);
+ if(this.closing) {
+ return;
+ }
+ }
+
+ this.mc.installResource(var4, var8);
+ } catch (Exception var10) {
+ var10.printStackTrace();
+ }
+
+ }
+
+ private void downloadResource(URL var1, File var2, int var3) throws IOException {
+ byte[] var4 = new byte[4096];
+ DataInputStream var5 = new DataInputStream(var1.openStream());
+ DataOutputStream var6 = new DataOutputStream(new FileOutputStream(var2));
+ boolean var7 = false;
+
+ do {
+ int var8 = var5.read(var4);
+ if(var8 < 0) {
+ var5.close();
+ var6.close();
+ return;
+ }
+
+ var6.write(var4, 0, var8);
+ } while(!this.closing);
+
+ }
+
+ public void closeMinecraft() {
+ this.closing = true;
+ }
+}
diff --git a/source/net/minecraft/src/ThreadRunIsoClient.java b/source/net/minecraft/src/ThreadRunIsoClient.java
new file mode 100644
index 0000000..aed30bb
--- /dev/null
+++ b/source/net/minecraft/src/ThreadRunIsoClient.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+class ThreadRunIsoClient extends Thread {
+ final CanvasIsomPreview isoCanvas;
+
+ ThreadRunIsoClient(CanvasIsomPreview var1) {
+ this.isoCanvas = var1;
+ }
+
+ public void run() {
+ while(CanvasIsomPreview.a(this.isoCanvas)) {
+ this.isoCanvas.render();
+
+ try {
+ Thread.sleep(1L);
+ } catch (Exception var2) {
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/ThreadSleepForever.java b/source/net/minecraft/src/ThreadSleepForever.java
new file mode 100644
index 0000000..09cb8b7
--- /dev/null
+++ b/source/net/minecraft/src/ThreadSleepForever.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+class ThreadSleepForever extends Thread {
+ final Minecraft mc;
+
+ ThreadSleepForever(Minecraft var1, String var2) {
+ super(var2);
+ this.mc = var1;
+ this.setDaemon(true);
+ this.start();
+ }
+
+ public void run() {
+ while(this.mc.running) {
+ try {
+ Thread.sleep(2147483647L);
+ } catch (InterruptedException var2) {
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TileEntity.java b/source/net/minecraft/src/TileEntity.java
new file mode 100644
index 0000000..78965d1
--- /dev/null
+++ b/source/net/minecraft/src/TileEntity.java
@@ -0,0 +1,86 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class TileEntity {
+ private static Map nameToClassMap = new HashMap();
+ private static Map classToNameMap = new HashMap();
+ public World worldObj;
+ public int xCoord;
+ public int yCoord;
+ public int zCoord;
+
+ private static void addMapping(Class var0, String var1) {
+ if(classToNameMap.containsKey(var1)) {
+ throw new IllegalArgumentException("Duplicate id: " + var1);
+ } else {
+ nameToClassMap.put(var1, var0);
+ classToNameMap.put(var0, var1);
+ }
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ this.xCoord = var1.getInteger("x");
+ this.yCoord = var1.getInteger("y");
+ this.zCoord = var1.getInteger("z");
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ 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);
+ }
+ }
+
+ public void updateEntity() {
+ }
+
+ public static TileEntity createAndLoadEntity(NBTTagCompound var0) {
+ TileEntity var1 = null;
+
+ try {
+ Class var2 = (Class)nameToClassMap.get(var0.getString("id"));
+ if(var2 != null) {
+ var1 = (TileEntity)var2.newInstance();
+ }
+ } catch (Exception var3) {
+ var3.printStackTrace();
+ }
+
+ if(var1 != null) {
+ var1.readFromNBT(var0);
+ } else {
+ System.out.println("Skipping TileEntity with id " + var0.getString("id"));
+ }
+
+ return var1;
+ }
+
+ public int getBlockMetadata() {
+ return this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ public void onInventoryChanged() {
+ this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ 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;
+ return var7 * var7 + var9 * var9 + var11 * var11;
+ }
+
+ static {
+ addMapping(TileEntityFurnace.class, "Furnace");
+ addMapping(TileEntityChest.class, "Chest");
+ addMapping(TileEntitySign.class, "Sign");
+ addMapping(TileEntityMobSpawner.class, "MobSpawner");
+ }
+}
diff --git a/source/net/minecraft/src/TileEntityChest.java b/source/net/minecraft/src/TileEntityChest.java
new file mode 100644
index 0000000..e29f7d0
--- /dev/null
+++ b/source/net/minecraft/src/TileEntityChest.java
@@ -0,0 +1,80 @@
+package net.minecraft.src;
+
+public class TileEntityChest extends TileEntity implements IInventory {
+ private ItemStack[] chestContents = new ItemStack[36];
+
+ public int getSizeInventory() {
+ return 27;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.chestContents[var1];
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.chestContents[var1] != null) {
+ ItemStack var3;
+ if(this.chestContents[var1].stackSize <= var2) {
+ var3 = this.chestContents[var1];
+ this.chestContents[var1] = null;
+ return var3;
+ } else {
+ var3 = this.chestContents[var1].splitStack(var2);
+ if(this.chestContents[var1].stackSize == 0) {
+ this.chestContents[var1] = null;
+ }
+
+ return var3;
+ }
+ } 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();
+ }
+
+ }
+
+ public String getInvName() {
+ return "Chest";
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+ NBTTagList var2 = var1.getTagList("Items");
+ this.chestContents = new ItemStack[this.getSizeInventory()];
+
+ 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) {
+ this.chestContents[var5] = new ItemStack(var4);
+ }
+ }
+
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ NBTTagList var2 = new NBTTagList();
+
+ 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);
+ var2.setTag(var4);
+ }
+ }
+
+ var1.setTag("Items", var2);
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+}
diff --git a/source/net/minecraft/src/TileEntityFurnace.java b/source/net/minecraft/src/TileEntityFurnace.java
new file mode 100644
index 0000000..fe6c7d7
--- /dev/null
+++ b/source/net/minecraft/src/TileEntityFurnace.java
@@ -0,0 +1,190 @@
+package net.minecraft.src;
+
+public class TileEntityFurnace extends TileEntity implements IInventory {
+ private ItemStack[] furnaceItemStacks = new ItemStack[3];
+ private int furnaceBurnTime = 0;
+ private int currentItemBurnTime = 0;
+ private int furnaceCookTime = 0;
+
+ public int getSizeInventory() {
+ return this.furnaceItemStacks.length;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.furnaceItemStacks[var1];
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.furnaceItemStacks[var1] != null) {
+ ItemStack var3;
+ if(this.furnaceItemStacks[var1].stackSize <= var2) {
+ var3 = this.furnaceItemStacks[var1];
+ this.furnaceItemStacks[var1] = null;
+ return var3;
+ } else {
+ var3 = this.furnaceItemStacks[var1].splitStack(var2);
+ if(this.furnaceItemStacks[var1].stackSize == 0) {
+ this.furnaceItemStacks[var1] = null;
+ }
+
+ return var3;
+ }
+ } 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();
+ }
+
+ }
+
+ public String getInvName() {
+ return "Chest";
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+ NBTTagList var2 = var1.getTagList("Items");
+ this.furnaceItemStacks = new ItemStack[this.getSizeInventory()];
+
+ 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) {
+ this.furnaceItemStacks[var5] = new ItemStack(var4);
+ }
+ }
+
+ this.furnaceBurnTime = var1.getShort("BurnTime");
+ this.furnaceCookTime = var1.getShort("CookTime");
+ this.currentItemBurnTime = this.getItemBurnTime(this.furnaceItemStacks[1]);
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ var1.setShort("BurnTime", (short)this.furnaceBurnTime);
+ var1.setShort("CookTime", (short)this.furnaceCookTime);
+ NBTTagList var2 = new NBTTagList();
+
+ 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);
+ var2.setTag(var4);
+ }
+ }
+
+ var1.setTag("Items", var2);
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public int getCookProgressScaled(int var1) {
+ return this.furnaceCookTime * var1 / 200;
+ }
+
+ public int getBurnTimeRemainingScaled(int var1) {
+ if(this.currentItemBurnTime == 0) {
+ this.currentItemBurnTime = 200;
+ }
+
+ return this.furnaceBurnTime * var1 / this.currentItemBurnTime;
+ }
+
+ public boolean isBurning() {
+ return this.furnaceBurnTime > 0;
+ }
+
+ public void updateEntity() {
+ boolean var1 = this.furnaceBurnTime > 0;
+ boolean var2 = false;
+ if(this.furnaceBurnTime > 0) {
+ --this.furnaceBurnTime;
+ var2 = true;
+ }
+
+ if(this.furnaceBurnTime == 0 && this.canSmelt()) {
+ this.currentItemBurnTime = this.furnaceBurnTime = this.getItemBurnTime(this.furnaceItemStacks[1]);
+ if(this.furnaceBurnTime > 0) {
+ var2 = true;
+ if(this.furnaceItemStacks[1] != null) {
+ --this.furnaceItemStacks[1].stackSize;
+ if(this.furnaceItemStacks[1].stackSize == 0) {
+ this.furnaceItemStacks[1] = null;
+ }
+ }
+ }
+ }
+
+ if(this.isBurning() && this.canSmelt()) {
+ ++this.furnaceCookTime;
+ if(this.furnaceCookTime == 200) {
+ this.furnaceCookTime = 0;
+ this.smeltItem();
+ var2 = true;
+ }
+ } else {
+ this.furnaceCookTime = 0;
+ }
+
+ if(var1 != this.furnaceBurnTime > 0) {
+ var2 = true;
+ BlockFurnace.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ if(var2) {
+ this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ }
+
+ private boolean canSmelt() {
+ if(this.furnaceItemStacks[0] == null) {
+ return false;
+ } else {
+ int var1 = this.getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex);
+ return var1 < 0 ? false : (this.furnaceItemStacks[2] == null ? true : (this.furnaceItemStacks[2].itemID != var1 ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < Item.itemsList[var1].getItemStackLimit())));
+ }
+ }
+
+ public void smeltItem() {
+ if(this.canSmelt()) {
+ int var1 = this.getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex);
+ if(this.furnaceItemStacks[2] == null) {
+ this.furnaceItemStacks[2] = new ItemStack(var1, 1);
+ } else if(this.furnaceItemStacks[2].itemID == var1) {
+ ++this.furnaceItemStacks[2].stackSize;
+ }
+
+ --this.furnaceItemStacks[0].stackSize;
+ if(this.furnaceItemStacks[0].stackSize <= 0) {
+ this.furnaceItemStacks[0] = null;
+ }
+
+ }
+ }
+
+ private int getSmeltingResult(int var1) {
+ return var1 == Block.oreIron.blockID ? Item.ingotIron.shiftedIndex : (var1 == Block.oreGold.blockID ? Item.ingotGold.shiftedIndex : (var1 == Block.oreDiamond.blockID ? Item.diamond.shiftedIndex : (var1 == Block.sand.blockID ? Block.glass.blockID : (var1 == Item.porkRaw.shiftedIndex ? Item.porkCooked.shiftedIndex : (var1 == Block.cobblestone.blockID ? Block.stone.blockID : -1)))));
+ }
+
+ private int getItemBurnTime(ItemStack var1) {
+ if(var1 == null) {
+ return 0;
+ } else {
+ int var2 = var1.getItem().shiftedIndex;
+ return var2 < 256 && Block.blocksList[var2].blockMaterial == Material.wood ? 300 : (var2 == Item.stick.shiftedIndex ? 100 : (var2 == Item.coal.shiftedIndex ? 1600 : 0));
+ }
+ }
+
+ public void onInventoryChanged() {
+ this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord);
+ }
+}
diff --git a/source/net/minecraft/src/TileEntityMobSpawner.java b/source/net/minecraft/src/TileEntityMobSpawner.java
new file mode 100644
index 0000000..a03cbb6
--- /dev/null
+++ b/source/net/minecraft/src/TileEntityMobSpawner.java
@@ -0,0 +1,94 @@
+package net.minecraft.src;
+
+public class TileEntityMobSpawner extends TileEntity {
+ public int delay = -1;
+ public String mobID = "Pig";
+ public double yaw;
+ public double prevYaw = 0.0D;
+
+ public TileEntityMobSpawner() {
+ this.delay = 20;
+ }
+
+ public boolean anyPlayerInRange() {
+ double var1 = this.worldObj.playerEntity.getDistanceSq((double)this.xCoord, (double)this.yCoord, (double)this.zCoord);
+ return var1 <= 256.0D;
+ }
+
+ public void updateEntity() {
+ this.prevYaw = this.yaw;
+ if(this.anyPlayerInRange()) {
+ double var1 = (double)((float)this.xCoord + this.worldObj.rand.nextFloat());
+ double var3 = (double)((float)this.yCoord + this.worldObj.rand.nextFloat());
+ double var5 = (double)((float)this.zCoord + this.worldObj.rand.nextFloat());
+ this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+
+ for(this.yaw += (double)(1000.0F / ((float)this.delay + 200.0F)); this.yaw > 360.0D; this.prevYaw -= 360.0D) {
+ this.yaw -= 360.0D;
+ }
+
+ if(this.delay == -1) {
+ this.updateDelay();
+ }
+
+ if(this.delay > 0) {
+ --this.delay;
+ } else {
+ byte var7 = 4;
+
+ for(int var8 = 0; var8 < var7; ++var8) {
+ EntityLiving var9 = (EntityLiving)((EntityLiving)EntityList.createEntityInWorld(this.mobID, this.worldObj));
+ if(var9 == null) {
+ return;
+ }
+
+ int var10 = this.worldObj.getEntitiesWithinAABB(var9.getClass(), AxisAlignedBB.getBoundingBoxFromPool((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)(this.xCoord + 1), (double)(this.yCoord + 1), (double)(this.zCoord + 1)).expand(8.0D, 4.0D, 8.0D)).size();
+ if(var10 >= 6) {
+ this.updateDelay();
+ return;
+ }
+
+ if(var9 != null) {
+ double var11 = (double)this.xCoord + (this.worldObj.rand.nextDouble() - this.worldObj.rand.nextDouble()) * 4.0D;
+ double var13 = (double)(this.yCoord + this.worldObj.rand.nextInt(3) - 1);
+ double var15 = (double)this.zCoord + (this.worldObj.rand.nextDouble() - this.worldObj.rand.nextDouble()) * 4.0D;
+ var9.setPositionAndRotation(var11, var13, var15, this.worldObj.rand.nextFloat() * 360.0F, 0.0F);
+ if(var9.getCanSpawnHere(var11, var13, var15)) {
+ this.worldObj.spawnEntityInWorld(var9);
+
+ for(int var17 = 0; var17 < 20; ++var17) {
+ var1 = (double)this.xCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
+ var3 = (double)this.yCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
+ var5 = (double)this.zCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
+ this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ }
+
+ var9.spawnExplosionParticle();
+ this.updateDelay();
+ }
+ }
+ }
+
+ super.updateEntity();
+ }
+ }
+ }
+
+ private void updateDelay() {
+ this.delay = 200 + this.worldObj.rand.nextInt(600);
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+ this.mobID = var1.getString("EntityId");
+ this.delay = var1.getShort("Delay");
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ var1.setString("EntityId", this.mobID);
+ var1.setShort("Delay", (short)this.delay);
+ }
+}
diff --git a/source/net/minecraft/src/TileEntityMobSpawnerRenderer.java b/source/net/minecraft/src/TileEntityMobSpawnerRenderer.java
new file mode 100644
index 0000000..6487d2e
--- /dev/null
+++ b/source/net/minecraft/src/TileEntityMobSpawnerRenderer.java
@@ -0,0 +1,36 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.lwjgl.opengl.GL11;
+
+public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer {
+ private Map entityHashMap = new HashMap();
+
+ public void a(TileEntityMobSpawner var1, double var2, double var4, double var6, float var8) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2 + 0.5F, (float)var4, (float)var6 + 0.5F);
+ Entity var9 = (Entity)this.entityHashMap.get(var1.mobID);
+ if(var9 == null) {
+ var9 = EntityList.createEntityInWorld(var1.mobID, (World)null);
+ this.entityHashMap.put(var1.mobID, var9);
+ }
+
+ if(var9 != null) {
+ var9.setWorld(var1.worldObj);
+ float var10 = 7.0F / 16.0F;
+ GL11.glTranslatef(0.0F, 0.4F, 0.0F);
+ GL11.glRotatef((float)(var1.prevYaw + (var1.yaw - var1.prevYaw) * (double)var8) * 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(var10, var10, var10);
+ RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, var8);
+ }
+
+ GL11.glPopMatrix();
+ }
+
+ public void renderTileEntityMobSpawner(TileEntity var1, double var2, double var4, double var6, float var8) {
+ this.a((TileEntityMobSpawner)var1, var2, var4, var6, var8);
+ }
+}
diff --git a/source/net/minecraft/src/TileEntityRenderer.java b/source/net/minecraft/src/TileEntityRenderer.java
new file mode 100644
index 0000000..c11fa4e
--- /dev/null
+++ b/source/net/minecraft/src/TileEntityRenderer.java
@@ -0,0 +1,86 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.lwjgl.opengl.GL11;
+
+public class TileEntityRenderer {
+ private Map specialRendererMap = new HashMap();
+ public static TileEntityRenderer instance = new TileEntityRenderer();
+ private FontRenderer fontRenderer;
+ public static double staticPlayerX;
+ public static double staticPlayerY;
+ public static double staticPlayerZ;
+ public RenderEngine renderEngine;
+ public World worldObj;
+ public EntityPlayer entityPlayer;
+ public float playerYaw;
+ public float playerPitch;
+ public double playerX;
+ public double playerY;
+ public double playerZ;
+
+ private TileEntityRenderer() {
+ this.specialRendererMap.put(TileEntitySign.class, new TileEntitySignRenderer());
+ this.specialRendererMap.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
+ Iterator var1 = this.specialRendererMap.values().iterator();
+
+ while(var1.hasNext()) {
+ TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next();
+ var2.setTileEntityRenderer(this);
+ }
+
+ }
+
+ public TileEntitySpecialRenderer getSpecialRendererForClass(Class var1) {
+ TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)this.specialRendererMap.get(var1);
+ if(var2 == null && var1 != TileEntity.class) {
+ var2 = this.getSpecialRendererForClass(var1.getSuperclass());
+ this.specialRendererMap.put(var1, var2);
+ }
+
+ return var2;
+ }
+
+ public boolean hasSpecialRenderer(TileEntity var1) {
+ return this.getSpecialRendererForEntity(var1) != null;
+ }
+
+ public TileEntitySpecialRenderer getSpecialRendererForEntity(TileEntity var1) {
+ return this.getSpecialRendererForClass(var1.getClass());
+ }
+
+ public void cacheActiveRenderInfo(World var1, RenderEngine var2, FontRenderer var3, EntityPlayer var4, float var5) {
+ this.worldObj = var1;
+ this.renderEngine = var2;
+ this.entityPlayer = 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;
+ }
+
+ public void renderTileEntity(TileEntity var1, float var2) {
+ if(var1.getDistanceFrom(this.playerX, this.playerY, this.playerZ) < 4096.0D) {
+ float var3 = this.worldObj.getBrightness(var1.xCoord, var1.yCoord, var1.zCoord);
+ GL11.glColor3f(var3, var3, var3);
+ this.renderTileEntityAt(var1, (double)var1.xCoord - staticPlayerX, (double)var1.yCoord - staticPlayerY, (double)var1.zCoord - staticPlayerZ, var2);
+ }
+
+ }
+
+ public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {
+ TileEntitySpecialRenderer var9 = this.getSpecialRendererForEntity(var1);
+ if(var9 != null) {
+ var9.renderTileEntityMobSpawner(var1, var2, var4, var6, var8);
+ }
+
+ }
+
+ public FontRenderer getFontRenderer() {
+ return this.fontRenderer;
+ }
+}
diff --git a/source/net/minecraft/src/TileEntitySign.java b/source/net/minecraft/src/TileEntitySign.java
new file mode 100644
index 0000000..69f2787
--- /dev/null
+++ b/source/net/minecraft/src/TileEntitySign.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class TileEntitySign extends TileEntity {
+ public String[] signText = new String[]{"", "", "", ""};
+ public int lineBeingEdited = -1;
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ var1.setString("Text1", this.signText[0]);
+ var1.setString("Text2", this.signText[1]);
+ var1.setString("Text3", this.signText[2]);
+ var1.setString("Text4", this.signText[3]);
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+
+ for(int var2 = 0; var2 < 4; ++var2) {
+ this.signText[var2] = var1.getString("Text" + (var2 + 1));
+ if(this.signText[var2].length() > 15) {
+ this.signText[var2] = this.signText[var2].substring(0, 15);
+ }
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/TileEntitySignRenderer.java b/source/net/minecraft/src/TileEntitySignRenderer.java
new file mode 100644
index 0000000..b12ca76
--- /dev/null
+++ b/source/net/minecraft/src/TileEntitySignRenderer.java
@@ -0,0 +1,41 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class TileEntitySignRenderer extends TileEntitySpecialRenderer {
+ private SignModel modelSign = new SignModel();
+
+ public void a(TileEntitySign var1, double var2, double var4, double var6, float var8) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F, (float)var6 + 0.5F);
+ float var9 = (float)(var1.getBlockMetadata() * 360) / 16.0F;
+ GL11.glRotatef(-var9, 0.0F, 1.0F, 0.0F);
+ this.bindTextureByName("/item/sign.png");
+ GL11.glPushMatrix();
+ GL11.glScalef(1.0F, -1.0F, -1.0F);
+ this.modelSign.renderSign();
+ GL11.glPopMatrix();
+ float var10 = (float)(1.0D / 60.0D);
+ GL11.glTranslatef(0.0F, 0.5F, 0.09F);
+ GL11.glScalef(var10, -var10, var10);
+ GL11.glNormal3f(0.0F, 0.0F, -1.0F * var10);
+ FontRenderer var11 = this.getFontRenderer();
+
+ for(int var12 = 0; var12 < var1.signText.length; ++var12) {
+ String var13 = var1.signText[var12];
+ if(var12 == var1.lineBeingEdited) {
+ var13 = "> " + var13 + " <";
+ var11.drawString(var13, -var11.getStringWidth(var13) / 2, var12 * 10 - var1.signText.length * 5, 0);
+ } else {
+ var11.drawString(var13, -var11.getStringWidth(var13) / 2, var12 * 10 - var1.signText.length * 5, 0);
+ }
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glPopMatrix();
+ }
+
+ public void renderTileEntityMobSpawner(TileEntity var1, double var2, double var4, double var6, float var8) {
+ this.a((TileEntitySign)var1, var2, var4, var6, var8);
+ }
+}
diff --git a/source/net/minecraft/src/TileEntitySpecialRenderer.java b/source/net/minecraft/src/TileEntitySpecialRenderer.java
new file mode 100644
index 0000000..d0ae86c
--- /dev/null
+++ b/source/net/minecraft/src/TileEntitySpecialRenderer.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+public abstract class TileEntitySpecialRenderer {
+ protected TileEntityRenderer tileEntityRenderer;
+
+ public abstract void renderTileEntityMobSpawner(TileEntity var1, double var2, double var4, double var6, float var8);
+
+ protected void bindTextureByName(String var1) {
+ RenderEngine var2 = this.tileEntityRenderer.renderEngine;
+ var2.bindTexture(var2.getTexture(var1));
+ }
+
+ public void setTileEntityRenderer(TileEntityRenderer var1) {
+ this.tileEntityRenderer = var1;
+ }
+
+ public FontRenderer getFontRenderer() {
+ return this.tileEntityRenderer.getFontRenderer();
+ }
+}
diff --git a/source/net/minecraft/src/Timer.java b/source/net/minecraft/src/Timer.java
new file mode 100644
index 0000000..55f1390
--- /dev/null
+++ b/source/net/minecraft/src/Timer.java
@@ -0,0 +1,58 @@
+package net.minecraft.src;
+
+public class Timer {
+ float ticksPerSecond;
+ private double lastHRTime;
+ public int elapsedTicks;
+ public float renderPartialTicks;
+ public float timerSpeed = 1.0F;
+ public float elapsedPartialTicks = 0.0F;
+ private long lastSyncSysClock;
+ private long lastSyncHRClock;
+ private double timeSyncAdjustment = 1.0D;
+
+ public Timer(float var1) {
+ this.ticksPerSecond = var1;
+ this.lastSyncSysClock = System.currentTimeMillis();
+ this.lastSyncHRClock = System.nanoTime() / 1000000L;
+ }
+
+ public void updateTimer() {
+ long var1 = System.currentTimeMillis();
+ long var3 = var1 - this.lastSyncSysClock;
+ long var5 = System.nanoTime() / 1000000L;
+ double var9;
+ if(var3 > 1000L) {
+ long var7 = var5 - this.lastSyncHRClock;
+ var9 = (double)var3 / (double)var7;
+ this.timeSyncAdjustment += (var9 - this.timeSyncAdjustment) * (double)0.2F;
+ this.lastSyncSysClock = var1;
+ this.lastSyncHRClock = var5;
+ }
+
+ if(var3 < 0L) {
+ this.lastSyncSysClock = var1;
+ this.lastSyncHRClock = var5;
+ }
+
+ double var11 = (double)var5 / 1000.0D;
+ var9 = (var11 - this.lastHRTime) * this.timeSyncAdjustment;
+ this.lastHRTime = var11;
+ if(var9 < 0.0D) {
+ var9 = 0.0D;
+ }
+
+ if(var9 > 1.0D) {
+ var9 = 1.0D;
+ }
+
+ this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + var9 * (double)this.timerSpeed * (double)this.ticksPerSecond);
+ this.elapsedTicks = (int)this.elapsedPartialTicks;
+ this.elapsedPartialTicks -= (float)this.elapsedTicks;
+ if(this.elapsedTicks > 10) {
+ this.elapsedTicks = 10;
+ }
+
+ this.renderPartialTicks = this.elapsedPartialTicks;
+ }
+}
diff --git a/source/net/minecraft/src/UnexpectedThrowable.java b/source/net/minecraft/src/UnexpectedThrowable.java
new file mode 100644
index 0000000..b05f1b4
--- /dev/null
+++ b/source/net/minecraft/src/UnexpectedThrowable.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class UnexpectedThrowable {
+ public final String description;
+ public final Exception exception;
+
+ public UnexpectedThrowable(String var1, Exception var2) {
+ this.description = var1;
+ this.exception = var2;
+ }
+}
diff --git a/source/net/minecraft/src/Vec3D.java b/source/net/minecraft/src/Vec3D.java
new file mode 100644
index 0000000..c0b23a5
--- /dev/null
+++ b/source/net/minecraft/src/Vec3D.java
@@ -0,0 +1,135 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Vec3D {
+ private static List vectorList = new ArrayList();
+ private static int nextVector = 0;
+ public double xCoord;
+ public double yCoord;
+ public double zCoord;
+
+ public static Vec3D createVectorHelper(double var0, double var2, double var4) {
+ return new Vec3D(var0, var2, var4);
+ }
+
+ public static void initialize() {
+ nextVector = 0;
+ }
+
+ public static Vec3D createVector(double var0, double var2, double var4) {
+ if(nextVector >= vectorList.size()) {
+ vectorList.add(createVectorHelper(0.0D, 0.0D, 0.0D));
+ }
+
+ return ((Vec3D)vectorList.get(nextVector++)).setComponents(var0, var2, var4);
+ }
+
+ private Vec3D(double var1, double var3, double var5) {
+ if(var1 == -0.0D) {
+ var1 = 0.0D;
+ }
+
+ if(var3 == -0.0D) {
+ var3 = 0.0D;
+ }
+
+ if(var5 == -0.0D) {
+ var5 = 0.0D;
+ }
+
+ this.xCoord = var1;
+ this.yCoord = var3;
+ this.zCoord = var5;
+ }
+
+ private Vec3D setComponents(double var1, double var3, double var5) {
+ this.xCoord = var1;
+ this.yCoord = var3;
+ this.zCoord = var5;
+ return this;
+ }
+
+ public Vec3D subtract(Vec3D var1) {
+ return createVector(var1.xCoord - this.xCoord, var1.yCoord - this.yCoord, var1.zCoord - this.zCoord);
+ }
+
+ public Vec3D normalize() {
+ double var1 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
+ return var1 < 1.0E-4D ? createVector(0.0D, 0.0D, 0.0D) : createVector(this.xCoord / var1, this.yCoord / var1, this.zCoord / var1);
+ }
+
+ public Vec3D crossProduct(Vec3D var1) {
+ return createVector(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 Vec3D addVector(double var1, double var3, double var5) {
+ return createVector(this.xCoord + var1, this.yCoord + var3, this.zCoord + var5);
+ }
+
+ public double distanceTo(Vec3D var1) {
+ double var2 = var1.xCoord - this.xCoord;
+ double var4 = var1.yCoord - this.yCoord;
+ double var6 = var1.zCoord - this.zCoord;
+ return (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6);
+ }
+
+ public double squareDistanceTo(Vec3D var1) {
+ double var2 = var1.xCoord - this.xCoord;
+ double var4 = var1.yCoord - this.yCoord;
+ double var6 = var1.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;
+ return var7 * var7 + var9 * var9 + var11 * var11;
+ }
+
+ public double lengthVector() {
+ return (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
+ }
+
+ public Vec3D getIntermediateWithXValue(Vec3D 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 ? createVector(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
+ }
+ }
+
+ public Vec3D getIntermediateWithYValue(Vec3D 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 ? createVector(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
+ }
+ }
+
+ public Vec3D getIntermediateWithZValue(Vec3D 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;
+ return var10 >= 0.0D && var10 <= 1.0D ? createVector(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
+ }
+ }
+
+ public String toString() {
+ return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")";
+ }
+}
diff --git a/source/net/minecraft/src/World.java b/source/net/minecraft/src/World.java
new file mode 100644
index 0000000..ce6119a
--- /dev/null
+++ b/source/net/minecraft/src/World.java
@@ -0,0 +1,1599 @@
+package net.minecraft.src;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeSet;
+
+public class World implements IBlockAccess {
+ private List lightingToUpdate;
+ private List loadedEntityList;
+ private List unloadedEntityList;
+ private TreeSet scheduledTickTreeSet;
+ private Set scheduledTickSet;
+ public List loadedTileEntityList;
+ public long worldTime;
+ private long skyColor;
+ private long fogColor;
+ private long cloudColor;
+ public int skylightSubtracted;
+ private int updateLCG;
+ private int DIST_HASH_MAGIC;
+ public boolean editingBlocks;
+ public static float[] lightBrightnessTable = new float[16];
+ public Entity playerEntity;
+ public int difficultySetting;
+ public Object fontRenderer;
+ public Random rand;
+ public int spawnX;
+ public int spawnY;
+ public int spawnZ;
+ public boolean isNewWorld;
+ private List worldAccesses;
+ private IChunkProvider chunkProvider;
+ private File saveDirectory;
+ public long randomSeed;
+ private NBTTagCompound nbtCompoundPlayer;
+ public long setSizeOnDisk;
+ public final String levelName;
+ private ArrayList collidingBoundingBoxes;
+ private List entitiesWithinAABBExcludingEntity;
+
+ public static NBTTagCompound getLevelData(File var0, String var1) {
+ File var2 = new File(var0, "saves");
+ File var3 = new File(var2, var1);
+ if(!var3.exists()) {
+ return null;
+ } else {
+ File var4 = new File(var3, "level.dat");
+ if(var4.exists()) {
+ try {
+ NBTTagCompound var5 = CompressedStreamTools.readCompressed(new FileInputStream(var4));
+ NBTTagCompound var6 = var5.getCompoundTag("Data");
+ return var6;
+ } catch (Exception var7) {
+ var7.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+ }
+
+ public static void deleteWorld(File var0, String var1) {
+ File var2 = new File(var0, "saves");
+ File var3 = new File(var2, var1);
+ if(var3.exists()) {
+ deleteWorldFiles(var3.listFiles());
+ var3.delete();
+ }
+ }
+
+ private static void deleteWorldFiles(File[] var0) {
+ for(int var1 = 0; var1 < var0.length; ++var1) {
+ if(var0[var1].isDirectory()) {
+ deleteWorldFiles(var0[var1].listFiles());
+ }
+
+ var0[var1].delete();
+ }
+
+ }
+
+ public World(File var1, String var2) {
+ this(var1, var2, (new Random()).nextLong());
+ }
+
+ public World(File var1, String var2, long var3) {
+ this.lightingToUpdate = new ArrayList();
+ this.loadedEntityList = new ArrayList();
+ this.unloadedEntityList = new ArrayList();
+ this.scheduledTickTreeSet = new TreeSet();
+ this.scheduledTickSet = new HashSet();
+ this.loadedTileEntityList = new ArrayList();
+ this.worldTime = 0L;
+ this.skyColor = 8961023L;
+ this.fogColor = 12638463L;
+ this.cloudColor = 16777215L;
+ this.skylightSubtracted = 0;
+ this.updateLCG = (new Random()).nextInt();
+ this.DIST_HASH_MAGIC = 1013904223;
+ this.editingBlocks = false;
+ this.rand = new Random();
+ this.isNewWorld = false;
+ this.worldAccesses = new ArrayList();
+ this.randomSeed = 0L;
+ this.setSizeOnDisk = 0L;
+ this.collidingBoundingBoxes = new ArrayList();
+ this.entitiesWithinAABBExcludingEntity = new ArrayList();
+ this.levelName = var2;
+ var1.mkdirs();
+ this.saveDirectory = new File(var1, var2);
+ this.saveDirectory.mkdirs();
+ File var5 = new File(this.saveDirectory, "level.dat");
+ this.isNewWorld = !var5.exists();
+ if(var5.exists()) {
+ try {
+ NBTTagCompound var6 = CompressedStreamTools.readCompressed(new FileInputStream(var5));
+ NBTTagCompound var7 = var6.getCompoundTag("Data");
+ this.randomSeed = var7.getLong("RandomSeed");
+ this.spawnX = var7.getInteger("SpawnX");
+ this.spawnY = var7.getInteger("SpawnY");
+ this.spawnZ = var7.getInteger("SpawnZ");
+ this.worldTime = var7.getLong("Time");
+ this.setSizeOnDisk = var7.getLong("SizeOnDisk");
+ this.nbtCompoundPlayer = var7.getCompoundTag("Player");
+ } catch (Exception var8) {
+ var8.printStackTrace();
+ }
+ }
+
+ boolean var9 = false;
+ if(this.randomSeed == 0L) {
+ this.randomSeed = var3;
+ var9 = true;
+ }
+
+ this.chunkProvider = this.getChunkProvider(this.saveDirectory);
+ if(var9) {
+ this.spawnX = 0;
+ this.spawnY = 64;
+
+ for(this.spawnZ = 0; !this.findSpawn(this.spawnX, this.spawnZ); this.spawnZ += this.rand.nextInt(64) - this.rand.nextInt(64)) {
+ this.spawnX += this.rand.nextInt(64) - this.rand.nextInt(64);
+ }
+ }
+
+ this.calculateInitialSkylight();
+ }
+
+ protected IChunkProvider getChunkProvider(File var1) {
+ return new ChunkProviderLoadOrGenerate(this, new ChunkLoader(var1, true), new ChunkProviderGenerate(this, this.randomSeed));
+ }
+
+ public void setSpawnLocation() {
+ while(this.getFirstUncoveredBlock(this.spawnX, this.spawnZ) == 0) {
+ this.spawnX += this.rand.nextInt(8) - this.rand.nextInt(8);
+ this.spawnZ += this.rand.nextInt(8) - this.rand.nextInt(8);
+ }
+
+ }
+
+ private boolean findSpawn(int var1, int var2) {
+ return this.getFirstUncoveredBlock(var1, var2) == Block.sand.blockID;
+ }
+
+ private int getFirstUncoveredBlock(int var1, int var2) {
+ int var3;
+ for(var3 = 63; this.getBlockId(var1, var3 + 1, var2) != 0; ++var3) {
+ }
+
+ return this.getBlockId(var1, var3, var2);
+ }
+
+ public void spawnPlayerWithLoadedChunks() {
+ try {
+ if(this.nbtCompoundPlayer != null) {
+ this.playerEntity.readFromNBT(this.nbtCompoundPlayer);
+ this.nbtCompoundPlayer = null;
+ }
+
+ this.spawnEntityInWorld(this.playerEntity);
+ } catch (Exception var2) {
+ var2.printStackTrace();
+ }
+
+ }
+
+ public void saveWorld(boolean var1, IProgressUpdate var2) {
+ if(this.chunkProvider.canSave()) {
+ if(var2 != null) {
+ var2.displayProgressMessage("Saving level");
+ }
+
+ this.saveLevel();
+ if(var2 != null) {
+ var2.displayLoadingString("Saving chunks");
+ }
+
+ this.chunkProvider.saveChunks(var1, var2);
+ }
+ }
+
+ private void saveLevel() {
+ NBTTagCompound var1 = new NBTTagCompound();
+ var1.setLong("RandomSeed", this.randomSeed);
+ var1.setInteger("SpawnX", this.spawnX);
+ var1.setInteger("SpawnY", this.spawnY);
+ var1.setInteger("SpawnZ", this.spawnZ);
+ var1.setLong("Time", this.worldTime);
+ var1.setLong("SizeOnDisk", this.setSizeOnDisk);
+ var1.setLong("LastPlayed", System.currentTimeMillis());
+ NBTTagCompound var2;
+ if(this.playerEntity != null) {
+ var2 = new NBTTagCompound();
+ this.playerEntity.writeToNBT(var2);
+ var1.setCompoundTag("Player", var2);
+ }
+
+ var2 = new NBTTagCompound();
+ var2.setTag("Data", var1);
+
+ try {
+ File var3 = new File(this.saveDirectory, "level.dat_new");
+ File var4 = new File(this.saveDirectory, "level.dat_old");
+ File var5 = new File(this.saveDirectory, "level.dat");
+ CompressedStreamTools.writeCompressed(var2, new FileOutputStream(var3));
+ if(var4.exists()) {
+ var4.delete();
+ }
+
+ var5.renameTo(var4);
+ if(var5.exists()) {
+ var5.delete();
+ }
+
+ var3.renameTo(var5);
+ if(var3.exists()) {
+ var3.delete();
+ }
+ } catch (Exception var6) {
+ var6.printStackTrace();
+ }
+
+ }
+
+ public boolean saveWorld(int var1) {
+ if(!this.chunkProvider.canSave()) {
+ return true;
+ } else {
+ if(var1 == 0) {
+ this.saveLevel();
+ }
+
+ return this.chunkProvider.saveChunks(false, (IProgressUpdate)null);
+ }
+ }
+
+ public int getBlockId(int var1, int var2, int var3) {
+ return var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000 ? (var2 < 0 ? 0 : (var2 >= 128 ? 0 : this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4).getBlockID(var1 & 15, var2, var3 & 15))) : 0;
+ }
+
+ public boolean blockExists(int var1, int var2, int var3) {
+ return var2 >= 0 && var2 < 128 ? this.chunkExists(var1 >> 4, var3 >> 4) : false;
+ }
+
+ public boolean checkChunksExist(int var1, int var2, int var3, int var4, int var5, int var6) {
+ if(var5 >= 0 && var2 < 128) {
+ var1 >>= 4;
+ var2 >>= 4;
+ var3 >>= 4;
+ var4 >>= 4;
+ var5 >>= 4;
+ var6 >>= 4;
+
+ for(int var7 = var1; var7 <= var4; ++var7) {
+ for(int var8 = var3; var8 <= var6; ++var8) {
+ if(!this.chunkExists(var7, var8)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private 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 setBlockAndMetadata(int var1, int var2, int var3, int var4, int var5) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return false;
+ } else {
+ Chunk var6 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ return var6.setBlockIDWithMetadata(var1 & 15, var2, var3 & 15, var4, var5);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setBlock(int var1, int var2, int var3, int var4) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return false;
+ } else {
+ Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ return var5.setBlockID(var1 & 15, var2, var3 & 15, var4);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public Material getBlockMaterial(int var1, int var2, int var3) {
+ int var4 = this.getBlockId(var1, var2, var3);
+ return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial;
+ }
+
+ public int getBlockMetadata(int var1, int var2, int var3) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ return 0;
+ } else {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ return var4.getBlockMetadata(var1, var2, var3);
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ public void setBlockMetadataWithNotify(int var1, int var2, int var3, int var4) {
+ this.setBlockMetadata(var1, var2, var3, var4);
+ }
+
+ public boolean setBlockMetadata(int var1, int var2, int var3, int var4) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return false;
+ } else {
+ Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ var5.setBlockMetadata(var1, var2, var3, var4);
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setBlockWithNotify(int var1, int var2, int var3, int var4) {
+ if(this.setBlock(var1, var2, var3, var4)) {
+ this.markBlockNeedsUpdate(var1, var2, var3, var4);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setBlockAndMetadataWithNotify(int var1, int var2, int var3, int var4, int var5) {
+ if(this.setBlockAndMetadata(var1, var2, var3, var4, var5)) {
+ this.markBlockNeedsUpdate(var1, var2, var3, var4);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private void markBlockNeedsUpdate(int var1, int var2, int var3, int var4) {
+ for(int var5 = 0; var5 < this.worldAccesses.size(); ++var5) {
+ ((IWorldAccess)this.worldAccesses.get(var5)).markBlockAndNeighborsNeedsUpdate(var1, var2, var3);
+ }
+
+ this.notifyBlocksOfNeighborChange(var1, var2, var3, var4);
+ }
+
+ public void markBlockAsNeedsUpdate(int var1, int var2, int var3, int var4) {
+ if(var3 > var4) {
+ int var5 = var4;
+ var4 = var3;
+ var3 = var5;
+ }
+
+ this.markBlocksDirty(var1, var3, var2, var1, var4, var2);
+ }
+
+ public void markBlocksDirty(int var1, int var2, int var3, int var4, int var5, int var6) {
+ for(int var7 = 0; var7 < this.worldAccesses.size(); ++var7) {
+ ((IWorldAccess)this.worldAccesses.get(var7)).markBlockRangeNeedsUpdate(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);
+ }
+
+ private void notifyBlockOfNeighborChange(int var1, int var2, int var3, int var4) {
+ if(!this.editingBlocks) {
+ Block var5 = Block.blocksList[this.getBlockId(var1, var2, var3)];
+ if(var5 != null) {
+ var5.onNeighborBlockChange(this, var1, var2, var3, var4);
+ }
+
+ }
+ }
+
+ public boolean canBlockSeeTheSky(int var1, int var2, int var3) {
+ return this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4).canBlockSeeTheSky(var1 & 15, var2, var3 & 15);
+ }
+
+ public int getBlockLightValue(int var1, int var2, int var3) {
+ return this.getBlockLightValue_do(var1, var2, var3, true);
+ }
+
+ public int getBlockLightValue_do(int var1, int var2, int var3, boolean var4) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ int var5;
+ if(var4) {
+ var5 = this.getBlockId(var1, var2, var3);
+ if(var5 == Block.stairSingle.blockID || var5 == Block.tilledField.blockID) {
+ 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) {
+ var6 = var7;
+ }
+
+ if(var8 > var6) {
+ var6 = var8;
+ }
+
+ if(var9 > var6) {
+ var6 = var9;
+ }
+
+ if(var10 > var6) {
+ var6 = var10;
+ }
+
+ return var6;
+ }
+ }
+
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ var5 = 15 - this.skylightSubtracted;
+ if(var5 < 0) {
+ var5 = 0;
+ }
+
+ return var5;
+ } else {
+ Chunk var11 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ return var11.getBlockLightValue(var1, var2, var3, this.skylightSubtracted);
+ }
+ } else {
+ return 15;
+ }
+ }
+
+ public boolean canExistingBlockSeeTheSky(int var1, int var2, int var3) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return true;
+ } else if(!this.chunkExists(var1 >> 4, var3 >> 4)) {
+ return false;
+ } else {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ return var4.canBlockSeeTheSky(var1, var2, var3);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public int getHeightValue(int var1, int var2) {
+ if(var1 >= -32000000 && var2 >= -32000000 && var1 < 32000000 && var2 <= 32000000) {
+ if(!this.chunkExists(var1 >> 4, var2 >> 4)) {
+ return 0;
+ } else {
+ Chunk var3 = this.getChunkFromChunkCoords(var1 >> 4, var2 >> 4);
+ return var3.getHeightValue(var1 & 15, var2 & 15);
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ public void neighborLightPropagationChanged(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
+ if(this.blockExists(var2, var3, var4)) {
+ if(var1 == EnumSkyBlock.Sky) {
+ if(this.canExistingBlockSeeTheSky(var2, var3, var4)) {
+ var5 = 15;
+ }
+ } else if(var1 == EnumSkyBlock.Block) {
+ int var6 = this.getBlockId(var2, var3, var4);
+ if(Block.lightValue[var6] > var5) {
+ var5 = Block.lightValue[var6];
+ }
+ }
+
+ if(this.getSavedLightValue(var1, var2, var3, var4) != var5) {
+ this.scheduleLightingUpdate(var1, var2, var3, var4, var2, var3, var4);
+ }
+
+ }
+ }
+
+ public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) {
+ if(var3 >= 0 && var3 < 128 && var2 >= -32000000 && var4 >= -32000000 && var2 < 32000000 && var4 <= 32000000) {
+ int var5 = var2 >> 4;
+ int var6 = var4 >> 4;
+ if(!this.chunkExists(var5, var6)) {
+ return 0;
+ } 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 >= -32000000 && var4 >= -32000000 && var2 < 32000000 && var4 <= 32000000) {
+ if(var3 >= 0) {
+ if(var3 < 128) {
+ 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.worldAccesses.size(); ++var7) {
+ ((IWorldAccess)this.worldAccesses.get(var7)).markBlockAndNeighborsNeedsUpdate(var2, var3, var4);
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+ public float getBrightness(int var1, int var2, int var3) {
+ return lightBrightnessTable[this.getBlockLightValue(var1, var2, var3)];
+ }
+
+ public boolean isDaytime() {
+ return this.skylightSubtracted < 4;
+ }
+
+ public MovingObjectPosition rayTraceBlocks(Vec3D var1, Vec3D var2) {
+ return this.rayTraceBlocks_do(var1, var2, false);
+ }
+
+ public MovingObjectPosition rayTraceBlocks_do(Vec3D var1, Vec3D var2, boolean var3) {
+ 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 var4 = MathHelper.floor_double(var2.xCoord);
+ int var5 = MathHelper.floor_double(var2.yCoord);
+ int var6 = MathHelper.floor_double(var2.zCoord);
+ int var7 = MathHelper.floor_double(var1.xCoord);
+ int var8 = MathHelper.floor_double(var1.yCoord);
+ int var9 = MathHelper.floor_double(var1.zCoord);
+ int var10 = 20;
+
+ while(var10-- >= 0) {
+ if(Double.isNaN(var1.xCoord) || Double.isNaN(var1.yCoord) || Double.isNaN(var1.zCoord)) {
+ return null;
+ }
+
+ if(var7 == var4 && var8 == var5 && var9 == var6) {
+ return null;
+ }
+
+ double var11 = 999.0D;
+ double var13 = 999.0D;
+ double var15 = 999.0D;
+ if(var4 > var7) {
+ var11 = (double)var7 + 1.0D;
+ }
+
+ if(var4 < var7) {
+ var11 = (double)var7 + 0.0D;
+ }
+
+ if(var5 > var8) {
+ var13 = (double)var8 + 1.0D;
+ }
+
+ if(var5 < var8) {
+ var13 = (double)var8 + 0.0D;
+ }
+
+ if(var6 > var9) {
+ var15 = (double)var9 + 1.0D;
+ }
+
+ if(var6 < var9) {
+ var15 = (double)var9 + 0.0D;
+ }
+
+ double var17 = 999.0D;
+ double var19 = 999.0D;
+ double var21 = 999.0D;
+ double var23 = var2.xCoord - var1.xCoord;
+ double var25 = var2.yCoord - var1.yCoord;
+ double var27 = var2.zCoord - var1.zCoord;
+ if(var11 != 999.0D) {
+ var17 = (var11 - var1.xCoord) / var23;
+ }
+
+ if(var13 != 999.0D) {
+ var19 = (var13 - var1.yCoord) / var25;
+ }
+
+ if(var15 != 999.0D) {
+ var21 = (var15 - var1.zCoord) / var27;
+ }
+
+ boolean var29 = false;
+ byte var35;
+ if(var17 < var19 && var17 < var21) {
+ if(var4 > var7) {
+ var35 = 4;
+ } else {
+ var35 = 5;
+ }
+
+ var1.xCoord = var11;
+ var1.yCoord += var25 * var17;
+ var1.zCoord += var27 * var17;
+ } else if(var19 < var21) {
+ if(var5 > var8) {
+ var35 = 0;
+ } else {
+ var35 = 1;
+ }
+
+ var1.xCoord += var23 * var19;
+ var1.yCoord = var13;
+ var1.zCoord += var27 * var19;
+ } else {
+ if(var6 > var9) {
+ var35 = 2;
+ } else {
+ var35 = 3;
+ }
+
+ var1.xCoord += var23 * var21;
+ var1.yCoord += var25 * var21;
+ var1.zCoord = var15;
+ }
+
+ Vec3D var30 = Vec3D.createVector(var1.xCoord, var1.yCoord, var1.zCoord);
+ var7 = (int)(var30.xCoord = (double)MathHelper.floor_double(var1.xCoord));
+ if(var35 == 5) {
+ --var7;
+ ++var30.xCoord;
+ }
+
+ var8 = (int)(var30.yCoord = (double)MathHelper.floor_double(var1.yCoord));
+ if(var35 == 1) {
+ --var8;
+ ++var30.yCoord;
+ }
+
+ var9 = (int)(var30.zCoord = (double)MathHelper.floor_double(var1.zCoord));
+ if(var35 == 3) {
+ --var9;
+ ++var30.zCoord;
+ }
+
+ int var31 = this.getBlockId(var7, var8, var9);
+ int var32 = this.getBlockMetadata(var7, var8, var9);
+ Block var33 = Block.blocksList[var31];
+ MovingObjectPosition var34;
+ if(var31 > 0 && var33.canCollideCheck(var32, var3)) {
+ var34 = var33.collisionRayTrace(this, var7, var8, var9, var1, var2);
+ if(var34 != null) {
+ return var34;
+ }
+ }
+
+ var31 = this.getBlockId(var7, var8 - 1, var9);
+ var32 = this.getBlockMetadata(var7, var8 - 1, var9);
+ var33 = Block.blocksList[var31];
+ if(var31 > 0 && var33.canCollideCheck(var32, var3)) {
+ var34 = var33.collisionRayTrace(this, var7, var8 - 1, var9, var1, var2);
+ if(var34 != null) {
+ return var34;
+ }
+ }
+ }
+
+ return null;
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void playSoundAtEntity(Entity var1, String var2, float var3, float var4) {
+ for(int var5 = 0; var5 < this.worldAccesses.size(); ++var5) {
+ float var6 = 16.0F;
+ if(var3 > 1.0F) {
+ var6 *= var3;
+ }
+
+ if(this.playerEntity.getDistanceSqToEntity(var1) < (double)(var6 * var6)) {
+ ((IWorldAccess)this.worldAccesses.get(var5)).playSound(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) {
+ try {
+ for(int var10 = 0; var10 < this.worldAccesses.size(); ++var10) {
+ float var11 = 16.0F;
+ if(var8 > 1.0F) {
+ var11 *= var8;
+ }
+
+ double var12 = var1 - this.playerEntity.posX;
+ double var14 = var3 - this.playerEntity.posY;
+ double var16 = var5 - this.playerEntity.posZ;
+ if(var12 * var12 + var14 * var14 + var16 * var16 < (double)(var11 * var11)) {
+ ((IWorldAccess)this.worldAccesses.get(var10)).playSound(var7, var1, var3, var5, var8, var9);
+ }
+ }
+ } catch (Exception var18) {
+ var18.printStackTrace();
+ }
+
+ }
+
+ public void playMusic(double var1, double var3, double var5, String var7, float var8) {
+ }
+
+ public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) {
+ for(int var14 = 0; var14 < this.worldAccesses.size(); ++var14) {
+ ((IWorldAccess)this.worldAccesses.get(var14)).spawnParticle(var1, var2, var4, var6, var8, var10, var12);
+ }
+
+ }
+
+ public void spawnEntityInWorld(Entity var1) {
+ int var2 = MathHelper.floor_double(var1.posX / 16.0D);
+ int var3 = MathHelper.floor_double(var1.posZ / 16.0D);
+ if(this.chunkExists(var2, var3)) {
+ this.getChunkFromChunkCoords(var2, var3).addEntity(var1);
+ this.loadedEntityList.add(var1);
+
+ for(int var4 = 0; var4 < this.worldAccesses.size(); ++var4) {
+ ((IWorldAccess)this.worldAccesses.get(var4)).obtainEntitySkin(var1);
+ }
+ } else {
+ System.out.println("Failed to add entity " + var1);
+ }
+
+ }
+
+ public void setEntityDead(Entity var1) {
+ var1.setEntityDead();
+ }
+
+ public void addWorldAccess(IWorldAccess var1) {
+ this.worldAccesses.add(var1);
+ }
+
+ public void removeWorldAccess(IWorldAccess var1) {
+ this.worldAccesses.remove(var1);
+ }
+
+ public List getCollidingBoundingBoxes(Entity var1, AxisAlignedBB var2) {
+ this.collidingBoundingBoxes.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 = var5 - 1; var10 < var6; ++var10) {
+ for(int var11 = var7; var11 < var8; ++var11) {
+ Block var12 = Block.blocksList[this.getBlockId(var9, var10, var11)];
+ if(var12 != null) {
+ var12.getCollidingBoundingBoxes(this, var9, var10, var11, var2, this.collidingBoundingBoxes);
+ }
+ }
+ }
+ }
+
+ double var16 = 0.25D;
+ List var14 = this.getEntitiesWithinAABBExcludingEntity(var1, var2.expand(var16, var16, var16));
+
+ for(int var15 = 0; var15 < var14.size(); ++var15) {
+ AxisAlignedBB var13 = ((Entity)var14.get(var15)).getBoundingBox();
+ if(var13 != null) {
+ this.collidingBoundingBoxes.add(var13);
+ }
+
+ var13 = var1.getCollisionBox((Entity)var14.get(var15));
+ if(var13 != null) {
+ this.collidingBoundingBoxes.add(var13);
+ }
+ }
+
+ return this.collidingBoundingBoxes;
+ }
+
+ public int calculateSkylightSubtracted(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F);
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ return (int)(var3 * 11.0F);
+ }
+
+ public Vec3D getSkyColor(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ float var4 = (float)(this.skyColor >> 16 & 255L) / 255.0F;
+ float var5 = (float)(this.skyColor >> 8 & 255L) / 255.0F;
+ float var6 = (float)(this.skyColor & 255L) / 255.0F;
+ var4 *= var3;
+ var5 *= var3;
+ var6 *= var3;
+ return Vec3D.createVector((double)var4, (double)var5, (double)var6);
+ }
+
+ public float getCelestialAngle(float var1) {
+ int var2 = (int)(this.worldTime % 24000L);
+ float var3 = ((float)var2 + var1) / 24000.0F - 0.25F;
+ if(var3 < 0.0F) {
+ ++var3;
+ }
+
+ if(var3 > 1.0F) {
+ --var3;
+ }
+
+ float var4 = var3;
+ var3 = 1.0F - (float)((Math.cos((double)var3 * Math.PI) + 1.0D) / 2.0D);
+ var3 = var4 + (var3 - var4) / 3.0F;
+ return var3;
+ }
+
+ public Vec3D getCloudColor(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ float var4 = (float)(this.cloudColor >> 16 & 255L) / 255.0F;
+ float var5 = (float)(this.cloudColor >> 8 & 255L) / 255.0F;
+ float var6 = (float)(this.cloudColor & 255L) / 255.0F;
+ var4 *= var3 * 0.9F + 0.1F;
+ var5 *= var3 * 0.9F + 0.1F;
+ var6 *= var3 * 0.85F + 0.15F;
+ return Vec3D.createVector((double)var4, (double)var5, (double)var6);
+ }
+
+ public Vec3D getFogColor(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ float var4 = (float)(this.fogColor >> 16 & 255L) / 255.0F;
+ float var5 = (float)(this.fogColor >> 8 & 255L) / 255.0F;
+ float var6 = (float)(this.fogColor & 255L) / 255.0F;
+ var4 *= var3 * 0.94F + 0.06F;
+ var5 *= var3 * 0.94F + 0.06F;
+ var6 *= var3 * 0.91F + 0.09F;
+ return Vec3D.createVector((double)var4, (double)var5, (double)var6);
+ }
+
+ public int getTopSolidOrLiquidBlock(int var1, int var2) {
+ return 64;
+ }
+
+ public float getStarBrightness(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 12.0F / 16.0F);
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ return var3 * var3 * 0.5F;
+ }
+
+ public void scheduleBlockUpdate(int var1, int var2, int var3, int var4) {
+ NextTickListEntry var5 = new NextTickListEntry(var1, var2, var3, var4);
+ byte var6 = 8;
+ if(this.checkChunksExist(var1 - var6, var2 - var6, var3 - var6, var1 + var6, var2 + var6, var3 + var6)) {
+ if(var4 > 0) {
+ var5.setScheduledTime((long)Block.blocksList[var4].tickRate() + this.worldTime);
+ }
+
+ if(!this.scheduledTickSet.contains(var5)) {
+ this.scheduledTickSet.add(var5);
+ this.scheduledTickTreeSet.add(var5);
+ }
+ }
+
+ }
+
+ public void updateEntities() {
+ this.loadedEntityList.removeAll(this.unloadedEntityList);
+
+ int var1;
+ int var3;
+ for(var1 = 0; var1 < this.worldAccesses.size(); ++var1) {
+ IWorldAccess var2 = (IWorldAccess)this.worldAccesses.get(var1);
+
+ for(var3 = 0; var3 < this.unloadedEntityList.size(); ++var3) {
+ var2.releaseEntitySkin((Entity)this.unloadedEntityList.get(var3));
+ }
+ }
+
+ this.unloadedEntityList.clear();
+
+ for(var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
+ Entity var6 = (Entity)this.loadedEntityList.get(var1);
+ if(var6.ridingEntity != null) {
+ if(!var6.ridingEntity.isDead && var6.ridingEntity.riddenByEntity == var6) {
+ continue;
+ }
+
+ var6.ridingEntity.riddenByEntity = null;
+ var6.ridingEntity = null;
+ }
+
+ if(!var6.isDead) {
+ this.updateEntity(var6);
+ }
+
+ if(var6.isDead) {
+ var3 = MathHelper.floor_double(var6.posX / 16.0D);
+ int var4 = MathHelper.floor_double(var6.posZ / 16.0D);
+ if(this.chunkExists(var3, var4)) {
+ this.getChunkFromChunkCoords(var3, var4).removeEntity(var6);
+ }
+
+ this.loadedEntityList.remove(var1--);
+
+ for(int var5 = 0; var5 < this.worldAccesses.size(); ++var5) {
+ ((IWorldAccess)this.worldAccesses.get(var5)).releaseEntitySkin(var6);
+ }
+ }
+ }
+
+ for(var1 = 0; var1 < this.loadedTileEntityList.size(); ++var1) {
+ TileEntity var7 = (TileEntity)this.loadedTileEntityList.get(var1);
+ var7.updateEntity();
+ }
+
+ }
+
+ private void updateEntity(Entity var1) {
+ int var2 = MathHelper.floor_double(var1.posX);
+ int var3 = MathHelper.floor_double(var1.posY);
+ int var4 = MathHelper.floor_double(var1.posZ);
+ byte var5 = 16;
+ if(this.checkChunksExist(var2 - var5, 0, var4 - var5, var2 + var5, 128, var4 + var5)) {
+ var1.lastTickPosX = var1.posX;
+ var1.lastTickPosY = var1.posY;
+ var1.lastTickPosZ = var1.posZ;
+ var1.prevRotationYaw = var1.rotationYaw;
+ var1.prevRotationPitch = var1.rotationPitch;
+ 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.ridingEntity != null) {
+ var1.updateRidden();
+ } else {
+ var1.onUpdate();
+ }
+
+ int var9 = MathHelper.floor_double(var1.posX / 16.0D);
+ int var10 = MathHelper.floor_double(var1.posY / 16.0D);
+ int var11 = MathHelper.floor_double(var1.posZ / 16.0D);
+ if(var6 != var9 || var7 != var10 || var8 != var11) {
+ if(this.chunkExists(var6, var8)) {
+ this.getChunkFromChunkCoords(var6, var8).removeEntityAtIndex(var1, var7);
+ }
+
+ if(this.chunkExists(var9, var11)) {
+ this.getChunkFromChunkCoords(var9, var11).addEntity(var1);
+ } else {
+ var1.setEntityDead();
+ }
+ }
+
+ if(var1.riddenByEntity != null) {
+ if(!var1.riddenByEntity.isDead && var1.riddenByEntity.ridingEntity == var1) {
+ this.updateEntity(var1.riddenByEntity);
+ } else {
+ var1.riddenByEntity.ridingEntity = null;
+ var1.riddenByEntity = null;
+ }
+ }
+
+ 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;
+ }
+
+ }
+ }
+
+ public boolean checkIfAABBIsClear(AxisAlignedBB var1) {
+ List var2 = this.getEntitiesWithinAABBExcludingEntity((Entity)null, var1);
+
+ for(int var3 = 0; var3 < var2.size(); ++var3) {
+ Entity var4 = (Entity)var2.get(var3);
+ if(!var4.isDead && var4.preventEntitySpawning) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public boolean getIsAnyLiquid(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.getIsLiquid()) {
+ 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);
+
+ 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) {
+ return true;
+ }
+ }
+ }
+ }
+
+ 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);
+ boolean var10 = false;
+ Vec3D var11 = Vec3D.createVector(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) {
+ Block var15 = Block.blocksList[this.getBlockId(var12, var13, var14)];
+ if(var15 != null && var15.blockMaterial == var2) {
+ double var16 = (double)((float)(var13 + 1) - BlockFluid.getPercentAir(this.getBlockMetadata(var12, var13, var14)));
+ if((double)var7 >= var16) {
+ var10 = true;
+ var15.velocityToAddToEntity(this, var12, var13, var14, var3, var11);
+ }
+ }
+ }
+ }
+ }
+
+ if(var11.lengthVector() > 0.0D) {
+ var11 = var11.normalize();
+ double var18 = 0.004D;
+ var3.motionX += var11.xCoord * var18;
+ var3.motionY += var11.yCoord * var18;
+ var3.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);
+
+ 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) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public void createExplosion(Entity var1, double var2, double var4, double var6, float var8) {
+ (new Explosion()).doExplosion(this, var1, var2, var4, var6, var8);
+ }
+
+ public float getBlockDensity(Vec3D 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);
+ 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(Vec3D.createVector(var14, var16, var18), var1) == null) {
+ ++var9;
+ }
+
+ ++var10;
+ }
+ }
+ }
+
+ return (float)var9 / (float)var10;
+ }
+
+ public void extinguishFire(int var1, int var2, int var3, int var4) {
+ if(var4 == 0) {
+ --var2;
+ }
+
+ if(var4 == 1) {
+ ++var2;
+ }
+
+ if(var4 == 2) {
+ --var3;
+ }
+
+ if(var4 == 3) {
+ ++var3;
+ }
+
+ if(var4 == 4) {
+ --var1;
+ }
+
+ if(var4 == 5) {
+ ++var1;
+ }
+
+ if(this.getBlockId(var1, var2, var3) == Block.fire.blockID) {
+ this.playSoundEffect((double)((float)var1 + 0.5F), (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), "random.fizz", 0.5F, 2.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.8F);
+ this.setBlockWithNotify(var1, var2, var3, 0);
+ }
+
+ }
+
+ public Entity createDebugPlayer(Class var1) {
+ return null;
+ }
+
+ public String getDebugLoadedEntities() {
+ return "All: " + this.loadedEntityList.size();
+ }
+
+ public Entity getPlayerEntity() {
+ return this.playerEntity;
+ }
+
+ public TileEntity getBlockTileEntity(int var1, int var2, int var3) {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ return var4 != null ? var4.getChunkBlockTileEntity(var1 & 15, var2, var3 & 15) : null;
+ }
+
+ public void setBlockTileEntity(int var1, int var2, int var3, TileEntity var4) {
+ Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ if(var5 != null) {
+ var5.setChunkBlockTileEntity(var1 & 15, var2, var3 & 15, var4);
+ }
+
+ }
+
+ public void removeBlockTileEntity(int var1, int var2, int var3) {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ if(var4 != null) {
+ var4.removeChunkBlockTileEntity(var1 & 15, var2, var3 & 15);
+ }
+
+ }
+
+ public boolean isBlockNormalCube(int var1, int var2, int var3) {
+ Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)];
+ return var4 == null ? false : var4.isOpaqueCube();
+ }
+
+ public void saveWorldIndirectly(IProgressUpdate var1) {
+ this.saveWorld(true, var1);
+ }
+
+ public boolean updatingLighting() {
+ int var1 = 100000;
+
+ while(this.lightingToUpdate.size() > 0) {
+ --var1;
+ if(var1 <= 0) {
+ return true;
+ }
+
+ ((MetadataChunkBlock)this.lightingToUpdate.remove(this.lightingToUpdate.size() - 1)).updateLight(this);
+ }
+
+ return false;
+ }
+
+ public void scheduleLightingUpdate(EnumSkyBlock var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ int var8 = this.lightingToUpdate.size();
+ int var9 = 4;
+ if(var9 > var8) {
+ var9 = var8;
+ }
+
+ for(int var10 = 0; var10 < var9; ++var10) {
+ MetadataChunkBlock var11 = (MetadataChunkBlock)this.lightingToUpdate.get(this.lightingToUpdate.size() - var10 - 1);
+ if(var11.skyBlock == var1 && var11.getLightUpdated(var2, var3, var4, var5, var6, var7)) {
+ return;
+ }
+ }
+
+ this.lightingToUpdate.add(new MetadataChunkBlock(var1, var2, var3, var4, var5, var6, var7));
+ if(this.lightingToUpdate.size() > 100000) {
+ while(this.lightingToUpdate.size() > '\uc350') {
+ this.updatingLighting();
+ }
+ }
+
+ }
+
+ public void calculateInitialSkylight() {
+ int var1 = this.calculateSkylightSubtracted(1.0F);
+ if(var1 != this.skylightSubtracted) {
+ this.skylightSubtracted = var1;
+ }
+
+ }
+
+ public void tick() {
+ this.chunkProvider.unload100OldestChunks();
+ if(!this.loadedEntityList.contains(this.playerEntity) && this.playerEntity != null) {
+ System.out.println("DOHASDOSHIH!");
+ this.spawnEntityInWorld(this.playerEntity);
+ }
+
+ int var1 = this.calculateSkylightSubtracted(1.0F);
+ int var2;
+ if(var1 != this.skylightSubtracted) {
+ this.skylightSubtracted = var1;
+
+ for(var2 = 0; var2 < this.worldAccesses.size(); ++var2) {
+ ((IWorldAccess)this.worldAccesses.get(var2)).updateAllRenderers();
+ }
+ }
+
+ ++this.worldTime;
+ if(this.worldTime % 20L == 0L) {
+ this.saveWorld(false, (IProgressUpdate)null);
+ }
+
+ this.tickUpdates(false);
+ var2 = MathHelper.floor_double(this.playerEntity.posX);
+ int var3 = MathHelper.floor_double(this.playerEntity.posZ);
+ byte var4 = 64;
+ ChunkCache var5 = new ChunkCache(this, var2 - var4, 0, var3 - var4, var2 + var4, 128, var3 + var4);
+
+ for(int var6 = 0; var6 < 8000; ++var6) {
+ this.updateLCG = this.updateLCG * 3 + this.DIST_HASH_MAGIC;
+ int var7 = this.updateLCG >> 2;
+ int var8 = (var7 & 127) - 64 + var2;
+ int var9 = (var7 >> 8 & 127) - 64 + var3;
+ int var10 = var7 >> 16 & 127;
+ int var11 = var5.getBlockId(var8, var10, var9);
+ if(Block.tickOnLoad[var11]) {
+ Block.blocksList[var11].updateTick(this, var8, var10, var9, this.rand);
+ }
+ }
+
+ }
+
+ public boolean tickUpdates(boolean var1) {
+ int var2 = this.scheduledTickTreeSet.size();
+ if(var2 != this.scheduledTickSet.size()) {
+ throw new IllegalStateException("TickNextTick list out of synch");
+ } else {
+ if(var2 > 500) {
+ var2 = 500;
+ }
+
+ for(int var3 = 0; var3 < var2; ++var3) {
+ NextTickListEntry var4 = (NextTickListEntry)this.scheduledTickTreeSet.first();
+ if(!var1 && var4.scheduledTime > this.worldTime) {
+ break;
+ }
+
+ this.scheduledTickTreeSet.remove(var4);
+ this.scheduledTickSet.remove(var4);
+ byte var5 = 8;
+ 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 == var4.blockID && var6 > 0) {
+ Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.rand);
+ }
+ }
+ }
+
+ return this.scheduledTickTreeSet.size() != 0;
+ }
+ }
+
+ public void randomDisplayUpdates(int var1, int var2, int var3) {
+ byte var4 = 16;
+ Random var5 = new Random();
+
+ for(int var6 = 0; var6 < 1000; ++var6) {
+ int var7 = var1 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
+ int var8 = var2 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
+ int var9 = var3 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
+ int var10 = this.getBlockId(var7, var8, var9);
+ if(var10 > 0) {
+ Block.blocksList[var10].randomDisplayTick(this, var7, var8, var9, var5);
+ }
+ }
+
+ }
+
+ public List getEntitiesWithinAABBExcludingEntity(Entity var1, AxisAlignedBB var2) {
+ this.entitiesWithinAABBExcludingEntity.clear();
+ int var3 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D);
+ int var4 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.minZ - 2.0D) / 16.0D);
+ int var6 = MathHelper.floor_double((var2.maxZ + 2.0D) / 16.0D);
+
+ for(int var7 = var3; var7 <= var4; ++var7) {
+ for(int var8 = var5; var8 <= var6; ++var8) {
+ if(this.chunkExists(var7, var8)) {
+ this.getChunkFromChunkCoords(var7, var8).getEntitiesWithinAABBForEntity(var1, var2, this.entitiesWithinAABBExcludingEntity);
+ }
+ }
+ }
+
+ return this.entitiesWithinAABBExcludingEntity;
+ }
+
+ public List getEntitiesWithinAABB(Class var1, AxisAlignedBB var2) {
+ int var3 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D);
+ int var4 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.minZ - 2.0D) / 16.0D);
+ int var6 = MathHelper.floor_double((var2.maxZ + 2.0D) / 16.0D);
+ ArrayList var7 = new ArrayList();
+
+ for(int var8 = var3; var8 <= var4; ++var8) {
+ for(int var9 = var5; var9 <= var6; ++var9) {
+ if(this.chunkExists(var8, var9)) {
+ this.getChunkFromChunkCoords(var8, var9).getEntitiesOfTypeWithinAAAB(var1, var2, var7);
+ }
+ }
+ }
+
+ return var7;
+ }
+
+ public List getLoadedEntityList() {
+ return this.loadedEntityList;
+ }
+
+ public void updateTileEntityChunkAndDoNothing(int var1, int var2, int var3) {
+ if(this.blockExists(var1, var2, var3)) {
+ this.getChunkFromBlockCoords(var1, var3).setChunkModified();
+ }
+
+ }
+
+ public int countEntities(Class var1) {
+ int var2 = 0;
+
+ for(int var3 = 0; var3 < this.loadedEntityList.size(); ++var3) {
+ Entity var4 = (Entity)this.loadedEntityList.get(var3);
+ if(var1.isAssignableFrom(var4.getClass())) {
+ ++var2;
+ }
+ }
+
+ return var2;
+ }
+
+ public void addLoadedEntities(List var1) {
+ this.loadedEntityList.addAll(var1);
+
+ for(int var2 = 0; var2 < this.worldAccesses.size(); ++var2) {
+ IWorldAccess var3 = (IWorldAccess)this.worldAccesses.get(var2);
+
+ for(int var4 = 0; var4 < var1.size(); ++var4) {
+ var3.obtainEntitySkin((Entity)var1.get(var4));
+ }
+ }
+
+ }
+
+ public void unloadEntities(List var1) {
+ this.unloadedEntityList.addAll(var1);
+ }
+
+ public void dropOldChunks() {
+ while(this.chunkProvider.unload100OldestChunks()) {
+ }
+
+ }
+
+ public boolean canBlockBePlacedAt(int var1, int var2, int var3, int var4, boolean var5) {
+ int var6 = this.getBlockId(var2, var3, var4);
+ Block var7 = Block.blocksList[var6];
+ Block var8 = Block.blocksList[var1];
+ AxisAlignedBB var9 = var8.getCollisionBoundingBoxFromPool(this, var2, var3, var4);
+ if(var5) {
+ var9 = null;
+ }
+
+ return (var1 > 0 && var7 == null || var7 == Block.waterMoving || var7 == Block.waterStill || var7 == Block.lavaMoving || var7 == Block.lavaStill || var7 == Block.fire) && (var9 == null || this.checkIfAABBIsClear(var9)) && var8.canPlaceBlockAt(this, var2, var3, var4);
+ }
+
+ public PathEntity getPathToEntity(Entity var1, Entity var2, float var3) {
+ int var4 = MathHelper.floor_double(var1.posX);
+ int var5 = MathHelper.floor_double(var1.posY);
+ int var6 = MathHelper.floor_double(var1.posZ);
+ int var7 = (int)(var3 + 32.0F);
+ int var8 = var4 - var7;
+ int var9 = var5 - var7;
+ int var10 = var6 - var7;
+ int var11 = var4 + var7;
+ int var12 = var5 + var7;
+ int var13 = var6 + var7;
+ ChunkCache var14 = new ChunkCache(this, var8, var9, var10, var11, var12, var13);
+ return (new Pathfinder(var14)).createEntityPathTo(var1, var2, var3);
+ }
+
+ public PathEntity getEntityPathToXYZ(Entity var1, int var2, int var3, int var4, float var5) {
+ int var6 = MathHelper.floor_double(var1.posX);
+ int var7 = MathHelper.floor_double(var1.posY);
+ int var8 = MathHelper.floor_double(var1.posZ);
+ int var9 = (int)(var5 + 32.0F);
+ int var10 = var6 - var9;
+ int var11 = var7 - var9;
+ int var12 = var8 - var9;
+ int var13 = var6 + var9;
+ int var14 = var7 + var9;
+ int var15 = var8 + var9;
+ ChunkCache var16 = new ChunkCache(this, var10, var11, var12, var13, var14, var15);
+ return (new Pathfinder(var16)).createEntityPathTo(var1, var2, var3, var4, var5);
+ }
+
+ static {
+ float var0 = 0.05F;
+
+ for(int var1 = 0; var1 <= 15; ++var1) {
+ float var2 = 1.0F - (float)var1 / 15.0F;
+ lightBrightnessTable[var1] = (1.0F - var2) / (var2 * 3.0F + 1.0F) * (1.0F - var0) + var0;
+ }
+
+ }
+}
diff --git a/source/net/minecraft/src/WorldGenDungeons.java b/source/net/minecraft/src/WorldGenDungeons.java
new file mode 100644
index 0000000..64d59f0
--- /dev/null
+++ b/source/net/minecraft/src/WorldGenDungeons.java
@@ -0,0 +1,116 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenDungeons extends WorldGenerator {
+ public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
+ byte var6 = 3;
+ int var7 = var2.nextInt(2) + 2;
+ int var8 = var2.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.getBlockId(var10, var11, var12) == 0 && var1.getBlockId(var10, var11 + 1, var12) == 0) {
+ ++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.setBlockWithNotify(var10, var11, var12, 0);
+ } else if(var11 >= 0 && !var1.getBlockMaterial(var10, var11 - 1, var12).isSolid()) {
+ var1.setBlockWithNotify(var10, var11, var12, 0);
+ } else if(var1.getBlockMaterial(var10, var11, var12).isSolid()) {
+ if(var11 == var4 - 1 && var2.nextInt(4) != 0) {
+ var1.setBlockWithNotify(var10, var11, var12, Block.cobblestoneMossy.blockID);
+ } else {
+ var1.setBlockWithNotify(var10, var11, var12, Block.cobblestone.blockID);
+ }
+ }
+ }
+ }
+ }
+
+ label110:
+ 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.getBlockId(var12, var4, var14) == 0) {
+ 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.setBlockWithNotify(var12, var4, var14, Block.chest.blockID);
+ TileEntityChest var16 = (TileEntityChest)var1.getBlockTileEntity(var12, var4, var14);
+ int var17 = 0;
+
+ while(true) {
+ if(var17 >= 8) {
+ continue label110;
+ }
+
+ ItemStack var18 = this.pickCheckLootItem(var2);
+ if(var18 != null) {
+ var16.setInventorySlotContents(var2.nextInt(var16.getSizeInventory()), var18);
+ }
+
+ ++var17;
+ }
+ }
+ }
+ }
+ }
+
+ var1.setBlockWithNotify(var3, var4, var5, Block.mobSpawner.blockID);
+ TileEntityMobSpawner var19 = (TileEntityMobSpawner)var1.getBlockTileEntity(var3, var4, var5);
+ var19.mobID = this.pickMobSpawner(var2);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private ItemStack pickCheckLootItem(Random var1) {
+ int var2 = var1.nextInt(10);
+ return var2 == 0 ? new ItemStack(Item.saddle) : (var2 == 1 ? new ItemStack(Item.ingotIron, var1.nextInt(4) + 1) : (var2 == 2 ? new ItemStack(Item.bread) : (var2 == 3 ? new ItemStack(Item.wheat, var1.nextInt(4) + 1) : (var2 == 4 ? new ItemStack(Item.gunpowder, var1.nextInt(4) + 1) : (var2 == 5 ? new ItemStack(Item.silk, var1.nextInt(4) + 1) : (var2 == 6 ? new ItemStack(Item.bucketEmpty) : (var2 == 7 && var1.nextInt(100) == 0 ? new ItemStack(Item.appleGold) : null)))))));
+ }
+
+ private String pickMobSpawner(Random var1) {
+ int var2 = var1.nextInt(4);
+ return var2 == 0 ? "Skeleton" : (var2 == 1 ? "Zombie" : (var2 == 2 ? "Zombie" : (var2 == 3 ? "Spider" : "")));
+ }
+}
diff --git a/source/net/minecraft/src/WorldGenFlowers.java b/source/net/minecraft/src/WorldGenFlowers.java
new file mode 100644
index 0000000..f01a0f1
--- /dev/null
+++ b/source/net/minecraft/src/WorldGenFlowers.java
@@ -0,0 +1,24 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenFlowers extends WorldGenerator {
+ private int plantBlockId;
+
+ public WorldGenFlowers(int var1) {
+ this.plantBlockId = var1;
+ }
+
+ 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.getBlockId(var7, var8, var9) == 0 && ((BlockFlower)Block.blocksList[this.plantBlockId]).canBlockStay(var1, var7, var8, var9)) {
+ var1.setBlock(var7, var8, var9, this.plantBlockId);
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/WorldGenLiquids.java b/source/net/minecraft/src/WorldGenLiquids.java
new file mode 100644
index 0000000..7fbf0cb
--- /dev/null
+++ b/source/net/minecraft/src/WorldGenLiquids.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenLiquids extends WorldGenerator {
+ private int liquidBlockId;
+
+ public WorldGenLiquids(int var1) {
+ this.liquidBlockId = var1;
+ }
+
+ 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) {
+ 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) {
+ ++var6;
+ }
+
+ int var7 = 0;
+ if(var1.getBlockId(var3 - 1, var4, var5) == 0) {
+ ++var7;
+ }
+
+ if(var1.getBlockId(var3 + 1, var4, var5) == 0) {
+ ++var7;
+ }
+
+ if(var1.getBlockId(var3, var4, var5 - 1) == 0) {
+ ++var7;
+ }
+
+ if(var1.getBlockId(var3, var4, var5 + 1) == 0) {
+ ++var7;
+ }
+
+ if(var6 == 3 && var7 == 1) {
+ var1.setBlockWithNotify(var3, var4, var5, this.liquidBlockId);
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/WorldGenMinable.java b/source/net/minecraft/src/WorldGenMinable.java
new file mode 100644
index 0000000..652dd5a
--- /dev/null
+++ b/source/net/minecraft/src/WorldGenMinable.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenMinable extends WorldGenerator {
+ private int minableBlockId;
+ private int numberOfBlocks;
+
+ public WorldGenMinable(int var1, int var2) {
+ this.minableBlockId = var1;
+ this.numberOfBlocks = var2;
+ }
+
+ 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) {
+ 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 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;
+
+ for(int var32 = (int)(var20 - var28 / 2.0D); var32 <= (int)(var20 + var28 / 2.0D); ++var32) {
+ for(int var33 = (int)(var22 - var30 / 2.0D); var33 <= (int)(var22 + var30 / 2.0D); ++var33) {
+ for(int var34 = (int)(var24 - var28 / 2.0D); var34 <= (int)(var24 + var28 / 2.0D); ++var34) {
+ double var35 = ((double)var32 + 0.5D - var20) / (var28 / 2.0D);
+ double var37 = ((double)var33 + 0.5D - var22) / (var30 / 2.0D);
+ double var39 = ((double)var34 + 0.5D - var24) / (var28 / 2.0D);
+ if(var35 * var35 + var37 * var37 + var39 * var39 < 1.0D && var1.getBlockId(var32, var33, var34) == Block.stone.blockID) {
+ var1.setBlock(var32, var33, var34, this.minableBlockId);
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/source/net/minecraft/src/WorldGenTrees.java b/source/net/minecraft/src/WorldGenTrees.java
new file mode 100644
index 0000000..631e379
--- /dev/null
+++ b/source/net/minecraft/src/WorldGenTrees.java
@@ -0,0 +1,78 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenTrees extends WorldGenerator {
+ public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
+ int var6 = var2.nextInt(3) + 4;
+ boolean var7 = true;
+ if(var4 >= 1 && var4 + var6 + 1 <= 128) {
+ int var8;
+ int var10;
+ int var11;
+ int var12;
+ for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) {
+ byte var9 = 1;
+ if(var8 == var4) {
+ var9 = 0;
+ }
+
+ if(var8 >= var4 + 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 < 128) {
+ var12 = var1.getBlockId(var10, var8, var11);
+ if(var12 != 0 && var12 != Block.leaves.blockID) {
+ var7 = false;
+ }
+ } else {
+ var7 = false;
+ }
+ }
+ }
+ }
+
+ 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) {
+ var1.setBlock(var3, var4 - 1, var5, Block.dirt.blockID);
+
+ int var16;
+ for(var16 = var4 - 3 + var6; var16 <= var4 + var6; ++var16) {
+ var10 = var16 - (var4 + 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) && !Block.opaqueCubeLookup[var1.getBlockId(var12, var16, var14)]) {
+ var1.setBlock(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) {
+ var1.setBlock(var3, var4 + var16, var5, Block.wood.blockID);
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/source/net/minecraft/src/WorldGenerator.java b/source/net/minecraft/src/WorldGenerator.java
new file mode 100644
index 0000000..61bcf66
--- /dev/null
+++ b/source/net/minecraft/src/WorldGenerator.java
@@ -0,0 +1,10 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public abstract class WorldGenerator {
+ public abstract boolean generate(World var1, Random var2, int var3, int var4, int var5);
+
+ public void setScale(double var1, double var3, double var5) {
+ }
+}
diff --git a/source/net/minecraft/src/WorldIso.java b/source/net/minecraft/src/WorldIso.java
new file mode 100644
index 0000000..703718d
--- /dev/null
+++ b/source/net/minecraft/src/WorldIso.java
@@ -0,0 +1,16 @@
+package net.minecraft.src;
+
+import java.io.File;
+
+class WorldIso extends World {
+ final CanvasIsomPreview isomPreview;
+
+ WorldIso(CanvasIsomPreview var1, File var2, String var3) {
+ super(var2, var3);
+ this.isomPreview = var1;
+ }
+
+ protected IChunkProvider getChunkProvider(File var1) {
+ return new ChunkProviderIso(this, new ChunkLoader(var1, false));
+ }
+}
diff --git a/source/net/minecraft/src/WorldRenderer.java b/source/net/minecraft/src/WorldRenderer.java
new file mode 100644
index 0000000..d9ae1a0
--- /dev/null
+++ b/source/net/minecraft/src/WorldRenderer.java
@@ -0,0 +1,214 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import org.lwjgl.opengl.GL11;
+
+public class WorldRenderer {
+ public World worldObj;
+ private int glRenderList = -1;
+ private static Tessellator tessellator = Tessellator.instance;
+ public static int chunksUpdated = 0;
+ public int posX;
+ public int posY;
+ public int posZ;
+ public int sizeWidth;
+ public int sizeHeight;
+ public int sizeDepth;
+ public int posXMinus;
+ public int posYMinus;
+ public int posZMinus;
+ public int posXClip;
+ public int posYClip;
+ public int posZClip;
+ public boolean isInFrustum = false;
+ public boolean[] skipRenderPass = new boolean[2];
+ public int posXPlus;
+ public int posYPlus;
+ public int posZPlus;
+ public float rendererRadius;
+ public boolean needsUpdate;
+ public AxisAlignedBB rendererBoundingBox;
+ public int chunkIndex;
+ public boolean isVisible = true;
+ public boolean isWaitingOnOcclusionQuery;
+ public int glOcclusionQuery;
+ public boolean isChunkLit;
+ private boolean isInitialized = false;
+ public List tileEntityRenderers = new ArrayList();
+ private List tileEntities;
+
+ public WorldRenderer(World var1, List var2, int var3, int var4, int var5, int var6, int var7) {
+ this.worldObj = var1;
+ this.tileEntities = var2;
+ this.sizeWidth = this.sizeHeight = this.sizeDepth = var6;
+ this.rendererRadius = MathHelper.sqrt_float((float)(this.sizeWidth * this.sizeWidth + this.sizeHeight * this.sizeHeight + this.sizeDepth * this.sizeDepth)) / 2.0F;
+ this.glRenderList = var7;
+ this.posX = -999;
+ this.setPosition(var3, var4, var5);
+ this.needsUpdate = false;
+ }
+
+ public void setPosition(int var1, int var2, int var3) {
+ if(var1 != this.posX || var2 != this.posY || var3 != this.posZ) {
+ this.setDontDraw();
+ this.posX = var1;
+ this.posY = var2;
+ this.posZ = var3;
+ this.posXPlus = var1 + this.sizeWidth / 2;
+ this.posYPlus = var2 + this.sizeHeight / 2;
+ this.posZPlus = var3 + this.sizeDepth / 2;
+ 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;
+ float var4 = 2.0F;
+ this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)((float)var1 - var4), (double)((float)var2 - var4), (double)((float)var3 - var4), (double)((float)(var1 + this.sizeWidth) + var4), (double)((float)(var2 + this.sizeHeight) + var4), (double)((float)(var3 + this.sizeDepth) + var4));
+ GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE);
+ RenderItem.renderAABB(AxisAlignedBB.getBoundingBoxFromPool((double)((float)this.posXClip - var4), (double)((float)this.posYClip - var4), (double)((float)this.posZClip - var4), (double)((float)(this.posXClip + this.sizeWidth) + var4), (double)((float)(this.posYClip + this.sizeHeight) + var4), (double)((float)(this.posZClip + this.sizeDepth) + var4)));
+ GL11.glEndList();
+ this.markDirty();
+ }
+ }
+
+ private void setupGLTranslation() {
+ GL11.glTranslatef((float)this.posXClip, (float)this.posYClip, (float)this.posZClip);
+ }
+
+ public void updateRenderer() {
+ if(this.needsUpdate) {
+ ++chunksUpdated;
+ int var1 = this.posX;
+ int var2 = this.posY;
+ int var3 = this.posZ;
+ int var4 = this.posX + this.sizeWidth;
+ int var5 = this.posY + this.sizeHeight;
+ int var6 = this.posZ + this.sizeDepth;
+
+ for(int var7 = 0; var7 < 2; ++var7) {
+ this.skipRenderPass[var7] = true;
+ }
+
+ Chunk.isLit = false;
+ HashSet var21 = new HashSet();
+ var21.addAll(this.tileEntityRenderers);
+ this.tileEntityRenderers.clear();
+ byte var8 = 1;
+ ChunkCache var9 = new ChunkCache(this.worldObj, var1 - var8, var2 - var8, var3 - var8, var4 + var8, var5 + var8, var6 + var8);
+ RenderBlocks var10 = new RenderBlocks(var9);
+
+ 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((float)(-this.sizeDepth) / 2.0F, (float)(-this.sizeHeight) / 2.0F, (float)(-this.sizeDepth) / 2.0F);
+ GL11.glScalef(var19, var19, var19);
+ GL11.glTranslatef((float)this.sizeDepth / 2.0F, (float)this.sizeHeight / 2.0F, (float)this.sizeDepth / 2.0F);
+ tessellator.startDrawingQuads();
+ tessellator.setTranslationD((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
+ }
+
+ if(var11 == 0 && Block.blocksList[var18] instanceof BlockContainer) {
+ TileEntity var23 = var9.getBlockTileEntity(var17, var15, var16);
+ if(TileEntityRenderer.instance.hasSpecialRenderer(var23)) {
+ this.tileEntityRenderers.add(var23);
+ }
+ }
+
+ Block var24 = Block.blocksList[var18];
+ int var20 = var24.getRenderBlockPass();
+ if(var20 != var11) {
+ var12 = true;
+ } else if(var20 == var11) {
+ var13 |= var10.renderBlockByRenderType(var24, var17, var15, var16);
+ }
+ }
+ }
+ }
+ }
+
+ if(var14) {
+ tessellator.draw();
+ GL11.glPopMatrix();
+ GL11.glEndList();
+ tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
+ } else {
+ var13 = false;
+ }
+
+ if(var13) {
+ this.skipRenderPass[var11] = false;
+ }
+
+ if(!var12) {
+ break;
+ }
+ }
+
+ HashSet var22 = new HashSet();
+ var22.addAll(this.tileEntityRenderers);
+ var22.removeAll(var21);
+ this.tileEntities.addAll(var22);
+ var21.removeAll(this.tileEntityRenderers);
+ this.tileEntities.removeAll(var21);
+ this.isChunkLit = Chunk.isLit;
+ this.isInitialized = true;
+ }
+ }
+
+ 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);
+ return var2 * var2 + var3 * var3 + var4 * var4;
+ }
+
+ public void setDontDraw() {
+ for(int var1 = 0; var1 < 2; ++var1) {
+ this.skipRenderPass[var1] = true;
+ }
+
+ this.isInFrustum = false;
+ this.isInitialized = false;
+ }
+
+ public void stopRendering() {
+ this.setDontDraw();
+ this.worldObj = null;
+ }
+
+ public int getGLCallListForPass(int var1) {
+ return !this.isInFrustum ? -1 : (!this.skipRenderPass[var1] ? this.glRenderList + var1 : -1);
+ }
+
+ public void updateInFrustrum(ICamera var1) {
+ this.isInFrustum = var1.isBoundingBoxInFrustum(this.rendererBoundingBox);
+ }
+
+ public void callOcclusionQueryList() {
+ GL11.glCallList(this.glRenderList + 2);
+ }
+
+ public boolean skipAllRenderPasses() {
+ return !this.isInitialized ? false : this.skipRenderPass[0] && this.skipRenderPass[1];
+ }
+
+ public void markDirty() {
+ this.needsUpdate = true;
+ }
+}
diff --git a/src/net/minecraft/client/MinecraftApplet.java b/src/net/minecraft/client/MinecraftApplet.java
new file mode 100644
index 0000000..da453ec
--- /dev/null
+++ b/src/net/minecraft/client/MinecraftApplet.java
@@ -0,0 +1,105 @@
+package net.minecraft.client;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import net.minecraft.src.CanvasMinecraftApplet;
+import net.minecraft.src.Minecraft;
+import net.minecraft.src.MinecraftAppletImpl;
+import net.minecraft.src.Session;
+
+public class MinecraftApplet extends Applet {
+ private Canvas mcCanvas;
+ private Minecraft mc;
+ private Thread mcThread = null;
+
+ public void init() {
+ this.mcCanvas = new CanvasMinecraftApplet(this);
+ boolean var1 = false;
+ if(this.getParameter("fullscreen") != null) {
+ var1 = this.getParameter("fullscreen").equalsIgnoreCase("true");
+ }
+
+ this.mc = new MinecraftAppletImpl(this, this, this.mcCanvas, this, this.getWidth(), this.getHeight(), var1);
+ this.mc.minecraftUri = this.getDocumentBase().getHost();
+ if(this.getDocumentBase().getPort() > 0) {
+ this.mc.minecraftUri = this.mc.minecraftUri + ":" + this.getDocumentBase().getPort();
+ }
+
+ if(this.getParameter("username") != null && this.getParameter("sessionid") != null) {
+ this.mc.session = new Session(this.getParameter("username"), this.getParameter("sessionid"));
+ if(this.getParameter("mppass") != null) {
+ this.mc.session.mpPassParameter = this.getParameter("mppass");
+ }
+ }
+
+ if(this.getParameter("loadmap_user") != null && this.getParameter("loadmap_id") != null) {
+ this.mc.objectMouseOverString = this.getParameter("loadmap_user");
+ this.mc.rightClickDelayTimer = Integer.parseInt(this.getParameter("loadmap_id"));
+ } else if(this.getParameter("server") != null && this.getParameter("port") != null) {
+ this.mc.setServer(this.getParameter("server"), Integer.parseInt(this.getParameter("port")));
+ }
+
+ this.mc.appletMode = true;
+ this.setLayout(new BorderLayout());
+ this.add(this.mcCanvas, "Center");
+ this.mcCanvas.setFocusable(true);
+ this.validate();
+ }
+
+ public void startMainThread() {
+ if(this.mcThread == null) {
+ this.mcThread = new Thread(this.mc, "Minecraft main thread");
+ this.mcThread.start();
+ }
+ }
+
+ public void start() {
+ if(this.mc != null) {
+ this.mc.isGamePaused = false;
+ }
+
+ }
+
+ public void stop() {
+ if(this.mc != null) {
+ this.mc.isGamePaused = true;
+ }
+
+ }
+
+ public void destroy() {
+ this.shutdown();
+ }
+
+ public void shutdown() {
+ if(this.mcThread != null) {
+ this.mc.shutdown();
+
+ try {
+ this.mcThread.join(10000L);
+ } catch (InterruptedException var4) {
+ try {
+ this.mc.shutdownMinecraftApplet();
+ } catch (Exception var3) {
+ var3.printStackTrace();
+ }
+ }
+
+ this.mcThread = null;
+ }
+ }
+
+ public void clearApplet() {
+ this.mcCanvas = null;
+ this.mc = null;
+ this.mcThread = null;
+
+ try {
+ this.removeAll();
+ this.validate();
+ } catch (Exception var2) {
+ }
+
+ }
+}
diff --git a/src/net/minecraft/isom/IsomPreviewApplet.java b/src/net/minecraft/isom/IsomPreviewApplet.java
new file mode 100644
index 0000000..b192ed2
--- /dev/null
+++ b/src/net/minecraft/isom/IsomPreviewApplet.java
@@ -0,0 +1,22 @@
+package net.minecraft.isom;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import net.minecraft.src.CanvasIsomPreview;
+
+public class IsomPreviewApplet extends Applet {
+ private CanvasIsomPreview isomCanvas = new CanvasIsomPreview();
+
+ public IsomPreviewApplet() {
+ this.setLayout(new BorderLayout());
+ this.add(this.isomCanvas, "Center");
+ }
+
+ public void start() {
+ this.isomCanvas.start();
+ }
+
+ public void stop() {
+ this.isomCanvas.stop();
+ }
+}
diff --git a/src/net/minecraft/src/AxisAlignedBB.java b/src/net/minecraft/src/AxisAlignedBB.java
new file mode 100644
index 0000000..e680fee
--- /dev/null
+++ b/src/net/minecraft/src/AxisAlignedBB.java
@@ -0,0 +1,313 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AxisAlignedBB {
+ private static List boundingBoxes = new ArrayList();
+ private static int numBoundingBoxesInUse = 0;
+ public double minX;
+ public double minY;
+ public double minZ;
+ public double maxX;
+ 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);
+ }
+
+ public static void clearBoundingBoxPool() {
+ numBoundingBoxesInUse = 0;
+ }
+
+ public static AxisAlignedBB getBoundingBoxFromPool(double var0, double var2, double var4, double var6, double var8, double var10) {
+ if(numBoundingBoxesInUse >= boundingBoxes.size()) {
+ boundingBoxes.add(getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D));
+ }
+
+ return ((AxisAlignedBB)boundingBoxes.get(numBoundingBoxesInUse++)).setBounds(var0, var2, var4, var6, var8, var10);
+ }
+
+ private 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 this;
+ }
+
+ public AxisAlignedBB addCoord(double var1, double var3, double var5) {
+ 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 getBoundingBoxFromPool(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 getBoundingBoxFromPool(var7, var9, var11, var13, var15, var17);
+ }
+
+ public AxisAlignedBB getOffsetBoundingBox(double var1, double var3, double var5) {
+ return getBoundingBoxFromPool(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;
+ return this;
+ }
+
+ public double getAverageEdgeLength() {
+ double var1 = this.maxX - this.minX;
+ double var3 = this.maxY - this.minY;
+ double var5 = this.maxZ - this.minZ;
+ return (var1 + var3 + var5) / 3.0D;
+ }
+
+ public AxisAlignedBB copy() {
+ return getBoundingBoxFromPool(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
+ }
+
+ public MovingObjectPosition calculateIntercept(Vec3D var1, Vec3D var2) {
+ Vec3D var3 = var1.getIntermediateWithXValue(var2, this.minX);
+ Vec3D var4 = var1.getIntermediateWithXValue(var2, this.maxX);
+ Vec3D var5 = var1.getIntermediateWithYValue(var2, this.minY);
+ Vec3D var6 = var1.getIntermediateWithYValue(var2, this.maxY);
+ Vec3D var7 = var1.getIntermediateWithZValue(var2, this.minZ);
+ Vec3D var8 = var1.getIntermediateWithZValue(var2, this.maxZ);
+ if(!this.isVecInYZ(var3)) {
+ var3 = null;
+ }
+
+ if(!this.isVecInYZ(var4)) {
+ var4 = null;
+ }
+
+ if(!this.isVecInXZ(var5)) {
+ var5 = null;
+ }
+
+ if(!this.isVecInXZ(var6)) {
+ var6 = null;
+ }
+
+ if(!this.isVecInXY(var7)) {
+ var7 = null;
+ }
+
+ if(!this.isVecInXY(var8)) {
+ var8 = null;
+ }
+
+ Vec3D var9 = null;
+ if(var3 != null && (var9 == null || var1.squareDistanceTo(var3) < var1.squareDistanceTo(var9))) {
+ var9 = var3;
+ }
+
+ if(var4 != null && (var9 == null || var1.squareDistanceTo(var4) < var1.squareDistanceTo(var9))) {
+ var9 = var4;
+ }
+
+ if(var5 != null && (var9 == null || var1.squareDistanceTo(var5) < var1.squareDistanceTo(var9))) {
+ var9 = var5;
+ }
+
+ if(var6 != null && (var9 == null || var1.squareDistanceTo(var6) < var1.squareDistanceTo(var9))) {
+ var9 = var6;
+ }
+
+ if(var7 != null && (var9 == null || var1.squareDistanceTo(var7) < var1.squareDistanceTo(var9))) {
+ var9 = var7;
+ }
+
+ if(var8 != null && (var9 == null || var1.squareDistanceTo(var8) < var1.squareDistanceTo(var9))) {
+ var9 = var8;
+ }
+
+ if(var9 == null) {
+ return null;
+ } else {
+ byte var10 = -1;
+ if(var9 == var3) {
+ var10 = 4;
+ }
+
+ if(var9 == var4) {
+ var10 = 5;
+ }
+
+ if(var9 == var5) {
+ var10 = 0;
+ }
+
+ if(var9 == var6) {
+ var10 = 1;
+ }
+
+ if(var9 == var7) {
+ var10 = 2;
+ }
+
+ if(var9 == var8) {
+ var10 = 3;
+ }
+
+ return new MovingObjectPosition(0, 0, 0, var10, var9);
+ }
+ }
+
+ private boolean isVecInYZ(Vec3D var1) {
+ return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInXZ(Vec3D var1) {
+ return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInXY(Vec3D 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;
+ }
+}
diff --git a/src/net/minecraft/src/Block.java b/src/net/minecraft/src/Block.java
new file mode 100644
index 0000000..a962b9d
--- /dev/null
+++ b/src/net/minecraft/src/Block.java
@@ -0,0 +1,432 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+public class Block {
+ 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);
+ public static final StepSound soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F);
+ public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
+ public static final StepSound soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
+ public static final StepSound soundGlassFootstep = new StepSoundGlass("stone", 1.0F, 1.0F);
+ public static final StepSound soundClothFootstep = new StepSound("cloth", 1.0F, 1.0F);
+ public static final StepSound soundSandFootstep = new StepSoundSand("sand", 1.0F, 1.0F);
+ public static final Block[] blocksList = new Block[256];
+ public static final boolean[] tickOnLoad = new boolean[256];
+ public static final boolean[] opaqueCubeLookup = new boolean[256];
+ public static final int[] lightOpacity = new int[256];
+ public static final boolean[] canBlockGrass = new boolean[256];
+ public static final int[] lightValue = new int[256];
+ public static final Block stone = (new BlockStone(1, 1)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final BlockGrass grass = (BlockGrass)(new BlockGrass(2)).setHardness(0.6F).setStepSound(soundGrassFootstep);
+ public static final Block dirt = (new BlockDirt(3, 2)).setHardness(0.5F).setStepSound(soundGravelFootstep);
+ public static final Block cobblestone = (new Block(4, 16, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block planks = (new Block(5, 4, Material.wood)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep);
+ public static final Block sapling = (new BlockSapling(6, 15)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block bedrock = (new Block(7, 17, Material.rock)).setHardness(-1.0F).setResistance(6000000.0F).setStepSound(soundStoneFootstep);
+ public static final Block waterMoving = (new BlockFlowing(8, Material.water)).setHardness(100.0F).setLightOpacity(3);
+ public static final Block waterStill = (new BlockStationary(9, Material.water)).setHardness(100.0F).setLightOpacity(3);
+ public static final Block lavaMoving = (new BlockFlowing(10, Material.lava)).setHardness(0.0F).setLightValue(1.0F).setLightOpacity(255);
+ public static final Block lavaStill = (new BlockStationary(11, Material.lava)).setHardness(100.0F).setLightValue(1.0F).setLightOpacity(255);
+ public static final Block sand = (new BlockSand(12, 18)).setHardness(0.5F).setStepSound(soundSandFootstep);
+ public static final Block gravel = (new BlockGravel(13, 19)).setHardness(0.6F).setStepSound(soundGravelFootstep);
+ public static final Block oreGold = (new BlockOre(14, 32)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block oreIron = (new BlockOre(15, 33)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block oreCoal = (new BlockOre(16, 34)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block wood = (new BlockLog(17)).setHardness(2.0F).setStepSound(soundWoodFootstep);
+ public static final BlockLeaves leaves = (BlockLeaves)(new BlockLeaves(18, 52)).setHardness(0.2F).setLightOpacity(1).setStepSound(soundGrassFootstep);
+ public static final Block sponge = (new BlockSponge(19)).setHardness(0.6F).setStepSound(soundGrassFootstep);
+ public static final Block glass = (new BlockGlass(20, 49, Material.glass, false)).setHardness(0.3F).setStepSound(soundGlassFootstep);
+ public static final Block clothRed = null;
+ public static final Block clothOrange = null;
+ public static final Block clothYellow = null;
+ public static final Block clothChartreuse = null;
+ public static final Block clothGreen = null;
+ public static final Block clothSpringGreen = null;
+ public static final Block clothCyan = null;
+ public static final Block clothCapri = null;
+ public static final Block clothUltramarine = null;
+ public static final Block clothViolet = null;
+ public static final Block clothPurple = null;
+ public static final Block clothMagenta = null;
+ public static final Block clothRose = null;
+ public static final Block clothDarkGray = null;
+ public static final Block cloth = (new Block(35, 64, Material.cloth)).setHardness(0.8F).setStepSound(soundClothFootstep);
+ public static final Block clothWhite = null;
+ public static final BlockFlower plantYellow = (BlockFlower)(new BlockFlower(37, 13)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final BlockFlower plantRed = (BlockFlower)(new BlockFlower(38, 12)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final BlockFlower mushroomBrown = (BlockFlower)(new BlockMushroom(39, 29)).setHardness(0.0F).setStepSound(soundGrassFootstep).setLightValue(2.0F / 16.0F);
+ public static final BlockFlower mushroomRed = (BlockFlower)(new BlockMushroom(40, 28)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block blockGold = (new BlockOreBlock(41, 39)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
+ public static final Block blockSteel = (new BlockOreBlock(42, 38)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
+ public static final Block stairDouble = (new BlockStep(43, true)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block stairSingle = (new BlockStep(44, false)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block brick = (new Block(45, 7, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block tnt = (new BlockTNT(46, 8)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block bookshelf = (new BlockBookshelf(47, 35)).setHardness(1.5F).setStepSound(soundWoodFootstep);
+ public static final Block cobblestoneMossy = (new Block(48, 36, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
+ public static final Block obsidian = (new BlockObsidian(49, 37)).setHardness(10.0F).setResistance(20.0F).setStepSound(soundStoneFootstep);
+ public static final Block torch = (new BlockTorch(50, 80)).setHardness(0.0F).setLightValue(15.0F / 16.0F).setStepSound(soundWoodFootstep);
+ public static final BlockFire fire = (BlockFire)((BlockFire)(new BlockFire(51, 31)).setHardness(0.0F).setLightValue(1.0F).setStepSound(soundWoodFootstep));
+ public static final Block mobSpawner = (new BlockMobSpawner(52, 65)).setHardness(5.0F).setStepSound(soundMetalFootstep);
+ public static final Block stairCompactWood = new BlockStairs(53, planks);
+ public static final Block chest = (new BlockChest(54)).setHardness(2.5F).setStepSound(soundWoodFootstep);
+ public static final Block cog = (new BlockGears(55, 62)).setHardness(0.5F).setStepSound(soundMetalFootstep);
+ public static final Block oreDiamond = (new BlockOre(56, 50)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
+ public static final Block blockDiamond = (new BlockOreBlock(57, 40)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
+ public static final Block workbench = (new BlockWorkbench(58)).setHardness(2.5F).setStepSound(soundWoodFootstep);
+ public static final Block crops = (new BlockCrops(59, 88)).setHardness(0.0F).setStepSound(soundGrassFootstep);
+ public static final Block tilledField = (new BlockFarmland(60)).setHardness(0.6F).setStepSound(soundGravelFootstep);
+ public static final Block stoneOvenIdle = (new BlockFurnace(61, false)).setHardness(3.5F).setStepSound(soundStoneFootstep);
+ public static final Block stoneOvenActive = (new BlockFurnace(62, true)).setHardness(3.5F).setStepSound(soundStoneFootstep).setLightValue(14.0F / 16.0F);
+ public static final Block signStanding = (new BlockSign(63, TileEntitySign.class, Item.sign.shiftedIndex)).setHardness(1.0F).setStepSound(soundWoodFootstep);
+ public static final Block doorWood = (new BlockDoor(64)).setHardness(3.0F).setStepSound(soundWoodFootstep);
+ public static final Block ladder = (new BlockLadder(65, 83)).setHardness(0.4F).setStepSound(soundWoodFootstep);
+ public static final Block minecartTrack = (new BlockMinecartTrack(66, 128)).setHardness(1.0F).setStepSound(soundMetalFootstep);
+ public static final Block stairCompactStone = new BlockStairs(67, cobblestone);
+ public int blockIndexInTexture;
+ public final int blockID;
+ protected float blockHardness;
+ protected float blockResistance;
+ public double minX;
+ public double minY;
+ public double minZ;
+ public double maxX;
+ public double maxY;
+ public double maxZ;
+ public StepSound stepSound;
+ public float blockParticleGravity;
+ public final Material blockMaterial;
+
+ protected Block(int var1, Material var2) {
+ this.stepSound = soundPowderFootstep;
+ this.blockParticleGravity = 1.0F;
+ if(blocksList[var1] != null) {
+ throw new IllegalArgumentException("Slot " + var1 + " is already occupied by " + blocksList[var1] + " when adding " + this);
+ } else {
+ this.blockMaterial = var2;
+ blocksList[var1] = this;
+ this.blockID = var1;
+ 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] = this.getCanBlockGrass();
+ }
+ }
+
+ protected Block(int var1, int var2, Material var3) {
+ this(var1, var3);
+ this.blockIndexInTexture = var2;
+ }
+
+ 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;
+ }
+
+ private boolean getCanBlockGrass() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ public int getRenderType() {
+ return 0;
+ }
+
+ protected Block setHardness(float var1) {
+ this.blockHardness = var1;
+ if(this.blockResistance < var1 * 5.0F) {
+ this.blockResistance = var1 * 5.0F;
+ }
+
+ return this;
+ }
+
+ protected void setTickOnLoad(boolean var1) {
+ tickOnLoad[this.blockID] = var1;
+ }
+
+ public 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);
+ }
+
+ 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.isBlockNormalCube(var2, var3, var4))))));
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return this.getBlockTextureFromSideAndMetadata(var5, var1.getBlockMetadata(var2, var3, var4));
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return this.getBlockTextureFromSide(var1);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return this.blockIndexInTexture;
+ }
+
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return AxisAlignedBB.getBoundingBoxFromPool((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 getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
+ AxisAlignedBB var7 = this.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
+ if(var7 != null && var5.intersectsWith(var7)) {
+ var6.add(var7);
+ }
+
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return AxisAlignedBB.getBoundingBoxFromPool((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 boolean isOpaqueCube() {
+ return true;
+ }
+
+ public boolean canCollideCheck(int var1, boolean var2) {
+ return this.isCollidable();
+ }
+
+ 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() {
+ return 10;
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ }
+
+ public void onBlockRemoval(World var1, int var2, int var3, int var4) {
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.blockID;
+ }
+
+ public float blockStrength(EntityPlayer var1) {
+ return this.blockHardness < 0.0F ? 0.0F : (!var1.canHarvestBlock(this) ? 1.0F / this.blockHardness / 100.0F : var1.getCurrentPlayerStrVsBlock(this) / this.blockHardness / 30.0F);
+ }
+
+ public void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5) {
+ this.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, 1.0F);
+ }
+
+ public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
+ int var7 = this.quantityDropped(var1.rand);
+
+ for(int var8 = 0; var8 < var7; ++var8) {
+ if(var1.rand.nextFloat() <= var6) {
+ int var9 = this.idDropped(var5, var1.rand);
+ if(var9 > 0) {
+ float var10 = 0.7F;
+ double var11 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
+ double var13 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
+ double var15 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
+ EntityItem var17 = new EntityItem(var1, (double)var2 + var11, (double)var3 + var13, (double)var4 + var15, new ItemStack(var9));
+ var17.delayBeforeCanPickup = 10;
+ var1.spawnEntityInWorld(var17);
+ }
+ }
+ }
+
+ }
+
+ public float getExplosionResistance(Entity var1) {
+ return this.blockResistance / 5.0F;
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ var5 = var5.addVector((double)(-var2), (double)(-var3), (double)(-var4));
+ var6 = var6.addVector((double)(-var2), (double)(-var3), (double)(-var4));
+ Vec3D var7 = var5.getIntermediateWithXValue(var6, this.minX);
+ Vec3D var8 = var5.getIntermediateWithXValue(var6, this.maxX);
+ Vec3D var9 = var5.getIntermediateWithYValue(var6, this.minY);
+ Vec3D var10 = var5.getIntermediateWithYValue(var6, this.maxY);
+ Vec3D var11 = var5.getIntermediateWithZValue(var6, this.minZ);
+ Vec3D var12 = var5.getIntermediateWithZValue(var6, this.maxZ);
+ if(!this.isVecInsideYZBounds(var7)) {
+ var7 = null;
+ }
+
+ if(!this.isVecInsideYZBounds(var8)) {
+ var8 = null;
+ }
+
+ if(!this.isVecInsideXZBounds(var9)) {
+ var9 = null;
+ }
+
+ if(!this.isVecInsideXZBounds(var10)) {
+ var10 = null;
+ }
+
+ if(!this.isVecInsideXYBounds(var11)) {
+ var11 = null;
+ }
+
+ if(!this.isVecInsideXYBounds(var12)) {
+ var12 = null;
+ }
+
+ Vec3D var13 = null;
+ if(var7 != null && (var13 == null || var5.distanceTo(var7) < var5.distanceTo(var13))) {
+ var13 = var7;
+ }
+
+ if(var8 != null && (var13 == null || var5.distanceTo(var8) < var5.distanceTo(var13))) {
+ var13 = var8;
+ }
+
+ if(var9 != null && (var13 == null || var5.distanceTo(var9) < var5.distanceTo(var13))) {
+ var13 = var9;
+ }
+
+ if(var10 != null && (var13 == null || var5.distanceTo(var10) < var5.distanceTo(var13))) {
+ var13 = var10;
+ }
+
+ if(var11 != null && (var13 == null || var5.distanceTo(var11) < var5.distanceTo(var13))) {
+ var13 = var11;
+ }
+
+ if(var12 != null && (var13 == null || var5.distanceTo(var12) < var5.distanceTo(var13))) {
+ var13 = var12;
+ }
+
+ if(var13 == null) {
+ return null;
+ } else {
+ byte var14 = -1;
+ if(var13 == var7) {
+ var14 = 4;
+ }
+
+ if(var13 == var8) {
+ var14 = 5;
+ }
+
+ if(var13 == var9) {
+ var14 = 0;
+ }
+
+ if(var13 == var10) {
+ var14 = 1;
+ }
+
+ if(var13 == var11) {
+ var14 = 2;
+ }
+
+ if(var13 == var12) {
+ var14 = 3;
+ }
+
+ return new MovingObjectPosition(var2, var3, var4, var14, var13.addVector((double)var2, (double)var3, (double)var4));
+ }
+ }
+
+ private boolean isVecInsideYZBounds(Vec3D var1) {
+ return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInsideXZBounds(Vec3D var1) {
+ return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
+ }
+
+ private boolean isVecInsideXYBounds(Vec3D 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) {
+ }
+
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return true;
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ return false;
+ }
+
+ public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
+ }
+
+ public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
+ }
+
+ 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, Vec3D var6) {
+ }
+
+ public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
+ }
+
+ public int getRenderColor(IBlockAccess var1, int var2, int var3, int var4) {
+ return 16777215;
+ }
+
+ static {
+ for(int var0 = 0; var0 < 256; ++var0) {
+ if(blocksList[var0] != null) {
+ Item.itemsList[var0] = new ItemBlock(var0 - 256);
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockBookshelf.java b/src/net/minecraft/src/BlockBookshelf.java
new file mode 100644
index 0000000..e91f8a9
--- /dev/null
+++ b/src/net/minecraft/src/BlockBookshelf.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockBookshelf extends Block {
+ public BlockBookshelf(int var1, int var2) {
+ super(var1, var2, Material.wood);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 <= 1 ? 4 : this.blockIndexInTexture;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+}
diff --git a/src/net/minecraft/src/BlockBreakable.java b/src/net/minecraft/src/BlockBreakable.java
new file mode 100644
index 0000000..a037862
--- /dev/null
+++ b/src/net/minecraft/src/BlockBreakable.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class BlockBreakable extends Block {
+ private boolean localFlag;
+
+ protected BlockBreakable(int var1, int var2, Material var3, boolean var4) {
+ super(var1, var2, var3);
+ this.localFlag = var4;
+ }
+
+ 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);
+ }
+}
diff --git a/src/net/minecraft/src/BlockChest.java b/src/net/minecraft/src/BlockChest.java
new file mode 100644
index 0000000..9807507
--- /dev/null
+++ b/src/net/minecraft/src/BlockChest.java
@@ -0,0 +1,196 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockChest extends BlockContainer {
+ private Random random = new Random();
+
+ protected BlockChest(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 26;
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ if(var5 == 1) {
+ return this.blockIndexInTexture - 1;
+ } else if(var5 == 0) {
+ return this.blockIndexInTexture - 1;
+ } else {
+ 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;
+ int var11;
+ int var12;
+ byte var13;
+ if(var6 != this.blockID && var7 != this.blockID) {
+ if(var8 != this.blockID && var9 != this.blockID) {
+ byte var14 = 3;
+ if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var7]) {
+ var14 = 3;
+ }
+
+ if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var6]) {
+ var14 = 2;
+ }
+
+ if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var9]) {
+ var14 = 5;
+ }
+
+ if(Block.opaqueCubeLookup[var9] && !Block.opaqueCubeLookup[var8]) {
+ var14 = 4;
+ }
+
+ return var5 == var14 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
+ } else if(var5 != 4 && var5 != 5) {
+ var10 = 0;
+ if(var8 == this.blockID) {
+ var10 = -1;
+ }
+
+ var11 = var1.getBlockId(var8 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 - 1);
+ var12 = var1.getBlockId(var8 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 + 1);
+ if(var5 == 3) {
+ var10 = -1 - var10;
+ }
+
+ var13 = 3;
+ if((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var12]) {
+ var13 = 3;
+ }
+
+ if((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var12]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) {
+ var13 = 2;
+ }
+
+ return (var5 == var13 ? this.blockIndexInTexture + 16 : this.blockIndexInTexture + 32) + var10;
+ } else {
+ return this.blockIndexInTexture;
+ }
+ } else if(var5 != 2 && var5 != 3) {
+ var10 = 0;
+ if(var6 == this.blockID) {
+ var10 = -1;
+ }
+
+ var11 = var1.getBlockId(var2 - 1, var3, var6 == this.blockID ? var4 - 1 : var4 + 1);
+ var12 = var1.getBlockId(var2 + 1, var3, var6 == this.blockID ? var4 - 1 : var4 + 1);
+ if(var5 == 4) {
+ var10 = -1 - var10;
+ }
+
+ var13 = 5;
+ if((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var9] && !Block.opaqueCubeLookup[var12]) {
+ var13 = 5;
+ }
+
+ if((Block.opaqueCubeLookup[var9] || Block.opaqueCubeLookup[var12]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) {
+ var13 = 4;
+ }
+
+ return (var5 == var13 ? this.blockIndexInTexture + 16 : this.blockIndexInTexture + 32) + var10;
+ } else {
+ return this.blockIndexInTexture;
+ }
+ }
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? this.blockIndexInTexture - 1 : (var1 == 0 ? this.blockIndexInTexture - 1 : (var1 == 3 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture));
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ 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 onBlockRemoval(World var1, int var2, int var3, int var4) {
+ TileEntityChest var5 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4);
+
+ for(int var6 = 0; var6 < var5.getSizeInventory(); ++var6) {
+ ItemStack var7 = var5.getStackInSlot(var6);
+ if(var7 != null) {
+ float var8 = this.random.nextFloat() * 0.8F + 0.1F;
+ float var9 = this.random.nextFloat() * 0.8F + 0.1F;
+ float var10 = this.random.nextFloat() * 0.8F + 0.1F;
+
+ while(var7.stackSize > 0) {
+ int var11 = this.random.nextInt(21) + 10;
+ if(var11 > var7.stackSize) {
+ var11 = var7.stackSize;
+ }
+
+ var7.stackSize -= var11;
+ EntityItem var12 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(var7.itemID, var11, var7.itemDmg));
+ float var13 = 0.05F;
+ var12.motionX = (double)((float)this.random.nextGaussian() * var13);
+ var12.motionY = (double)((float)this.random.nextGaussian() * var13 + 0.2F);
+ var12.motionZ = (double)((float)this.random.nextGaussian() * var13);
+ var1.spawnEntityInWorld(var12);
+ }
+ }
+ }
+
+ super.onBlockRemoval(var1, var2, var3, var4);
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ Object var6 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4);
+ if(var1.isBlockNormalCube(var2, var3 + 1, var4)) {
+ return true;
+ } else if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID && var1.isBlockNormalCube(var2 - 1, var3 + 1, var4)) {
+ return true;
+ } else if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID && var1.isBlockNormalCube(var2 + 1, var3 + 1, var4)) {
+ return true;
+ } else if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID && var1.isBlockNormalCube(var2, var3 + 1, var4 - 1)) {
+ return true;
+ } else if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID && var1.isBlockNormalCube(var2, var3 + 1, var4 + 1)) {
+ return true;
+ } else {
+ if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (TileEntityChest)var1.getBlockTileEntity(var2 - 1, var3, var4), (IInventory)var6);
+ }
+
+ if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (IInventory)var6, (TileEntityChest)var1.getBlockTileEntity(var2 + 1, var3, var4));
+ }
+
+ if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 - 1), (IInventory)var6);
+ }
+
+ if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) {
+ var6 = new InventoryLargeChest("Large chest", (IInventory)var6, (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 + 1));
+ }
+
+ var5.displayGUIChest((IInventory)var6);
+ return true;
+ }
+ }
+
+ protected TileEntity getBlockEntity() {
+ return new TileEntityChest();
+ }
+}
diff --git a/src/net/minecraft/src/BlockContainer.java b/src/net/minecraft/src/BlockContainer.java
new file mode 100644
index 0000000..6b5cee0
--- /dev/null
+++ b/src/net/minecraft/src/BlockContainer.java
@@ -0,0 +1,23 @@
+package net.minecraft.src;
+
+public abstract class BlockContainer extends Block {
+ protected BlockContainer(int var1, Material var2) {
+ super(var1, var2);
+ }
+
+ protected BlockContainer(int var1, int var2, Material var3) {
+ super(var1, var2, var3);
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ super.onBlockAdded(var1, var2, var3, var4);
+ var1.setBlockTileEntity(var2, var3, var4, this.getBlockEntity());
+ }
+
+ public void onBlockRemoval(World var1, int var2, int var3, int var4) {
+ super.onBlockRemoval(var1, var2, var3, var4);
+ var1.removeBlockTileEntity(var2, var3, var4);
+ }
+
+ protected abstract TileEntity getBlockEntity();
+}
diff --git a/src/net/minecraft/src/BlockCrops.java b/src/net/minecraft/src/BlockCrops.java
new file mode 100644
index 0000000..9cb6741
--- /dev/null
+++ b/src/net/minecraft/src/BlockCrops.java
@@ -0,0 +1,110 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockCrops extends BlockFlower {
+ protected BlockCrops(int var1, int var2) {
+ super(var1, var2);
+ this.blockIndexInTexture = var2;
+ this.setTickOnLoad(true);
+ float var3 = 0.5F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3);
+ }
+
+ protected boolean canThisPlantGrowOnThisBlockID(int var1) {
+ return var1 == 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.updateTick(var1, var2, var3, var4);
+ if(var5.nextInt((int)(100.0F / var7)) == 0) {
+ ++var6;
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
+ }
+ }
+ }
+
+ }
+
+ private float updateTick(World var1, int var2, int var3, int var4) {
+ 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);
+ 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);
+ float var20 = 0.0F;
+ if(var19 == Block.tilledField.blockID) {
+ var20 = 1.0F;
+ if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) {
+ var20 = 3.0F;
+ }
+ }
+
+ if(var17 != var2 || var18 != var4) {
+ var20 /= 4.0F;
+ }
+
+ var5 += var20;
+ }
+ }
+
+ if(var16 || var14 && var15) {
+ var5 /= 2.0F;
+ }
+
+ return var5;
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ if(var2 < 0) {
+ var2 = 7;
+ }
+
+ return this.blockIndexInTexture + var2;
+ }
+
+ public int getRenderType() {
+ return 6;
+ }
+
+ public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
+ super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5);
+
+ for(int var6 = 0; var6 < 3; ++var6) {
+ if(var1.rand.nextInt(15) <= var5) {
+ float var7 = 0.7F;
+ float var8 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
+ float var9 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
+ float var10 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
+ EntityItem var11 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(Item.seeds));
+ var11.delayBeforeCanPickup = 10;
+ var1.spawnEntityInWorld(var11);
+ }
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ System.out.println("Get resource: " + var1);
+ return var1 == 7 ? Item.wheat.shiftedIndex : -1;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+}
diff --git a/src/net/minecraft/src/BlockDirt.java b/src/net/minecraft/src/BlockDirt.java
new file mode 100644
index 0000000..d3b8a7a
--- /dev/null
+++ b/src/net/minecraft/src/BlockDirt.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+public class BlockDirt extends Block {
+ protected BlockDirt(int var1, int var2) {
+ super(var1, var2, Material.ground);
+ }
+}
diff --git a/src/net/minecraft/src/BlockDoor.java b/src/net/minecraft/src/BlockDoor.java
new file mode 100644
index 0000000..25b2c67
--- /dev/null
+++ b/src/net/minecraft/src/BlockDoor.java
@@ -0,0 +1,154 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockDoor extends Block {
+ protected BlockDoor(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 97;
+ float var2 = 0.5F;
+ float var3 = 1.0F;
+ this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var3, 0.5F + var2);
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ if(var1 != 0 && var1 != 1) {
+ int var3 = this.getState(var2);
+ if((var3 == 0 || var3 == 2) ^ var1 <= 3) {
+ return this.blockIndexInTexture;
+ } else {
+ int var4 = var3 / 2 + (var1 & 1 ^ var3);
+ var4 += (var2 & 4) / 4;
+ int var5 = this.blockIndexInTexture - (var2 & 8) * 2;
+ if((var4 & 1) != 0) {
+ var5 = -var5;
+ }
+
+ return var5;
+ }
+ } else {
+ return this.blockIndexInTexture;
+ }
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ 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.getState(var1.getBlockMetadata(var2, var3, var4)));
+ }
+
+ public void setDoorRotation(int var1) {
+ float var2 = 3.0F / 16.0F;
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
+ if(var1 == 0) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
+ }
+
+ if(var1 == 1) {
+ this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var1 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var1 == 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) {
+ this.blockActivated(var1, var2, var3, var4, var5);
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if((var6 & 8) != 0) {
+ if(var1.getBlockId(var2, var3 - 1, var4) == this.blockID) {
+ this.blockActivated(var1, var2, var3 - 1, var4, var5);
+ }
+
+ return true;
+ } else {
+ if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
+ var1.setBlockMetadataWithNotify(var2, var3 + 1, var4, (var6 ^ 4) + 8);
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 ^ 4);
+ var1.markBlocksDirty(var2, var3 - 1, var4, var2, var3, var4);
+ if(Math.random() < 0.5D) {
+ var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
+ } else {
+ var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
+ }
+
+ return true;
+ }
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if((var6 & 8) != 0) {
+ if(var1.getBlockId(var2, var3 - 1, var4) != this.blockID) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ } else {
+ boolean var7 = false;
+ if(var1.getBlockId(var2, var3 + 1, var4) != this.blockID) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ var7 = true;
+ }
+
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ var7 = true;
+ if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
+ var1.setBlockWithNotify(var2, var3 + 1, var4, 0);
+ }
+ }
+
+ if(var7) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var6);
+ }
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return (var1 & 8) != 0 ? 0 : Item.door.shiftedIndex;
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
+ return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
+ }
+
+ public int getState(int var1) {
+ return (var1 & 4) == 0 ? var1 - 1 & 3 : var1 & 3;
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return var3 >= 127 ? false : var1.isBlockNormalCube(var2, var3 - 1, var4) && super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4);
+ }
+}
diff --git a/src/net/minecraft/src/BlockFarmland.java b/src/net/minecraft/src/BlockFarmland.java
new file mode 100644
index 0000000..790d39c
--- /dev/null
+++ b/src/net/minecraft/src/BlockFarmland.java
@@ -0,0 +1,93 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFarmland extends Block {
+ protected BlockFarmland(int var1) {
+ super(var1, Material.ground);
+ this.blockIndexInTexture = 87;
+ this.setTickOnLoad(true);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 15.0F / 16.0F, 1.0F);
+ this.setLightOpacity(255);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return AxisAlignedBB.getBoundingBoxFromPool((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 0), (double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1));
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return var1 == 1 && var2 > 0 ? this.blockIndexInTexture - 1 : (var1 == 1 ? this.blockIndexInTexture : 2);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(var5.nextInt(5) == 0) {
+ if(this.isWaterNearby(var1, var2, var3, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 7);
+ } else {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 > 0) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 - 1);
+ } else if(!this.isCropsNearby(var1, var2, var3, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ }
+ }
+ }
+
+ }
+
+ public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
+ if(var1.rand.nextInt(4) == 0) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ }
+
+ }
+
+ private boolean isCropsNearby(World var1, int var2, int var3, int var4) {
+ byte var5 = 0;
+
+ for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
+ for(int var7 = var4 - var5; var7 <= var4 + var5; ++var7) {
+ if(var1.getBlockId(var6, var3 + 1, var7) == Block.crops.blockID) {
+ return true;
+ }
+ }
+ }
+
+ 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) {
+ return true;
+ }
+ }
+ }
+ }
+
+ 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.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.dirt.idDropped(0, var2);
+ }
+}
diff --git a/src/net/minecraft/src/BlockFire.java b/src/net/minecraft/src/BlockFire.java
new file mode 100644
index 0000000..594e81e
--- /dev/null
+++ b/src/net/minecraft/src/BlockFire.java
@@ -0,0 +1,225 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFire extends Block {
+ private int[] chanceToEncourageFire = new int[256];
+ private int[] abilityToCatchFire = new int[256];
+
+ protected BlockFire(int var1, int var2) {
+ super(var1, var2, Material.fire);
+ this.setBurnRate(Block.planks.blockID, 5, 20);
+ this.setBurnRate(Block.wood.blockID, 5, 5);
+ this.setBurnRate(Block.leaves.blockID, 30, 60);
+ this.setBurnRate(Block.bookshelf.blockID, 30, 20);
+ this.setBurnRate(Block.tnt.blockID, 15, 100);
+ this.setBurnRate(Block.cloth.blockID, 30, 60);
+ this.setTickOnLoad(true);
+ }
+
+ private void setBurnRate(int var1, int var2, int var3) {
+ this.chanceToEncourageFire[var1] = var2;
+ this.abilityToCatchFire[var1] = var3;
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 3;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+
+ public int tickRate() {
+ return 20;
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 < 15) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + 1);
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+
+ if(!this.canNeighborCatchFire(var1, var2, var3, var4)) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4) || var6 > 3) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ } else if(!this.canBlockCatchFire(var1, var2, var3 - 1, var4) && var6 == 15 && var5.nextInt(4) == 0) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ } else {
+ if(var6 % 5 == 0 && var6 > 5) {
+ this.tryToCatchBlockOnFire(var1, var2 + 1, var3, var4, 300, var5);
+ this.tryToCatchBlockOnFire(var1, var2 - 1, var3, var4, 300, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 100, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 200, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3, var4 - 1, 300, var5);
+ this.tryToCatchBlockOnFire(var1, var2, var3, var4 + 1, 300, var5);
+
+ for(int var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
+ for(int var8 = var4 - 1; var8 <= var4 + 1; ++var8) {
+ for(int var9 = var3 - 1; var9 <= var3 + 4; ++var9) {
+ if(var7 != var2 || var9 != var3 || var8 != var4) {
+ int var10 = 100;
+ if(var9 > var3 + 1) {
+ var10 += (var9 - (var3 + 1)) * 100;
+ }
+
+ int var11 = this.getChanceOfNeighborsEncouragingFire(var1, var7, var9, var8);
+ if(var11 > 0 && var5.nextInt(var10) <= var11) {
+ var1.setBlockWithNotify(var7, var9, var8, this.blockID);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ private void tryToCatchBlockOnFire(World var1, int var2, int var3, int var4, int var5, Random var6) {
+ int var7 = this.abilityToCatchFire[var1.getBlockId(var2, var3, var4)];
+ if(var6.nextInt(var5) < var7) {
+ boolean var8 = var1.getBlockId(var2, var3, var4) == Block.tnt.blockID;
+ if(var6.nextInt(2) == 0) {
+ var1.setBlockWithNotify(var2, var3, var4, this.blockID);
+ } else {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ if(var8) {
+ Block.tnt.onBlockDestroyedByPlayer(var1, var2, var3, var4, 0);
+ }
+ }
+
+ }
+
+ private boolean canNeighborCatchFire(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) {
+ byte var5 = 0;
+ if(var1.getBlockId(var2, var3, var4) != 0) {
+ 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);
+ return var6;
+ }
+ }
+
+ 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.isBlockNormalCube(var2, var3 - 1, var4) || this.canNeighborCatchFire(var1, var2, var3, var4);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4) && !this.canNeighborCatchFire(var1, var2, var3, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4) && !this.canNeighborCatchFire(var1, var2, var3, var4)) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ } else {
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+ }
+
+ public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(var5.nextInt(24) == 0) {
+ var1.playSoundEffect((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);
+ }
+
+ int var6;
+ float var7;
+ float var8;
+ float var9;
+ if(!var1.isBlockNormalCube(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);
+ }
+ }
+ } 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);
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockFlower.java b/src/net/minecraft/src/BlockFlower.java
new file mode 100644
index 0000000..8551ad0
--- /dev/null
+++ b/src/net/minecraft/src/BlockFlower.java
@@ -0,0 +1,58 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFlower extends Block {
+ protected BlockFlower(int var1, int var2) {
+ super(var1, Material.plants);
+ this.blockIndexInTexture = var2;
+ this.setTickOnLoad(true);
+ float var3 = 0.2F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 3.0F, 0.5F + var3);
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return 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));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ }
+
+ public boolean canBlockStay(World var1, int var2, int var3, int var4) {
+ return (var1.getBlockLightValue(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) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 1;
+ }
+}
diff --git a/src/net/minecraft/src/BlockFlowing.java b/src/net/minecraft/src/BlockFlowing.java
new file mode 100644
index 0000000..7052e0c
--- /dev/null
+++ b/src/net/minecraft/src/BlockFlowing.java
@@ -0,0 +1,253 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFlowing extends BlockFluid {
+ int numAdjacentSources = 0;
+ boolean[] isOptimalFlowDirection = new boolean[4];
+ 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.setBlockAndMetadata(var2, var3, var4, this.blockID + 1, var5);
+ var1.markBlocksDirty(var2, var3, var4, var2, var3, var4);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ int var6 = this.getFlowDecay(var1, var2, var3, var4);
+ boolean var7 = true;
+ int var9;
+ if(var6 > 0) {
+ byte var8 = -100;
+ this.numAdjacentSources = 0;
+ int var11 = this.getSmallestFlowDecay(var1, var2 - 1, var3, var4, var8);
+ var11 = this.getSmallestFlowDecay(var1, var2 + 1, var3, var4, var11);
+ var11 = this.getSmallestFlowDecay(var1, var2, var3, var4 - 1, var11);
+ var11 = this.getSmallestFlowDecay(var1, var2, var3, var4 + 1, var11);
+ var9 = var11 + this.fluidType;
+ if(var9 >= 8 || var11 < 0) {
+ var9 = -1;
+ }
+
+ if(this.getFlowDecay(var1, var2, var3 + 1, var4) >= 0) {
+ int var10 = this.getFlowDecay(var1, var2, var3 + 1, var4);
+ if(var10 >= 8) {
+ var9 = var10;
+ } else {
+ var9 = var10 + 8;
+ }
+ }
+
+ if(this.numAdjacentSources >= 2 && this.blockMaterial == Material.water) {
+ var9 = 0;
+ }
+
+ if(this.blockMaterial == Material.lava && var6 < 8 && var9 < 8 && var9 > var6 && var5.nextInt(4) != 0) {
+ var9 = var6;
+ var7 = false;
+ }
+
+ if(var9 != var6) {
+ var6 = var9;
+ if(var9 < 0) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ } else {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var9);
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
+ }
+ } else if(var7) {
+ this.updateFlow(var1, var2, var3, var4);
+ }
+ } else {
+ this.updateFlow(var1, var2, var3, var4);
+ }
+
+ if(this.liquidCanDisplaceBlock(var1, var2, var3 - 1, var4)) {
+ if(var6 >= 8) {
+ var1.setBlockAndMetadataWithNotify(var2, var3 - 1, var4, this.blockID, var6);
+ } else {
+ var1.setBlockAndMetadataWithNotify(var2, var3 - 1, var4, this.blockID, var6 + 8);
+ }
+ } else if(var6 >= 0 && (var6 == 0 || this.blockBlocksFlow(var1, var2, var3 - 1, var4))) {
+ boolean[] var12 = this.getOptimalFlowDirections(var1, var2, var3, var4);
+ var9 = var6 + this.fluidType;
+ if(var6 >= 8) {
+ var9 = 1;
+ }
+
+ if(var9 >= 8) {
+ return;
+ }
+
+ if(var12[0]) {
+ this.flowIntoBlock(var1, var2 - 1, var3, var4, var9);
+ }
+
+ if(var12[1]) {
+ this.flowIntoBlock(var1, var2 + 1, var3, var4, var9);
+ }
+
+ if(var12[2]) {
+ this.flowIntoBlock(var1, var2, var3, var4 - 1, var9);
+ }
+
+ if(var12[3]) {
+ this.flowIntoBlock(var1, var2, var3, var4 + 1, var9);
+ }
+ }
+
+ }
+
+ 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);
+ } else {
+ Block.blocksList[var6].dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ }
+ }
+
+ var1.setBlockAndMetadataWithNotify(var2, var3, var4, this.blockID, var5);
+ }
+
+ }
+
+ private int calculateFlowCost(World var1, int var2, int var3, int var4, int var5, int var6) {
+ 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;
+ }
+
+ if(var8 == 1) {
+ ++var9;
+ }
+
+ if(var8 == 2) {
+ var11 = var4 - 1;
+ }
+
+ 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(var5 < 4) {
+ int var12 = this.calculateFlowCost(var1, var9, var3, var11, var5 + 1, var8);
+ if(var12 < var7) {
+ var7 = var12;
+ }
+ }
+ }
+ }
+ }
+
+ return var7;
+ }
+
+ private boolean[] getOptimalFlowDirections(World var1, int var2, int var3, int var4) {
+ int var5;
+ int var6;
+ for(var5 = 0; var5 < 4; ++var5) {
+ this.flowCost[var5] = 1000;
+ var6 = var2;
+ int var8 = var4;
+ if(var5 == 0) {
+ var6 = var2 - 1;
+ }
+
+ if(var5 == 1) {
+ ++var6;
+ }
+
+ if(var5 == 2) {
+ var8 = var4 - 1;
+ }
+
+ 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] = 0;
+ } else {
+ this.flowCost[var5] = this.calculateFlowCost(var1, var6, var3, var8, 1, var5);
+ }
+ }
+ }
+
+ var5 = this.flowCost[0];
+
+ for(var6 = 1; var6 < 4; ++var6) {
+ if(this.flowCost[var6] < var5) {
+ var5 = this.flowCost[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.signStanding.blockID && var5 != Block.ladder.blockID) {
+ if(var5 == 0) {
+ return false;
+ } else {
+ Material var6 = Block.blocksList[var5].blockMaterial;
+ return var6.isSolid();
+ }
+ } else {
+ return true;
+ }
+ }
+
+ 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;
+ } else {
+ if(var6 == 0) {
+ ++this.numAdjacentSources;
+ }
+
+ 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);
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockFluid.java b/src/net/minecraft/src/BlockFluid.java
new file mode 100644
index 0000000..cb56215
--- /dev/null
+++ b/src/net/minecraft/src/BlockFluid.java
@@ -0,0 +1,273 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public abstract class BlockFluid extends Block {
+ protected int fluidType = 1;
+
+ protected BlockFluid(int var1, Material var2) {
+ super(var1, (var2 == Material.lava ? 14 : 12) * 16 + 13, var2);
+ float var3 = 0.0F;
+ float var4 = 0.0F;
+ if(var2 == Material.lava) {
+ this.fluidType = 2;
+ }
+
+ this.setBlockBounds(0.0F + var4, 0.0F + var3, 0.0F + var4, 1.0F + var4, 1.0F + var3, 1.0F + var4);
+ this.setTickOnLoad(true);
+ }
+
+ public static float getPercentAir(int var0) {
+ if(var0 >= 8) {
+ var0 = 0;
+ }
+
+ float var1 = (float)(var0 + 1) / 9.0F;
+ return var1;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 != 0 && var1 != 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
+ }
+
+ protected int getFlowDecay(World var1, int var2, int var3, int var4) {
+ return var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial ? -1 : var1.getBlockMetadata(var2, var3, var4);
+ }
+
+ protected int getEffectiveFlowDecay(IBlockAccess var1, int var2, int var3, int var4) {
+ if(var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial) {
+ return -1;
+ } else {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ if(var5 >= 8) {
+ var5 = 0;
+ }
+
+ return var5;
+ }
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean canCollideCheck(int var1, boolean var2) {
+ return var2 && var1 == 0;
+ }
+
+ 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 : super.shouldSideBeRendered(var1, var2, var3, var4, var5));
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public int getRenderType() {
+ return 4;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return 0;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+
+ private Vec3D getFlowVector(IBlockAccess var1, int var2, int var3, int var4) {
+ Vec3D var5 = Vec3D.createVector(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) {
+ ++var8;
+ }
+
+ if(var7 == 3) {
+ ++var10;
+ }
+
+ int var11 = this.getEffectiveFlowDecay(var1, var8, var3, var10);
+ int var12;
+ if(var11 < 0) {
+ var11 = this.getEffectiveFlowDecay(var1, var8, var3 - 1, var10);
+ if(var11 >= 0) {
+ var12 = var11 - (var6 - 8);
+ var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12));
+ }
+ } else if(var11 >= 0) {
+ var12 = var11 - var6;
+ var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12));
+ }
+ }
+
+ if(var1.getBlockMetadata(var2, var3, var4) >= 8) {
+ boolean var13 = false;
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3, var4 - 1, 2)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3, var4 + 1, 3)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 - 1, var3, var4, 4)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 + 1, var3, var4, 5)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3 + 1, var4 - 1, 2)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2, var3 + 1, var4 + 1, 3)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 - 1, var3 + 1, var4, 4)) {
+ var13 = true;
+ }
+
+ if(var13 || this.shouldSideBeRendered(var1, var2 + 1, var3 + 1, var4, 5)) {
+ var13 = true;
+ }
+
+ if(var13) {
+ var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D);
+ }
+ }
+
+ var5 = var5.normalize();
+ return var5;
+ }
+
+ public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3D var6) {
+ Vec3D var7 = this.getFlowVector(var1, var2, var3, var4);
+ var6.xCoord += var7.xCoord;
+ var6.yCoord += var7.yCoord;
+ var6.zCoord += var7.zCoord;
+ }
+
+ public int tickRate() {
+ return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? 30 : 0);
+ }
+
+ public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) {
+ float var5 = var1.getBrightness(var2, var3, var4);
+ float var6 = var1.getBrightness(var2, var3 + 1, var4);
+ return var5 > var6 ? var5 : var6;
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ super.updateTick(var1, var2, var3, var4, var5);
+ }
+
+ public int getRenderBlockPass() {
+ return this.blockMaterial == Material.water ? 1 : 0;
+ }
+
+ public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(this.blockMaterial == Material.water && var5.nextInt(64) == 0) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 > 0 && var6 < 8) {
+ var1.playSoundEffect((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);
+ }
+ }
+
+ if(this.blockMaterial == Material.lava && var1.getBlockMaterial(var2, var3 + 1, var4) == Material.air && !var1.isBlockNormalCube(var2, var3 + 1, var4) && var5.nextInt(100) == 0) {
+ double var12 = (double)((float)var2 + var5.nextFloat());
+ double var8 = (double)var3 + this.maxY;
+ double var10 = (double)((float)var4 + var5.nextFloat());
+ var1.spawnParticle("lava", var12, var8, var10, 0.0D, 0.0D, 0.0D);
+ }
+
+ }
+
+ public static double getFlowDirection(IBlockAccess var0, int var1, int var2, int var3, Material var4) {
+ Vec3D var5 = null;
+ if(var4 == Material.water) {
+ var5 = ((BlockFluid)Block.waterMoving).getFlowVector(var0, var1, var2, var3);
+ }
+
+ if(var4 == Material.lava) {
+ var5 = ((BlockFluid)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) {
+ 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.setBlockWithNotify(var2, var3, var4, Block.obsidian.blockID);
+ } else if(var6 <= 4) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.cobblestone.blockID);
+ }
+
+ this.triggerLavaMixEffects(var1, var2, var3, var4);
+ }
+ }
+
+ }
+ }
+
+ 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.rand.nextFloat() - var1.rand.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);
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockFurnace.java b/src/net/minecraft/src/BlockFurnace.java
new file mode 100644
index 0000000..69a78c5
--- /dev/null
+++ b/src/net/minecraft/src/BlockFurnace.java
@@ -0,0 +1,106 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockFurnace extends BlockContainer {
+ private final boolean isActive;
+
+ protected BlockFurnace(int var1, boolean var2) {
+ super(var1, Material.rock);
+ this.isActive = var2;
+ this.blockIndexInTexture = 45;
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ super.onBlockAdded(var1, var2, var3, var4);
+ this.setDefaultDirection(var1, var2, var3, var4);
+ }
+
+ private void setDefaultDirection(World var1, int var2, int var3, int 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);
+ byte var9 = 3;
+ if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) {
+ var9 = 3;
+ }
+
+ if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) {
+ var9 = 2;
+ }
+
+ if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) {
+ var9 = 5;
+ }
+
+ if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) {
+ var9 = 4;
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var9);
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ if(var5 == 1) {
+ return Block.stone.blockIndexInTexture;
+ } else if(var5 == 0) {
+ return Block.stone.blockIndexInTexture;
+ } else {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ return var5 != var6 ? this.blockIndexInTexture : (this.isActive ? this.blockIndexInTexture + 16 : this.blockIndexInTexture - 1);
+ }
+ }
+
+ 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;
+ 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);
+ }
+
+ }
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? Block.stone.blockID : (var1 == 0 ? Block.stone.blockID : (var1 == 3 ? this.blockIndexInTexture - 1 : this.blockIndexInTexture));
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ TileEntityFurnace var6 = (TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4);
+ var5.displayGUIFurnace(var6);
+ 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);
+ if(var0) {
+ var1.setBlockWithNotify(var2, var3, var4, Block.stoneOvenActive.blockID);
+ } else {
+ var1.setBlockWithNotify(var2, var3, var4, Block.stoneOvenIdle.blockID);
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var5);
+ var1.setBlockTileEntity(var2, var3, var4, var6);
+ }
+
+ protected TileEntity getBlockEntity() {
+ return new TileEntityFurnace();
+ }
+}
diff --git a/src/net/minecraft/src/BlockGears.java b/src/net/minecraft/src/BlockGears.java
new file mode 100644
index 0000000..a58762f
--- /dev/null
+++ b/src/net/minecraft/src/BlockGears.java
@@ -0,0 +1,33 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGears extends Block {
+ protected BlockGears(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 5;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public boolean isCollidable() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/BlockGlass.java b/src/net/minecraft/src/BlockGlass.java
new file mode 100644
index 0000000..c2672d1
--- /dev/null
+++ b/src/net/minecraft/src/BlockGlass.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGlass extends BlockBreakable {
+ public BlockGlass(int var1, int var2, Material var3, boolean var4) {
+ super(var1, var2, var3, var4);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+}
diff --git a/src/net/minecraft/src/BlockGrass.java b/src/net/minecraft/src/BlockGrass.java
new file mode 100644
index 0000000..f9bff22
--- /dev/null
+++ b/src/net/minecraft/src/BlockGrass.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGrass extends Block {
+ protected BlockGrass(int var1) {
+ super(var1, Material.ground);
+ this.blockIndexInTexture = 3;
+ this.setTickOnLoad(true);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? 0 : (var1 == 0 ? 2 : 3);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && var1.getBlockMaterial(var2, var3 + 1, var4).getCanBlockGrass()) {
+ if(var5.nextInt(4) != 0) {
+ return;
+ }
+
+ var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
+ } else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) {
+ int var6 = var2 + var5.nextInt(3) - 1;
+ int var7 = var3 + var5.nextInt(5) - 3;
+ int var8 = var4 + var5.nextInt(3) - 1;
+ if(var1.getBlockId(var6, var7, var8) == Block.dirt.blockID && var1.getBlockLightValue(var6, var7 + 1, var8) >= 4 && !var1.getBlockMaterial(var6, var7 + 1, var8).getCanBlockGrass()) {
+ var1.setBlockWithNotify(var6, var7, var8, Block.grass.blockID);
+ }
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.dirt.idDropped(0, var2);
+ }
+}
diff --git a/src/net/minecraft/src/BlockGravel.java b/src/net/minecraft/src/BlockGravel.java
new file mode 100644
index 0000000..c0fd641
--- /dev/null
+++ b/src/net/minecraft/src/BlockGravel.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockGravel extends BlockSand {
+ public BlockGravel(int var1, int var2) {
+ super(var1, var2);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return var2.nextInt(10) == 0 ? Item.flint.shiftedIndex : this.blockID;
+ }
+}
diff --git a/src/net/minecraft/src/BlockLadder.java b/src/net/minecraft/src/BlockLadder.java
new file mode 100644
index 0000000..dfcce6f
--- /dev/null
+++ b/src/net/minecraft/src/BlockLadder.java
@@ -0,0 +1,121 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockLadder extends Block {
+ protected BlockLadder(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ float var6 = 2.0F / 16.0F;
+ if(var5 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - var6, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 3) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var6);
+ }
+
+ if(var5 == 4) {
+ this.setBlockBounds(1.0F - var6, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 5) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, var6, 1.0F, 1.0F);
+ }
+
+ return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
+ }
+
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ float var6 = 2.0F / 16.0F;
+ if(var5 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - var6, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 3) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var6);
+ }
+
+ if(var5 == 4) {
+ this.setBlockBounds(1.0F - var6, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ if(var5 == 5) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, var6, 1.0F, 1.0F);
+ }
+
+ return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4);
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ 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)));
+ }
+
+ public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if((var6 == 0 || var5 == 2) && var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var6 = 2;
+ }
+
+ if((var6 == 0 || var5 == 3) && var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var6 = 3;
+ }
+
+ if((var6 == 0 || var5 == 4) && var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var6 = 4;
+ }
+
+ if((var6 == 0 || var5 == 5) && var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var6 = 5;
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ 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);
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ super.onNeighborBlockChange(var1, var2, var3, var4, var5);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+}
diff --git a/src/net/minecraft/src/BlockLeaves.java b/src/net/minecraft/src/BlockLeaves.java
new file mode 100644
index 0000000..d79b80e
--- /dev/null
+++ b/src/net/minecraft/src/BlockLeaves.java
@@ -0,0 +1,53 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockLeaves extends BlockLeavesBase {
+ private int leafTexIndex;
+
+ protected BlockLeaves(int var1, int var2) {
+ super(var1, var2, Material.leaves, false);
+ this.leafTexIndex = var2;
+ this.setTickOnLoad(true);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ if(!var1.getBlockMaterial(var2, var3 - 1, var4).isSolid()) {
+ byte var6 = 2;
+
+ for(int var7 = var2 - var6; var7 <= var2 + var6; ++var7) {
+ for(int var8 = var3 - 1; var8 <= var3 + 1; ++var8) {
+ for(int var9 = var4 - var6; var9 <= var4 + var6; ++var9) {
+ if(var1.getBlockId(var7, var8, var9) == Block.wood.blockID) {
+ return;
+ }
+ }
+ }
+ }
+
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ }
+
+ public int quantityDropped(Random var1) {
+ return var1.nextInt(10) == 0 ? 1 : 0;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.sapling.blockID;
+ }
+
+ public boolean isOpaqueCube() {
+ return !this.graphicsLevel;
+ }
+
+ public void setGraphicsLevel(boolean var1) {
+ this.graphicsLevel = var1;
+ this.blockIndexInTexture = this.leafTexIndex + (var1 ? 0 : 1);
+ }
+
+ public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
+ super.onEntityWalking(var1, var2, var3, var4, var5);
+ }
+}
diff --git a/src/net/minecraft/src/BlockLeavesBase.java b/src/net/minecraft/src/BlockLeavesBase.java
new file mode 100644
index 0000000..c719d88
--- /dev/null
+++ b/src/net/minecraft/src/BlockLeavesBase.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class BlockLeavesBase extends Block {
+ protected boolean graphicsLevel;
+
+ protected BlockLeavesBase(int var1, int var2, Material var3, boolean var4) {
+ super(var1, var2, var3);
+ this.graphicsLevel = var4;
+ }
+
+ 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);
+ }
+}
diff --git a/src/net/minecraft/src/BlockLog.java b/src/net/minecraft/src/BlockLog.java
new file mode 100644
index 0000000..357e5a0
--- /dev/null
+++ b/src/net/minecraft/src/BlockLog.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockLog extends Block {
+ protected BlockLog(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 20;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.wood.blockID;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? 21 : (var1 == 0 ? 21 : 20);
+ }
+}
diff --git a/src/net/minecraft/src/BlockMinecartTrack.java b/src/net/minecraft/src/BlockMinecartTrack.java
new file mode 100644
index 0000000..6566102
--- /dev/null
+++ b/src/net/minecraft/src/BlockMinecartTrack.java
@@ -0,0 +1,92 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockMinecartTrack extends Block {
+ protected BlockMinecartTrack(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
+ return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
+ }
+
+ 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);
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
+ }
+
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return var2 >= 6 ? this.blockIndexInTexture - 16 : this.blockIndexInTexture;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 9;
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return var1.isBlockNormalCube(var2, var3 - 1, var4);
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 15);
+ this.refreshTrackShape(var1, var2, var3, var4);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ boolean var7 = false;
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var7 = true;
+ }
+
+ if(var6 == 2 && !var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var7 = true;
+ }
+
+ if(var6 == 3 && !var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var7 = true;
+ }
+
+ if(var6 == 4 && !var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var7 = true;
+ }
+
+ if(var6 == 5 && !var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var7 = true;
+ }
+
+ if(var7) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ }
+
+ private void refreshTrackShape(World var1, int var2, int var3, int var4) {
+ (new MinecartTrackLogic(this, var1, var2, var3, var4)).place();
+ }
+}
diff --git a/src/net/minecraft/src/BlockMobSpawner.java b/src/net/minecraft/src/BlockMobSpawner.java
new file mode 100644
index 0000000..b845263
--- /dev/null
+++ b/src/net/minecraft/src/BlockMobSpawner.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class BlockMobSpawner extends BlockContainer {
+ protected BlockMobSpawner(int var1, int var2) {
+ super(var1, var2, Material.rock);
+ }
+
+ protected TileEntity getBlockEntity() {
+ return new TileEntityMobSpawner();
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/BlockMushroom.java b/src/net/minecraft/src/BlockMushroom.java
new file mode 100644
index 0000000..f129b7b
--- /dev/null
+++ b/src/net/minecraft/src/BlockMushroom.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class BlockMushroom extends BlockFlower {
+ protected BlockMushroom(int var1, int var2) {
+ super(var1, var2);
+ float var3 = 0.2F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3);
+ }
+
+ protected boolean canThisPlantGrowOnThisBlockID(int var1) {
+ return Block.opaqueCubeLookup[var1];
+ }
+
+ public boolean canBlockStay(World var1, int var2, int var3, int var4) {
+ return var1.getBlockLightValue(var2, var3, var4) <= 13 && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4));
+ }
+}
diff --git a/src/net/minecraft/src/BlockObsidian.java b/src/net/minecraft/src/BlockObsidian.java
new file mode 100644
index 0000000..c75b227
--- /dev/null
+++ b/src/net/minecraft/src/BlockObsidian.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockObsidian extends BlockStone {
+ public BlockObsidian(int var1, int var2) {
+ super(var1, var2);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.obsidian.blockID;
+ }
+}
diff --git a/src/net/minecraft/src/BlockOre.java b/src/net/minecraft/src/BlockOre.java
new file mode 100644
index 0000000..a66fd91
--- /dev/null
+++ b/src/net/minecraft/src/BlockOre.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockOre extends Block {
+ public BlockOre(int var1, int var2) {
+ super(var1, var2, Material.rock);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.blockID == Block.oreCoal.blockID ? Item.coal.shiftedIndex : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.shiftedIndex : this.blockID);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 1;
+ }
+}
diff --git a/src/net/minecraft/src/BlockOreBlock.java b/src/net/minecraft/src/BlockOreBlock.java
new file mode 100644
index 0000000..5655234
--- /dev/null
+++ b/src/net/minecraft/src/BlockOreBlock.java
@@ -0,0 +1,12 @@
+package net.minecraft.src;
+
+public class BlockOreBlock extends Block {
+ public BlockOreBlock(int var1, int var2) {
+ super(var1, Material.iron);
+ this.blockIndexInTexture = var2;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? this.blockIndexInTexture - 16 : (var1 == 0 ? this.blockIndexInTexture + 16 : this.blockIndexInTexture);
+ }
+}
diff --git a/src/net/minecraft/src/BlockSand.java b/src/net/minecraft/src/BlockSand.java
new file mode 100644
index 0000000..451a32e
--- /dev/null
+++ b/src/net/minecraft/src/BlockSand.java
@@ -0,0 +1,53 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockSand extends Block {
+ public static boolean fallInstantly = false;
+
+ public BlockSand(int var1, int var2) {
+ super(var1, var2, Material.sand);
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
+ }
+
+ public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
+ this.tryToFall(var1, var2, var3, var4);
+ }
+
+ private void tryToFall(World var1, int var2, int var3, int var4) {
+ if(canFallBelow(var1, var2, var3 - 1, var4) && var3 >= 0) {
+ EntityFallingSand var8 = new EntityFallingSand(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F, this.blockID);
+ if(fallInstantly) {
+ while(!var8.isDead) {
+ var8.onUpdate();
+ }
+ } else {
+ var1.spawnEntityInWorld(var8);
+ }
+ }
+
+ }
+
+ public int tickRate() {
+ return 3;
+ }
+
+ public static boolean canFallBelow(World var0, int var1, int var2, int var3) {
+ int var4 = var0.getBlockId(var1, var2, var3);
+ if(var4 == 0) {
+ return true;
+ } else if(var4 == Block.fire.blockID) {
+ return true;
+ } else {
+ Material var5 = Block.blocksList[var4].blockMaterial;
+ return var5 == Material.water ? true : var5 == Material.lava;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/BlockSapling.java b/src/net/minecraft/src/BlockSapling.java
new file mode 100644
index 0000000..7d13f83
--- /dev/null
+++ b/src/net/minecraft/src/BlockSapling.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockSapling extends BlockFlower {
+ protected BlockSapling(int var1, int var2) {
+ super(var1, var2);
+ float var3 = 0.4F;
+ this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3);
+ }
+
+ 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 && var5.nextInt(5) == 0) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var6 < 15) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + 1);
+ } else {
+ var1.setBlock(var2, var3, var4, 0);
+ WorldGenTrees var7 = new WorldGenTrees();
+ if(!var7.generate(var1, var5, var2, var3, var4)) {
+ var1.setBlock(var2, var3, var4, this.blockID);
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockSign.java b/src/net/minecraft/src/BlockSign.java
new file mode 100644
index 0000000..03b8536
--- /dev/null
+++ b/src/net/minecraft/src/BlockSign.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockSign extends BlockContainer {
+ private Class signEntityClass;
+ private int itemDropID;
+
+ protected BlockSign(int var1, Class var2, int var3) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 4;
+ this.signEntityClass = var2;
+ float var4 = 0.25F;
+ float var5 = 1.625F;
+ this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4);
+ this.itemDropID = var3;
+ }
+
+ public int getRenderType() {
+ return -1;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ protected TileEntity getBlockEntity() {
+ try {
+ return (TileEntity)this.signEntityClass.newInstance();
+ } catch (Exception var2) {
+ throw new RuntimeException(var2);
+ }
+ }
+
+ public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
+ return super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.itemDropID;
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(!var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockSponge.java b/src/net/minecraft/src/BlockSponge.java
new file mode 100644
index 0000000..d8a441d
--- /dev/null
+++ b/src/net/minecraft/src/BlockSponge.java
@@ -0,0 +1,35 @@
+package net.minecraft.src;
+
+public class BlockSponge extends Block {
+ protected BlockSponge(int var1) {
+ super(var1, Material.sponge);
+ this.blockIndexInTexture = 48;
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ byte var5 = 2;
+
+ for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
+ for(int var7 = var3 - var5; var7 <= var3 + var5; ++var7) {
+ for(int var8 = var4 - var5; var8 <= var4 + var5; ++var8) {
+ if(var1.getBlockMaterial(var6, var7, var8) == Material.water) {
+ }
+ }
+ }
+ }
+
+ }
+
+ public void onBlockRemoval(World var1, int var2, int var3, int var4) {
+ byte var5 = 2;
+
+ for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
+ for(int var7 = var3 - var5; var7 <= var3 + var5; ++var7) {
+ for(int var8 = var4 - var5; var8 <= var4 + var5; ++var8) {
+ var1.notifyBlocksOfNeighborChange(var6, var7, var8, var1.getBlockId(var6, var7, var8));
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockStairs.java b/src/net/minecraft/src/BlockStairs.java
new file mode 100644
index 0000000..aec58f7
--- /dev/null
+++ b/src/net/minecraft/src/BlockStairs.java
@@ -0,0 +1,249 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+public class BlockStairs extends Block {
+ private Block modelBlock;
+
+ protected BlockStairs(int var1, Block var2) {
+ super(var1, var2.blockIndexInTexture, var2.blockMaterial);
+ this.modelBlock = var2;
+ this.setHardness(var2.blockHardness);
+ this.setResistance(var2.blockResistance / 3.0F);
+ this.setStepSound(var2.stepSound);
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 10;
+ }
+
+ public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return super.shouldSideBeRendered(var1, var2, var3, var4, var5);
+ }
+
+ public void getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
+ int var7 = var1.getBlockMetadata(var2, var3, var4);
+ if(var7 == 0) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ } else if(var7 == 1) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ } else if(var7 == 2) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ } else if(var7 == 3) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
+ super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
+ }
+
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(var1.getBlockMaterial(var2, var3 + 1, var4).isSolid()) {
+ var1.setBlockWithNotify(var2, var3, var4, this.modelBlock.blockID);
+ } else {
+ this.updateState(var1, var2, var3, var4);
+ this.updateState(var1, var2 + 1, var3 - 1, var4);
+ this.updateState(var1, var2 - 1, var3 - 1, var4);
+ this.updateState(var1, var2, var3 - 1, var4 - 1);
+ this.updateState(var1, var2, var3 - 1, var4 + 1);
+ this.updateState(var1, var2 + 1, var3 + 1, var4);
+ this.updateState(var1, var2 - 1, var3 + 1, var4);
+ this.updateState(var1, var2, var3 + 1, var4 - 1);
+ this.updateState(var1, var2, var3 + 1, var4 + 1);
+ }
+
+ this.modelBlock.onNeighborBlockChange(var1, var2, var3, var4, var5);
+ }
+
+ private void updateState(World var1, int var2, int var3, int var4) {
+ if(this.isBlockStair(var1, var2, var3, var4)) {
+ byte var5 = -1;
+ if(this.isBlockStair(var1, var2 + 1, var3 + 1, var4)) {
+ var5 = 0;
+ }
+
+ if(this.isBlockStair(var1, var2 - 1, var3 + 1, var4)) {
+ var5 = 1;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 + 1, var4 + 1)) {
+ var5 = 2;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 + 1, var4 - 1)) {
+ var5 = 3;
+ }
+
+ if(var5 < 0) {
+ if(this.isBlockSolid(var1, var2 + 1, var3, var4) && !this.isBlockSolid(var1, var2 - 1, var3, var4)) {
+ var5 = 0;
+ }
+
+ if(this.isBlockSolid(var1, var2 - 1, var3, var4) && !this.isBlockSolid(var1, var2 + 1, var3, var4)) {
+ var5 = 1;
+ }
+
+ if(this.isBlockSolid(var1, var2, var3, var4 + 1) && !this.isBlockSolid(var1, var2, var3, var4 - 1)) {
+ var5 = 2;
+ }
+
+ if(this.isBlockSolid(var1, var2, var3, var4 - 1) && !this.isBlockSolid(var1, var2, var3, var4 + 1)) {
+ var5 = 3;
+ }
+ }
+
+ if(var5 < 0) {
+ if(this.isBlockStair(var1, var2 - 1, var3 - 1, var4)) {
+ var5 = 0;
+ }
+
+ if(this.isBlockStair(var1, var2 + 1, var3 - 1, var4)) {
+ var5 = 1;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 - 1, var4 - 1)) {
+ var5 = 2;
+ }
+
+ if(this.isBlockStair(var1, var2, var3 - 1, var4 + 1)) {
+ var5 = 3;
+ }
+ }
+
+ if(var5 >= 0) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var5);
+ }
+
+ }
+ }
+
+ private boolean isBlockSolid(World var1, int var2, int var3, int var4) {
+ return var1.getBlockMaterial(var2, var3, var4).isSolid();
+ }
+
+ private boolean isBlockStair(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockId(var2, var3, var4);
+ return var5 == 0 ? false : Block.blocksList[var5].getRenderType() == 10;
+ }
+
+ 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 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);
+ }
+
+ public int getRenderBlockPass() {
+ return this.modelBlock.getRenderBlockPass();
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return this.modelBlock.idDropped(var1, var2);
+ }
+
+ public int quantityDropped(Random var1) {
+ return this.modelBlock.quantityDropped(var1);
+ }
+
+ public int getBlockTextureFromSideAndMetadata(int var1, int var2) {
+ return this.modelBlock.getBlockTextureFromSideAndMetadata(var1, var2);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return this.modelBlock.getBlockTextureFromSide(var1);
+ }
+
+ public int getBlockTextureGeneric(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return this.modelBlock.getBlockTextureGeneric(var1, var2, var3, var4, var5);
+ }
+
+ public int tickRate() {
+ return this.modelBlock.tickRate();
+ }
+
+ 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, Vec3D var6) {
+ this.modelBlock.velocityToAddToEntity(var1, var2, var3, var4, var5, var6);
+ }
+
+ 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 onBlockRemoval(World var1, int var2, int var3, int var4) {
+ this.modelBlock.onBlockRemoval(var1, var2, var3, var4);
+ }
+
+ public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
+ this.modelBlock.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6);
+ }
+
+ public void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5) {
+ this.modelBlock.dropBlockAsItem(var1, var2, var3, var4, var5);
+ }
+
+ 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 blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ return this.modelBlock.blockActivated(var1, var2, var3, var4, var5);
+ }
+
+ public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
+ this.modelBlock.onBlockDestroyedByExplosion(var1, var2, var3, var4);
+ }
+}
diff --git a/src/net/minecraft/src/BlockStationary.java b/src/net/minecraft/src/BlockStationary.java
new file mode 100644
index 0000000..12332ea
--- /dev/null
+++ b/src/net/minecraft/src/BlockStationary.java
@@ -0,0 +1,25 @@
+package net.minecraft.src;
+
+public class BlockStationary extends BlockFluid {
+ protected BlockStationary(int var1, Material var2) {
+ super(var1, var2);
+ this.setTickOnLoad(false);
+ }
+
+ 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.updateTick(var1, var2, var3, var4);
+ }
+
+ }
+
+ private void updateTick(World var1, int var2, int var3, int var4) {
+ int var5 = var1.getBlockMetadata(var2, var3, var4);
+ var1.editingBlocks = true;
+ var1.setBlockAndMetadata(var2, var3, var4, this.blockID - 1, var5);
+ var1.markBlocksDirty(var2, var3, var4, var2, var3, var4);
+ var1.scheduleBlockUpdate(var2, var3, var4, this.blockID - 1);
+ var1.editingBlocks = false;
+ }
+}
diff --git a/src/net/minecraft/src/BlockStep.java b/src/net/minecraft/src/BlockStep.java
new file mode 100644
index 0000000..c9e7fce
--- /dev/null
+++ b/src/net/minecraft/src/BlockStep.java
@@ -0,0 +1,59 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockStep extends Block {
+ private boolean blockType;
+
+ public BlockStep(int var1, boolean var2) {
+ super(var1, 6, Material.rock);
+ this.blockType = var2;
+ if(!var2) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
+ }
+
+ this.setLightOpacity(255);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 <= 1 ? 6 : 5;
+ }
+
+ public boolean isOpaqueCube() {
+ return this.blockType;
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(this == Block.stairSingle) {
+ }
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ if(this != Block.stairSingle) {
+ super.onBlockAdded(var1, var2, var3, var4);
+ }
+
+ int var5 = var1.getBlockId(var2, var3 - 1, var4);
+ if(var5 == stairSingle.blockID) {
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ var1.setBlockWithNotify(var2, var3 - 1, var4, Block.stairDouble.blockID);
+ }
+
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.stairSingle.blockID;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return this.blockType;
+ }
+
+ public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ if(this != Block.stairSingle) {
+ super.shouldSideBeRendered(var1, var2, var3, var4, var5);
+ }
+
+ return var5 == 1 ? true : (!super.shouldSideBeRendered(var1, var2, var3, var4, var5) ? false : (var5 == 0 ? true : var1.getBlockId(var2, var3, var4) != this.blockID));
+ }
+}
diff --git a/src/net/minecraft/src/BlockStone.java b/src/net/minecraft/src/BlockStone.java
new file mode 100644
index 0000000..eae4ecd
--- /dev/null
+++ b/src/net/minecraft/src/BlockStone.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockStone extends Block {
+ public BlockStone(int var1, int var2) {
+ super(var1, var2, Material.rock);
+ }
+
+ public int idDropped(int var1, Random var2) {
+ return Block.cobblestone.blockID;
+ }
+}
diff --git a/src/net/minecraft/src/BlockTNT.java b/src/net/minecraft/src/BlockTNT.java
new file mode 100644
index 0000000..aa103d5
--- /dev/null
+++ b/src/net/minecraft/src/BlockTNT.java
@@ -0,0 +1,29 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockTNT extends Block {
+ public BlockTNT(int var1, int var2) {
+ super(var1, var2, Material.tnt);
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 0 ? this.blockIndexInTexture + 2 : (var1 == 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture);
+ }
+
+ public int quantityDropped(Random var1) {
+ return 0;
+ }
+
+ public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
+ EntityTNTPrimed var5 = new EntityTNTPrimed(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F);
+ var5.fuse = var1.rand.nextInt(var5.fuse / 4) + var5.fuse / 8;
+ var1.spawnEntityInWorld(var5);
+ }
+
+ public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
+ EntityTNTPrimed var6 = new EntityTNTPrimed(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F);
+ var1.spawnEntityInWorld(var6);
+ var1.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F);
+ }
+}
diff --git a/src/net/minecraft/src/BlockTorch.java b/src/net/minecraft/src/BlockTorch.java
new file mode 100644
index 0000000..a099e4a
--- /dev/null
+++ b/src/net/minecraft/src/BlockTorch.java
@@ -0,0 +1,166 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class BlockTorch extends Block {
+ protected BlockTorch(int var1, int var2) {
+ super(var1, var2, Material.circuits);
+ this.setTickOnLoad(true);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
+ return null;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public int getRenderType() {
+ return 2;
+ }
+
+ 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.isBlockNormalCube(var2, var3 - 1, var4))));
+ }
+
+ public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ if(var5 == 1 && var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var6 = 5;
+ }
+
+ if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var6 = 4;
+ }
+
+ if(var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var6 = 3;
+ }
+
+ if(var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var6 = 2;
+ }
+
+ if(var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var6 = 1;
+ }
+
+ var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
+ }
+
+ 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);
+ }
+
+ }
+
+ public void onBlockAdded(World var1, int var2, int var3, int var4) {
+ if(var1.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
+ } else if(var1.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
+ } else if(var1.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
+ } else if(var1.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
+ } else if(var1.isBlockNormalCube(var2, var3 - 1, var4)) {
+ var1.setBlockMetadataWithNotify(var2, var3, var4, 5);
+ }
+
+ this.dropTorchIfCantStay(var1, var2, var3, var4);
+ }
+
+ public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
+ if(this.dropTorchIfCantStay(var1, var2, var3, var4)) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ 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.isBlockNormalCube(var2, var3 - 1, var4) && var6 == 5) {
+ var7 = true;
+ }
+
+ if(var7) {
+ this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ }
+ }
+
+ }
+
+ private boolean dropTorchIfCantStay(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));
+ var1.setBlockWithNotify(var2, var3, var4, 0);
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
+ int var7 = var1.getBlockMetadata(var2, var3, var4);
+ float var8 = 0.15F;
+ if(var7 == 1) {
+ this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8);
+ } 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) {
+ this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F);
+ } 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);
+ }
+
+ public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
+ int var6 = var1.getBlockMetadata(var2, var3, var4);
+ float var7 = (float)var2 + 0.5F;
+ float var8 = (float)var3 + 0.7F;
+ float var9 = (float)var4 + 0.5F;
+ float var10 = 0.22F;
+ float var11 = 0.27F;
+ if(var6 == 1) {
+ var1.spawnParticle("smoke", (double)(var7 - var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)(var7 - var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ } else if(var6 == 2) {
+ var1.spawnParticle("smoke", (double)(var7 + var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)(var7 + var11), (double)(var8 + var10), (double)var9, 0.0D, 0.0D, 0.0D);
+ } else if(var6 == 3) {
+ var1.spawnParticle("smoke", (double)var7, (double)(var8 + var10), (double)(var9 - var11), 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)var7, (double)(var8 + var10), (double)(var9 - var11), 0.0D, 0.0D, 0.0D);
+ } else if(var6 == 4) {
+ var1.spawnParticle("smoke", (double)var7, (double)(var8 + var10), (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)var7, (double)(var8 + var10), (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
+ } else {
+ var1.spawnParticle("smoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
+ var1.spawnParticle("flame", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/BlockWorkbench.java b/src/net/minecraft/src/BlockWorkbench.java
new file mode 100644
index 0000000..8b02c5f
--- /dev/null
+++ b/src/net/minecraft/src/BlockWorkbench.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class BlockWorkbench extends Block {
+ protected BlockWorkbench(int var1) {
+ super(var1, Material.wood);
+ this.blockIndexInTexture = 59;
+ }
+
+ public int getBlockTextureFromSide(int var1) {
+ return var1 == 1 ? this.blockIndexInTexture - 16 : (var1 == 0 ? Block.planks.getBlockTextureFromSide(0) : (var1 != 2 && var1 != 4 ? this.blockIndexInTexture : this.blockIndexInTexture + 1));
+ }
+
+ public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
+ var5.displayWorkbenchGUI();
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/CanvasCrashReport.java b/src/net/minecraft/src/CanvasCrashReport.java
new file mode 100644
index 0000000..caa70c7
--- /dev/null
+++ b/src/net/minecraft/src/CanvasCrashReport.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Dimension;
+
+class CanvasCrashReport extends Canvas {
+ public CanvasCrashReport(int var1) {
+ this.setPreferredSize(new Dimension(var1, var1));
+ this.setMinimumSize(new Dimension(var1, var1));
+ }
+}
diff --git a/src/net/minecraft/src/CanvasIsomPreview.java b/src/net/minecraft/src/CanvasIsomPreview.java
new file mode 100644
index 0000000..d175b90
--- /dev/null
+++ b/src/net/minecraft/src/CanvasIsomPreview.java
@@ -0,0 +1,378 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferStrategy;
+import java.awt.image.ImageObserver;
+import java.io.File;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+public class CanvasIsomPreview extends Canvas implements KeyListener, MouseListener, MouseMotionListener, Runnable {
+ private int currentRender = 0;
+ private int zoomLevel = 2;
+ private boolean displayHelpText = true;
+ private World level;
+ private File dataFolder = this.getMinecraftDir();
+ private boolean running = true;
+ private List zonesToRender = Collections.synchronizedList(new LinkedList());
+ private IsoImageBuffer[][] zoneMap = new IsoImageBuffer[64][64];
+ private int translateX;
+ private int translateY;
+ private int xPosition;
+ private int yPosition;
+
+ public File getMinecraftDir() {
+ if(this.dataFolder == null) {
+ this.dataFolder = this.getWorkingDirectory("minecraft");
+ }
+
+ return this.dataFolder;
+ }
+
+ public File getWorkingDirectory(String var1) {
+ String var2 = System.getProperty("user.home", ".");
+ File var3;
+ switch(OSMapIsom.osValues[getPlatform().ordinal()]) {
+ case 1:
+ case 2:
+ var3 = new File(var2, '.' + var1 + '/');
+ break;
+ case 3:
+ String var4 = System.getenv("APPDATA");
+ if(var4 != null) {
+ var3 = new File(var4, "." + var1 + '/');
+ } else {
+ var3 = new File(var2, '.' + var1 + '/');
+ }
+ break;
+ case 4:
+ var3 = new File(var2, "Library/Application Support/" + var1);
+ break;
+ default:
+ var3 = new File(var2, var1 + '/');
+ }
+
+ if(!var3.exists() && !var3.mkdirs()) {
+ throw new RuntimeException("The working directory could not be created: " + var3);
+ } else {
+ return var3;
+ }
+ }
+
+ private static EnumOSIsom getPlatform() {
+ String var0 = System.getProperty("os.name").toLowerCase();
+ return var0.contains("win") ? EnumOSIsom.windows : (var0.contains("mac") ? EnumOSIsom.macos : (var0.contains("solaris") ? EnumOSIsom.solaris : (var0.contains("sunos") ? EnumOSIsom.solaris : (var0.contains("linux") ? EnumOSIsom.linux : (var0.contains("unix") ? EnumOSIsom.linux : EnumOSIsom.unknown)))));
+ }
+
+ public CanvasIsomPreview() {
+ for(int var1 = 0; var1 < 64; ++var1) {
+ for(int var2 = 0; var2 < 64; ++var2) {
+ this.zoneMap[var1][var2] = new IsoImageBuffer((World)null, var1, var2);
+ }
+ }
+
+ this.addMouseListener(this);
+ this.addMouseMotionListener(this);
+ this.addKeyListener(this);
+ this.setFocusable(true);
+ this.requestFocus();
+ this.setBackground(Color.red);
+ }
+
+ public void loadWorld(String var1) {
+ this.translateX = this.translateY = 0;
+ this.level = new WorldIso(this, new File(this.dataFolder, "saves"), var1);
+ this.level.skylightSubtracted = 0;
+ List var2 = this.zonesToRender;
+ synchronized(var2) {
+ this.zonesToRender.clear();
+
+ for(int var3 = 0; var3 < 64; ++var3) {
+ for(int var4 = 0; var4 < 64; ++var4) {
+ this.zoneMap[var3][var4].setWorldAndChunkPosition(this.level, var3, var4);
+ }
+ }
+
+ }
+ }
+
+ private void setBrightness(int var1) {
+ List var2 = this.zonesToRender;
+ synchronized(var2) {
+ this.level.skylightSubtracted = var1;
+ this.zonesToRender.clear();
+
+ for(int var3 = 0; var3 < 64; ++var3) {
+ for(int var4 = 0; var4 < 64; ++var4) {
+ this.zoneMap[var3][var4].setWorldAndChunkPosition(this.level, var3, var4);
+ }
+ }
+
+ }
+ }
+
+ public void start() {
+ (new ThreadRunIsoClient(this)).start();
+
+ for(int var1 = 0; var1 < 1; ++var1) {
+ (new Thread(this)).start();
+ }
+
+ }
+
+ public void stop() {
+ this.running = false;
+ }
+
+ private IsoImageBuffer getZone(int var1, int var2) {
+ int var3 = var1 & 63;
+ int var4 = var2 & 63;
+ IsoImageBuffer var5 = this.zoneMap[var3][var4];
+ if(var5.chunkX == var1 && var5.chunkZ == var2) {
+ return var5;
+ } else {
+ List var6 = this.zonesToRender;
+ synchronized(var6) {
+ this.zonesToRender.remove(var5);
+ }
+
+ var5.setChunkPosition(var1, var2);
+ return var5;
+ }
+ }
+
+ public void run() {
+ TerrainTextureManager var1 = new TerrainTextureManager();
+
+ while(this.running) {
+ IsoImageBuffer var2 = null;
+ List var3 = this.zonesToRender;
+ synchronized(var3) {
+ if(this.zonesToRender.size() > 0) {
+ var2 = (IsoImageBuffer)this.zonesToRender.remove(0);
+ }
+ }
+
+ if(var2 != null) {
+ if(this.currentRender - var2.lastVisible < 2) {
+ var1.render(var2);
+ this.repaint();
+ } else {
+ var2.addedToRenderQueue = false;
+ }
+ }
+
+ try {
+ Thread.sleep(2L);
+ } catch (InterruptedException var5) {
+ var5.printStackTrace();
+ }
+ }
+
+ }
+
+ public void update(Graphics var1) {
+ }
+
+ public void paint(Graphics var1) {
+ }
+
+ public void render() {
+ BufferStrategy var1 = this.getBufferStrategy();
+ if(var1 == null) {
+ this.createBufferStrategy(2);
+ } else {
+ this.render((Graphics2D)var1.getDrawGraphics());
+ var1.show();
+ }
+ }
+
+ public void render(Graphics2D var1) {
+ ++this.currentRender;
+ AffineTransform var2 = var1.getTransform();
+ var1.setClip(0, 0, this.getWidth(), this.getHeight());
+ var1.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
+ var1.translate(this.getWidth() / 2, this.getHeight() / 2);
+ var1.scale((double)this.zoomLevel, (double)this.zoomLevel);
+ var1.translate(this.translateX, this.translateY);
+ if(this.level != null) {
+ var1.translate(-(this.level.spawnX + this.level.spawnZ), -(-this.level.spawnX + this.level.spawnZ) + 64);
+ }
+
+ Rectangle var3 = var1.getClipBounds();
+ var1.setColor(new Color(-15724512));
+ var1.fillRect(var3.x, var3.y, var3.width, var3.height);
+ byte var4 = 16;
+ byte var5 = 3;
+ int var6 = var3.x / var4 / 2 - 2 - var5;
+ int var7 = (var3.x + var3.width) / var4 / 2 + 1 + var5;
+ int var8 = var3.y / var4 - 1 - var5 * 2;
+ int var9 = (var3.y + var3.height + 16 + 128) / var4 + 1 + var5 * 2;
+
+ int var10;
+ for(var10 = var8; var10 <= var9; ++var10) {
+ for(int var11 = var6; var11 <= var7; ++var11) {
+ int var12 = var11 - (var10 >> 1);
+ int var13 = var11 + (var10 + 1 >> 1);
+ IsoImageBuffer var14 = this.getZone(var12, var13);
+ var14.lastVisible = this.currentRender;
+ if(!var14.rendered) {
+ if(!var14.addedToRenderQueue) {
+ var14.addedToRenderQueue = true;
+ this.zonesToRender.add(var14);
+ }
+ } else {
+ var14.addedToRenderQueue = false;
+ if(!var14.noContent) {
+ int var15 = var11 * var4 * 2 + (var10 & 1) * var4;
+ int var16 = var10 * var4 - 128 - 16;
+ var1.drawImage(var14.image, var15, var16, (ImageObserver)null);
+ }
+ }
+ }
+ }
+
+ if(this.displayHelpText) {
+ var1.setTransform(var2);
+ var10 = this.getHeight() - 32 - 4;
+ var1.setColor(new Color(Integer.MIN_VALUE, true));
+ var1.fillRect(4, this.getHeight() - 32 - 4, this.getWidth() - 8, 32);
+ var1.setColor(Color.WHITE);
+ String var17 = "F1 - F5: load levels | 0-9: Set time of day | Space: return to spawn | Double click: zoom | Escape: hide this text";
+ var1.drawString(var17, this.getWidth() / 2 - var1.getFontMetrics().stringWidth(var17) / 2, var10 + 20);
+ }
+
+ var1.dispose();
+ }
+
+ public void mouseDragged(MouseEvent var1) {
+ int var2 = var1.getX() / this.zoomLevel;
+ int var3 = var1.getY() / this.zoomLevel;
+ this.translateX += var2 - this.xPosition;
+ this.translateY += var3 - this.yPosition;
+ this.xPosition = var2;
+ this.yPosition = var3;
+ this.repaint();
+ }
+
+ public void mouseMoved(MouseEvent var1) {
+ }
+
+ public void mouseClicked(MouseEvent var1) {
+ if(var1.getClickCount() == 2) {
+ this.zoomLevel = 3 - this.zoomLevel;
+ this.repaint();
+ }
+
+ }
+
+ public void mouseEntered(MouseEvent var1) {
+ }
+
+ public void mouseExited(MouseEvent var1) {
+ }
+
+ public void mousePressed(MouseEvent var1) {
+ int var2 = var1.getX() / this.zoomLevel;
+ int var3 = var1.getY() / this.zoomLevel;
+ this.xPosition = var2;
+ this.yPosition = var3;
+ }
+
+ public void mouseReleased(MouseEvent var1) {
+ }
+
+ public void keyPressed(KeyEvent var1) {
+ if(var1.getKeyCode() == 48) {
+ this.setBrightness(11);
+ }
+
+ if(var1.getKeyCode() == 49) {
+ this.setBrightness(10);
+ }
+
+ if(var1.getKeyCode() == 50) {
+ this.setBrightness(9);
+ }
+
+ if(var1.getKeyCode() == 51) {
+ this.setBrightness(7);
+ }
+
+ if(var1.getKeyCode() == 52) {
+ this.setBrightness(6);
+ }
+
+ if(var1.getKeyCode() == 53) {
+ this.setBrightness(5);
+ }
+
+ if(var1.getKeyCode() == 54) {
+ this.setBrightness(3);
+ }
+
+ if(var1.getKeyCode() == 55) {
+ this.setBrightness(2);
+ }
+
+ if(var1.getKeyCode() == 56) {
+ this.setBrightness(1);
+ }
+
+ if(var1.getKeyCode() == 57) {
+ this.setBrightness(0);
+ }
+
+ if(var1.getKeyCode() == 112) {
+ this.loadWorld("World1");
+ }
+
+ if(var1.getKeyCode() == 113) {
+ this.loadWorld("World2");
+ }
+
+ if(var1.getKeyCode() == 114) {
+ this.loadWorld("World3");
+ }
+
+ if(var1.getKeyCode() == 115) {
+ this.loadWorld("World4");
+ }
+
+ if(var1.getKeyCode() == 116) {
+ this.loadWorld("World5");
+ }
+
+ if(var1.getKeyCode() == 32) {
+ this.translateX = this.translateY = 0;
+ }
+
+ if(var1.getKeyCode() == 27) {
+ this.displayHelpText = !this.displayHelpText;
+ }
+
+ this.repaint();
+ }
+
+ public void keyReleased(KeyEvent var1) {
+ }
+
+ public void keyTyped(KeyEvent var1) {
+ }
+
+ static boolean a(CanvasIsomPreview var0) {
+ return var0.running;
+ }
+}
diff --git a/src/net/minecraft/src/CanvasMinecraftApplet.java b/src/net/minecraft/src/CanvasMinecraftApplet.java
new file mode 100644
index 0000000..51f39f3
--- /dev/null
+++ b/src/net/minecraft/src/CanvasMinecraftApplet.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import net.minecraft.client.MinecraftApplet;
+
+public class CanvasMinecraftApplet extends Canvas {
+ final MinecraftApplet mcApplet;
+
+ public CanvasMinecraftApplet(MinecraftApplet var1) {
+ this.mcApplet = var1;
+ }
+
+ public synchronized void addNotify() {
+ super.addNotify();
+ this.mcApplet.startMainThread();
+ }
+
+ public synchronized void removeNotify() {
+ this.mcApplet.shutdown();
+ super.removeNotify();
+ }
+}
diff --git a/src/net/minecraft/src/CanvasMojangLogo.java b/src/net/minecraft/src/CanvasMojangLogo.java
new file mode 100644
index 0000000..796b0a3
--- /dev/null
+++ b/src/net/minecraft/src/CanvasMojangLogo.java
@@ -0,0 +1,29 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+class CanvasMojangLogo extends Canvas {
+ private BufferedImage logo;
+
+ public CanvasMojangLogo() {
+ try {
+ this.logo = ImageIO.read(PanelCrashReport.class.getResource("/gui/logo.png"));
+ } catch (IOException var2) {
+ }
+
+ byte var1 = 100;
+ this.setPreferredSize(new Dimension(var1, var1));
+ this.setMinimumSize(new Dimension(var1, var1));
+ }
+
+ public void paint(Graphics var1) {
+ super.paint(var1);
+ var1.drawImage(this.logo, this.getWidth() / 2 - this.logo.getWidth() / 2, 32, (ImageObserver)null);
+ }
+}
diff --git a/src/net/minecraft/src/ChatLine.java b/src/net/minecraft/src/ChatLine.java
new file mode 100644
index 0000000..98635da
--- /dev/null
+++ b/src/net/minecraft/src/ChatLine.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class ChatLine {
+ public String message;
+ public int updateCounter;
+
+ public ChatLine(String var1) {
+ this.message = var1;
+ this.updateCounter = 0;
+ }
+}
diff --git a/src/net/minecraft/src/Chunk.java b/src/net/minecraft/src/Chunk.java
new file mode 100644
index 0000000..56f534b
--- /dev/null
+++ b/src/net/minecraft/src/Chunk.java
@@ -0,0 +1,473 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Chunk {
+ public static boolean isLit;
+ public byte[] blocks;
+ public boolean isChunkLoaded;
+ public World worldObj;
+ public NibbleArray data;
+ public NibbleArray skylightMap;
+ public NibbleArray blocklightMap;
+ public byte[] heightMap;
+ public int height;
+ public final int xPosition;
+ public final int zPosition;
+ public Map chunkTileEntityMap;
+ public List[] entities;
+ public boolean isTerrainPopulated;
+ public boolean isModified;
+ public boolean neverSave;
+ public boolean isChunkRendered;
+ public boolean hasEntities;
+ public long lastSaveTime;
+
+ public Chunk(World var1, int var2, int var3) {
+ this.chunkTileEntityMap = new HashMap();
+ this.entities = new List[8];
+ this.isTerrainPopulated = false;
+ this.isModified = false;
+ this.isChunkRendered = false;
+ this.hasEntities = false;
+ this.lastSaveTime = 0L;
+ this.worldObj = var1;
+ this.xPosition = var2;
+ this.zPosition = var3;
+ this.heightMap = new byte[256];
+
+ for(int var4 = 0; var4 < this.entities.length; ++var4) {
+ this.entities[var4] = new ArrayList();
+ }
+
+ }
+
+ public Chunk(World var1, byte[] var2, int var3, int var4) {
+ this(var1, var3, var4);
+ this.blocks = var2;
+ this.data = new NibbleArray(var2.length);
+ this.skylightMap = new NibbleArray(var2.length);
+ this.blocklightMap = new NibbleArray(var2.length);
+ }
+
+ 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] & 255;
+ }
+
+ public void doNothing() {
+ }
+
+ public void generateHeightMap() {
+ int var1 = 127;
+
+ int var2;
+ int var3;
+ for(var2 = 0; var2 < 16; ++var2) {
+ for(var3 = 0; var3 < 16; ++var3) {
+ this.heightMap[var3 << 4 | var2] = -128;
+ this.relightBlock(var2, 127, var3);
+ if((this.heightMap[var3 << 4 | var2] & 255) < var1) {
+ var1 = this.heightMap[var3 << 4 | var2] & 255;
+ }
+ }
+ }
+
+ this.height = var1;
+
+ for(var2 = 0; var2 < 16; ++var2) {
+ for(var3 = 0; var3 < 16; ++var3) {
+ this.updateSkylight_do(var2, var3);
+ }
+ }
+
+ this.isModified = true;
+ }
+
+ private void updateSkylight_do(int var1, int var2) {
+ int var3 = this.getHeightValue(var1, var2);
+ int var4 = this.xPosition * 16 + var1;
+ int var5 = this.zPosition * 16 + var2;
+ this.checkSkylightNeighborHeight(var4 - 1, var5, var3);
+ this.checkSkylightNeighborHeight(var4 + 1, var5, var3);
+ this.checkSkylightNeighborHeight(var4, var5 - 1, var3);
+ this.checkSkylightNeighborHeight(var4, var5 + 1, var3);
+ }
+
+ private void checkSkylightNeighborHeight(int var1, int var2, int var3) {
+ int var4 = this.worldObj.getHeightValue(var1, var2);
+ if(var4 > var3) {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var1, var3, var2, var1, var4, var2);
+ } else if(var4 < var3) {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var1, var4, var2, var1, var3, var2);
+ }
+
+ this.isModified = true;
+ }
+
+ private void relightBlock(int var1, int var2, int var3) {
+ int var4 = this.heightMap[var3 << 4 | var1] & 255;
+ int var5 = var4;
+ if(var2 > var4) {
+ var5 = var2;
+ }
+
+ while(var5 > 0 && Block.lightOpacity[this.getBlockID(var1, var5 - 1, var3)] == 0) {
+ --var5;
+ }
+
+ if(var5 != var4) {
+ this.worldObj.markBlockAsNeedsUpdate(var1, var3, var5, var4);
+ this.heightMap[var3 << 4 | var1] = (byte)var5;
+ int var6;
+ int var7;
+ int var8;
+ if(var5 < this.height) {
+ this.height = var5;
+ } else {
+ var6 = 127;
+
+ for(var7 = 0; var7 < 16; ++var7) {
+ for(var8 = 0; var8 < 16; ++var8) {
+ if((this.heightMap[var8 << 4 | var7] & 255) < var6) {
+ var6 = this.heightMap[var8 << 4 | var7] & 255;
+ }
+ }
+ }
+
+ this.height = var6;
+ }
+
+ var6 = this.xPosition * 16 + var1;
+ var7 = this.zPosition * 16 + var3;
+ if(var5 < var4) {
+ for(var8 = var5; var8 < var4; ++var8) {
+ this.skylightMap.set(var1, var8, var3, 15);
+ }
+ } else {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var6, var4, var7, var6, var5, var7);
+
+ for(var8 = var4; var8 < var5; ++var8) {
+ this.skylightMap.set(var1, var8, var3, 0);
+ }
+ }
+
+ var8 = 15;
+
+ int var9;
+ for(var9 = var5; var5 > 0 && var8 > 0; this.skylightMap.set(var1, var5, var3, var8)) {
+ --var5;
+ int var10 = Block.lightOpacity[this.getBlockID(var1, var5, var3)];
+ if(var10 == 0) {
+ var10 = 1;
+ }
+
+ var8 -= var10;
+ if(var8 < 0) {
+ var8 = 0;
+ }
+ }
+
+ while(var5 > 0 && Block.lightOpacity[this.getBlockID(var1, var5 - 1, var3)] == 0) {
+ --var5;
+ }
+
+ if(var5 != var9) {
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var6 - 1, var5, var7 - 1, var6 + 1, var9, var7 + 1);
+ }
+
+ this.isModified = true;
+ }
+ }
+
+ public int getBlockID(int var1, int var2, int var3) {
+ return this.blocks[var1 << 11 | var3 << 7 | var2];
+ }
+
+ public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) {
+ byte var6 = (byte)var4;
+ int var7 = this.heightMap[var3 << 4 | var1] & 255;
+ int var8 = this.blocks[var1 << 11 | var3 << 7 | var2] & 255;
+ if(var8 == var4) {
+ return false;
+ } else {
+ int var9 = this.xPosition * 16 + var1;
+ int var10 = this.zPosition * 16 + var3;
+ this.blocks[var1 << 11 | var3 << 7 | var2] = var6;
+ if(var8 != 0) {
+ Block.blocksList[var8].onBlockRemoval(this.worldObj, var9, var2, var10);
+ }
+
+ this.data.set(var1, var2, var3, var5);
+ if(Block.lightOpacity[var6] != 0) {
+ if(var2 >= var7) {
+ this.relightBlock(var1, var2 + 1, var3);
+ }
+ } else if(var2 == var7 - 1) {
+ this.relightBlock(var1, var2, var3);
+ }
+
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var9, var2, var10, var9, var2, var10);
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Block, var9, var2, var10, var9, var2, var10);
+ this.updateSkylight_do(var1, var3);
+ if(var4 != 0) {
+ Block.blocksList[var4].onBlockAdded(this.worldObj, var9, var2, var10);
+ }
+
+ this.isModified = true;
+ return true;
+ }
+ }
+
+ public boolean setBlockID(int var1, int var2, int var3, int var4) {
+ byte var5 = (byte)var4;
+ int var6 = this.heightMap[var3 << 4 | var1] & 255;
+ int var7 = this.blocks[var1 << 11 | var3 << 7 | var2] & 255;
+ if(var7 == var4) {
+ return false;
+ } else {
+ int var8 = this.xPosition * 16 + var1;
+ int var9 = this.zPosition * 16 + var3;
+ this.blocks[var1 << 11 | var3 << 7 | var2] = var5;
+ if(var7 != 0) {
+ Block.blocksList[var7].onBlockRemoval(this.worldObj, var8, var2, var9);
+ }
+
+ this.data.set(var1, var2, var3, 0);
+ if(Block.lightOpacity[var5] != 0) {
+ if(var2 >= var6) {
+ this.relightBlock(var1, var2 + 1, var3);
+ }
+ } else if(var2 == var6 - 1) {
+ this.relightBlock(var1, var2, var3);
+ }
+
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Sky, var8, var2, var9, var8, var2, var9);
+ this.worldObj.scheduleLightingUpdate(EnumSkyBlock.Block, var8, var2, var9, var8, var2, var9);
+ this.updateSkylight_do(var1, var3);
+ if(var4 != 0) {
+ Block.blocksList[var4].onBlockAdded(this.worldObj, var8, var2, var9);
+ }
+
+ this.isModified = true;
+ return true;
+ }
+ }
+
+ public int getBlockMetadata(int var1, int var2, int var3) {
+ return this.data.get(var1, var2, var3);
+ }
+
+ public void setBlockMetadata(int var1, int var2, int var3, int var4) {
+ this.isModified = true;
+ this.data.set(var1, var2, var3, var4);
+ }
+
+ public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) {
+ return var1 == EnumSkyBlock.Sky ? this.skylightMap.get(var2, var3, var4) : (var1 == EnumSkyBlock.Block ? this.blocklightMap.get(var2, var3, var4) : 0);
+ }
+
+ public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
+ this.isModified = true;
+ if(var1 == EnumSkyBlock.Sky) {
+ this.skylightMap.set(var2, var3, var4, var5);
+ } else {
+ if(var1 != EnumSkyBlock.Block) {
+ return;
+ }
+
+ this.blocklightMap.set(var2, var3, var4, var5);
+ }
+
+ }
+
+ public int getBlockLightValue(int var1, int var2, int var3, int var4) {
+ int var5 = this.skylightMap.get(var1, var2, var3);
+ if(var5 > 0) {
+ isLit = true;
+ }
+
+ var5 -= var4;
+ int var6 = this.blocklightMap.get(var1, var2, var3);
+ if(var6 > var5) {
+ var5 = var6;
+ }
+
+ return var5;
+ }
+
+ public void addEntity(Entity var1) {
+ 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) {
+ System.out.println("Wrong location! " + var1);
+ }
+
+ int var4 = MathHelper.floor_double(var1.posY / 16.0D);
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var4 >= this.entities.length) {
+ var4 = this.entities.length - 1;
+ }
+
+ this.entities[var4].add(var1);
+ }
+
+ public void removeEntity(Entity var1) {
+ this.removeEntityAtIndex(var1, MathHelper.floor_double(var1.posY / 16.0D));
+ }
+
+ public void removeEntityAtIndex(Entity var1, int var2) {
+ if(var2 < 0) {
+ var2 = 0;
+ }
+
+ if(var2 >= this.entities.length) {
+ var2 = this.entities.length - 1;
+ }
+
+ if(!this.entities[var2].contains(var1)) {
+ System.out.println("There\'s no such entity to remove: " + var1);
+ }
+
+ this.entities[var2].remove(var1);
+ }
+
+ public boolean canBlockSeeTheSky(int var1, int var2, int var3) {
+ return var2 >= (this.heightMap[var3 << 4 | var1] & 255);
+ }
+
+ public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) {
+ int var4 = var1 + var2 * 1024 + var3 * 1024 * 1024;
+ TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(Integer.valueOf(var4));
+ if(var5 == null) {
+ int var6 = this.getBlockID(var1, var2, var3);
+ BlockContainer var7 = (BlockContainer)Block.blocksList[var6];
+ var7.onBlockAdded(this.worldObj, this.xPosition * 16 + var1, var2, this.zPosition * 16 + var3);
+ var5 = (TileEntity)this.chunkTileEntityMap.get(Integer.valueOf(var4));
+ }
+
+ 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);
+ }
+
+ public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) {
+ int var5 = var1 + var2 * 1024 + var3 * 1024 * 1024;
+ var4.worldObj = 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 BlockContainer) {
+ if(this.isChunkLoaded) {
+ if(this.chunkTileEntityMap.get(Integer.valueOf(var5)) != null) {
+ this.worldObj.loadedTileEntityList.remove(this.chunkTileEntityMap.get(Integer.valueOf(var5)));
+ }
+
+ this.worldObj.loadedTileEntityList.add(var4);
+ }
+
+ this.chunkTileEntityMap.put(Integer.valueOf(var5), var4);
+ } else {
+ System.out.println("Attempted to place a tile entity where there was no entity tile!");
+ }
+ }
+
+ public void removeChunkBlockTileEntity(int var1, int var2, int var3) {
+ int var4 = var1 + var2 * 1024 + var3 * 1024 * 1024;
+ if(this.isChunkLoaded) {
+ this.worldObj.loadedTileEntityList.remove(this.chunkTileEntityMap.remove(Integer.valueOf(var4)));
+ }
+
+ }
+
+ public void onChunkLoad() {
+ this.isChunkLoaded = true;
+ this.worldObj.loadedTileEntityList.addAll(this.chunkTileEntityMap.values());
+
+ for(int var1 = 0; var1 < this.entities.length; ++var1) {
+ this.worldObj.addLoadedEntities(this.entities[var1]);
+ }
+
+ }
+
+ public void onChunkUnload() {
+ this.isChunkLoaded = false;
+ this.worldObj.loadedTileEntityList.removeAll(this.chunkTileEntityMap.values());
+
+ for(int var1 = 0; var1 < this.entities.length; ++var1) {
+ this.worldObj.unloadEntities(this.entities[var1]);
+ }
+
+ }
+
+ public void setChunkModified() {
+ this.isModified = true;
+ }
+
+ public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3) {
+ int var4 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D);
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var5 >= this.entities.length) {
+ var5 = this.entities.length - 1;
+ }
+
+ for(int var6 = var4; var6 <= var5; ++var6) {
+ List var7 = this.entities[var6];
+
+ for(int var8 = 0; var8 < var7.size(); ++var8) {
+ Entity var9 = (Entity)var7.get(var8);
+ if(var9 != var1 && var9.boundingBox.intersectsWith(var2)) {
+ var3.add(var9);
+ }
+ }
+ }
+
+ }
+
+ public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3) {
+ int var4 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D);
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var5 >= this.entities.length) {
+ var5 = this.entities.length - 1;
+ }
+
+ for(int var6 = var4; var6 <= var5; ++var6) {
+ List var7 = this.entities[var6];
+
+ for(int var8 = 0; var8 < var7.size(); ++var8) {
+ Entity var9 = (Entity)var7.get(var8);
+ if(var1.isAssignableFrom(var9.getClass()) && var9.boundingBox.intersectsWith(var2)) {
+ var3.add(var9);
+ }
+ }
+ }
+
+ }
+
+ public boolean needsSaving(boolean var1) {
+ return this.neverSave ? false : (this.hasEntities && this.worldObj.worldTime != this.lastSaveTime ? true : this.isModified);
+ }
+}
diff --git a/src/net/minecraft/src/ChunkCache.java b/src/net/minecraft/src/ChunkCache.java
new file mode 100644
index 0000000..8856be6
--- /dev/null
+++ b/src/net/minecraft/src/ChunkCache.java
@@ -0,0 +1,123 @@
+package net.minecraft.src;
+
+public class ChunkCache implements IBlockAccess {
+ private int chunkX;
+ private int chunkZ;
+ private Chunk[][] chunkArray;
+ private World worldObj;
+
+ public ChunkCache(World var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ this.worldObj = var1;
+ this.chunkX = var2 >> 4;
+ this.chunkZ = var4 >> 4;
+ int var8 = var5 >> 4;
+ int var9 = var7 >> 4;
+ this.chunkArray = new Chunk[var8 - this.chunkX + 1][var9 - this.chunkZ + 1];
+
+ for(int var10 = this.chunkX; var10 <= var8; ++var10) {
+ for(int var11 = this.chunkZ; var11 <= var9; ++var11) {
+ this.chunkArray[var10 - this.chunkX][var11 - this.chunkZ] = var1.getChunkFromChunkCoords(var10, var11);
+ }
+ }
+
+ }
+
+ public int getBlockId(int var1, int var2, int var3) {
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ return 0;
+ } else {
+ int var4 = (var1 >> 4) - this.chunkX;
+ int var5 = (var3 >> 4) - this.chunkZ;
+ return this.chunkArray[var4][var5].getBlockID(var1 & 15, var2, var3 & 15);
+ }
+ }
+
+ 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);
+ }
+
+ public float getBrightness(int var1, int var2, int var3) {
+ return World.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 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ int var5;
+ int var6;
+ if(var4) {
+ var5 = this.getBlockId(var1, var2, var3);
+ if(var5 == Block.stairSingle.blockID || var5 == Block.tilledField.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) {
+ var6 = var7;
+ }
+
+ if(var8 > var6) {
+ var6 = var8;
+ }
+
+ if(var9 > var6) {
+ var6 = var9;
+ }
+
+ if(var10 > var6) {
+ var6 = var10;
+ }
+
+ return var6;
+ }
+ }
+
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ var5 = 15 - this.worldObj.skylightSubtracted;
+ 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);
+ }
+ } else {
+ return 15;
+ }
+ }
+
+ public int getBlockMetadata(int var1, int var2, int var3) {
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ 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);
+ }
+ }
+
+ public Material getBlockMaterial(int var1, int var2, int var3) {
+ int var4 = this.getBlockId(var1, var2, var3);
+ return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial;
+ }
+
+ public boolean isBlockNormalCube(int var1, int var2, int var3) {
+ Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)];
+ return var4 == null ? false : var4.isOpaqueCube();
+ }
+}
diff --git a/src/net/minecraft/src/ChunkLoader.java b/src/net/minecraft/src/ChunkLoader.java
new file mode 100644
index 0000000..4d6af16
--- /dev/null
+++ b/src/net/minecraft/src/ChunkLoader.java
@@ -0,0 +1,186 @@
+package net.minecraft.src;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.Iterator;
+
+public class ChunkLoader implements IChunkLoader {
+ private File saveDir;
+ private boolean createIfNecessary;
+
+ public ChunkLoader(File var1, boolean var2) {
+ this.saveDir = var1;
+ this.createIfNecessary = var2;
+ }
+
+ private File chunkFileForXZ(int var1, int var2) {
+ String var3 = "c." + Integer.toString(var1, 36) + "." + Integer.toString(var2, 36) + ".dat";
+ String var4 = Integer.toString(var1 & 63, 36);
+ String var5 = Integer.toString(var2 & 63, 36);
+ File var6 = new File(this.saveDir, var4);
+ if(!var6.exists()) {
+ if(!this.createIfNecessary) {
+ return null;
+ }
+
+ var6.mkdir();
+ }
+
+ var6 = new File(var6, var5);
+ if(!var6.exists()) {
+ if(!this.createIfNecessary) {
+ return null;
+ }
+
+ var6.mkdir();
+ }
+
+ var6 = new File(var6, var3);
+ return !var6.exists() && !this.createIfNecessary ? null : var6;
+ }
+
+ public Chunk loadChunk(World var1, int var2, int var3) {
+ File var4 = this.chunkFileForXZ(var2, var3);
+ if(var4 != null && var4.exists()) {
+ try {
+ FileInputStream var5 = new FileInputStream(var4);
+ NBTTagCompound var6 = CompressedStreamTools.readCompressed(var5);
+ return loadChunkIntoWorldFromCompound(var1, var6.getCompoundTag("Level"));
+ } catch (Exception var7) {
+ var7.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+
+ public void saveChunk(World var1, Chunk var2) {
+ File var3 = this.chunkFileForXZ(var2.xPosition, var2.zPosition);
+ if(var3.exists()) {
+ var1.setSizeOnDisk -= var3.length();
+ }
+
+ try {
+ File var4 = new File(this.saveDir, "tmp_chunk.dat");
+ FileOutputStream var5 = new FileOutputStream(var4);
+ NBTTagCompound var6 = new NBTTagCompound();
+ NBTTagCompound var7 = new NBTTagCompound();
+ var6.setTag("Level", var7);
+ this.storeChunkInCompound(var2, var1, var7);
+ CompressedStreamTools.writeCompressed(var6, var5);
+ var5.close();
+ if(var3.exists()) {
+ var3.delete();
+ }
+
+ var4.renameTo(var3);
+ var1.setSizeOnDisk += var3.length();
+ } catch (Exception var8) {
+ var8.printStackTrace();
+ }
+
+ }
+
+ public void storeChunkInCompound(Chunk var1, World var2, NBTTagCompound var3) {
+ var3.setInteger("xPos", var1.xPosition);
+ var3.setInteger("zPos", var1.zPosition);
+ var3.setLong("LastUpdate", var2.worldTime);
+ var3.setByteArray("Blocks", var1.blocks);
+ var3.setByteArray("Data", var1.data.data);
+ var3.setByteArray("SkyLight", var1.skylightMap.data);
+ var3.setByteArray("BlockLight", var1.blocklightMap.data);
+ var3.setByteArray("HeightMap", var1.heightMap);
+ var3.setBoolean("TerrainPopulated", var1.isTerrainPopulated);
+ var1.hasEntities = false;
+ NBTTagList var4 = new NBTTagList();
+
+ Iterator var6;
+ NBTTagCompound var8;
+ for(int var5 = 0; var5 < var1.entities.length; ++var5) {
+ var6 = var1.entities[var5].iterator();
+
+ while(var6.hasNext()) {
+ Entity var7 = (Entity)var6.next();
+ var1.hasEntities = true;
+ var8 = new NBTTagCompound();
+ if(var7.addEntityID(var8)) {
+ var4.setTag(var8);
+ }
+ }
+ }
+
+ var3.setTag("Entities", var4);
+ NBTTagList var9 = new NBTTagList();
+ var6 = var1.chunkTileEntityMap.values().iterator();
+
+ while(var6.hasNext()) {
+ TileEntity var10 = (TileEntity)var6.next();
+ var8 = new NBTTagCompound();
+ var10.writeToNBT(var8);
+ var9.setTag(var8);
+ }
+
+ var3.setTag("TileEntities", var9);
+ }
+
+ public static Chunk loadChunkIntoWorldFromCompound(World var0, NBTTagCompound var1) {
+ int var2 = var1.getInteger("xPos");
+ int var3 = var1.getInteger("zPos");
+ Chunk var4 = new Chunk(var0, var2, var3);
+ var4.blocks = var1.getByteArray("Blocks");
+ var4.data = new NibbleArray(var1.getByteArray("Data"));
+ var4.skylightMap = new NibbleArray(var1.getByteArray("SkyLight"));
+ var4.blocklightMap = new NibbleArray(var1.getByteArray("BlockLight"));
+ var4.heightMap = var1.getByteArray("HeightMap");
+ var4.isTerrainPopulated = var1.getBoolean("TerrainPopulated");
+ if(!var4.data.isValid()) {
+ var4.data = new NibbleArray(var4.blocks.length);
+ }
+
+ if(var4.heightMap == null || !var4.skylightMap.isValid()) {
+ var4.heightMap = new byte[256];
+ var4.skylightMap = new NibbleArray(var4.blocks.length);
+ var4.generateHeightMap();
+ }
+
+ if(!var4.blocklightMap.isValid()) {
+ var4.blocklightMap = new NibbleArray(var4.blocks.length);
+ var4.doNothing();
+ }
+
+ NBTTagList var5 = var1.getTagList("Entities");
+ if(var5 != null) {
+ for(int var6 = 0; var6 < var5.tagCount(); ++var6) {
+ NBTTagCompound var7 = (NBTTagCompound)var5.tagAt(var6);
+ Entity var8 = EntityList.createEntityFromNBT(var7, var0);
+ var4.hasEntities = true;
+ if(var8 != null) {
+ var4.addEntity(var8);
+ }
+ }
+ }
+
+ NBTTagList var10 = var1.getTagList("TileEntities");
+ if(var10 != null) {
+ for(int var11 = 0; var11 < var10.tagCount(); ++var11) {
+ NBTTagCompound var12 = (NBTTagCompound)var10.tagAt(var11);
+ TileEntity var9 = TileEntity.createAndLoadEntity(var12);
+ if(var9 != null) {
+ var4.addTileEntity(var9);
+ }
+ }
+ }
+
+ return var4;
+ }
+
+ public void chunkTick() {
+ }
+
+ public void saveExtraData() {
+ }
+
+ public void saveExtraChunkData(World var1, Chunk var2) {
+ }
+}
diff --git a/src/net/minecraft/src/ChunkPosition.java b/src/net/minecraft/src/ChunkPosition.java
new file mode 100644
index 0000000..8b19854
--- /dev/null
+++ b/src/net/minecraft/src/ChunkPosition.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ChunkPosition {
+ public final int x;
+ public final int y;
+ public final int z;
+
+ public ChunkPosition(int var1, int var2, int var3) {
+ this.x = var1;
+ this.y = var2;
+ this.z = var3;
+ }
+
+ public boolean equals(Object var1) {
+ if(!(var1 instanceof ChunkPosition)) {
+ return false;
+ } else {
+ ChunkPosition var2 = (ChunkPosition)var1;
+ return var2.x == this.x && var2.y == this.y && var2.z == this.z;
+ }
+ }
+
+ public int hashCode() {
+ return this.x * 8976890 + this.y * 981131 + this.z;
+ }
+}
diff --git a/src/net/minecraft/src/ChunkProviderGenerate.java b/src/net/minecraft/src/ChunkProviderGenerate.java
new file mode 100644
index 0000000..5a97630
--- /dev/null
+++ b/src/net/minecraft/src/ChunkProviderGenerate.java
@@ -0,0 +1,610 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class ChunkProviderGenerate implements IChunkProvider {
+ private Random rand;
+ private NoiseGeneratorOctaves noiseGen1;
+ private NoiseGeneratorOctaves noiseGen2;
+ private NoiseGeneratorOctaves noiseGen3;
+ private NoiseGeneratorOctaves noiseGen4;
+ private NoiseGeneratorOctaves noiseGen5;
+ private NoiseGeneratorOctaves noiseGen6;
+ private NoiseGeneratorOctaves noiseGen7;
+ private NoiseGeneratorOctaves mobSpawnerNoise;
+ private World worldObj;
+ private double[] noiseArray;
+ double[] noise3;
+ double[] noise1;
+ double[] noise2;
+ double[] noise6;
+ double[] noise7;
+ int[][] unused = new int[32][32];
+
+ public ChunkProviderGenerate(World var1, long var2) {
+ this.worldObj = var1;
+ this.rand = new Random(var2);
+ 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, 4);
+ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 10);
+ this.noiseGen7 = new NoiseGeneratorOctaves(this.rand, 16);
+ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
+ }
+
+ public void generateTerrain(int var1, int var2, byte[] var3) {
+ byte var4 = 4;
+ byte var5 = 64;
+ int var6 = var4 + 1;
+ byte var7 = 17;
+ int var8 = var4 + 1;
+ this.noiseArray = this.initializeNoiseField(this.noiseArray, var1 * var4, 0, var2 * 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) {
+ double var12 = 0.125D;
+ double var14 = this.noiseArray[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0];
+ double var16 = this.noiseArray[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0];
+ double var18 = this.noiseArray[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 0];
+ double var20 = this.noiseArray[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 0];
+ double var22 = (this.noiseArray[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 1] - var14) * var12;
+ double var24 = (this.noiseArray[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 1] - var16) * var12;
+ double var26 = (this.noiseArray[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12;
+ double var28 = (this.noiseArray[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12;
+
+ 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) {
+ 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) {
+ int var51 = 0;
+ if(var11 * 8 + var30 < var5) {
+ var51 = Block.waterStill.blockID;
+ }
+
+ if(var46 > 0.0D) {
+ var51 = Block.stone.blockID;
+ }
+
+ var3[var42] = (byte)var51;
+ var42 += var43;
+ var46 += var48;
+ }
+
+ var33 += var37;
+ var35 += var39;
+ }
+
+ var14 += var22;
+ var16 += var24;
+ var18 += var26;
+ var20 += var28;
+ }
+ }
+ }
+ }
+
+ }
+
+ public void replaceBlocks(int var1, int var2, byte[] var3) {
+ byte var4 = 64;
+
+ for(int var5 = 0; var5 < 16; ++var5) {
+ for(int var6 = 0; var6 < 16; ++var6) {
+ double var7 = (double)(var1 * 16 + var5);
+ double var9 = (double)(var2 * 16 + var6);
+ double var11 = 1.0D / 32.0D;
+ boolean var13 = this.noiseGen4.a(var7 * var11, var9 * var11, 0.0D) + this.rand.nextDouble() * 0.2D > 0.0D;
+ boolean var14 = this.noiseGen4.a(var9 * var11, 109.0134D, var7 * var11) + this.rand.nextDouble() * 0.2D > 3.0D;
+ int var15 = (int)(this.noiseGen5.generateNoiseOctaves(var7 * var11 * 2.0D, var9 * var11 * 2.0D) / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
+ int var16 = -1;
+ int var17 = Block.grass.blockID;
+ int var18 = Block.dirt.blockID;
+ int var19 = (var5 * 16 + var6) * 128 + 128;
+
+ for(int var20 = 127; var20 >= 0; --var20) {
+ --var19;
+ if(var20 <= 0 + this.rand.nextInt(6) - 1) {
+ var3[var19] = (byte)Block.bedrock.blockID;
+ } else if(var3[var19] == 0) {
+ var16 = -1;
+ } else if(var3[var19] == Block.stone.blockID) {
+ if(var16 == -1) {
+ if(var15 <= 0) {
+ var17 = 0;
+ var18 = (byte)Block.stone.blockID;
+ } else if(var20 >= var4 - 4 && var20 <= var4 + 1) {
+ var17 = Block.grass.blockID;
+ var18 = Block.dirt.blockID;
+ if(var14) {
+ var17 = 0;
+ }
+
+ if(var14) {
+ var18 = Block.gravel.blockID;
+ }
+
+ if(var13) {
+ var17 = Block.sand.blockID;
+ }
+
+ if(var13) {
+ var18 = Block.sand.blockID;
+ }
+ }
+
+ if(var20 < var4 && var17 == 0) {
+ var17 = Block.waterStill.blockID;
+ }
+
+ var16 = var15;
+ if(var20 >= var4 - 1) {
+ var3[var19] = (byte)var17;
+ } else {
+ var3[var19] = (byte)var18;
+ }
+ } else if(var16 > 0) {
+ --var16;
+ var3[var19] = (byte)var18;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ public Chunk provideChunk(int var1, int var2) {
+ this.rand.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L);
+ byte[] var3 = new byte[-Short.MIN_VALUE];
+ Chunk var4 = new Chunk(this.worldObj, var3, var1, var2);
+ this.generateTerrain(var1, var2, var3);
+ this.replaceBlocks(var1, var2, var3);
+ this.generateCaves(var1, var2, var3);
+ var4.generateHeightMap();
+ return var4;
+ }
+
+ protected void generateLargeCaveNode(int var1, int var2, byte[] var3, double var4, double var6, double var8) {
+ this.generateCaveNode(var1, var2, var3, var4, var6, var8, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
+ }
+
+ protected void generateCaveNode(int var1, int var2, byte[] var3, double var4, double var6, double var8, float var10, float var11, float var12, int var13, int var14, double var15) {
+ double var17 = (double)(var1 * 16 + 8);
+ double var19 = (double)(var2 * 16 + 8);
+ float var21 = 0.0F;
+ float var22 = 0.0F;
+ Random var23 = new Random(this.rand.nextLong());
+ if(var14 <= 0) {
+ byte var24 = 112;
+ var14 = var24 - var23.nextInt(var24 / 4);
+ }
+
+ boolean var52 = false;
+ if(var13 == -1) {
+ var13 = var14 / 2;
+ var52 = true;
+ }
+
+ int var25 = var23.nextInt(var14 / 2) + var14 / 4;
+
+ for(boolean var26 = var23.nextInt(6) == 0; var13 < var14; ++var13) {
+ double var27 = 1.5D + (double)(MathHelper.sin((float)var13 * (float)Math.PI / (float)var14) * var10 * 1.0F);
+ double var29 = var27 * var15;
+ float var31 = MathHelper.cos(var12);
+ float var32 = MathHelper.sin(var12);
+ var4 += (double)(MathHelper.cos(var11) * var31);
+ var6 += (double)var32;
+ var8 += (double)(MathHelper.sin(var11) * var31);
+ if(var26) {
+ var12 *= 0.92F;
+ } else {
+ var12 *= 0.7F;
+ }
+
+ var12 += var22 * 0.1F;
+ var11 += var21 * 0.1F;
+ var22 *= 0.9F;
+ var21 *= 12.0F / 16.0F;
+ var22 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 2.0F;
+ var21 += (var23.nextFloat() - var23.nextFloat()) * var23.nextFloat() * 4.0F;
+ if(!var52 && var13 == var25 && var10 > 1.0F) {
+ this.generateCaveNode(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 - (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
+ this.generateCaveNode(var1, var2, var3, var4, var6, var8, var23.nextFloat() * 0.5F + 0.5F, var11 + (float)Math.PI * 0.5F, var12 / 3.0F, var13, var14, 1.0D);
+ return;
+ }
+
+ if(var52 || var23.nextInt(4) != 0) {
+ double var33 = var4 - var17;
+ double var35 = var8 - var19;
+ double var37 = (double)(var14 - var13);
+ double var39 = (double)(var10 + 2.0F + 16.0F);
+ if(var33 * var33 + var35 * var35 - var37 * var37 > var39 * var39) {
+ return;
+ }
+
+ if(var4 >= var17 - 16.0D - var27 * 2.0D && var8 >= var19 - 16.0D - var27 * 2.0D && var4 <= var17 + 16.0D + var27 * 2.0D && var8 <= var19 + 16.0D + var27 * 2.0D) {
+ int var53 = MathHelper.floor_double(var4 - var27) - var1 * 16 - 1;
+ int var34 = MathHelper.floor_double(var4 + var27) - var1 * 16 + 1;
+ int var54 = MathHelper.floor_double(var6 - var29) - 1;
+ int var36 = MathHelper.floor_double(var6 + var29) + 1;
+ int var55 = MathHelper.floor_double(var8 - var27) - var2 * 16 - 1;
+ int var38 = MathHelper.floor_double(var8 + var27) - var2 * 16 + 1;
+ if(var53 < 0) {
+ var53 = 0;
+ }
+
+ if(var34 > 16) {
+ var34 = 16;
+ }
+
+ if(var54 < 1) {
+ var54 = 1;
+ }
+
+ if(var36 > 120) {
+ var36 = 120;
+ }
+
+ if(var55 < 0) {
+ var55 = 0;
+ }
+
+ if(var38 > 16) {
+ var38 = 16;
+ }
+
+ boolean var56 = false;
+
+ int var40;
+ int var43;
+ for(var40 = var53; !var56 && var40 < var34; ++var40) {
+ for(int var41 = var55; !var56 && var41 < var38; ++var41) {
+ for(int var42 = var36 + 1; !var56 && var42 >= var54 - 1; --var42) {
+ var43 = (var40 * 16 + var41) * 128 + var42;
+ if(var42 >= 0 && var42 < 128) {
+ if(var3[var43] == Block.waterMoving.blockID || var3[var43] == Block.waterStill.blockID) {
+ var56 = true;
+ }
+
+ if(var42 != var54 - 1 && var40 != var53 && var40 != var34 - 1 && var41 != var55 && var41 != var38 - 1) {
+ var42 = var54;
+ }
+ }
+ }
+ }
+ }
+
+ if(!var56) {
+ for(var40 = var53; var40 < var34; ++var40) {
+ double var57 = ((double)(var40 + var1 * 16) + 0.5D - var4) / var27;
+
+ for(var43 = var55; var43 < var38; ++var43) {
+ double var44 = ((double)(var43 + var2 * 16) + 0.5D - var8) / var27;
+ int var46 = (var40 * 16 + var43) * 128 + var36;
+ boolean var47 = false;
+
+ for(int var48 = var36 - 1; var48 >= var54; --var48) {
+ double var49 = ((double)var48 + 0.5D - var6) / var29;
+ if(var49 > -0.7D && var57 * var57 + var49 * var49 + var44 * var44 < 1.0D) {
+ byte var51 = var3[var46];
+ if(var51 == Block.grass.blockID) {
+ var47 = true;
+ }
+
+ if(var51 == Block.stone.blockID || var51 == Block.dirt.blockID || var51 == Block.grass.blockID) {
+ if(var48 < 10) {
+ var3[var46] = (byte)Block.lavaMoving.blockID;
+ } else {
+ var3[var46] = 0;
+ if(var47 && var3[var46 - 1] == Block.dirt.blockID) {
+ var3[var46 - 1] = (byte)Block.grass.blockID;
+ }
+ }
+ }
+ }
+
+ --var46;
+ }
+ }
+ }
+
+ if(var52) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ private void generateCaves(int var1, int var2, byte[] var3) {
+ byte var4 = 8;
+ this.rand.setSeed(this.worldObj.randomSeed);
+ long var5 = this.rand.nextLong() / 2L * 2L + 1L;
+ long var7 = this.rand.nextLong() / 2L * 2L + 1L;
+
+ for(int var9 = var1 - var4; var9 <= var1 + var4; ++var9) {
+ for(int var10 = var2 - var4; var10 <= var2 + var4; ++var10) {
+ this.rand.setSeed((long)var9 * var5 + (long)var10 * var7 ^ this.worldObj.randomSeed);
+ int var11 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
+ if(this.rand.nextInt(15) != 0) {
+ var11 = 0;
+ }
+
+ for(int var12 = 0; var12 < var11; ++var12) {
+ double var13 = (double)(var9 * 16 + this.rand.nextInt(16));
+ double var15 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
+ double var17 = (double)(var10 * 16 + this.rand.nextInt(16));
+ int var19 = 1;
+ if(this.rand.nextInt(4) == 0) {
+ this.generateLargeCaveNode(var1, var2, var3, var13, var15, var17);
+ var19 += this.rand.nextInt(4);
+ }
+
+ for(int var20 = 0; var20 < var19; ++var20) {
+ float var21 = this.rand.nextFloat() * (float)Math.PI * 2.0F;
+ float var22 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
+ float var23 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
+ this.generateCaveNode(var1, var2, var3, var13, var15, var17, var23, var21, var22, 0, 0, 1.0D);
+ }
+ }
+ }
+ }
+
+ }
+
+ 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];
+ }
+
+ double var8 = 684.412D;
+ double var10 = 684.412D;
+ this.noise6 = this.noiseGen6.a(this.noise6, var2, var3, var4, var5, 1, var7, 1.0D, 0.0D, 1.0D);
+ this.noise7 = this.noiseGen7.a(this.noise7, var2, var3, var4, var5, 1, var7, 100.0D, 0.0D, 100.0D);
+ this.noise3 = this.noiseGen3.a(this.noise3, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D);
+ this.noise1 = this.noiseGen1.a(this.noise1, var2, var3, var4, var5, var6, var7, var8, var10, var8);
+ this.noise2 = this.noiseGen2.a(this.noise2, var2, var3, var4, var5, var6, var7, var8, var10, var8);
+ int var12 = 0;
+ int var13 = 0;
+
+ for(int var14 = 0; var14 < var5; ++var14) {
+ for(int var15 = 0; var15 < var7; ++var15) {
+ double var16 = (this.noise6[var13] + 256.0D) / 512.0D;
+ if(var16 > 1.0D) {
+ var16 = 1.0D;
+ }
+
+ double var18 = 0.0D;
+ double var20 = this.noise7[var13] / 8000.0D;
+ if(var20 < 0.0D) {
+ var20 = -var20;
+ }
+
+ var20 = var20 * 3.0D - 3.0D;
+ if(var20 < 0.0D) {
+ var20 /= 2.0D;
+ if(var20 < -1.0D) {
+ var20 = -1.0D;
+ }
+
+ var20 /= 1.4D;
+ var20 /= 2.0D;
+ var16 = 0.0D;
+ } else {
+ if(var20 > 1.0D) {
+ var20 = 1.0D;
+ }
+
+ var20 /= 6.0D;
+ }
+
+ var16 += 0.5D;
+ var20 = var20 * (double)var6 / 16.0D;
+ double var22 = (double)var6 / 2.0D + var20 * 4.0D;
+ ++var13;
+
+ for(int var24 = 0; var24 < var6; ++var24) {
+ double var25 = 0.0D;
+ double var27 = ((double)var24 - var22) * 12.0D / var16;
+ if(var27 < 0.0D) {
+ var27 *= 4.0D;
+ }
+
+ double var29 = this.noise1[var12] / 512.0D;
+ double var31 = this.noise2[var12] / 512.0D;
+ double var33 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
+ if(var33 < 0.0D) {
+ var25 = var29;
+ } else if(var33 > 1.0D) {
+ var25 = var31;
+ } else {
+ var25 = var29 + (var31 - var29) * var33;
+ }
+
+ var25 -= var27;
+ double var35;
+ if(var24 > var6 - 4) {
+ var35 = (double)((float)(var24 - (var6 - 4)) / 3.0F);
+ var25 = var25 * (1.0D - var35) + -10.0D * var35;
+ }
+
+ if((double)var24 < var18) {
+ var35 = (var18 - (double)var24) / 4.0D;
+ if(var35 < 0.0D) {
+ var35 = 0.0D;
+ }
+
+ if(var35 > 1.0D) {
+ var35 = 1.0D;
+ }
+
+ var25 = var25 * (1.0D - var35) + -10.0D * var35;
+ }
+
+ var1[var12] = var25;
+ ++var12;
+ }
+ }
+ }
+
+ return var1;
+ }
+
+ public boolean chunkExists(int var1, int var2) {
+ return true;
+ }
+
+ public void populate(IChunkProvider var1, int var2, int var3) {
+ int var4 = var2 * 16;
+ int var5 = var3 * 16;
+ this.rand.setSeed(this.worldObj.randomSeed);
+ long var6 = this.rand.nextLong() / 2L * 2L + 1L;
+ long var8 = this.rand.nextLong() / 2L * 2L + 1L;
+ this.rand.setSeed((long)var2 * var6 + (long)var3 * var8 ^ this.worldObj.randomSeed);
+ double var10 = 0.25D;
+
+ int var12;
+ int var13;
+ int var14;
+ int var15;
+ for(var12 = 0; var12 < 4; ++var12) {
+ var13 = var4 + this.rand.nextInt(16) + 8;
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 20; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.dirt.blockID, 32)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 10; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.gravel.blockID, 32)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 20; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(128);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ for(var12 = 0; var12 < 20; ++var12) {
+ var13 = var4 + this.rand.nextInt(16);
+ var14 = this.rand.nextInt(64);
+ var15 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreIron.blockID, 8)).generate(this.worldObj, this.rand, var13, var14, var15);
+ }
+
+ if(this.rand.nextInt(1) == 0) {
+ var12 = var4 + this.rand.nextInt(16);
+ var13 = this.rand.nextInt(32);
+ var14 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreGold.blockID, 8)).generate(this.worldObj, this.rand, var12, var13, var14);
+ }
+
+ if(this.rand.nextInt(4) == 0) {
+ var12 = var4 + this.rand.nextInt(16);
+ var13 = this.rand.nextInt(16);
+ var14 = var5 + this.rand.nextInt(16);
+ (new WorldGenMinable(Block.oreDiamond.blockID, 8)).generate(this.worldObj, this.rand, var12, var13, var14);
+ }
+
+ var10 = 0.5D;
+ var12 = (int)((this.mobSpawnerNoise.generateNoiseOctaves((double)var4 * var10, (double)var5 * var10) / 8.0D + this.rand.nextDouble() * 4.0D + 4.0D) / 3.0D);
+ if(var12 < 0) {
+ var12 = 0;
+ }
+
+ WorldGenTrees var18 = new WorldGenTrees();
+ if(this.rand.nextInt(10) == 0) {
+ ++var12;
+ }
+
+ int var16;
+ for(var14 = 0; var14 < var12; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ var18.setScale(1.0D, 1.0D, 1.0D);
+ var18.generate(this.worldObj, this.rand, var15, this.worldObj.getHeightValue(var15, var16), var16);
+ }
+
+ int var17;
+ for(var14 = 0; var14 < 2; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = this.rand.nextInt(128);
+ var17 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.plantYellow.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
+ }
+
+ if(this.rand.nextInt(2) == 0) {
+ var14 = var4 + this.rand.nextInt(16) + 8;
+ var15 = this.rand.nextInt(128);
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.plantRed.blockID)).generate(this.worldObj, this.rand, var14, var15, var16);
+ }
+
+ if(this.rand.nextInt(4) == 0) {
+ var14 = var4 + this.rand.nextInt(16) + 8;
+ var15 = this.rand.nextInt(128);
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.rand, var14, var15, var16);
+ }
+
+ if(this.rand.nextInt(8) == 0) {
+ var14 = var4 + this.rand.nextInt(16) + 8;
+ var15 = this.rand.nextInt(128);
+ var16 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.rand, var14, var15, var16);
+ }
+
+ for(var14 = 0; var14 < 50; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = this.rand.nextInt(this.rand.nextInt(120) + 8);
+ var17 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenLiquids(Block.waterMoving.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
+ }
+
+ for(var14 = 0; var14 < 20; ++var14) {
+ var15 = var4 + this.rand.nextInt(16) + 8;
+ var16 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(112) + 8) + 8);
+ var17 = var5 + this.rand.nextInt(16) + 8;
+ (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.worldObj, this.rand, var15, var16, var17);
+ }
+
+ }
+
+ public boolean saveChunks(boolean var1, IProgressUpdate var2) {
+ return true;
+ }
+
+ public boolean unload100OldestChunks() {
+ return false;
+ }
+
+ public boolean canSave() {
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/ChunkProviderIso.java b/src/net/minecraft/src/ChunkProviderIso.java
new file mode 100644
index 0000000..ca7a076
--- /dev/null
+++ b/src/net/minecraft/src/ChunkProviderIso.java
@@ -0,0 +1,66 @@
+package net.minecraft.src;
+
+import java.io.IOException;
+
+public class ChunkProviderIso implements IChunkProvider {
+ private Chunk[] chunks = new Chunk[256];
+ private World worldObj;
+ private IChunkLoader chunkLoader;
+ byte[] blocks = new byte[-Short.MIN_VALUE];
+
+ public ChunkProviderIso(World var1, IChunkLoader var2) {
+ this.worldObj = var1;
+ this.chunkLoader = var2;
+ }
+
+ public boolean chunkExists(int var1, int var2) {
+ int var3 = var1 & 15 | (var2 & 15) * 16;
+ return this.chunks[var3] != null && this.chunks[var3].isAtLocation(var1, var2);
+ }
+
+ public Chunk provideChunk(int var1, int var2) {
+ int var3 = var1 & 15 | (var2 & 15) * 16;
+
+ try {
+ if(!this.chunkExists(var1, var2)) {
+ Chunk var4 = this.getChunkAt(var1, var2);
+ if(var4 == null) {
+ var4 = new Chunk(this.worldObj, this.blocks, var1, var2);
+ var4.isChunkRendered = true;
+ var4.neverSave = true;
+ }
+
+ this.chunks[var3] = var4;
+ }
+
+ return this.chunks[var3];
+ } catch (Exception var5) {
+ var5.printStackTrace();
+ return null;
+ }
+ }
+
+ private synchronized Chunk getChunkAt(int var1, int var2) {
+ try {
+ return this.chunkLoader.loadChunk(this.worldObj, var1, var2);
+ } catch (IOException var4) {
+ var4.printStackTrace();
+ return null;
+ }
+ }
+
+ public void populate(IChunkProvider var1, int var2, int var3) {
+ }
+
+ public boolean saveChunks(boolean var1, IProgressUpdate var2) {
+ return true;
+ }
+
+ public boolean unload100OldestChunks() {
+ return false;
+ }
+
+ public boolean canSave() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/ChunkProviderLoadOrGenerate.java b/src/net/minecraft/src/ChunkProviderLoadOrGenerate.java
new file mode 100644
index 0000000..b4aff3d
--- /dev/null
+++ b/src/net/minecraft/src/ChunkProviderLoadOrGenerate.java
@@ -0,0 +1,203 @@
+package net.minecraft.src;
+
+import java.io.IOException;
+
+public class ChunkProviderLoadOrGenerate implements IChunkProvider {
+ private Chunk blankChunk;
+ private IChunkProvider chunkProvider;
+ private IChunkLoader chunkLoader;
+ private Chunk[] chunks = new Chunk[1024];
+ private World worldObj;
+ int lastQueriedChunkXPos = -999999999;
+ int lastQueriedChunkZPos = -999999999;
+ private Chunk lastQueriedChunk;
+
+ public ChunkProviderLoadOrGenerate(World var1, IChunkLoader var2, IChunkProvider var3) {
+ this.blankChunk = new Chunk(var1, new byte[-Short.MIN_VALUE], 0, 0);
+ this.blankChunk.isChunkRendered = true;
+ this.blankChunk.neverSave = true;
+ this.worldObj = var1;
+ this.chunkLoader = var2;
+ this.chunkProvider = var3;
+ }
+
+ public boolean chunkExists(int var1, int var2) {
+ if(var1 == this.lastQueriedChunkXPos && var2 == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
+ return true;
+ } else {
+ int var3 = var1 & 31;
+ int var4 = var2 & 31;
+ int var5 = var3 + var4 * 32;
+ return this.chunks[var5] != null && (this.chunks[var5] == this.blankChunk || this.chunks[var5].isAtLocation(var1, var2));
+ }
+ }
+
+ public Chunk provideChunk(int var1, int var2) {
+ if(var1 == this.lastQueriedChunkXPos && var2 == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
+ return this.lastQueriedChunk;
+ } else {
+ int var3 = var1 & 31;
+ int var4 = var2 & 31;
+ int var5 = var3 + var4 * 32;
+ if(!this.chunkExists(var1, var2)) {
+ BlockSand.fallInstantly = true;
+ if(this.chunks[var5] != null) {
+ this.chunks[var5].onChunkUnload();
+ this.saveChunk(this.chunks[var5]);
+ this.saveExtraChunkData(this.chunks[var5]);
+ }
+
+ Chunk var6 = this.getChunkAt(var1, var2);
+ if(var6 == null) {
+ if(this.chunkProvider == null) {
+ var6 = this.blankChunk;
+ } else {
+ var6 = this.chunkProvider.provideChunk(var1, var2);
+ }
+ }
+
+ this.chunks[var5] = var6;
+ if(this.chunks[var5] != null) {
+ this.chunks[var5].onChunkLoad();
+ }
+
+ if(!this.chunks[var5].isTerrainPopulated && this.chunkExists(var1 + 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 + 1, var2)) {
+ this.populate(this, var1, var2);
+ }
+
+ if(this.chunkExists(var1 - 1, var2) && !this.provideChunk(var1 - 1, var2).isTerrainPopulated && this.chunkExists(var1 - 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 - 1, var2)) {
+ this.populate(this, var1 - 1, var2);
+ }
+
+ if(this.chunkExists(var1, var2 - 1) && !this.provideChunk(var1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 + 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 + 1, var2)) {
+ this.populate(this, var1, var2 - 1);
+ }
+
+ if(this.chunkExists(var1 - 1, var2 - 1) && !this.provideChunk(var1 - 1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 - 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 - 1, var2)) {
+ this.populate(this, var1 - 1, var2 - 1);
+ }
+
+ BlockSand.fallInstantly = false;
+ }
+
+ this.lastQueriedChunkXPos = var1;
+ this.lastQueriedChunkZPos = var2;
+ this.lastQueriedChunk = this.chunks[var5];
+ return this.chunks[var5];
+ }
+ }
+
+ private Chunk getChunkAt(int var1, int var2) {
+ if(this.chunkLoader == null) {
+ return null;
+ } else {
+ try {
+ Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2);
+ if(var3 != null) {
+ var3.lastSaveTime = this.worldObj.worldTime;
+ }
+
+ return var3;
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ return null;
+ }
+ }
+ }
+
+ private void saveExtraChunkData(Chunk var1) {
+ if(this.chunkLoader != null) {
+ try {
+ this.chunkLoader.saveExtraChunkData(this.worldObj, var1);
+ } catch (Exception var3) {
+ var3.printStackTrace();
+ }
+
+ }
+ }
+
+ private void saveChunk(Chunk var1) {
+ if(this.chunkLoader != null) {
+ try {
+ var1.lastSaveTime = this.worldObj.worldTime;
+ this.chunkLoader.saveChunk(this.worldObj, var1);
+ } catch (IOException var3) {
+ var3.printStackTrace();
+ }
+
+ }
+ }
+
+ public void populate(IChunkProvider var1, int var2, int var3) {
+ Chunk var4 = this.provideChunk(var2, var3);
+ if(!var4.isTerrainPopulated) {
+ var4.isTerrainPopulated = true;
+ if(this.chunkProvider != null) {
+ this.chunkProvider.populate(var1, var2, var3);
+ var4.setChunkModified();
+ }
+ }
+
+ }
+
+ public boolean saveChunks(boolean var1, IProgressUpdate var2) {
+ int var3 = 0;
+ int var4 = 0;
+ int var5;
+ if(var2 != null) {
+ for(var5 = 0; var5 < this.chunks.length; ++var5) {
+ if(this.chunks[var5] != null && this.chunks[var5].needsSaving(var1)) {
+ ++var4;
+ }
+ }
+ }
+
+ var5 = 0;
+
+ for(int var6 = 0; var6 < this.chunks.length; ++var6) {
+ if(this.chunks[var6] != null) {
+ if(var1 && !this.chunks[var6].neverSave) {
+ this.saveExtraChunkData(this.chunks[var6]);
+ }
+
+ if(this.chunks[var6].needsSaving(var1)) {
+ this.saveChunk(this.chunks[var6]);
+ this.chunks[var6].isModified = false;
+ ++var3;
+ if(var3 == 2 && !var1) {
+ return false;
+ }
+
+ if(var2 != null) {
+ ++var5;
+ if(var5 % 10 == 0) {
+ var2.setLoadingProgress(var5 * 100 / var4);
+ }
+ }
+ }
+ }
+ }
+
+ if(var1) {
+ if(this.chunkLoader == null) {
+ return true;
+ }
+
+ this.chunkLoader.saveExtraData();
+ }
+
+ return true;
+ }
+
+ public boolean unload100OldestChunks() {
+ if(this.chunkLoader != null) {
+ this.chunkLoader.chunkTick();
+ }
+
+ return this.chunkProvider.unload100OldestChunks();
+ }
+
+ public boolean canSave() {
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/ClippingHelper.java b/src/net/minecraft/src/ClippingHelper.java
new file mode 100644
index 0000000..df283be
--- /dev/null
+++ b/src/net/minecraft/src/ClippingHelper.java
@@ -0,0 +1,18 @@
+package net.minecraft.src;
+
+public class ClippingHelper {
+ public float[][] frustum = new float[16][16];
+ public float[] projectionMatrix = new float[16];
+ 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) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/ClippingHelperImplementation.java b/src/net/minecraft/src/ClippingHelperImplementation.java
new file mode 100644
index 0000000..8bf16a5
--- /dev/null
+++ b/src/net/minecraft/src/ClippingHelperImplementation.java
@@ -0,0 +1,82 @@
+package net.minecraft.src;
+
+import java.nio.FloatBuffer;
+import org.lwjgl.opengl.GL11;
+
+public class ClippingHelperImplementation extends ClippingHelper {
+ private static ClippingHelperImplementation instance = new ClippingHelperImplementation();
+ private FloatBuffer projectionMatrixBuffer = GLAllocation.createFloatBuffer(16);
+ private FloatBuffer modelviewMatrixBuffer = GLAllocation.createFloatBuffer(16);
+ private FloatBuffer floatBuffer = GLAllocation.createFloatBuffer(16);
+
+ 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;
+ }
+
+ private void init() {
+ this.projectionMatrixBuffer.clear();
+ this.modelviewMatrixBuffer.clear();
+ this.floatBuffer.clear();
+ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer);
+ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer);
+ 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];
+ this.clippingMatrix[3] = this.modelviewMatrix[0] * this.projectionMatrix[3] + this.modelviewMatrix[1] * this.projectionMatrix[7] + this.modelviewMatrix[2] * this.projectionMatrix[11] + this.modelviewMatrix[3] * this.projectionMatrix[15];
+ this.clippingMatrix[4] = this.modelviewMatrix[4] * this.projectionMatrix[0] + this.modelviewMatrix[5] * this.projectionMatrix[4] + this.modelviewMatrix[6] * this.projectionMatrix[8] + this.modelviewMatrix[7] * this.projectionMatrix[12];
+ this.clippingMatrix[5] = this.modelviewMatrix[4] * this.projectionMatrix[1] + this.modelviewMatrix[5] * this.projectionMatrix[5] + this.modelviewMatrix[6] * this.projectionMatrix[9] + this.modelviewMatrix[7] * this.projectionMatrix[13];
+ this.clippingMatrix[6] = this.modelviewMatrix[4] * this.projectionMatrix[2] + this.modelviewMatrix[5] * this.projectionMatrix[6] + this.modelviewMatrix[6] * this.projectionMatrix[10] + this.modelviewMatrix[7] * this.projectionMatrix[14];
+ this.clippingMatrix[7] = this.modelviewMatrix[4] * this.projectionMatrix[3] + this.modelviewMatrix[5] * this.projectionMatrix[7] + this.modelviewMatrix[6] * this.projectionMatrix[11] + this.modelviewMatrix[7] * this.projectionMatrix[15];
+ this.clippingMatrix[8] = this.modelviewMatrix[8] * this.projectionMatrix[0] + this.modelviewMatrix[9] * this.projectionMatrix[4] + this.modelviewMatrix[10] * this.projectionMatrix[8] + this.modelviewMatrix[11] * this.projectionMatrix[12];
+ this.clippingMatrix[9] = this.modelviewMatrix[8] * this.projectionMatrix[1] + this.modelviewMatrix[9] * this.projectionMatrix[5] + this.modelviewMatrix[10] * this.projectionMatrix[9] + this.modelviewMatrix[11] * this.projectionMatrix[13];
+ this.clippingMatrix[10] = this.modelviewMatrix[8] * this.projectionMatrix[2] + this.modelviewMatrix[9] * this.projectionMatrix[6] + this.modelviewMatrix[10] * this.projectionMatrix[10] + this.modelviewMatrix[11] * this.projectionMatrix[14];
+ this.clippingMatrix[11] = this.modelviewMatrix[8] * this.projectionMatrix[3] + this.modelviewMatrix[9] * this.projectionMatrix[7] + this.modelviewMatrix[10] * this.projectionMatrix[11] + this.modelviewMatrix[11] * this.projectionMatrix[15];
+ this.clippingMatrix[12] = this.modelviewMatrix[12] * this.projectionMatrix[0] + this.modelviewMatrix[13] * this.projectionMatrix[4] + this.modelviewMatrix[14] * this.projectionMatrix[8] + this.modelviewMatrix[15] * this.projectionMatrix[12];
+ this.clippingMatrix[13] = this.modelviewMatrix[12] * this.projectionMatrix[1] + this.modelviewMatrix[13] * this.projectionMatrix[5] + this.modelviewMatrix[14] * this.projectionMatrix[9] + this.modelviewMatrix[15] * this.projectionMatrix[13];
+ this.clippingMatrix[14] = this.modelviewMatrix[12] * this.projectionMatrix[2] + this.modelviewMatrix[13] * this.projectionMatrix[6] + this.modelviewMatrix[14] * this.projectionMatrix[10] + this.modelviewMatrix[15] * this.projectionMatrix[14];
+ this.clippingMatrix[15] = this.modelviewMatrix[12] * this.projectionMatrix[3] + this.modelviewMatrix[13] * this.projectionMatrix[7] + this.modelviewMatrix[14] * this.projectionMatrix[11] + this.modelviewMatrix[15] * this.projectionMatrix[15];
+ this.frustum[0][0] = this.clippingMatrix[3] - this.clippingMatrix[0];
+ this.frustum[0][1] = this.clippingMatrix[7] - this.clippingMatrix[4];
+ this.frustum[0][2] = this.clippingMatrix[11] - this.clippingMatrix[8];
+ this.frustum[0][3] = this.clippingMatrix[15] - this.clippingMatrix[12];
+ this.normalize(this.frustum, 0);
+ this.frustum[1][0] = this.clippingMatrix[3] + this.clippingMatrix[0];
+ this.frustum[1][1] = this.clippingMatrix[7] + this.clippingMatrix[4];
+ this.frustum[1][2] = this.clippingMatrix[11] + this.clippingMatrix[8];
+ this.frustum[1][3] = this.clippingMatrix[15] + this.clippingMatrix[12];
+ this.normalize(this.frustum, 1);
+ this.frustum[2][0] = this.clippingMatrix[3] + this.clippingMatrix[1];
+ this.frustum[2][1] = this.clippingMatrix[7] + this.clippingMatrix[5];
+ this.frustum[2][2] = this.clippingMatrix[11] + this.clippingMatrix[9];
+ this.frustum[2][3] = this.clippingMatrix[15] + this.clippingMatrix[13];
+ this.normalize(this.frustum, 2);
+ this.frustum[3][0] = this.clippingMatrix[3] - this.clippingMatrix[1];
+ this.frustum[3][1] = this.clippingMatrix[7] - this.clippingMatrix[5];
+ this.frustum[3][2] = this.clippingMatrix[11] - this.clippingMatrix[9];
+ this.frustum[3][3] = this.clippingMatrix[15] - this.clippingMatrix[13];
+ this.normalize(this.frustum, 3);
+ this.frustum[4][0] = this.clippingMatrix[3] - this.clippingMatrix[2];
+ this.frustum[4][1] = this.clippingMatrix[7] - this.clippingMatrix[6];
+ this.frustum[4][2] = this.clippingMatrix[11] - this.clippingMatrix[10];
+ this.frustum[4][3] = this.clippingMatrix[15] - this.clippingMatrix[14];
+ this.normalize(this.frustum, 4);
+ this.frustum[5][0] = this.clippingMatrix[3] + this.clippingMatrix[2];
+ this.frustum[5][1] = this.clippingMatrix[7] + this.clippingMatrix[6];
+ this.frustum[5][2] = this.clippingMatrix[11] + this.clippingMatrix[10];
+ this.frustum[5][3] = this.clippingMatrix[15] + this.clippingMatrix[14];
+ this.normalize(this.frustum, 5);
+ }
+}
diff --git a/src/net/minecraft/src/CompressedStreamTools.java b/src/net/minecraft/src/CompressedStreamTools.java
new file mode 100644
index 0000000..025017f
--- /dev/null
+++ b/src/net/minecraft/src/CompressedStreamTools.java
@@ -0,0 +1,50 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+public class CompressedStreamTools {
+ public static NBTTagCompound readCompressed(InputStream var0) throws IOException {
+ DataInputStream var1 = new DataInputStream(new GZIPInputStream(var0));
+
+ NBTTagCompound var2;
+ try {
+ var2 = read(var1);
+ } finally {
+ var1.close();
+ }
+
+ return var2;
+ }
+
+ public static void writeCompressed(NBTTagCompound var0, OutputStream var1) throws IOException {
+ DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1));
+
+ try {
+ write(var0, var2);
+ } finally {
+ var2.close();
+ }
+
+ }
+
+ public static NBTTagCompound read(DataInput var0) throws IOException {
+ NBTBase var1 = NBTBase.readNamedTag(var0);
+ 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);
+ }
+}
diff --git a/src/net/minecraft/src/CraftingManager.java b/src/net/minecraft/src/CraftingManager.java
new file mode 100644
index 0000000..21ff2e3
--- /dev/null
+++ b/src/net/minecraft/src/CraftingManager.java
@@ -0,0 +1,107 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+public class CraftingManager {
+ private static final CraftingManager instance = new CraftingManager();
+ private List recipes = new ArrayList();
+
+ public static final CraftingManager getInstance() {
+ return instance;
+ }
+
+ private CraftingManager() {
+ (new RecipesTools()).addRecipes(this);
+ (new RecipesWeapons()).addRecipe(this);
+ (new RecipesIngots()).addRecipes(this);
+ (new RecipesFood()).addRecipes(this);
+ (new RecipesCrafting()).addRecipes(this);
+ (new RecipesArmor()).addRecipes(this);
+ 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.stairSingle, 3), new Object[]{"###", Character.valueOf('#'), Block.cobblestone});
+ this.addRecipe(new ItemStack(Block.ladder, 1), new Object[]{"# #", "###", "# #", Character.valueOf('#'), Item.stick});
+ this.addRecipe(new ItemStack(Item.door, 1), new Object[]{"##", "##", "##", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Item.sign, 1), new Object[]{"###", "###", " X ", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.stick});
+ this.addRecipe(new ItemStack(Block.planks, 4), new Object[]{"#", Character.valueOf('#'), Block.wood});
+ this.addRecipe(new ItemStack(Item.stick, 4), new Object[]{"#", "#", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Block.torch, 4), new Object[]{"X", "#", Character.valueOf('X'), Item.coal, Character.valueOf('#'), Item.stick});
+ this.addRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[]{"# #", " # ", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Block.minecartTrack, 16), new Object[]{"X X", "X#X", "X X", Character.valueOf('X'), Item.ingotIron, Character.valueOf('#'), Item.stick});
+ this.addRecipe(new ItemStack(Item.minecart, 1), new Object[]{"# #", "###", Character.valueOf('#'), Item.ingotIron});
+ this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[]{"# #", " # ", Character.valueOf('#'), Item.ingotIron});
+ this.addRecipe(new ItemStack(Item.striker, 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.stairCompactWood, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.planks});
+ this.addRecipe(new ItemStack(Block.stairCompactStone, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.cobblestone});
+ this.addRecipe(new ItemStack(Item.painting, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Block.cloth});
+ this.addRecipe(new ItemStack(Item.appleGold, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.blockGold, Character.valueOf('X'), Item.appleRed});
+ Collections.sort(this.recipes, new RecipeSorter(this));
+ System.out.println(this.recipes.size() + " recipes");
+ }
+
+ void addRecipe(ItemStack var1, Object... var2) {
+ 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];
+ ++var6;
+ var5 = var9.length();
+ var3 = var3 + var9;
+ }
+ } else {
+ while(var2[var4] instanceof String) {
+ String var7 = (String)var2[var4++];
+ ++var6;
+ var5 = var7.length();
+ var3 = var3 + var7;
+ }
+ }
+
+ HashMap var12;
+ int var15;
+ for(var12 = new HashMap(); var4 < var2.length; var4 += 2) {
+ Character var13 = (Character)var2[var4];
+ var15 = 0;
+ if(var2[var4 + 1] instanceof Item) {
+ var15 = ((Item)var2[var4 + 1]).shiftedIndex;
+ } else if(var2[var4 + 1] instanceof Block) {
+ var15 = ((Block)var2[var4 + 1]).blockID;
+ }
+
+ var12.put(var13, Integer.valueOf(var15));
+ }
+
+ int[] var14 = new int[var5 * var6];
+
+ for(var15 = 0; var15 < var5 * var6; ++var15) {
+ char var10 = var3.charAt(var15);
+ if(var12.containsKey(Character.valueOf(var10))) {
+ var14[var15] = ((Integer)var12.get(Character.valueOf(var10))).intValue();
+ } else {
+ var14[var15] = -1;
+ }
+ }
+
+ this.recipes.add(new CraftingRecipe(var5, var6, var14, var1));
+ }
+
+ public ItemStack findMatchingRecipe(int[] var1) {
+ for(int var2 = 0; var2 < this.recipes.size(); ++var2) {
+ CraftingRecipe var3 = (CraftingRecipe)this.recipes.get(var2);
+ if(var3.matchRecipe(var1)) {
+ return var3.createResult(var1);
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/src/net/minecraft/src/CraftingRecipe.java b/src/net/minecraft/src/CraftingRecipe.java
new file mode 100644
index 0000000..37b74c6
--- /dev/null
+++ b/src/net/minecraft/src/CraftingRecipe.java
@@ -0,0 +1,64 @@
+package net.minecraft.src;
+
+public class CraftingRecipe {
+ private int width;
+ private int height;
+ private int[] ingredientMap;
+ private ItemStack resultStack;
+ public final int resultId;
+
+ public CraftingRecipe(int var1, int var2, int[] var3, ItemStack var4) {
+ this.resultId = var4.itemID;
+ this.width = var1;
+ this.height = var2;
+ this.ingredientMap = var3;
+ this.resultStack = var4;
+ }
+
+ public boolean matchRecipe(int[] var1) {
+ for(int var2 = 0; var2 <= 3 - this.width; ++var2) {
+ for(int var3 = 0; var3 <= 3 - this.height; ++var3) {
+ if(this.checkMatch(var1, var2, var3, true)) {
+ return true;
+ }
+
+ if(this.checkMatch(var1, var2, var3, false)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private boolean checkMatch(int[] 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;
+ int var9 = -1;
+ if(var7 >= 0 && var8 >= 0 && var7 < this.width && var8 < this.height) {
+ if(var4) {
+ var9 = this.ingredientMap[this.width - var7 - 1 + var8 * this.width];
+ } else {
+ var9 = this.ingredientMap[var7 + var8 * this.width];
+ }
+ }
+
+ if(var1[var5 + var6 * 3] != var9) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public ItemStack createResult(int[] var1) {
+ return new ItemStack(this.resultStack.itemID, this.resultStack.stackSize);
+ }
+
+ public int getRecipeSize() {
+ return this.width * this.height;
+ }
+}
diff --git a/src/net/minecraft/src/EffectRenderer.java b/src/net/minecraft/src/EffectRenderer.java
new file mode 100644
index 0000000..8b30d9b
--- /dev/null
+++ b/src/net/minecraft/src/EffectRenderer.java
@@ -0,0 +1,162 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+
+public class EffectRenderer {
+ protected World worldObj;
+ private List[] fxLayers = new List[3];
+ private RenderEngine renderer;
+ private Random rand = new Random();
+
+ public EffectRenderer(World var1, RenderEngine var2) {
+ if(var1 != null) {
+ this.worldObj = var1;
+ }
+
+ this.renderer = var2;
+
+ for(int var3 = 0; var3 < 3; ++var3) {
+ this.fxLayers[var3] = new ArrayList();
+ }
+
+ }
+
+ public void addEffect(EntityFX var1) {
+ int var2 = var1.getFXLayer();
+ this.fxLayers[var2].add(var1);
+ }
+
+ public void updateEffects() {
+ for(int var1 = 0; var1 < 3; ++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.fxLayers[var1].remove(var2--);
+ }
+ }
+ }
+
+ }
+
+ public void renderParticles(Entity var1, float var2) {
+ float var3 = MathHelper.cos(var1.rotationYaw * (float)Math.PI / 180.0F);
+ float var4 = MathHelper.sin(var1.rotationYaw * (float)Math.PI / 180.0F);
+ float var5 = -var4 * MathHelper.sin(var1.rotationPitch * (float)Math.PI / 180.0F);
+ float var6 = var3 * MathHelper.sin(var1.rotationPitch * (float)Math.PI / 180.0F);
+ float var7 = MathHelper.cos(var1.rotationPitch * (float)Math.PI / 180.0F);
+ 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;
+
+ for(int var8 = 0; var8 < 2; ++var8) {
+ if(this.fxLayers[var8].size() != 0) {
+ int var9 = 0;
+ if(var8 == 0) {
+ var9 = this.renderer.getTexture("/particles.png");
+ }
+
+ if(var8 == 1) {
+ var9 = this.renderer.getTexture("/terrain.png");
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var9);
+ Tessellator var10 = Tessellator.instance;
+ var10.startDrawingQuads();
+
+ for(int var11 = 0; var11 < this.fxLayers[var8].size(); ++var11) {
+ EntityFX var12 = (EntityFX)this.fxLayers[var8].get(var11);
+ var12.renderParticle(var10, var2, var3, var7, var4, var5, var6);
+ }
+
+ var10.draw();
+ }
+ }
+
+ }
+
+ public void renderLitParticles(Entity var1, float var2) {
+ byte var3 = 2;
+ if(this.fxLayers[var3].size() != 0) {
+ Tessellator var4 = Tessellator.instance;
+
+ for(int var5 = 0; var5 < this.fxLayers[var3].size(); ++var5) {
+ EntityFX var6 = (EntityFX)this.fxLayers[var3].get(var5);
+ var6.renderParticle(var4, var2, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+
+ }
+ }
+
+ public void clearEffects(World var1) {
+ this.worldObj = var1;
+
+ for(int var2 = 0; var2 < 3; ++var2) {
+ this.fxLayers[var2].clear();
+ }
+
+ }
+
+ public void addBlockDestroyEffects(int var1, int var2, int var3) {
+ int var4 = this.worldObj.getBlockId(var1, var2, var3);
+ if(var4 != 0) {
+ Block var5 = Block.blocksList[var4];
+ byte var6 = 4;
+
+ for(int var7 = 0; var7 < var6; ++var7) {
+ for(int var8 = 0; var8 < var6; ++var8) {
+ for(int var9 = 0; var9 < var6; ++var9) {
+ double var10 = (double)var1 + ((double)var7 + 0.5D) / (double)var6;
+ double var12 = (double)var2 + ((double)var8 + 0.5D) / (double)var6;
+ double var14 = (double)var3 + ((double)var9 + 0.5D) / (double)var6;
+ this.addEffect(new EntityDiggingFX(this.worldObj, var10, var12, var14, var10 - (double)var1 - 0.5D, var12 - (double)var2 - 0.5D, var14 - (double)var3 - 0.5D, var5));
+ }
+ }
+ }
+
+ }
+ }
+
+ public void addBlockHitEffects(int var1, int var2, int var3, int var4) {
+ int var5 = this.worldObj.getBlockId(var1, var2, var3);
+ if(var5 != 0) {
+ Block var6 = Block.blocksList[var5];
+ float var7 = 0.1F;
+ double var8 = (double)var1 + this.rand.nextDouble() * (var6.maxX - var6.minX - (double)(var7 * 2.0F)) + (double)var7 + var6.minX;
+ double var10 = (double)var2 + this.rand.nextDouble() * (var6.maxY - var6.minY - (double)(var7 * 2.0F)) + (double)var7 + var6.minY;
+ double var12 = (double)var3 + this.rand.nextDouble() * (var6.maxZ - var6.minZ - (double)(var7 * 2.0F)) + (double)var7 + var6.minZ;
+ if(var4 == 0) {
+ var10 = (double)var2 + var6.minY - (double)var7;
+ }
+
+ if(var4 == 1) {
+ var10 = (double)var2 + var6.maxY + (double)var7;
+ }
+
+ if(var4 == 2) {
+ var12 = (double)var3 + var6.minZ - (double)var7;
+ }
+
+ if(var4 == 3) {
+ var12 = (double)var3 + var6.maxZ + (double)var7;
+ }
+
+ if(var4 == 4) {
+ var8 = (double)var1 + var6.minX - (double)var7;
+ }
+
+ if(var4 == 5) {
+ var8 = (double)var1 + var6.maxX + (double)var7;
+ }
+
+ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6)).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
+ }
+ }
+
+ public String getStatistics() {
+ return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size());
+ }
+}
diff --git a/src/net/minecraft/src/Entity.java b/src/net/minecraft/src/Entity.java
new file mode 100644
index 0000000..64fc4ce
--- /dev/null
+++ b/src/net/minecraft/src/Entity.java
@@ -0,0 +1,728 @@
+package net.minecraft.src;
+
+import java.util.List;
+import java.util.Random;
+
+public abstract class Entity {
+ public boolean preventEntitySpawning = false;
+ public Entity riddenByEntity;
+ public Entity ridingEntity;
+ protected World worldObj;
+ public double prevPosX;
+ public double prevPosY;
+ public double prevPosZ;
+ public double posX;
+ public double posY;
+ public double posZ;
+ public double motionX;
+ public double motionY;
+ public double motionZ;
+ public float rotationYaw;
+ 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);
+ public boolean onGround = false;
+ public boolean isCollidedHorizontally = false;
+ public boolean isCollided = false;
+ public boolean surfaceCollision = true;
+ public boolean isDead = false;
+ public float yOffset = 0.0F;
+ public float width = 0.6F;
+ public float height = 1.8F;
+ public float prevDistanceWalkedModified = 0.0F;
+ public float distanceWalkedModified = 0.0F;
+ protected boolean canTriggerWalking = true;
+ protected float fallDistance = 0.0F;
+ private int nextStepDistance = 1;
+ public double lastTickPosX;
+ public double lastTickPosY;
+ public double lastTickPosZ;
+ public float ySize = 0.0F;
+ public float stepHeight = 0.0F;
+ public boolean noClip = false;
+ public float entityCollisionReduction = 0.0F;
+ public boolean unusedBool = false;
+ protected Random rand = new Random();
+ public int ticksExisted = 0;
+ public int fireResistance = 1;
+ public int fire = 0;
+ protected int maxAir = 300;
+ protected boolean inWater = false;
+ public int heartsLife = 0;
+ public int air = 300;
+ private boolean isFirstUpdate = true;
+ public String skinUrl;
+ private double entityRiderPitchDelta;
+ private double entityRiderYawDelta;
+
+ public Entity(World var1) {
+ this.worldObj = var1;
+ this.setPosition(0.0D, 0.0D, 0.0D);
+ }
+
+ protected void preparePlayerToSpawn() {
+ if(this.worldObj != null) {
+ while(this.posY > 0.0D) {
+ this.setPosition(this.posX, this.posY, this.posZ);
+ if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0) {
+ break;
+ }
+
+ ++this.posY;
+ }
+
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+ this.rotationPitch = 0.0F;
+ }
+ }
+
+ public void setEntityDead() {
+ this.isDead = true;
+ }
+
+ protected void setSize(float var1, float var2) {
+ this.width = var1;
+ this.height = var2;
+ }
+
+ protected void setRotation(float var1, float var2) {
+ this.rotationYaw = var1;
+ this.rotationPitch = var2;
+ }
+
+ public void setPosition(double var1, double var3, double var5) {
+ this.posX = var1;
+ this.posY = var3;
+ this.posZ = var5;
+ float var7 = this.width / 2.0F;
+ float var8 = this.height / 2.0F;
+ this.boundingBox.setBounds(var1 - (double)var7, var3 - (double)var8, var5 - (double)var7, var1 + (double)var7, var3 + (double)var8, var5 + (double)var7);
+ }
+
+ public void setAngles(float var1, float var2) {
+ 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.rotationPitch = -90.0F;
+ }
+
+ if(this.rotationPitch > 90.0F) {
+ this.rotationPitch = 90.0F;
+ }
+
+ this.prevRotationPitch += this.rotationPitch - var3;
+ this.prevRotationYaw += this.rotationYaw - var4;
+ }
+
+ public void onUpdate() {
+ this.onEntityUpdate();
+ }
+
+ public void onEntityUpdate() {
+ if(this.ridingEntity != null && this.ridingEntity.isDead) {
+ this.ridingEntity = null;
+ }
+
+ ++this.ticksExisted;
+ this.prevDistanceWalkedModified = this.distanceWalkedModified;
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.prevRotationPitch = this.rotationPitch;
+ this.prevRotationYaw = this.rotationYaw;
+ if(this.handleWaterMovement()) {
+ if(!this.inWater && !this.isFirstUpdate) {
+ 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) {
+ var1 = 1.0F;
+ }
+
+ this.worldObj.playSoundAtEntity(this, "random.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.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.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);
+ }
+ }
+
+ this.fallDistance = 0.0F;
+ this.inWater = true;
+ this.fire = 0;
+ } else {
+ this.inWater = false;
+ }
+
+ if(this.fire > 0) {
+ if(this.fire % 20 == 0) {
+ this.attackEntityFrom((Entity)null, 1);
+ }
+
+ --this.fire;
+ }
+
+ if(this.handleLavaMovement()) {
+ this.attackEntityFrom((Entity)null, 10);
+ this.fire = 600;
+ }
+
+ if(this.posY < -64.0D) {
+ this.kill();
+ }
+
+ this.isFirstUpdate = false;
+ }
+
+ protected void kill() {
+ this.setEntityDead();
+ }
+
+ public boolean isOffsetPositionInLiquid(double var1, double var3, double var5) {
+ AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(var1, var3, var5);
+ List var8 = this.worldObj.getCollidingBoundingBoxes(this, var7);
+ return var8.size() > 0 ? false : !this.worldObj.getIsAnyLiquid(var7);
+ }
+
+ public void moveEntity(double var1, double var3, double var5) {
+ if(this.noClip) {
+ this.boundingBox.offset(var1, var3, var5);
+ 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;
+ } else {
+ double var7 = this.posX;
+ double var9 = this.posZ;
+ double var11 = var1;
+ double var13 = var3;
+ double var15 = var5;
+ AxisAlignedBB var17 = this.boundingBox.copy();
+ List var18 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var1, var3, var5));
+
+ for(int var19 = 0; var19 < var18.size(); ++var19) {
+ var3 = ((AxisAlignedBB)var18.get(var19)).calculateYOffset(this.boundingBox, var3);
+ }
+
+ this.boundingBox.offset(0.0D, var3, 0.0D);
+ if(!this.surfaceCollision && var13 != var3) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ boolean var29 = this.onGround || var13 != var3 && var13 < 0.0D;
+
+ int var20;
+ for(var20 = 0; var20 < var18.size(); ++var20) {
+ var1 = ((AxisAlignedBB)var18.get(var20)).calculateXOffset(this.boundingBox, var1);
+ }
+
+ this.boundingBox.offset(var1, 0.0D, 0.0D);
+ if(!this.surfaceCollision && var11 != var1) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ for(var20 = 0; var20 < var18.size(); ++var20) {
+ var5 = ((AxisAlignedBB)var18.get(var20)).calculateZOffset(this.boundingBox, var5);
+ }
+
+ this.boundingBox.offset(0.0D, 0.0D, var5);
+ if(!this.surfaceCollision && var15 != var5) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ double var22;
+ int var27;
+ double var30;
+ if(this.stepHeight > 0.0F && var29 && this.ySize < 0.05F && (var11 != var1 || var15 != var5)) {
+ var30 = var1;
+ var22 = var3;
+ double var24 = var5;
+ var1 = var11;
+ var3 = (double)this.stepHeight;
+ var5 = var15;
+ AxisAlignedBB var26 = this.boundingBox.copy();
+ this.boundingBox.setBB(var17);
+ var18 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var11, var3, var15));
+
+ for(var27 = 0; var27 < var18.size(); ++var27) {
+ var3 = ((AxisAlignedBB)var18.get(var27)).calculateYOffset(this.boundingBox, var3);
+ }
+
+ this.boundingBox.offset(0.0D, var3, 0.0D);
+ if(!this.surfaceCollision && var13 != var3) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ for(var27 = 0; var27 < var18.size(); ++var27) {
+ var1 = ((AxisAlignedBB)var18.get(var27)).calculateXOffset(this.boundingBox, var1);
+ }
+
+ this.boundingBox.offset(var1, 0.0D, 0.0D);
+ if(!this.surfaceCollision && var11 != var1) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ for(var27 = 0; var27 < var18.size(); ++var27) {
+ var5 = ((AxisAlignedBB)var18.get(var27)).calculateZOffset(this.boundingBox, var5);
+ }
+
+ this.boundingBox.offset(0.0D, 0.0D, var5);
+ if(!this.surfaceCollision && var15 != var5) {
+ var5 = 0.0D;
+ var3 = var5;
+ var1 = var5;
+ }
+
+ if(var30 * var30 + var24 * var24 >= var1 * var1 + var5 * var5) {
+ var1 = var30;
+ var3 = var22;
+ var5 = var24;
+ this.boundingBox.setBB(var26);
+ } else {
+ this.ySize = (float)((double)this.ySize + 0.5D);
+ }
+ }
+
+ 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 = var11 != var1 || var15 != var5;
+ this.onGround = var13 != var3 && var13 < 0.0D;
+ this.isCollided = this.isCollidedHorizontally || var13 != var3;
+ if(this.onGround) {
+ if(this.fallDistance > 0.0F) {
+ this.fall(this.fallDistance);
+ this.fallDistance = 0.0F;
+ }
+ } else if(var3 < 0.0D) {
+ this.fallDistance = (float)((double)this.fallDistance - var3);
+ }
+
+ if(var11 != var1) {
+ this.motionX = 0.0D;
+ }
+
+ if(var13 != var3) {
+ this.motionY = 0.0D;
+ }
+
+ if(var15 != var5) {
+ this.motionZ = 0.0D;
+ }
+
+ var30 = this.posX - var7;
+ var22 = this.posZ - var9;
+ this.distanceWalkedModified = (float)((double)this.distanceWalkedModified + (double)MathHelper.sqrt_double(var30 * var30 + var22 * var22) * 0.6D);
+ if(this.canTriggerWalking) {
+ int var31 = MathHelper.floor_double(this.posX);
+ int var25 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset);
+ int var33 = MathHelper.floor_double(this.posZ);
+ var27 = this.worldObj.getBlockId(var31, var25, var33);
+ if(this.distanceWalkedModified > (float)this.nextStepDistance && var27 > 0) {
+ ++this.nextStepDistance;
+ StepSound var28 = Block.blocksList[var27].stepSound;
+ if(!Block.blocksList[var27].blockMaterial.getIsLiquid()) {
+ this.worldObj.playSoundAtEntity(this, var28.getStepSound(), var28.getVolume() * 0.15F, var28.getPitch());
+ }
+
+ Block.blocksList[var27].onEntityWalking(this.worldObj, var31, var25, var33, this);
+ }
+ }
+
+ this.ySize *= 0.4F;
+ boolean var32 = this.handleWaterMovement();
+ if(this.worldObj.isBoundingBoxBurning(this.boundingBox)) {
+ this.dealFireDamage(1);
+ if(!var32) {
+ ++this.fire;
+ if(this.fire == 0) {
+ this.fire = 300;
+ }
+ }
+ } else if(this.fire <= 0) {
+ this.fire = -this.fireResistance;
+ }
+
+ if(var32 && this.fire > 0) {
+ this.worldObj.playSoundAtEntity(this, "random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
+ this.fire = -this.fireResistance;
+ }
+
+ }
+ }
+
+ public AxisAlignedBB getBoundingBox() {
+ return null;
+ }
+
+ protected void dealFireDamage(int var1) {
+ this.attackEntityFrom((Entity)null, var1);
+ }
+
+ protected void fall(float var1) {
+ }
+
+ public boolean handleWaterMovement() {
+ return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, (double)-0.4F, 0.0D), Material.water, this);
+ }
+
+ public boolean isInsideOfMaterial(Material var1) {
+ double var2 = this.posY + (double)this.getEyeHeight();
+ 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.getPercentAir(this.worldObj.getBlockMetadata(var4, var5, var6)) - 1.0F / 9.0F;
+ float var9 = (float)(var5 + 1) - var8;
+ return var2 < (double)var9;
+ } else {
+ return false;
+ }
+ }
+
+ protected float getEyeHeight() {
+ return 0.0F;
+ }
+
+ public boolean handleLavaMovement() {
+ return this.worldObj.isMaterialInBB(this.boundingBox.expand(0.0D, (double)-0.4F, 0.0D), Material.lava);
+ }
+
+ public void moveFlying(float var1, float var2, float var3) {
+ float var4 = MathHelper.sqrt_float(var1 * var1 + var2 * var2);
+ if(var4 >= 0.01F) {
+ if(var4 < 1.0F) {
+ var4 = 1.0F;
+ }
+
+ var4 = var3 / var4;
+ var1 *= var4;
+ var2 *= 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);
+ }
+ }
+
+ public float getEntityBrightness(float var1) {
+ int var2 = MathHelper.floor_double(this.posX);
+ double var3 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
+ int var5 = MathHelper.floor_double(this.posY - (double)this.yOffset + var3);
+ int var6 = MathHelper.floor_double(this.posZ);
+ return this.worldObj.getBrightness(var2, var5, var6);
+ }
+
+ public void setWorld(World var1) {
+ this.worldObj = var1;
+ }
+
+ public void setPositionAndRotation(double var1, double var3, double var5, float var7, float var8) {
+ this.prevPosX = this.posX = var1;
+ this.prevPosY = this.posY = var3 + (double)this.yOffset;
+ this.prevPosZ = this.posZ = var5;
+ this.rotationYaw = var7;
+ this.rotationPitch = var8;
+ 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);
+ 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;
+ 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;
+ 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;
+ return var2 * var2 + var4 * var4 + var6 * var6;
+ }
+
+ public void onCollideWithPlayer(EntityPlayer var1) {
+ }
+
+ public void applyEntityCollision(Entity var1) {
+ double var2 = var1.posX - this.posX;
+ double var4 = var1.posZ - this.posZ;
+ double var6 = MathHelper.abs_max(var2, var4);
+ if(var6 >= (double)0.01F) {
+ var6 = (double)MathHelper.sqrt_double(var6);
+ var2 /= var6;
+ var4 /= var6;
+ double var8 = 1.0D / var6;
+ if(var8 > 1.0D) {
+ var8 = 1.0D;
+ }
+
+ var2 *= var8;
+ var4 *= var8;
+ var2 *= (double)0.05F;
+ var4 *= (double)0.05F;
+ var2 *= (double)(1.0F - this.entityCollisionReduction);
+ var4 *= (double)(1.0F - this.entityCollisionReduction);
+ this.addVelocity(-var2, 0.0D, -var4);
+ var1.addVelocity(var2, 0.0D, var4);
+ }
+
+ }
+
+ public void addVelocity(double var1, double var3, double var5) {
+ this.motionX += var1;
+ this.motionY += var3;
+ this.motionZ += var5;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ return false;
+ }
+
+ public boolean canBeCollidedWith() {
+ return false;
+ }
+
+ public boolean canBePushed() {
+ return false;
+ }
+
+ public void addToPlayerScore(Entity var1, int var2) {
+ }
+
+ public boolean isInRangeToRenderVec3D(Vec3D var1) {
+ double var2 = this.posX - var1.xCoord;
+ double var4 = this.posY - var1.yCoord;
+ double var6 = this.posZ - var1.zCoord;
+ double var8 = var2 * var2 + var4 * var4 + var6 * var6;
+ return this.isInRangeToRenderDist(var8);
+ }
+
+ public boolean isInRangeToRenderDist(double var1) {
+ double var3 = this.boundingBox.getAverageEdgeLength();
+ var3 *= 64.0D;
+ return var1 < var3 * var3;
+ }
+
+ public String getTexture() {
+ return null;
+ }
+
+ public boolean addEntityID(NBTTagCompound var1) {
+ String var2 = this.getEntityString();
+ if(!this.isDead && var2 != null) {
+ var1.setString("id", var2);
+ this.writeToNBT(var1);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ var1.setTag("Pos", this.newDoubleNBTList(new double[]{this.posX, this.posY, 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.air);
+ var1.setBoolean("OnGround", this.onGround);
+ this.writeEntityToNBT(var1);
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ NBTTagList var2 = var1.getTagList("Pos");
+ NBTTagList var3 = var1.getTagList("Motion");
+ NBTTagList var4 = var1.getTagList("Rotation");
+ this.setPosition(0.0D, 0.0D, 0.0D);
+ this.motionX = ((NBTTagDouble)var3.tagAt(0)).doubleValue;
+ this.motionY = ((NBTTagDouble)var3.tagAt(1)).doubleValue;
+ this.motionZ = ((NBTTagDouble)var3.tagAt(2)).doubleValue;
+ this.prevPosX = this.lastTickPosX = this.posX = ((NBTTagDouble)var2.tagAt(0)).doubleValue;
+ this.prevPosY = this.lastTickPosY = this.posY = ((NBTTagDouble)var2.tagAt(1)).doubleValue;
+ this.prevPosZ = this.lastTickPosZ = this.posZ = ((NBTTagDouble)var2.tagAt(2)).doubleValue;
+ this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var4.tagAt(0)).floatValue;
+ this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var4.tagAt(1)).floatValue;
+ this.fallDistance = var1.getFloat("FallDistance");
+ this.fire = var1.getShort("Fire");
+ this.air = var1.getShort("Air");
+ this.onGround = var1.getBoolean("OnGround");
+ this.setPosition(this.posX, this.posY, this.posZ);
+ this.readEntityFromNBT(var1);
+ }
+
+ protected final String getEntityString() {
+ return EntityList.getEntityString(this);
+ }
+
+ protected abstract void readEntityFromNBT(NBTTagCompound var1);
+
+ protected abstract void writeEntityToNBT(NBTTagCompound var1);
+
+ protected NBTTagList newDoubleNBTList(double... var1) {
+ NBTTagList var2 = new NBTTagList();
+ double[] var3 = var1;
+ int var4 = var1.length;
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ double var6 = var3[var5];
+ var2.setTag(new NBTTagDouble(var6));
+ }
+
+ return var2;
+ }
+
+ protected NBTTagList newFloatNBTList(float... var1) {
+ NBTTagList var2 = new NBTTagList();
+ float[] var3 = var1;
+ int var4 = var1.length;
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ float var6 = var3[var5];
+ var2.setTag(new NBTTagFloat(var6));
+ }
+
+ return var2;
+ }
+
+ public EntityItem dropItem(int var1, int var2) {
+ return this.entityDropItem(var1, var2, 0.0F);
+ }
+
+ public EntityItem entityDropItem(int var1, int var2, float var3) {
+ EntityItem var4 = new EntityItem(this.worldObj, this.posX, this.posY + (double)var3, this.posZ, new ItemStack(var1, var2));
+ var4.delayBeforeCanPickup = 10;
+ this.worldObj.spawnEntityInWorld(var4);
+ return var4;
+ }
+
+ public boolean isEntityAlive() {
+ return !this.isDead;
+ }
+
+ public boolean isEntityInsideOpaqueBlock() {
+ int var1 = MathHelper.floor_double(this.posX);
+ int var2 = MathHelper.floor_double(this.posY + (double)this.getEyeHeight());
+ int var3 = MathHelper.floor_double(this.posZ);
+ return this.worldObj.isBlockNormalCube(var1, var2, var3);
+ }
+
+ public boolean interact(EntityPlayer var1) {
+ return false;
+ }
+
+ public AxisAlignedBB getCollisionBox(Entity var1) {
+ return null;
+ }
+
+ public void updateRidden() {
+ if(this.ridingEntity.isDead) {
+ this.ridingEntity = null;
+ } else {
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.onUpdate();
+ this.setPosition(this.ridingEntity.posX, this.ridingEntity.posY + (double)this.yOffset + this.ridingEntity.getYOffset(), this.ridingEntity.posZ);
+ 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) {
+ }
+
+ while(this.entityRiderYawDelta < -180.0D) {
+ this.entityRiderYawDelta += 360.0D;
+ }
+
+ while(this.entityRiderPitchDelta >= 180.0D) {
+ this.entityRiderPitchDelta -= 360.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) {
+ var1 = (double)var5;
+ }
+
+ if(var1 < (double)(-var5)) {
+ var1 = (double)(-var5);
+ }
+
+ if(var3 > (double)var5) {
+ var3 = (double)var5;
+ }
+
+ if(var3 < (double)(-var5)) {
+ var3 = (double)(-var5);
+ }
+
+ this.entityRiderYawDelta -= var1;
+ this.entityRiderPitchDelta -= var3;
+ this.rotationYaw = (float)((double)this.rotationYaw + var1);
+ this.rotationPitch = (float)((double)this.rotationPitch + var3);
+ }
+ }
+
+ public double getYOffset() {
+ return (double)this.height * 0.75D;
+ }
+
+ public void mountEntity(Entity var1) {
+ this.entityRiderPitchDelta = 0.0D;
+ this.entityRiderYawDelta = 0.0D;
+ if(this.ridingEntity == var1) {
+ this.ridingEntity.riddenByEntity = null;
+ this.ridingEntity = null;
+ } else {
+ if(this.ridingEntity != null) {
+ this.ridingEntity.riddenByEntity = null;
+ }
+
+ if(var1.riddenByEntity != null) {
+ var1.riddenByEntity.ridingEntity = null;
+ }
+
+ this.ridingEntity = var1;
+ var1.riddenByEntity = this;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/EntityAnimal.java b/src/net/minecraft/src/EntityAnimal.java
new file mode 100644
index 0000000..ebf27f5
--- /dev/null
+++ b/src/net/minecraft/src/EntityAnimal.java
@@ -0,0 +1,23 @@
+package net.minecraft.src;
+
+public abstract class EntityAnimal extends EntityCreature {
+ public EntityAnimal(World var1) {
+ super(var1);
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID ? 10.0F : this.worldObj.getBrightness(var1, var2, var3) - 0.5F;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ return this.worldObj.getBlockLightValue(MathHelper.floor_double(var1), MathHelper.floor_double(var3), MathHelper.floor_double(var5)) > 8 && super.getCanSpawnHere(var1, var3, var5);
+ }
+}
diff --git a/src/net/minecraft/src/EntityArrow.java b/src/net/minecraft/src/EntityArrow.java
new file mode 100644
index 0000000..2417a82
--- /dev/null
+++ b/src/net/minecraft/src/EntityArrow.java
@@ -0,0 +1,217 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityArrow extends Entity {
+ private int xTile = -1;
+ private int yTile = -1;
+ private int zTile = -1;
+ private int inTile = 0;
+ private boolean inGround = false;
+ public int arrowShake = 0;
+ private EntityLiving shootingEntity;
+ private int ticksInGround;
+ private int ticksInAir = 0;
+
+ public EntityArrow(World var1) {
+ super(var1);
+ this.setSize(0.5F, 0.5F);
+ }
+
+ public EntityArrow(World var1, EntityLiving var2) {
+ super(var1);
+ this.shootingEntity = var2;
+ this.setSize(0.5F, 0.5F);
+ this.setPositionAndRotation(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch);
+ this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
+ this.posY -= (double)0.1F;
+ 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.setArrowHeading(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
+ }
+
+ public void setArrowHeading(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.rand.nextGaussian() * (double)0.0075F * (double)var8;
+ var3 += this.rand.nextGaussian() * (double)0.0075F * (double)var8;
+ var5 += this.rand.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));
+ this.ticksInGround = 0;
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ if(this.arrowShake > 0) {
+ --this.arrowShake;
+ }
+
+ if(this.inGround) {
+ int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
+ if(var1 == this.inTile) {
+ ++this.ticksInGround;
+ if(this.ticksInGround == 1200) {
+ this.setEntityDead();
+ }
+
+ return;
+ }
+
+ this.inGround = false;
+ 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;
+ }
+
+ Vec3D var15 = Vec3D.createVector(this.posX, this.posY, this.posZ);
+ Vec3D var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
+ MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2);
+ var15 = Vec3D.createVector(this.posX, this.posY, this.posZ);
+ var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
+ if(var3 != null) {
+ var2 = Vec3D.createVector(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;
+
+ float var10;
+ for(int var8 = 0; var8 < var5.size(); ++var8) {
+ Entity var9 = (Entity)var5.get(var8);
+ if(var9.canBeCollidedWith() && (var9 != this.shootingEntity || this.ticksInAir >= 5)) {
+ var10 = 0.3F;
+ AxisAlignedBB var11 = var9.boundingBox.expand((double)var10, (double)var10, (double)var10);
+ MovingObjectPosition var12 = var11.calculateIntercept(var15, var2);
+ if(var12 != null) {
+ double var13 = var15.distanceTo(var12.hitVec);
+ if(var13 < var6 || var6 == 0.0D) {
+ var4 = var9;
+ var6 = var13;
+ }
+ }
+ }
+ }
+
+ if(var4 != null) {
+ var3 = new MovingObjectPosition(var4);
+ }
+
+ float var16;
+ if(var3 != null) {
+ if(var3.entityHit != null) {
+ if(var3.entityHit.attackEntityFrom(this.shootingEntity, 4)) {
+ this.worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
+ this.setEntityDead();
+ } else {
+ this.motionX *= (double)-0.1F;
+ this.motionY *= (double)-0.1F;
+ this.motionZ *= (double)-0.1F;
+ this.rotationYaw += 180.0F;
+ this.prevRotationYaw += 180.0F;
+ this.ticksInAir = 0;
+ }
+ } else {
+ this.xTile = var3.blockX;
+ this.yTile = var3.blockY;
+ this.zTile = var3.blockZ;
+ this.inTile = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
+ this.motionX = (double)((float)(var3.hitVec.xCoord - this.posX));
+ this.motionY = (double)((float)(var3.hitVec.yCoord - this.posY));
+ this.motionZ = (double)((float)(var3.hitVec.zCoord - this.posZ));
+ var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
+ this.posX -= this.motionX / (double)var16 * (double)0.05F;
+ this.posY -= this.motionY / (double)var16 * (double)0.05F;
+ this.posZ -= this.motionZ / (double)var16 * (double)0.05F;
+ this.worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
+ this.inGround = true;
+ this.arrowShake = 7;
+ }
+ }
+
+ this.posX += this.motionX;
+ this.posY += this.motionY;
+ this.posZ += this.motionZ;
+ var16 = 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));
+
+ for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var16) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
+ }
+
+ while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
+ this.prevRotationYaw -= 360.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 = 0.99F;
+ var10 = 0.03F;
+ if(this.handleWaterMovement()) {
+ 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);
+ }
+
+ var17 = 0.8F;
+ }
+
+ this.motionX *= (double)var17;
+ this.motionY *= (double)var17;
+ this.motionZ *= (double)var17;
+ this.motionY -= (double)var10;
+ this.setPosition(this.posX, this.posY, this.posZ);
+ }
+
+ 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.arrowShake);
+ var1.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.arrowShake = var1.getByte("shake") & 255;
+ this.inGround = var1.getByte("inGround") == 1;
+ }
+
+ public void onCollideWithPlayer(EntityPlayer var1) {
+ if(this.inGround && this.shootingEntity == var1 && this.arrowShake <= 0 && var1.inventory.addItemStackToInventory(new ItemStack(Item.arrow.shiftedIndex, 1))) {
+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
+ var1.onItemPickup(this);
+ this.setEntityDead();
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityBubbleFX.java b/src/net/minecraft/src/EntityBubbleFX.java
new file mode 100644
index 0000000..e36404b
--- /dev/null
+++ b/src/net/minecraft/src/EntityBubbleFX.java
@@ -0,0 +1,36 @@
+package net.minecraft.src;
+
+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;
+ this.particleTextureIndex = 32;
+ this.setSize(0.02F, 0.02F);
+ this.particleScale *= this.rand.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.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
+ }
+
+ 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.setEntityDead();
+ }
+
+ if(this.particleMaxAge-- <= 0) {
+ this.setEntityDead();
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityCreature.java b/src/net/minecraft/src/EntityCreature.java
new file mode 100644
index 0000000..db340ed
--- /dev/null
+++ b/src/net/minecraft/src/EntityCreature.java
@@ -0,0 +1,125 @@
+package net.minecraft.src;
+
+public class EntityCreature extends EntityLiving {
+ private PathEntity pathToEntity;
+ protected Entity playerToAttack;
+ protected boolean hasAttacked = false;
+
+ public EntityCreature(World var1) {
+ super(var1);
+ }
+
+ protected boolean canEntityBeSeen(Entity var1) {
+ return this.worldObj.rayTraceBlocks(Vec3D.createVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), Vec3D.createVector(var1.posX, var1.posY + (double)var1.getEyeHeight(), var1.posZ)) == null;
+ }
+
+ protected void updatePlayerActionState() {
+ this.hasAttacked = false;
+ float var1 = 16.0F;
+ if(this.playerToAttack == null) {
+ this.playerToAttack = this.findPlayerToAttack();
+ if(this.playerToAttack != null) {
+ this.pathToEntity = this.worldObj.getPathToEntity(this, this.playerToAttack, var1);
+ }
+ } else if(!this.playerToAttack.isEntityAlive()) {
+ this.playerToAttack = null;
+ } else {
+ float var2 = this.playerToAttack.getDistanceToEntity(this);
+ if(this.canEntityBeSeen(this.playerToAttack)) {
+ this.attackEntity(this.playerToAttack, var2);
+ }
+ }
+
+ int var19;
+ if(this.hasAttacked || this.playerToAttack == null || this.pathToEntity != null && this.rand.nextInt(20) != 0) {
+ if(this.pathToEntity == null || this.rand.nextInt(100) == 0) {
+ var19 = -1;
+ int var3 = -1;
+ int var4 = -1;
+ float var5 = -99999.0F;
+
+ for(int var6 = 0; var6 < 50; ++var6) {
+ int var7 = MathHelper.floor_double(this.posX + (double)this.rand.nextInt(11) - 5.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(11) - 5.0D);
+ float var10 = this.getBlockPathWeight(var7, var8, var9);
+ if(var10 > var5) {
+ var5 = var10;
+ var19 = var7;
+ var3 = var8;
+ var4 = var9;
+ }
+ }
+
+ if(var19 > 0) {
+ this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var19, var3, var4, var1);
+ }
+ }
+ } else {
+ this.pathToEntity = this.worldObj.getPathToEntity(this, this.playerToAttack, var1);
+ }
+
+ var19 = MathHelper.floor_double(this.boundingBox.minY);
+ boolean var20 = this.handleWaterMovement();
+ boolean var21 = this.handleLavaMovement();
+ if(this.pathToEntity != null && this.rand.nextInt(100) != 0) {
+ Vec3D var22 = this.pathToEntity.getPosition(this);
+ float var23 = this.width * 2.0F;
+
+ while(var22 != null && var22.squareDistanceTo(this.posX, this.posY, this.posZ) < (double)(var23 * var23) && var22.yCoord <= (double)var19) {
+ this.pathToEntity.incrementPathIndex();
+ if(this.pathToEntity.isFinished()) {
+ var22 = null;
+ this.pathToEntity = null;
+ } else {
+ var22 = this.pathToEntity.getPosition(this);
+ }
+ }
+
+ this.isJumping = false;
+ if(var22 != null) {
+ double var24 = var22.xCoord - this.posX;
+ double var25 = var22.zCoord - this.posZ;
+ double var11 = var22.yCoord - (double)var19;
+ this.rotationYaw = (float)(Math.atan2(var25, var24) * 180.0D / (double)((float)Math.PI)) - 90.0F;
+ this.moveForward = this.moveSpeed;
+ if(this.hasAttacked && this.playerToAttack != null) {
+ double var13 = this.playerToAttack.posX - this.posX;
+ double var15 = this.playerToAttack.posZ - this.posZ;
+ float var17 = this.rotationYaw;
+ this.rotationYaw = (float)(Math.atan2(var15, var13) * 180.0D / (double)((float)Math.PI)) - 90.0F;
+ float var18 = (var17 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F;
+ this.moveStrafing = -MathHelper.sin(var18) * this.moveForward * 1.0F;
+ this.moveForward = MathHelper.cos(var18) * this.moveForward * 1.0F;
+ }
+
+ if(var11 != 0.0D) {
+ this.isJumping = true;
+ }
+ }
+
+ if(this.rand.nextFloat() < 0.8F && (var20 || var21)) {
+ this.isJumping = true;
+ }
+
+ } else {
+ super.updatePlayerActionState();
+ this.pathToEntity = null;
+ }
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return 0.0F;
+ }
+
+ protected Entity findPlayerToAttack() {
+ return null;
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ return super.getCanSpawnHere(var1, var3, var5) && this.getBlockPathWeight((int)var1, (int)var3, (int)var5) >= 0.0F;
+ }
+}
diff --git a/src/net/minecraft/src/EntityCreeper.java b/src/net/minecraft/src/EntityCreeper.java
new file mode 100644
index 0000000..28dfe5f
--- /dev/null
+++ b/src/net/minecraft/src/EntityCreeper.java
@@ -0,0 +1,64 @@
+package net.minecraft.src;
+
+public class EntityCreeper extends EntityMonster {
+ int timeSinceIgnited;
+ int lastActiveTime;
+ int fuseTime = 30;
+ int creeperState = -1;
+
+ public EntityCreeper(World var1) {
+ super(var1);
+ this.texture = "/mob/creeper.png";
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ protected void updatePlayerActionState() {
+ this.lastActiveTime = this.timeSinceIgnited;
+ if(this.timeSinceIgnited > 0 && this.creeperState < 0) {
+ --this.timeSinceIgnited;
+ }
+
+ if(this.creeperState >= 0) {
+ this.creeperState = 2;
+ }
+
+ super.updatePlayerActionState();
+ if(this.creeperState != 1) {
+ this.creeperState = -1;
+ }
+
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ if(this.creeperState <= 0 && var2 < 3.0F || this.creeperState > 0 && var2 < 7.0F) {
+ if(this.timeSinceIgnited == 0) {
+ this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 0.5F);
+ }
+
+ this.creeperState = 1;
+ ++this.timeSinceIgnited;
+ if(this.timeSinceIgnited == this.fuseTime) {
+ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3.0F);
+ this.setEntityDead();
+ }
+
+ this.hasAttacked = true;
+ }
+
+ }
+
+ public float setCreeperFlashTime(float var1) {
+ return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * var1) / (float)(this.fuseTime - 2);
+ }
+
+ protected int getDropItemId() {
+ return Item.gunpowder.shiftedIndex;
+ }
+}
diff --git a/src/net/minecraft/src/EntityDiggingFX.java b/src/net/minecraft/src/EntityDiggingFX.java
new file mode 100644
index 0000000..ddc26fb
--- /dev/null
+++ b/src/net/minecraft/src/EntityDiggingFX.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+public class EntityDiggingFX extends EntityFX {
+ public EntityDiggingFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, Block var14) {
+ super(var1, var2, var4, var6, var8, var10, var12);
+ this.particleTextureIndex = var14.blockIndexInTexture;
+ this.particleGravity = var14.blockParticleGravity;
+ this.particleRed = this.particleGreen = this.particleBlue = 0.6F;
+ this.particleScale /= 2.0F;
+ }
+
+ public int getFXLayer() {
+ return 1;
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ float var8 = ((float)(this.particleTextureIndex % 16) + this.particleTextureJitterX / 4.0F) / 16.0F;
+ float var9 = var8 + 0.999F / 64.0F;
+ float var10 = ((float)(this.particleTextureIndex / 16) + this.particleTextureJitterY / 4.0F) / 16.0F;
+ float var11 = var10 + 0.999F / 64.0F;
+ float var12 = 0.1F * this.particleScale;
+ 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 var16 = this.getEntityBrightness(var2);
+ 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);
+ }
+}
diff --git a/src/net/minecraft/src/EntityExplodeFX.java b/src/net/minecraft/src/EntityExplodeFX.java
new file mode 100644
index 0000000..e6ed054
--- /dev/null
+++ b/src/net/minecraft/src/EntityExplodeFX.java
@@ -0,0 +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.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;
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ this.particleTextureIndex = 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;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityFX.java b/src/net/minecraft/src/EntityFX.java
new file mode 100644
index 0000000..9809da0
--- /dev/null
+++ b/src/net/minecraft/src/EntityFX.java
@@ -0,0 +1,99 @@
+package net.minecraft.src;
+
+public class EntityFX extends Entity {
+ protected int particleTextureIndex;
+ protected float particleTextureJitterX;
+ protected float particleTextureJitterY;
+ protected int particleAge = 0;
+ protected int particleMaxAge = 0;
+ protected float particleScale;
+ protected float particleGravity;
+ protected float particleRed;
+ protected float particleGreen;
+ protected float particleBlue;
+ public static double interpPosX;
+ public static double interpPosY;
+ public static double interpPosZ;
+
+ public EntityFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) {
+ super(var1);
+ this.setSize(0.2F, 0.2F);
+ this.yOffset = this.height / 2.0F;
+ this.setPosition(var2, var4, var6);
+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
+ 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);
+ 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;
+ 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;
+ this.canTriggerWalking = false;
+ }
+
+ 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 onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ 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;
+ }
+
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ float var8 = (float)(this.particleTextureIndex % 16) / 16.0F;
+ float var9 = var8 + 0.999F / 16.0F;
+ float var10 = (float)(this.particleTextureIndex / 16) / 16.0F;
+ float var11 = var10 + 0.999F / 16.0F;
+ float var12 = 0.1F * this.particleScale;
+ 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 var16 = this.getEntityBrightness(var2);
+ var1.setColorOpaque_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16);
+ 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);
+ }
+
+ public int getFXLayer() {
+ return 0;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ }
+}
diff --git a/src/net/minecraft/src/EntityFallingSand.java b/src/net/minecraft/src/EntityFallingSand.java
new file mode 100644
index 0000000..4dc1c13
--- /dev/null
+++ b/src/net/minecraft/src/EntityFallingSand.java
@@ -0,0 +1,78 @@
+package net.minecraft.src;
+
+public class EntityFallingSand extends Entity {
+ public int blockID;
+ public int fallTime = 0;
+
+ public EntityFallingSand(World var1) {
+ super(var1);
+ }
+
+ public EntityFallingSand(World var1, float var2, float var3, float var4, int var5) {
+ super(var1);
+ this.blockID = var5;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.98F);
+ this.yOffset = this.height / 2.0F;
+ this.setPosition((double)var2, (double)var3, (double)var4);
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.canTriggerWalking = false;
+ this.prevPosX = (double)var2;
+ this.prevPosY = (double)var3;
+ this.prevPosZ = (double)var4;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public void onUpdate() {
+ if(this.blockID == 0) {
+ this.setEntityDead();
+ } else {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ ++this.fallTime;
+ this.motionY -= (double)0.04F;
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= (double)0.98F;
+ this.motionY *= (double)0.98F;
+ this.motionZ *= (double)0.98F;
+ 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) == this.blockID) {
+ this.worldObj.setBlockWithNotify(var1, var2, var3, 0);
+ }
+
+ if(this.onGround) {
+ this.motionX *= (double)0.7F;
+ this.motionZ *= (double)0.7F;
+ this.motionY *= -0.5D;
+ this.setEntityDead();
+ if(!this.worldObj.canBlockBePlacedAt(this.blockID, var1, var2, var3, true) || !this.worldObj.setBlockWithNotify(var1, var2, var3, this.blockID)) {
+ this.dropItem(this.blockID, 1);
+ }
+ } else if(this.fallTime > 100) {
+ this.dropItem(this.blockID, 1);
+ this.setEntityDead();
+ }
+
+ }
+ }
+
+ protected void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setByte("Tile", (byte)this.blockID);
+ }
+
+ protected void readEntityFromNBT(NBTTagCompound var1) {
+ this.blockID = var1.getByte("Tile") & 255;
+ }
+
+ public World getWorld() {
+ return this.worldObj;
+ }
+}
diff --git a/src/net/minecraft/src/EntityFlameFX.java b/src/net/minecraft/src/EntityFlameFX.java
new file mode 100644
index 0000000..192090a
--- /dev/null
+++ b/src/net/minecraft/src/EntityFlameFX.java
@@ -0,0 +1,59 @@
+package net.minecraft.src;
+
+public class EntityFlameFX extends EntityFX {
+ 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.rand.nextFloat() - this.rand.nextFloat()) * 0.05F);
+ var10000 = var4 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F);
+ var10000 = var6 + (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;
+ this.noClip = true;
+ this.particleTextureIndex = 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;
+ this.particleScale = this.flameScale * (1.0F - var8 * var8 * 0.5F);
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public float getEntityBrightness(float var1) {
+ float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge;
+ if(var2 < 0.0F) {
+ var2 = 0.0F;
+ }
+
+ if(var2 > 1.0F) {
+ var2 = 1.0F;
+ }
+
+ float var3 = super.getEntityBrightness(var1);
+ return var3 * var2 + (1.0F - var2);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ 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;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityGiant.java b/src/net/minecraft/src/EntityGiant.java
new file mode 100644
index 0000000..115d51d
--- /dev/null
+++ b/src/net/minecraft/src/EntityGiant.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class EntityGiant extends EntityMonster {
+ public EntityGiant(World var1) {
+ super(var1);
+ this.texture = "/mob/zombie.png";
+ this.moveSpeed = 0.5F;
+ this.attackStrength = 50;
+ this.health *= 10;
+ this.yOffset *= 6.0F;
+ this.setSize(this.width * 6.0F, this.height * 6.0F);
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return this.worldObj.getBrightness(var1, var2, var3) - 0.5F;
+ }
+}
diff --git a/src/net/minecraft/src/EntityItem.java b/src/net/minecraft/src/EntityItem.java
new file mode 100644
index 0000000..785a54e
--- /dev/null
+++ b/src/net/minecraft/src/EntityItem.java
@@ -0,0 +1,180 @@
+package net.minecraft.src;
+
+public class EntityItem extends Entity {
+ public ItemStack item;
+ private int age2;
+ public int age = 0;
+ public int delayBeforeCanPickup;
+ private int health = 5;
+ public float hoverStart = (float)(Math.random() * Math.PI * 2.0D);
+
+ public EntityItem(World var1, double var2, double var4, double var6, ItemStack var8) {
+ super(var1);
+ this.setSize(0.25F, 0.25F);
+ this.yOffset = this.height / 2.0F;
+ this.setPosition(var2, var4, var6);
+ this.item = var8;
+ 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));
+ this.canTriggerWalking = false;
+ }
+
+ public EntityItem(World var1) {
+ super(var1);
+ this.setSize(0.25F, 0.25F);
+ this.yOffset = this.height / 2.0F;
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ if(this.delayBeforeCanPickup > 0) {
+ --this.delayBeforeCanPickup;
+ }
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= (double)0.04F;
+ 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.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
+ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
+ this.worldObj.playSoundAtEntity(this, "random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
+ }
+
+ this.pushOutOfBlocks(this.posX, this.posY, this.posZ);
+ this.handleWaterMovement();
+ 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.motionY *= -0.5D;
+ }
+
+ ++this.age2;
+ ++this.age;
+ if(this.age >= 6000) {
+ this.setEntityDead();
+ }
+
+ }
+
+ public boolean handleWaterMovement() {
+ return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this);
+ }
+
+ private 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;
+ if(Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8, var9)]) {
+ boolean var16 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7 - 1, var8, var9)];
+ boolean var17 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7 + 1, var8, var9)];
+ boolean var18 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8 - 1, var9)];
+ boolean var19 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8 + 1, var9)];
+ boolean var20 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8, var9 - 1)];
+ boolean var21 = !Block.opaqueCubeLookup[this.worldObj.getBlockId(var7, var8, var9 + 1)];
+ byte var22 = -1;
+ double var23 = 9999.0D;
+ if(var16 && var10 < var23) {
+ var23 = var10;
+ var22 = 0;
+ }
+
+ if(var17 && 1.0D - var10 < var23) {
+ var23 = 1.0D - var10;
+ var22 = 1;
+ }
+
+ if(var18 && var12 < var23) {
+ var23 = var12;
+ var22 = 2;
+ }
+
+ if(var19 && 1.0D - var12 < var23) {
+ var23 = 1.0D - var12;
+ var22 = 3;
+ }
+
+ if(var20 && var14 < var23) {
+ var23 = var14;
+ var22 = 4;
+ }
+
+ if(var21 && 1.0D - var14 < var23) {
+ var23 = 1.0D - var14;
+ var22 = 5;
+ }
+
+ float var25 = this.rand.nextFloat() * 0.2F + 0.1F;
+ if(var22 == 0) {
+ this.motionX = (double)(-var25);
+ }
+
+ if(var22 == 1) {
+ this.motionX = (double)var25;
+ }
+
+ if(var22 == 2) {
+ this.motionY = (double)(-var25);
+ }
+
+ if(var22 == 3) {
+ this.motionY = (double)var25;
+ }
+
+ if(var22 == 4) {
+ this.motionZ = (double)(-var25);
+ }
+
+ if(var22 == 5) {
+ this.motionZ = (double)var25;
+ }
+ }
+
+ return false;
+ }
+
+ protected void dealFireDamage(int var1) {
+ this.attackEntityFrom((Entity)null, var1);
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.health -= var2;
+ if(this.health <= 0) {
+ this.setEntityDead();
+ }
+
+ return false;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setShort("Health", (short)((byte)this.health));
+ var1.setShort("Age", (short)this.age);
+ var1.setCompoundTag("Item", this.item.writeToNBT(new NBTTagCompound()));
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ this.health = var1.getShort("Health") & 255;
+ this.age = var1.getShort("Age");
+ NBTTagCompound var2 = var1.getCompoundTag("Item");
+ this.item = new ItemStack(var2);
+ }
+
+ public void onCollideWithPlayer(EntityPlayer var1) {
+ if(this.delayBeforeCanPickup == 0 && var1.inventory.addItemStackToInventory(this.item)) {
+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
+ var1.onItemPickup(this);
+ this.setEntityDead();
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityLavaFX.java b/src/net/minecraft/src/EntityLavaFX.java
new file mode 100644
index 0000000..f6b735f
--- /dev/null
+++ b/src/net/minecraft/src/EntityLavaFX.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+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.rand.nextFloat() * 0.4F + 0.05F);
+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
+ 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.particleTextureIndex = 49;
+ }
+
+ public float getEntityBrightness(float var1) {
+ 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;
+ this.particleScale = this.lavaParticleScale * (1.0F - var8 * var8);
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ float var1 = (float)this.particleAge / (float)this.particleMaxAge;
+ 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;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityList.java b/src/net/minecraft/src/EntityList.java
new file mode 100644
index 0000000..0d673ef
--- /dev/null
+++ b/src/net/minecraft/src/EntityList.java
@@ -0,0 +1,72 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class EntityList {
+ private static Map stringToClassMapping = new HashMap();
+ private static Map classToStringMapping = new HashMap();
+
+ private static void addMapping(Class var0, String var1) {
+ stringToClassMapping.put(var1, var0);
+ classToStringMapping.put(var0, var1);
+ }
+
+ public static Entity createEntityInWorld(String var0, World var1) {
+ Entity var2 = null;
+
+ try {
+ Class var3 = (Class)stringToClassMapping.get(var0);
+ if(var3 != null) {
+ var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
+ }
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ }
+
+ return var2;
+ }
+
+ public static Entity createEntityFromNBT(NBTTagCompound var0, World var1) {
+ Entity var2 = null;
+
+ try {
+ Class var3 = (Class)stringToClassMapping.get(var0.getString("id"));
+ if(var3 != null) {
+ var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
+ }
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ }
+
+ if(var2 != null) {
+ var2.readFromNBT(var0);
+ } else {
+ System.out.println("Skipping Entity with id " + var0.getString("id"));
+ }
+
+ return var2;
+ }
+
+ public static String getEntityString(Entity var0) {
+ return (String)classToStringMapping.get(var0.getClass());
+ }
+
+ static {
+ addMapping(EntityArrow.class, "Arrow");
+ addMapping(EntityItem.class, "Item");
+ addMapping(EntityPainting.class, "Painting");
+ addMapping(EntityLiving.class, "Mob");
+ addMapping(EntityMonster.class, "Monster");
+ addMapping(EntityCreeper.class, "Creeper");
+ addMapping(EntitySkeleton.class, "Skeleton");
+ addMapping(EntitySpider.class, "Spider");
+ addMapping(EntityGiant.class, "Giant");
+ addMapping(EntityZombie.class, "Zombie");
+ addMapping(EntityPig.class, "Pig");
+ addMapping(EntitySheep.class, "Sheep");
+ addMapping(EntityTNTPrimed.class, "PrimedTnt");
+ addMapping(EntityFallingSand.class, "FallingSand");
+ addMapping(EntityMinecart.class, "Minecart");
+ }
+}
diff --git a/src/net/minecraft/src/EntityLiving.java b/src/net/minecraft/src/EntityLiving.java
new file mode 100644
index 0000000..09a9db0
--- /dev/null
+++ b/src/net/minecraft/src/EntityLiving.java
@@ -0,0 +1,548 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityLiving extends Entity {
+ public int heartsHalvesLife = 20;
+ public float unusedRotationPitch2;
+ public float unusedFloat;
+ public float unusedRotationPitch;
+ public float renderYawOffset = 0.0F;
+ public float prevRenderYawOffset = 0.0F;
+ protected float ridingRotUnused;
+ protected float prevRidingRotUnused;
+ protected float rotationUnused;
+ protected float prevRotationUnused;
+ protected boolean unusedBool1 = true;
+ protected String texture = "/char.png";
+ protected boolean unusedBool2 = true;
+ protected float unusedRotation = 0.0F;
+ protected String entityType = null;
+ protected float unusedFloat1 = 1.0F;
+ protected int scoreValue = 0;
+ protected float unusedFloat2 = 0.0F;
+ public int health = 10;
+ public int prevHealth;
+ private int livingSoundTime;
+ public int hurtTime;
+ public int maxHurtTime;
+ public float attackedAtYaw = 0.0F;
+ public int deathTime = 0;
+ public int attackTime = 0;
+ public float prevCameraPitch;
+ public float cameraPitch;
+ protected boolean dead = false;
+ public int unusedInt = -1;
+ public float unusedFloat4 = (float)(Math.random() * (double)0.9F + (double)0.1F);
+ public float prevLimbYaw;
+ public float limbYaw;
+ public float limbSwing;
+ protected int entityAge = 0;
+ protected float moveStrafing;
+ protected float moveForward;
+ protected float randomYawVelocity;
+ protected boolean isJumping = false;
+ protected float defaultPitch = 0.0F;
+ protected float moveSpeed = 0.7F;
+
+ public EntityLiving(World var1) {
+ super(var1);
+ this.preventEntitySpawning = true;
+ this.unusedRotationPitch = (float)(Math.random() + 1.0D) * 0.01F;
+ this.setPosition(this.posX, this.posY, this.posZ);
+ this.unusedRotationPitch2 = (float)Math.random() * 12398.0F;
+ this.rotationYaw = (float)(Math.random() * (double)((float)Math.PI) * 2.0D);
+ this.unusedFloat = 1.0F;
+ this.stepHeight = 0.5F;
+ }
+
+ public String getTexture() {
+ return this.texture;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public boolean canBePushed() {
+ return !this.isDead;
+ }
+
+ protected float getEyeHeight() {
+ return this.height * 0.85F;
+ }
+
+ public void onEntityUpdate() {
+ super.onEntityUpdate();
+ if(this.rand.nextInt(1000) < this.livingSoundTime++) {
+ this.livingSoundTime = -80;
+ String var1 = this.getLivingSound();
+ if(var1 != null) {
+ this.worldObj.playSoundAtEntity(this, var1, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
+ }
+
+ if(this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) {
+ this.attackEntityFrom((Entity)null, 1);
+ }
+
+ int var8;
+ if(this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) {
+ --this.air;
+ if(this.air == -20) {
+ this.air = 0;
+
+ for(var8 = 0; var8 < 8; ++var8) {
+ float var2 = this.rand.nextFloat() - this.rand.nextFloat();
+ float var3 = this.rand.nextFloat() - this.rand.nextFloat();
+ float var4 = this.rand.nextFloat() - this.rand.nextFloat();
+ this.worldObj.spawnParticle("bubble", this.posX + (double)var2, this.posY + (double)var3, this.posZ + (double)var4, this.motionX, this.motionY, this.motionZ);
+ }
+
+ this.attackEntityFrom((Entity)null, 2);
+ }
+
+ this.fire = 0;
+ } else {
+ this.air = this.maxAir;
+ }
+
+ this.prevCameraPitch = this.cameraPitch;
+ if(this.attackTime > 0) {
+ --this.attackTime;
+ }
+
+ if(this.hurtTime > 0) {
+ --this.hurtTime;
+ }
+
+ if(this.heartsLife > 0) {
+ --this.heartsLife;
+ }
+
+ if(this.health <= 0) {
+ ++this.deathTime;
+ if(this.deathTime > 20) {
+ this.onEntityDeath();
+ this.setEntityDead();
+
+ for(var8 = 0; var8 < 20; ++var8) {
+ double var9 = this.rand.nextGaussian() * 0.02D;
+ double var10 = 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, var9, var10, var6);
+ }
+ }
+ }
+
+ this.prevRotationUnused = this.rotationUnused;
+ this.prevRenderYawOffset = this.renderYawOffset;
+ this.prevRotationYaw = this.rotationYaw;
+ this.prevRotationPitch = this.rotationPitch;
+ }
+
+ public void spawnExplosionParticle() {
+ 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.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);
+ }
+
+ }
+
+ public void updateRidden() {
+ super.updateRidden();
+ this.ridingRotUnused = this.prevRidingRotUnused;
+ this.prevRidingRotUnused = 0.0F;
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ this.onLivingUpdate();
+ double var1 = this.posX - this.prevPosX;
+ double var3 = this.posZ - this.prevPosZ;
+ float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3);
+ float var6 = this.renderYawOffset;
+ float var7 = 0.0F;
+ this.ridingRotUnused = this.prevRidingRotUnused;
+ float var8 = 0.0F;
+ if(var5 > 0.05F) {
+ var8 = 1.0F;
+ var7 = var5 * 3.0F;
+ var6 = (float)Math.atan2(var3, var1) * 180.0F / (float)Math.PI - 90.0F;
+ }
+
+ if(!this.onGround) {
+ var8 = 0.0F;
+ }
+
+ this.prevRidingRotUnused += (var8 - this.prevRidingRotUnused) * 0.3F;
+
+ float var9;
+ for(var9 = var6 - this.renderYawOffset; var9 < -180.0F; var9 += 360.0F) {
+ }
+
+ while(var9 >= 180.0F) {
+ var9 -= 360.0F;
+ }
+
+ this.renderYawOffset += var9 * 0.1F;
+
+ float var10;
+ for(var10 = this.rotationYaw - this.renderYawOffset; var10 < -180.0F; var10 += 360.0F) {
+ }
+
+ while(var10 >= 180.0F) {
+ var10 -= 360.0F;
+ }
+
+ boolean var11 = var10 < -90.0F || var10 >= 90.0F;
+ if(var10 < -75.0F) {
+ var10 = -75.0F;
+ }
+
+ if(var10 >= 75.0F) {
+ var10 = 75.0F;
+ }
+
+ this.renderYawOffset = this.rotationYaw - var10;
+ this.renderYawOffset += var10 * 0.1F;
+ if(var11) {
+ var7 *= -1.0F;
+ }
+
+ while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ while(this.renderYawOffset - this.prevRenderYawOffset < -180.0F) {
+ this.prevRenderYawOffset -= 360.0F;
+ }
+
+ while(this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) {
+ this.prevRenderYawOffset += 360.0F;
+ }
+
+ while(this.rotationPitch - this.prevRotationPitch < -180.0F) {
+ this.prevRotationPitch -= 360.0F;
+ }
+
+ while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ this.rotationUnused += var7;
+ }
+
+ protected void setSize(float var1, float var2) {
+ super.setSize(var1, var2);
+ }
+
+ public void heal(int var1) {
+ if(this.health > 0) {
+ this.health += var1;
+ if(this.health > 20) {
+ this.health = 20;
+ }
+
+ this.heartsLife = this.heartsHalvesLife / 2;
+ }
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.entityAge = 0;
+ if(this.health <= 0) {
+ return false;
+ } else {
+ this.limbYaw = 1.5F;
+ if((float)this.heartsLife > (float)this.heartsHalvesLife / 2.0F) {
+ if(this.prevHealth - var2 >= this.health) {
+ return false;
+ }
+
+ this.health = this.prevHealth - var2;
+ } else {
+ this.prevHealth = this.health;
+ this.heartsLife = this.heartsHalvesLife;
+ this.health -= var2;
+ this.hurtTime = this.maxHurtTime = 10;
+ }
+
+ this.attackedAtYaw = 0.0F;
+ if(var1 != null) {
+ double var3 = var1.posX - this.posX;
+
+ double var5;
+ for(var5 = var1.posZ - this.posZ; var3 * var3 + var5 * var5 < 1.0E-4D; var5 = (Math.random() - Math.random()) * 0.01D) {
+ var3 = (Math.random() - Math.random()) * 0.01D;
+ }
+
+ this.attackedAtYaw = (float)(Math.atan2(var5, var3) * 180.0D / (double)((float)Math.PI)) - this.rotationYaw;
+ this.knockBack(var1, var2, var3, var5);
+ } else {
+ this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180);
+ }
+
+ if(this.health <= 0) {
+ this.worldObj.playSoundAtEntity(this, this.getDeathSound(), 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ this.onDeath(var1);
+ } else {
+ this.worldObj.playSoundAtEntity(this, this.getHurtSound(), 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
+
+ return true;
+ }
+ }
+
+ protected String getLivingSound() {
+ return null;
+ }
+
+ protected String getHurtSound() {
+ return "random.hurt";
+ }
+
+ protected String getDeathSound() {
+ return "random.hurt";
+ }
+
+ public void knockBack(Entity var1, int var2, double var3, double var5) {
+ float var7 = MathHelper.sqrt_double(var3 * var3 + var5 * var5);
+ float var8 = 0.4F;
+ this.motionX /= 2.0D;
+ this.motionY /= 2.0D;
+ this.motionZ /= 2.0D;
+ this.motionX -= var3 / (double)var7 * (double)var8;
+ this.motionY += (double)0.4F;
+ this.motionZ -= var5 / (double)var7 * (double)var8;
+ if(this.motionY > (double)0.4F) {
+ this.motionY = (double)0.4F;
+ }
+
+ }
+
+ public void onDeath(Entity var1) {
+ if(this.scoreValue > 0 && var1 != null) {
+ var1.addToPlayerScore(this, this.scoreValue);
+ }
+
+ this.dead = true;
+ int var2 = this.getDropItemId();
+ if(var2 > 0) {
+ int var3 = this.rand.nextInt(3);
+
+ for(int var4 = 0; var4 < var3; ++var4) {
+ this.dropItem(var2, 1);
+ }
+ }
+
+ }
+
+ protected int getDropItemId() {
+ return 0;
+ }
+
+ protected void fall(float var1) {
+ int var2 = (int)Math.ceil((double)(var1 - 3.0F));
+ if(var2 > 0) {
+ this.attackEntityFrom((Entity)null, var2);
+ int var3 = 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(var3 > 0) {
+ StepSound var4 = Block.blocksList[var3].stepSound;
+ this.worldObj.playSoundAtEntity(this, var4.getStepSound(), var4.getVolume() * 0.5F, var4.getPitch() * (12.0F / 16.0F));
+ }
+ }
+
+ }
+
+ public void moveEntityWithHeading(float var1, float var2) {
+ double var3;
+ if(this.handleWaterMovement()) {
+ var3 = this.posY;
+ this.moveFlying(var1, var2, 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;
+ 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;
+ }
+ } else if(this.handleLavaMovement()) {
+ 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;
+ }
+ } else {
+ this.moveFlying(var1, var2, this.onGround ? 0.1F : 0.02F);
+ if(this.isOnLadder()) {
+ this.fallDistance = 0.0F;
+ if(this.motionY < -0.15D) {
+ this.motionY = -0.15D;
+ }
+ }
+
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ if(this.isCollidedHorizontally && this.isOnLadder()) {
+ this.motionY = 0.2D;
+ }
+
+ this.motionX *= (double)0.91F;
+ this.motionY *= (double)0.98F;
+ this.motionZ *= (double)0.91F;
+ this.motionY -= 0.08D;
+ if(this.onGround) {
+ float var8 = 0.6F;
+ this.motionX *= (double)var8;
+ this.motionZ *= (double)var8;
+ }
+ }
+
+ this.prevLimbYaw = this.limbYaw;
+ var3 = this.posX - this.prevPosX;
+ double var5 = this.posZ - this.prevPosZ;
+ float var7 = MathHelper.sqrt_double(var3 * var3 + var5 * var5) * 4.0F;
+ if(var7 > 1.0F) {
+ var7 = 1.0F;
+ }
+
+ this.limbYaw += (var7 - this.limbYaw) * 0.4F;
+ this.limbSwing += this.limbYaw;
+ }
+
+ public boolean isOnLadder() {
+ int var1 = MathHelper.floor_double(this.posX);
+ int var2 = MathHelper.floor_double(this.boundingBox.minY);
+ int var3 = MathHelper.floor_double(this.posZ);
+ return this.worldObj.getBlockId(var1, var2, var3) == Block.ladder.blockID || this.worldObj.getBlockId(var1, var2 + 1, var3) == Block.ladder.blockID;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setShort("Health", (short)this.health);
+ var1.setShort("HurtTime", (short)this.hurtTime);
+ var1.setShort("DeathTime", (short)this.deathTime);
+ var1.setShort("AttackTime", (short)this.attackTime);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ this.health = var1.getShort("Health");
+ if(!var1.hasKey("Health")) {
+ this.health = 10;
+ }
+
+ this.hurtTime = var1.getShort("HurtTime");
+ this.deathTime = var1.getShort("DeathTime");
+ this.attackTime = var1.getShort("AttackTime");
+ }
+
+ public boolean isEntityAlive() {
+ return !this.isDead && this.health > 0;
+ }
+
+ public void onLivingUpdate() {
+ ++this.entityAge;
+ Entity var1 = this.worldObj.getPlayerEntity();
+ 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(var8 > 16384.0D) {
+ this.setEntityDead();
+ }
+
+ if(this.entityAge > 600 && this.rand.nextInt(800) == 0) {
+ if(var8 < 1024.0D) {
+ this.entityAge = 0;
+ } else {
+ this.setEntityDead();
+ }
+ }
+ }
+
+ if(this.health <= 0) {
+ this.isJumping = false;
+ this.moveStrafing = 0.0F;
+ this.moveForward = 0.0F;
+ this.randomYawVelocity = 0.0F;
+ } else {
+ this.updatePlayerActionState();
+ }
+
+ boolean var10 = this.handleWaterMovement();
+ boolean var3 = this.handleLavaMovement();
+ if(this.isJumping) {
+ if(var10) {
+ this.motionY += (double)0.04F;
+ } else if(var3) {
+ this.motionY += (double)0.04F;
+ } else if(this.onGround) {
+ this.jump();
+ }
+ }
+
+ this.moveStrafing *= 0.98F;
+ this.moveForward *= 0.98F;
+ this.randomYawVelocity *= 0.9F;
+ this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
+ List var11 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F));
+ if(var11 != null && var11.size() > 0) {
+ for(int var5 = 0; var5 < var11.size(); ++var5) {
+ Entity var12 = (Entity)var11.get(var5);
+ if(var12.canBePushed()) {
+ var12.applyEntityCollision(this);
+ }
+ }
+ }
+
+ }
+
+ protected void jump() {
+ this.motionY = (double)0.42F;
+ }
+
+ protected void updatePlayerActionState() {
+ if(this.rand.nextFloat() < 0.07F) {
+ this.moveStrafing = (this.rand.nextFloat() - 0.5F) * this.moveSpeed;
+ this.moveForward = this.rand.nextFloat() * this.moveSpeed;
+ }
+
+ this.isJumping = this.rand.nextFloat() < 0.01F;
+ if(this.rand.nextFloat() < 0.04F) {
+ this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 60.0F;
+ }
+
+ this.rotationYaw += this.randomYawVelocity;
+ this.rotationPitch = this.defaultPitch;
+ boolean var1 = this.handleWaterMovement();
+ boolean var2 = this.handleLavaMovement();
+ if(var1 || var2) {
+ this.isJumping = this.rand.nextFloat() < 0.8F;
+ }
+
+ }
+
+ public void onEntityDeath() {
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ this.setPosition(var1, var3 + (double)(this.height / 2.0F), var5);
+ return this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.getIsAnyLiquid(this.boundingBox);
+ }
+
+ protected void kill() {
+ this.attackEntityFrom((Entity)null, 4);
+ }
+}
diff --git a/src/net/minecraft/src/EntityMinecart.java b/src/net/minecraft/src/EntityMinecart.java
new file mode 100644
index 0000000..34926bb
--- /dev/null
+++ b/src/net/minecraft/src/EntityMinecart.java
@@ -0,0 +1,520 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityMinecart extends Entity implements IInventory {
+ private ItemStack[] cargoItems;
+ public int damageTaken;
+ public int timeSinceHit;
+ public int forwardDirection;
+ private boolean isInReverse;
+ 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}}};
+
+ public EntityMinecart(World var1) {
+ super(var1);
+ this.cargoItems = new ItemStack[36];
+ this.damageTaken = 0;
+ this.timeSinceHit = 0;
+ this.forwardDirection = 1;
+ this.isInReverse = false;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.7F);
+ this.yOffset = this.height / 2.0F;
+ this.canTriggerWalking = false;
+ }
+
+ public AxisAlignedBB getCollisionBox(Entity var1) {
+ return var1.boundingBox;
+ }
+
+ public AxisAlignedBB getBoundingBox() {
+ return this.boundingBox;
+ }
+
+ public boolean canBePushed() {
+ return true;
+ }
+
+ public EntityMinecart(World var1, double var2, double var4, double var6) {
+ this(var1);
+ this.setPosition(var2, var4 + (double)this.yOffset, var6);
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.prevPosX = var2;
+ this.prevPosY = var4;
+ this.prevPosZ = var6;
+ }
+
+ public double getYOffset() {
+ return (double)this.height * 0.2D;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.forwardDirection = -this.forwardDirection;
+ this.timeSinceHit = 10;
+ this.damageTaken += var2 * 10;
+ if(this.damageTaken > 40) {
+ this.entityDropItem(Item.minecart.shiftedIndex, 1, 0.0F);
+ this.setEntityDead();
+ }
+
+ return true;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public void setEntityDead() {
+ for(int var1 = 0; var1 < this.getSizeInventory(); ++var1) {
+ ItemStack var2 = this.getStackInSlot(var1);
+ 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.itemDmg));
+ float var8 = 0.05F;
+ 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);
+ }
+ }
+ }
+
+ super.setEntityDead();
+ }
+
+ public void onUpdate() {
+ if(this.timeSinceHit > 0) {
+ --this.timeSinceHit;
+ }
+
+ if(this.damageTaken > 0) {
+ --this.damageTaken;
+ }
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= (double)0.04F;
+ 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 - 1, var3) == Block.minecartTrack.blockID) {
+ --var2;
+ }
+
+ double var4 = 0.4D;
+ double var6 = 1.0D / 128.0D;
+ if(this.worldObj.getBlockId(var1, var2, var3) == Block.minecartTrack.blockID) {
+ Vec3D var8 = this.getPos(this.posX, this.posY, this.posZ);
+ int var9 = this.worldObj.getBlockMetadata(var1, var2, var3);
+ this.posY = (double)var2;
+ 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[][] var10 = matrix[var9];
+ double var11 = (double)(var10[1][0] - var10[0][0]);
+ double var13 = (double)(var10[1][2] - var10[0][2]);
+ double var15 = Math.sqrt(var11 * var11 + var13 * var13);
+ double var17 = this.motionX * var11 + this.motionZ * var13;
+ if(var17 < 0.0D) {
+ var11 = -var11;
+ var13 = -var13;
+ }
+
+ double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.motionX = var19 * var11 / var15;
+ this.motionZ = var19 * var13 / var15;
+ double var21 = 0.0D;
+ double var23 = (double)var1 + 0.5D + (double)var10[0][0] * 0.5D;
+ double var25 = (double)var3 + 0.5D + (double)var10[0][2] * 0.5D;
+ double var27 = (double)var1 + 0.5D + (double)var10[1][0] * 0.5D;
+ double var29 = (double)var3 + 0.5D + (double)var10[1][2] * 0.5D;
+ var11 = var27 - var23;
+ var13 = var29 - var25;
+ double var31;
+ double var33;
+ if(var11 == 0.0D) {
+ this.posX = (double)var1 + 0.5D;
+ var21 = this.posZ - (double)var3;
+ } else if(var13 == 0.0D) {
+ this.posZ = (double)var3 + 0.5D;
+ var21 = this.posX - (double)var1;
+ } else {
+ var31 = this.posX - var23;
+ var33 = this.posZ - var25;
+ double var35 = (var31 * var11 + var33 * var13) * 2.0D;
+ var21 = var35;
+ }
+
+ this.posX = var23 + var11 * var21;
+ this.posZ = var25 + var13 * var21;
+ this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ);
+ var31 = this.motionX;
+ var33 = this.motionZ;
+ if(this.riddenByEntity != null) {
+ var31 *= 0.75D;
+ var33 *= 0.75D;
+ }
+
+ if(var31 < -var4) {
+ var31 = -var4;
+ }
+
+ if(var31 > var4) {
+ var31 = var4;
+ }
+
+ if(var33 < -var4) {
+ var33 = -var4;
+ }
+
+ if(var33 > var4) {
+ var33 = var4;
+ }
+
+ this.moveEntity(var31, 0.0D, var33);
+ if(var10[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var10[0][0] && MathHelper.floor_double(this.posZ) - var3 == var10[0][2]) {
+ this.setPosition(this.posX, this.posY + (double)var10[0][1], this.posZ);
+ } else if(var10[1][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var10[1][0] && MathHelper.floor_double(this.posZ) - var3 == var10[1][2]) {
+ this.setPosition(this.posX, this.posY + (double)var10[1][1], this.posZ);
+ }
+
+ if(this.riddenByEntity != null) {
+ this.motionX *= (double)0.997F;
+ this.motionY *= 0.0D;
+ this.motionZ *= (double)0.997F;
+ } else {
+ this.motionX *= (double)0.96F;
+ this.motionY *= 0.0D;
+ this.motionZ *= (double)0.96F;
+ }
+
+ Vec3D var41 = this.getPos(this.posX, this.posY, this.posZ);
+ if(var41 != null && var8 != null) {
+ double var36 = (var8.yCoord - var41.yCoord) * 0.05D;
+ var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ if(var19 > 0.0D) {
+ this.motionX = this.motionX / var19 * (var19 + var36);
+ this.motionZ = this.motionZ / var19 * (var19 + var36);
+ }
+
+ this.setPosition(this.posX, var41.yCoord, this.posZ);
+ }
+
+ int var42 = MathHelper.floor_double(this.posX);
+ int var37 = MathHelper.floor_double(this.posZ);
+ if(var42 != var1 || var37 != var3) {
+ var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.motionX = var19 * (double)(var42 - var1);
+ this.motionZ = var19 * (double)(var37 - var3);
+ }
+ } else {
+ if(this.motionX < -var4) {
+ this.motionX = -var4;
+ }
+
+ if(this.motionX > var4) {
+ this.motionX = var4;
+ }
+
+ if(this.motionZ < -var4) {
+ this.motionZ = -var4;
+ }
+
+ if(this.motionZ > var4) {
+ this.motionZ = var4;
+ }
+
+ 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;
+ }
+ }
+
+ this.rotationPitch = 0.0F;
+ double var38 = this.prevPosX - this.posX;
+ double var39 = this.prevPosZ - this.posZ;
+ if(var38 * var38 + var39 * var39 > 0.001D) {
+ this.rotationYaw = (float)(Math.atan2(var39, var38) * 180.0D / Math.PI);
+ if(this.isInReverse) {
+ this.rotationYaw += 180.0F;
+ }
+ }
+
+ double var12;
+ for(var12 = (double)(this.rotationYaw - this.prevRotationYaw); var12 >= 180.0D; var12 -= 360.0D) {
+ }
+
+ while(var12 < -180.0D) {
+ var12 += 360.0D;
+ }
+
+ if(var12 < -170.0D || var12 >= 170.0D) {
+ this.rotationYaw += 180.0F;
+ this.isInReverse = !this.isInReverse;
+ }
+
+ this.setRotation(this.rotationYaw, this.rotationPitch);
+ List var14 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F));
+ if(var14 != null && var14.size() > 0) {
+ for(int var40 = 0; var40 < var14.size(); ++var40) {
+ Entity var16 = (Entity)var14.get(var40);
+ if(var16 != this.riddenByEntity && var16.canBePushed() && var16 instanceof EntityMinecart) {
+ var16.applyEntityCollision(this);
+ }
+ }
+ }
+
+ if(this.riddenByEntity != null && this.riddenByEntity.isDead) {
+ this.riddenByEntity = null;
+ }
+
+ }
+
+ public Vec3D getPosOffset(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(this.worldObj.getBlockId(var9, var10 - 1, var11) == Block.minecartTrack.blockID) {
+ --var10;
+ }
+
+ if(this.worldObj.getBlockId(var9, var10, var11) == Block.minecartTrack.blockID) {
+ int var12 = this.worldObj.getBlockMetadata(var9, var10, var11);
+ var3 = (double)var10;
+ if(var12 >= 2 && var12 <= 5) {
+ var3 = (double)(var10 + 1);
+ }
+
+ int[][] var13 = matrix[var12];
+ 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);
+ var14 /= var18;
+ var16 /= var18;
+ var1 += var14 * var7;
+ var5 += var16 * var7;
+ if(var13[0][1] != 0 && MathHelper.floor_double(var1) - var9 == var13[0][0] && MathHelper.floor_double(var5) - var11 == var13[0][2]) {
+ var3 += (double)var13[0][1];
+ } else if(var13[1][1] != 0 && MathHelper.floor_double(var1) - var9 == var13[1][0] && MathHelper.floor_double(var5) - var11 == var13[1][2]) {
+ var3 += (double)var13[1][1];
+ }
+
+ return this.getPos(var1, var3, var5);
+ } else {
+ return null;
+ }
+ }
+
+ public Vec3D getPos(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(this.worldObj.getBlockId(var7, var8 - 1, var9) == Block.minecartTrack.blockID) {
+ --var8;
+ }
+
+ if(this.worldObj.getBlockId(var7, var8, var9) == Block.minecartTrack.blockID) {
+ int var10 = this.worldObj.getBlockMetadata(var7, var8, var9);
+ var3 = (double)var8;
+ if(var10 >= 2 && var10 <= 5) {
+ var3 = (double)(var8 + 1);
+ }
+
+ int[][] var11 = matrix[var10];
+ double var12 = 0.0D;
+ double var14 = (double)var7 + 0.5D + (double)var11[0][0] * 0.5D;
+ double var16 = (double)var8 + 0.5D + (double)var11[0][1] * 0.5D;
+ double var18 = (double)var9 + 0.5D + (double)var11[0][2] * 0.5D;
+ double var20 = (double)var7 + 0.5D + (double)var11[1][0] * 0.5D;
+ double var22 = (double)var8 + 0.5D + (double)var11[1][1] * 0.5D;
+ double var24 = (double)var9 + 0.5D + (double)var11[1][2] * 0.5D;
+ double var26 = var20 - var14;
+ double var28 = (var22 - var16) * 2.0D;
+ double var30 = var24 - var18;
+ if(var26 == 0.0D) {
+ var1 = (double)var7 + 0.5D;
+ var12 = var5 - (double)var9;
+ } else if(var30 == 0.0D) {
+ var5 = (double)var9 + 0.5D;
+ var12 = var1 - (double)var7;
+ } else {
+ double var32 = var1 - var14;
+ double var34 = var5 - var18;
+ double var36 = (var32 * var26 + var34 * var30) * 2.0D;
+ var12 = var36;
+ }
+
+ var1 = var14 + var26 * var12;
+ var3 = var16 + var28 * var12;
+ var5 = var18 + var30 * var12;
+ if(var28 < 0.0D) {
+ ++var3;
+ }
+
+ if(var28 > 0.0D) {
+ var3 += 0.5D;
+ }
+
+ return Vec3D.createVector(var1, var3, var5);
+ } else {
+ return null;
+ }
+ }
+
+ protected void writeEntityToNBT(NBTTagCompound var1) {
+ NBTTagList var2 = new NBTTagList();
+
+ for(int var3 = 0; var3 < this.cargoItems.length; ++var3) {
+ if(this.cargoItems[var3] != null) {
+ NBTTagCompound var4 = new NBTTagCompound();
+ var4.setByte("Slot", (byte)var3);
+ this.cargoItems[var3].writeToNBT(var4);
+ var2.setTag(var4);
+ }
+ }
+
+ var1.setTag("Items", var2);
+ }
+
+ protected void readEntityFromNBT(NBTTagCompound var1) {
+ NBTTagList var2 = var1.getTagList("Items");
+ this.cargoItems = new ItemStack[this.getSizeInventory()];
+
+ 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.cargoItems.length) {
+ this.cargoItems[var5] = new ItemStack(var4);
+ }
+ }
+
+ }
+
+ public void applyEntityCollision(Entity var1) {
+ if(var1 != this.riddenByEntity) {
+ double var2 = var1.posX - this.posX;
+ double var4 = var1.posZ - this.posZ;
+ double var6 = var2 * var2 + var4 * var4;
+ if(var6 >= (double)1.0E-4F) {
+ var6 = (double)MathHelper.sqrt_double(var6);
+ var2 /= var6;
+ var4 /= var6;
+ double var8 = 1.0D / var6;
+ if(var8 > 1.0D) {
+ var8 = 1.0D;
+ }
+
+ var2 *= var8;
+ var4 *= var8;
+ var2 *= (double)0.1F;
+ var4 *= (double)0.1F;
+ 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.motionX + this.motionX) / 2.0D;
+ double var12 = (var1.motionZ + this.motionZ) / 2.0D;
+ this.motionX = this.motionZ = 0.0D;
+ this.addVelocity(var10 - var2, 0.0D, var12 - var4);
+ var1.motionX = var1.motionZ = 0.0D;
+ var1.addVelocity(var10 + var2, 0.0D, var12 + var4);
+ } else {
+ this.addVelocity(-var2, 0.0D, -var4);
+ var1.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D);
+ }
+ }
+
+ }
+ }
+
+ public int getSizeInventory() {
+ return 27;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.cargoItems[var1];
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.cargoItems[var1] != null) {
+ ItemStack var3;
+ if(this.cargoItems[var1].stackSize <= var2) {
+ var3 = this.cargoItems[var1];
+ this.cargoItems[var1] = null;
+ return var3;
+ } else {
+ var3 = this.cargoItems[var1].splitStack(var2);
+ if(this.cargoItems[var1].stackSize == 0) {
+ this.cargoItems[var1] = null;
+ }
+
+ return var3;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ this.cargoItems[var1] = var2;
+ if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) {
+ var2.stackSize = this.getInventoryStackLimit();
+ }
+
+ }
+
+ public String getInvName() {
+ return "Minecart";
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public void onInventoryChanged() {
+ }
+
+ public boolean interact(EntityPlayer var1) {
+ var1.mountEntity(this);
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/EntityMonster.java b/src/net/minecraft/src/EntityMonster.java
new file mode 100644
index 0000000..0e0fc19
--- /dev/null
+++ b/src/net/minecraft/src/EntityMonster.java
@@ -0,0 +1,70 @@
+package net.minecraft.src;
+
+public class EntityMonster extends EntityCreature {
+ protected int attackStrength = 2;
+
+ public EntityMonster(World var1) {
+ super(var1);
+ this.health = 20;
+ }
+
+ public void onLivingUpdate() {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 > 0.5F) {
+ this.entityAge += 2;
+ }
+
+ super.onLivingUpdate();
+ }
+
+ public void onUpdate() {
+ super.onUpdate();
+ if(this.worldObj.difficultySetting == 0) {
+ this.setEntityDead();
+ }
+
+ }
+
+ protected Entity findPlayerToAttack() {
+ double var1 = this.worldObj.playerEntity.getDistanceSqToEntity(this);
+ double var3 = 16.0D;
+ return var1 < var3 * var3 && this.canEntityBeSeen(this.worldObj.playerEntity) ? this.worldObj.playerEntity : null;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ if(super.attackEntityFrom(var1, var2)) {
+ if(var1 != this) {
+ this.playerToAttack = var1;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ if((double)var2 < 2.5D && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) {
+ this.attackTime = 20;
+ var1.attackEntityFrom(this, this.attackStrength);
+ }
+
+ }
+
+ protected float getBlockPathWeight(int var1, int var2, int var3) {
+ return 0.5F - this.worldObj.getBrightness(var1, var2, var3);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ public boolean getCanSpawnHere(double var1, double var3, double var5) {
+ int var7 = this.worldObj.getBlockLightValue(MathHelper.floor_double(var1), MathHelper.floor_double(var3), MathHelper.floor_double(var5));
+ return var7 <= this.rand.nextInt(8) && super.getCanSpawnHere(var1, var3, var5);
+ }
+}
diff --git a/src/net/minecraft/src/EntityPainting.java b/src/net/minecraft/src/EntityPainting.java
new file mode 100644
index 0000000..3090aa2
--- /dev/null
+++ b/src/net/minecraft/src/EntityPainting.java
@@ -0,0 +1,212 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class EntityPainting extends Entity {
+ private int tickCounter;
+ public int direction;
+ private int xPosition;
+ private int yPosition;
+ private int zPosition;
+ public EnumArt art;
+
+ public EntityPainting(World var1) {
+ super(var1);
+ this.tickCounter = 0;
+ this.direction = 0;
+ this.yOffset = 0.0F;
+ this.setSize(0.5F, 0.5F);
+ }
+
+ public EntityPainting(World var1, int var2, int var3, int var4, int var5) {
+ this(var1);
+ this.xPosition = var2;
+ this.yPosition = var3;
+ this.zPosition = var4;
+ ArrayList var6 = new ArrayList();
+ EnumArt[] var7 = EnumArt.values();
+ int var8 = var7.length;
+
+ for(int var9 = 0; var9 < var8; ++var9) {
+ EnumArt var10 = var7[var9];
+ this.art = var10;
+ this.setDirection(var5);
+ if(this.onValidSurface()) {
+ var6.add(var10);
+ }
+ }
+
+ if(var6.size() > 0) {
+ this.art = (EnumArt)var6.get(this.rand.nextInt(var6.size()));
+ }
+
+ this.setDirection(var5);
+ }
+
+ public void setDirection(int var1) {
+ this.direction = var1;
+ this.prevRotationYaw = this.rotationYaw = (float)(var1 * 90);
+ float var2 = (float)this.art.sizeX;
+ float var3 = (float)this.art.sizeY;
+ float var4 = (float)this.art.sizeX;
+ if(var1 != 0 && var1 != 2) {
+ var2 = 0.5F;
+ } else {
+ var4 = 0.5F;
+ }
+
+ var2 /= 32.0F;
+ var3 /= 32.0F;
+ var4 /= 32.0F;
+ 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 == 0) {
+ var7 -= var8;
+ }
+
+ if(var1 == 1) {
+ var5 -= var8;
+ }
+
+ if(var1 == 2) {
+ var7 += var8;
+ }
+
+ if(var1 == 3) {
+ var5 += var8;
+ }
+
+ if(var1 == 0) {
+ var5 -= this.getArtSize(this.art.sizeX);
+ }
+
+ if(var1 == 1) {
+ var7 += this.getArtSize(this.art.sizeX);
+ }
+
+ if(var1 == 2) {
+ var5 += this.getArtSize(this.art.sizeX);
+ }
+
+ if(var1 == 3) {
+ var7 -= this.getArtSize(this.art.sizeX);
+ }
+
+ var6 += this.getArtSize(this.art.sizeY);
+ this.setPosition((double)var5, (double)var6, (double)var7);
+ float var9 = -(0.1F / 16.0F);
+ 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 getArtSize(int var1) {
+ return var1 == 32 ? 0.5F : (var1 == 64 ? 0.5F : 0.0F);
+ }
+
+ public void onUpdate() {
+ if(this.tickCounter++ == 100 && !this.onValidSurface()) {
+ this.tickCounter = 0;
+ this.setEntityDead();
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.painting)));
+ }
+
+ }
+
+ public boolean onValidSurface() {
+ if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() > 0) {
+ return false;
+ } else {
+ int var1 = this.art.sizeX / 16;
+ int var2 = this.art.sizeY / 16;
+ int var3 = this.xPosition;
+ int var4 = this.yPosition;
+ int var5 = this.zPosition;
+ if(this.direction == 0) {
+ var3 = MathHelper.floor_double(this.posX - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ if(this.direction == 1) {
+ var5 = MathHelper.floor_double(this.posZ - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ if(this.direction == 2) {
+ var3 = MathHelper.floor_double(this.posX - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ if(this.direction == 3) {
+ var5 = MathHelper.floor_double(this.posZ - (double)((float)this.art.sizeX / 32.0F));
+ }
+
+ var4 = MathHelper.floor_double(this.posY - (double)((float)this.art.sizeY / 32.0F));
+
+ int var7;
+ for(int var6 = 0; var6 < var1; ++var6) {
+ for(var7 = 0; var7 < var2; ++var7) {
+ Material var8;
+ if(this.direction != 0 && this.direction != 2) {
+ var8 = this.worldObj.getBlockMaterial(this.xPosition, var4 + var7, var5 + var6);
+ } else {
+ var8 = this.worldObj.getBlockMaterial(var3 + var6, var4 + var7, this.zPosition);
+ }
+
+ if(!var8.isSolid()) {
+ return false;
+ }
+ }
+ }
+
+ List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox);
+
+ for(var7 = 0; var7 < var9.size(); ++var7) {
+ if(var9.get(var7) instanceof EntityPainting) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ public boolean canBeCollidedWith() {
+ return true;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.setEntityDead();
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.painting)));
+ return true;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setByte("Dir", (byte)this.direction);
+ var1.setString("Motive", this.art.title);
+ var1.setInteger("TileX", this.xPosition);
+ var1.setInteger("TileY", this.yPosition);
+ var1.setInteger("TileZ", this.zPosition);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ this.direction = var1.getByte("Dir");
+ this.xPosition = var1.getInteger("TileX");
+ this.yPosition = var1.getInteger("TileY");
+ this.zPosition = var1.getInteger("TileZ");
+ String var2 = var1.getString("Motive");
+ EnumArt[] var3 = EnumArt.values();
+ int var4 = var3.length;
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ EnumArt var6 = var3[var5];
+ if(var6.title.equals(var2)) {
+ this.art = var6;
+ }
+ }
+
+ if(this.art == null) {
+ this.art = EnumArt.Kebab;
+ }
+
+ this.setDirection(this.direction);
+ }
+}
diff --git a/src/net/minecraft/src/EntityPickupFX.java b/src/net/minecraft/src/EntityPickupFX.java
new file mode 100644
index 0000000..7faaec3
--- /dev/null
+++ b/src/net/minecraft/src/EntityPickupFX.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class EntityPickupFX extends EntityFX {
+ private Entity entityToPickUp;
+ private EntityLiving entityPickingUp;
+ private int age = 0;
+ private int maxAge = 0;
+ private float yOffs;
+
+ public EntityPickupFX(World var1, Entity var2, EntityLiving var3, float var4) {
+ super(var1, var2.posX, var2.posY, var2.posZ, var2.motionX, var2.motionY, var2.motionZ);
+ this.entityToPickUp = var2;
+ this.entityPickingUp = var3;
+ this.maxAge = 3;
+ this.yOffs = var4;
+ }
+
+ 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;
+ 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 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);
+ float var30 = this.worldObj.getBrightness(var27, var28, var29);
+ var21 -= interpPosX;
+ var23 -= interpPosY;
+ var25 -= interpPosZ;
+ GL11.glColor4f(var30, var30, var30, 1.0F);
+ RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, var2);
+ }
+
+ public void onUpdate() {
+ ++this.age;
+ if(this.age == this.maxAge) {
+ this.setEntityDead();
+ }
+
+ }
+
+ public int getFXLayer() {
+ return 2;
+ }
+}
diff --git a/src/net/minecraft/src/EntityPig.java b/src/net/minecraft/src/EntityPig.java
new file mode 100644
index 0000000..805c3fd
--- /dev/null
+++ b/src/net/minecraft/src/EntityPig.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class EntityPig extends EntityAnimal {
+ public boolean saddled = false;
+
+ public EntityPig(World var1) {
+ super(var1);
+ this.texture = "/mob/pig.png";
+ this.setSize(0.9F, 0.9F);
+ this.saddled = false;
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ var1.setBoolean("Saddle", this.saddled);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ this.saddled = var1.getBoolean("Saddle");
+ }
+
+ protected String getLivingSound() {
+ return "mob.pig";
+ }
+
+ protected String getHurtSound() {
+ return "mob.pig";
+ }
+
+ protected String getDeathSound() {
+ return "mob.pigdeath";
+ }
+
+ public boolean interact(EntityPlayer var1) {
+ if(this.saddled) {
+ var1.mountEntity(this);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected int getDropItemId() {
+ return Item.porkRaw.shiftedIndex;
+ }
+}
diff --git a/src/net/minecraft/src/EntityPlayer.java b/src/net/minecraft/src/EntityPlayer.java
new file mode 100644
index 0000000..b7db196
--- /dev/null
+++ b/src/net/minecraft/src/EntityPlayer.java
@@ -0,0 +1,219 @@
+package net.minecraft.src;
+
+import java.util.List;
+
+public class EntityPlayer extends EntityLiving {
+ public InventoryPlayer inventory = new InventoryPlayer(this);
+ public byte unusedMiningCooldown = 0;
+ public int score = 0;
+ public float prevCameraYaw;
+ public float cameraYaw;
+ protected String username;
+ private int damageRemainder = 0;
+
+ public EntityPlayer(World var1) {
+ super(var1);
+ this.setPositionAndRotation((double)var1.spawnX + 0.5D, (double)var1.spawnY, (double)var1.spawnZ + 0.5D, 0.0F, 0.0F);
+ this.yOffset = 1.62F;
+ this.health = 20;
+ this.entityType = "humanoid";
+ this.unusedRotation = 180.0F;
+ this.fireResistance = 20;
+ this.texture = "/char.png";
+ }
+
+ public void updateRidden() {
+ super.updateRidden();
+ this.prevCameraYaw = this.cameraYaw;
+ this.cameraYaw = 0.0F;
+ }
+
+ public void preparePlayerToSpawn() {
+ this.yOffset = 1.62F;
+ this.setSize(0.6F, 1.8F);
+ super.preparePlayerToSpawn();
+ if(this.worldObj != null) {
+ this.worldObj.playerEntity = this;
+ }
+
+ this.health = 20;
+ this.deathTime = 0;
+ }
+
+ public void onLivingUpdate() {
+ this.worldObj.playMusic(this.posX, this.posY, this.posZ, "calm", 0.0F);
+ if(this.worldObj.difficultySetting == 0 && this.health < 20 && this.ticksExisted % 20 * 4 == 0) {
+ this.heal(1);
+ }
+
+ this.inventory.decrementAnimations();
+ this.prevCameraYaw = this.cameraYaw;
+ super.onLivingUpdate();
+ float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ float var2 = (float)Math.atan(-this.motionY * (double)0.2F) * 15.0F;
+ if(var1 > 0.1F) {
+ var1 = 0.1F;
+ }
+
+ if(!this.onGround || this.health <= 0) {
+ var1 = 0.0F;
+ }
+
+ if(this.onGround || this.health <= 0) {
+ var2 = 0.0F;
+ }
+
+ this.cameraYaw += (var1 - this.cameraYaw) * 0.4F;
+ this.cameraPitch += (var2 - this.cameraPitch) * 0.8F;
+ if(this.health > 0) {
+ List var3 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(1.0D, 0.0D, 1.0D));
+ if(var3 != null) {
+ for(int var4 = 0; var4 < var3.size(); ++var4) {
+ this.collideWithPlayer((Entity)var3.get(var4));
+ }
+ }
+ }
+
+ }
+
+ private void collideWithPlayer(Entity var1) {
+ var1.onCollideWithPlayer(this);
+ }
+
+ public int getScore() {
+ return this.score;
+ }
+
+ public void onDeath(Entity var1) {
+ this.setSize(0.2F, 0.2F);
+ this.setPosition(this.posX, this.posY, this.posZ);
+ this.motionY = (double)0.1F;
+ if(this.username.equals("Notch")) {
+ this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true);
+ }
+
+ this.inventory.dropAllItems();
+ if(var1 != 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 {
+ this.motionX = this.motionZ = 0.0D;
+ }
+
+ this.yOffset = 0.1F;
+ }
+
+ public void addToPlayerScore(Entity var1, int var2) {
+ this.score += var2;
+ }
+
+ public void dropPlayerItem(ItemStack var1) {
+ this.dropPlayerItemWithRandomChoice(var1, false);
+ }
+
+ public void dropPlayerItemWithRandomChoice(ItemStack var1, boolean var2) {
+ if(var1 != null) {
+ EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - (double)0.3F, this.posZ, var1);
+ var3.delayBeforeCanPickup = 40;
+ float var4 = 0.1F;
+ float var5;
+ if(var2) {
+ 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;
+ } 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.rand.nextFloat() * (float)Math.PI * 2.0F;
+ var4 *= this.rand.nextFloat();
+ var3.motionX += Math.cos((double)var5) * (double)var4;
+ var3.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
+ var3.motionZ += Math.sin((double)var5) * (double)var4;
+ }
+
+ this.worldObj.spawnEntityInWorld(var3);
+ }
+ }
+
+ public float getCurrentPlayerStrVsBlock(Block var1) {
+ float var2 = this.inventory.getStrVsBlock(var1);
+ if(this.isInsideOfMaterial(Material.water)) {
+ var2 /= 5.0F;
+ }
+
+ if(!this.onGround) {
+ var2 /= 5.0F;
+ }
+
+ return var2;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return this.inventory.canHarvestBlock(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void displayGUIChest(IInventory var1) {
+ }
+
+ public void displayWorkbenchGUI() {
+ }
+
+ public void onItemPickup(Entity var1) {
+ }
+
+ protected float getEyeHeight() {
+ return 0.12F;
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ this.entityAge = 0;
+ if(this.health <= 0) {
+ return false;
+ } else if((float)this.heartsLife > (float)this.heartsHalvesLife / 2.0F) {
+ return false;
+ } else {
+ if(var1 instanceof EntityMonster || var1 instanceof EntityArrow) {
+ if(this.worldObj.difficultySetting == 0) {
+ var2 = 0;
+ }
+
+ if(this.worldObj.difficultySetting == 1) {
+ var2 = var2 / 3 + 1;
+ }
+
+ if(this.worldObj.difficultySetting == 3) {
+ var2 = var2 * 3 / 2;
+ }
+ }
+
+ int var3 = 25 - this.inventory.getTotalArmorValue();
+ int var4 = var2 * var3 + this.damageRemainder;
+ this.inventory.damageArmor(var2);
+ var2 = var4 / 25;
+ this.damageRemainder = var4 % 25;
+ return var2 == 0 ? false : super.attackEntityFrom(var1, var2);
+ }
+ }
+
+ public void displayGUIFurnace(TileEntityFurnace var1) {
+ }
+
+ public void displayGUIEditSign(TileEntitySign var1) {
+ }
+
+ public void interactWithEntity(Entity var1) {
+ }
+}
diff --git a/src/net/minecraft/src/EntityPlayerSP.java b/src/net/minecraft/src/EntityPlayerSP.java
new file mode 100644
index 0000000..7b791e1
--- /dev/null
+++ b/src/net/minecraft/src/EntityPlayerSP.java
@@ -0,0 +1,118 @@
+package net.minecraft.src;
+
+public class EntityPlayerSP extends EntityPlayer {
+ public MovementInput movementInput;
+ private Minecraft mc;
+
+ public EntityPlayerSP(Minecraft var1, World var2, Session var3) {
+ super(var2);
+ this.mc = var1;
+ if(var2 != null) {
+ if(var2.playerEntity != null) {
+ var2.setEntityDead(var2.playerEntity);
+ }
+
+ var2.playerEntity = this;
+ }
+
+ if(var3 != null && var3.username != null && var3.username.length() > 0) {
+ this.skinUrl = "http://www.minecraft.net/skin/" + var3.username + ".png";
+ }
+
+ this.username = var3.username;
+ }
+
+ public void updatePlayerActionState() {
+ this.moveStrafing = this.movementInput.moveStrafe;
+ this.moveForward = this.movementInput.moveForward;
+ this.isJumping = this.movementInput.jump;
+ }
+
+ public void onLivingUpdate() {
+ this.movementInput.updatePlayerMoveState(this);
+ super.onLivingUpdate();
+ }
+
+ public void resetPlayerKeyState() {
+ this.movementInput.resetKeyState();
+ }
+
+ public void handleKeyPress(int var1, boolean var2) {
+ this.movementInput.checkKeyForMovementInput(var1, var2);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ var1.setInteger("Score", this.score);
+ var1.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList()));
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ this.score = var1.getInteger("Score");
+ NBTTagList var2 = var1.getTagList("Inventory");
+ this.inventory.readFromNBT(var2);
+ }
+
+ public void displayGUIChest(IInventory var1) {
+ this.mc.displayGuiScreen(new GuiChest(this.inventory, var1));
+ }
+
+ public void displayGUIEditSign(TileEntitySign var1) {
+ this.mc.displayGuiScreen(new GuiEditSign(var1));
+ }
+
+ public void displayWorkbenchGUI() {
+ this.mc.displayGuiScreen(new GuiCrafting(this.inventory));
+ }
+
+ public void displayGUIFurnace(TileEntityFurnace var1) {
+ this.mc.displayGuiScreen(new GuiFurnace(this.inventory, var1));
+ }
+
+ public ItemStack getCurrentEquippedItem() {
+ return this.inventory.getCurrentItem();
+ }
+
+ public void displayGUIInventory() {
+ this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null);
+ }
+
+ public void attackEntity(Entity var1) {
+ int var2 = this.inventory.getDamageVsEntity(var1);
+ if(var2 > 0) {
+ var1.attackEntityFrom(this, var2);
+ ItemStack var3 = this.getCurrentEquippedItem();
+ if(var3 != null && var1 instanceof EntityLiving) {
+ var3.hitEntity((EntityLiving)var1);
+ if(var3.stackSize <= 0) {
+ var3.onItemDestroyedByUse(this);
+ this.displayGUIInventory();
+ }
+ }
+ }
+
+ }
+
+ public void onItemPickup(Entity var1) {
+ this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var1, this, -0.5F));
+ }
+
+ public int getPlayerArmorValue() {
+ return this.inventory.getTotalArmorValue();
+ }
+
+ public void interactWithEntity(Entity var1) {
+ if(!var1.interact(this)) {
+ ItemStack var2 = this.getCurrentEquippedItem();
+ if(var2 != null && var1 instanceof EntityLiving) {
+ var2.useItemOnEntity((EntityLiving)var1);
+ if(var2.stackSize <= 0) {
+ var2.onItemDestroyedByUse(this);
+ this.displayGUIInventory();
+ }
+ }
+
+ }
+ }
+}
diff --git a/src/net/minecraft/src/EntityRainFX.java b/src/net/minecraft/src/EntityRainFX.java
new file mode 100644
index 0000000..1b3c2bc
--- /dev/null
+++ b/src/net/minecraft/src/EntityRainFX.java
@@ -0,0 +1,53 @@
+package net.minecraft.src;
+
+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;
+ 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.particleTextureIndex = 16;
+ this.setSize(0.01F, 0.01F);
+ this.particleGravity = 0.06F;
+ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
+ }
+
+ public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ 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.setEntityDead();
+ }
+
+ if(this.onGround) {
+ if(Math.random() < 0.5D) {
+ this.setEntityDead();
+ }
+
+ this.motionX *= (double)0.7F;
+ this.motionZ *= (double)0.7F;
+ }
+
+ Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
+ if(var1.getIsLiquid() || var1.isSolid()) {
+ double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getPercentAir(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))));
+ if(this.posY < var2) {
+ this.setEntityDead();
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityRenderer.java b/src/net/minecraft/src/EntityRenderer.java
new file mode 100644
index 0000000..7d2ce97
--- /dev/null
+++ b/src/net/minecraft/src/EntityRenderer.java
@@ -0,0 +1,623 @@
+package net.minecraft.src;
+
+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.GLU;
+
+public class EntityRenderer {
+ private Minecraft mc;
+ private boolean isDisplayActive = false;
+ private float farPlaneDistance = 0.0F;
+ public ItemRenderer itemRenderer;
+ private int rendererUpdateCount;
+ private Entity pointedEntity = null;
+ private int mouseDX;
+ private int mouseDY;
+ private Random random = new Random();
+ volatile int unusedInt1 = 0;
+ volatile int unusedInt2 = 0;
+ FloatBuffer fogColorBuffer = GLAllocation.createFloatBuffer(16);
+ float fogColorRed;
+ float fogColorGreen;
+ float fogColorBlue;
+ private float prevFogColor;
+ private float fogColor;
+
+ public EntityRenderer(Minecraft var1) {
+ this.mc = var1;
+ this.itemRenderer = new ItemRenderer(var1);
+ }
+
+ public void updateRenderer() {
+ this.prevFogColor = this.fogColor;
+ float var1 = this.mc.theWorld.getBrightness(MathHelper.floor_double(this.mc.thePlayer.posX), MathHelper.floor_double(this.mc.thePlayer.posY), MathHelper.floor_double(this.mc.thePlayer.posZ));
+ float var2 = (float)(3 - this.mc.gameSettings.renderDistance) / 3.0F;
+ float var3 = var1 * (1.0F - var2) + var2;
+ this.fogColor += (var3 - this.fogColor) * 0.1F;
+ ++this.rendererUpdateCount;
+ this.itemRenderer.updateEquippedItem();
+ if(this.mc.isRaining) {
+ this.addRainParticles();
+ }
+
+ }
+
+ private Vec3D getPlayerPosition(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ double var3 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1;
+ double var5 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1;
+ double var7 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1;
+ return Vec3D.createVector(var3, var5, var7);
+ }
+
+ private void getMouseOver(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ float var3 = var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1;
+ float var4 = var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1;
+ Vec3D var5 = this.getPlayerPosition(var1);
+ float var6 = MathHelper.cos(-var4 * ((float)Math.PI / 180.0F) - (float)Math.PI);
+ float var7 = MathHelper.sin(-var4 * ((float)Math.PI / 180.0F) - (float)Math.PI);
+ float var8 = -MathHelper.cos(-var3 * ((float)Math.PI / 180.0F));
+ float var9 = MathHelper.sin(-var3 * ((float)Math.PI / 180.0F));
+ float var10 = var7 * var8;
+ float var12 = var6 * var8;
+ double var13 = (double)this.mc.playerController.getBlockReachDistance();
+ Vec3D var15 = var5.addVector((double)var10 * var13, (double)var9 * var13, (double)var12 * var13);
+ this.mc.objectMouseOver = this.mc.theWorld.rayTraceBlocks(var5, var15);
+ double var16 = var13;
+ var5 = this.getPlayerPosition(var1);
+ if(this.mc.objectMouseOver != null) {
+ var16 = this.mc.objectMouseOver.hitVec.distanceTo(var5);
+ }
+
+ if(this.mc.playerController instanceof PlayerControllerCreative) {
+ var13 = 32.0D;
+ } else {
+ if(var16 > 3.0D) {
+ var16 = 3.0D;
+ }
+
+ var13 = var16;
+ }
+
+ var15 = var5.addVector((double)var10 * var13, (double)var9 * var13, (double)var12 * var13);
+ this.pointedEntity = null;
+ List var18 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(var2, var2.boundingBox.addCoord((double)var10 * var13, (double)var9 * var13, (double)var12 * var13));
+ double var19 = 0.0D;
+
+ for(int var21 = 0; var21 < var18.size(); ++var21) {
+ Entity var22 = (Entity)var18.get(var21);
+ if(var22.canBeCollidedWith()) {
+ float var23 = 0.1F;
+ AxisAlignedBB var24 = var22.boundingBox.expand((double)var23, (double)var23, (double)var23);
+ MovingObjectPosition var25 = var24.calculateIntercept(var5, var15);
+ if(var25 != null) {
+ double var26 = var5.distanceTo(var25.hitVec);
+ if(var26 < var19 || var19 == 0.0D) {
+ this.pointedEntity = var22;
+ var19 = var26;
+ }
+ }
+ }
+ }
+
+ if(this.pointedEntity != null && !(this.mc.playerController instanceof PlayerControllerCreative)) {
+ this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity);
+ }
+
+ }
+
+ private float getFOVModifier(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ float var3 = 70.0F;
+ if(var2.isInsideOfMaterial(Material.water)) {
+ var3 = 60.0F;
+ }
+
+ if(var2.health <= 0) {
+ float var4 = (float)var2.deathTime + var1;
+ var3 /= (1.0F - 500.0F / (var4 + 500.0F)) * 2.0F + 1.0F;
+ }
+
+ return var3;
+ }
+
+ private void hurtCameraEffect(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ float var3 = (float)var2.hurtTime - var1;
+ float var4;
+ if(var2.health <= 0) {
+ var4 = (float)var2.deathTime + var1;
+ GL11.glRotatef(40.0F - 8000.0F / (var4 + 200.0F), 0.0F, 0.0F, 1.0F);
+ }
+
+ if(var3 >= 0.0F) {
+ var3 /= (float)var2.maxHurtTime;
+ var3 = MathHelper.sin(var3 * var3 * var3 * var3 * (float)Math.PI);
+ var4 = var2.attackedAtYaw;
+ GL11.glRotatef(-var4, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var3 * 14.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(var4, 0.0F, 1.0F, 0.0F);
+ }
+ }
+
+ private void setupViewBobbing(float var1) {
+ if(!this.mc.gameSettings.thirdPersonView) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ 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;
+ 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);
+ GL11.glRotatef(var6, 1.0F, 0.0F, 0.0F);
+ }
+ }
+
+ private void orientCamera(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ double var3 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1;
+ double var5 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1;
+ double var7 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1;
+ if(this.mc.gameSettings.thirdPersonView) {
+ double var9 = 4.0D;
+ double var11 = (double)(-MathHelper.sin(var2.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(var2.rotationPitch / 180.0F * (float)Math.PI)) * var9;
+ double var13 = (double)(MathHelper.cos(var2.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(var2.rotationPitch / 180.0F * (float)Math.PI)) * var9;
+ double var15 = (double)(-MathHelper.sin(var2.rotationPitch / 180.0F * (float)Math.PI)) * var9;
+
+ for(int var17 = 0; var17 < 8; ++var17) {
+ float var18 = (float)((var17 & 1) * 2 - 1);
+ float var19 = (float)((var17 >> 1 & 1) * 2 - 1);
+ float var20 = (float)((var17 >> 2 & 1) * 2 - 1);
+ var18 *= 0.1F;
+ var19 *= 0.1F;
+ var20 *= 0.1F;
+ MovingObjectPosition var21 = this.mc.theWorld.rayTraceBlocks(Vec3D.createVector(var3 + (double)var18, var5 + (double)var19, var7 + (double)var20), Vec3D.createVector(var3 - var11 + (double)var18 + (double)var20, var5 - var15 + (double)var19, var7 - var13 + (double)var20));
+ if(var21 != null) {
+ double var22 = var21.hitVec.distanceTo(Vec3D.createVector(var3, var5, var7));
+ if(var22 < var9) {
+ var9 = var22;
+ }
+ }
+ }
+
+ GL11.glTranslatef(0.0F, 0.0F, (float)(-var9));
+ } else {
+ GL11.glTranslatef(0.0F, 0.0F, -0.1F);
+ }
+
+ 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);
+ }
+
+ private void setupCameraTransform(float var1, int var2) {
+ this.farPlaneDistance = (float)(256 >> this.mc.gameSettings.renderDistance);
+ 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);
+ }
+
+ GLU.gluPerspective(this.getFOVModifier(var1), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance);
+ 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);
+ }
+
+ this.orientCamera(var1);
+ }
+
+ private void renderHand(float var1, int var2) {
+ GL11.glLoadIdentity();
+ if(this.mc.gameSettings.anaglyph) {
+ GL11.glTranslatef((float)(var2 * 2 - 1) * 0.1F, 0.0F, 0.0F);
+ }
+
+ GL11.glPushMatrix();
+ this.hurtCameraEffect(var1);
+ if(this.mc.gameSettings.viewBobbing) {
+ this.setupViewBobbing(var1);
+ }
+
+ if(!this.mc.gameSettings.thirdPersonView) {
+ this.itemRenderer.renderItemInFirstPerson(var1);
+ }
+
+ GL11.glPopMatrix();
+ if(!this.mc.gameSettings.thirdPersonView) {
+ this.itemRenderer.renderOverlays(var1);
+ this.hurtCameraEffect(var1);
+ }
+
+ if(this.mc.gameSettings.viewBobbing) {
+ this.setupViewBobbing(var1);
+ }
+
+ }
+
+ public void updateCameraAndRender(float var1) {
+ if(this.isDisplayActive && !Display.isActive()) {
+ this.mc.displayInGameMenu();
+ }
+
+ this.isDisplayActive = Display.isActive();
+ int var3;
+ int var9;
+ int var10;
+ if(this.mc.inGameHasFocus) {
+ int var2 = Mouse.getDX() * 0;
+ var3 = Mouse.getDY() * 0;
+ this.mc.mouseHelper.mouseXYChange();
+ byte var4 = 1;
+ if(this.mc.gameSettings.invertMouse) {
+ var4 = -1;
+ }
+
+ boolean var5 = false;
+ boolean var6 = false;
+ var9 = var2 + this.mc.mouseHelper.deltaX;
+ var10 = var3 - this.mc.mouseHelper.deltaY;
+ if(var2 != 0 || this.mouseDX != 0) {
+ System.out.println("xxo: " + var2 + ", " + this.mouseDX + ": " + this.mouseDX + ", xo: " + var9);
+ }
+
+ if(this.mouseDX != 0) {
+ this.mouseDX = 0;
+ }
+
+ if(this.mouseDY != 0) {
+ this.mouseDY = 0;
+ }
+
+ if(var2 != 0) {
+ this.mouseDX = var2;
+ }
+
+ if(var3 != 0) {
+ this.mouseDY = var3;
+ }
+
+ this.mc.thePlayer.setAngles((float)var9, (float)(var10 * var4));
+ }
+
+ if(!this.mc.skipRenderWorld) {
+ ScaledResolution var7 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ var3 = var7.getScaledWidth();
+ int var8 = var7.getScaledHeight();
+ var9 = Mouse.getX() * var3 / this.mc.displayWidth;
+ var10 = var8 - Mouse.getY() * var8 / this.mc.displayHeight - 1;
+ if(this.mc.theWorld != null) {
+ this.renderWorld(var1);
+ this.mc.ingameGUI.renderGameOverlay(var1, this.mc.currentScreen != null, var9, var10);
+ } else {
+ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
+ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ this.setupOverlayRendering();
+ }
+
+ if(this.mc.currentScreen != null) {
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ this.mc.currentScreen.drawScreen(var9, var10, var1);
+ }
+
+ }
+ }
+
+ public void renderWorld(float var1) {
+ this.getMouseOver(var1);
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ RenderGlobal var3 = this.mc.renderGlobal;
+ EffectRenderer var4 = this.mc.effectRenderer;
+ double var5 = var2.lastTickPosX + (var2.posX - var2.lastTickPosX) * (double)var1;
+ double var7 = var2.lastTickPosY + (var2.posY - var2.lastTickPosY) * (double)var1;
+ double var9 = var2.lastTickPosZ + (var2.posZ - var2.lastTickPosZ) * (double)var1;
+
+ for(int var11 = 0; var11 < 2; ++var11) {
+ if(this.mc.gameSettings.anaglyph) {
+ if(var11 == 0) {
+ GL11.glColorMask(false, true, true, false);
+ } else {
+ GL11.glColorMask(true, false, false, false);
+ }
+ }
+
+ 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);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ this.setupCameraTransform(var1, var11);
+ ClippingHelperImplementation.getInstance();
+ if(this.mc.gameSettings.renderDistance < 2) {
+ this.setupFog(-1);
+ var3.renderSky(var1);
+ }
+
+ GL11.glEnable(GL11.GL_FOG);
+ this.setupFog(1);
+ Frustrum var12 = new Frustrum();
+ var12.setPosition(var5, var7, var9);
+ this.mc.renderGlobal.clipRenderersByFrustrum(var12, var1);
+ this.mc.renderGlobal.updateRenderers(var2, false);
+ this.setupFog(0);
+ GL11.glEnable(GL11.GL_FOG);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ RenderHelper.disableStandardItemLighting();
+ var3.sortAndRender(var2, 0, (double)var1);
+ RenderHelper.enableStandardItemLighting();
+ var3.renderEntities(this.getPlayerPosition(var1), var12, var1);
+ var4.renderLitParticles(var2, var1);
+ RenderHelper.disableStandardItemLighting();
+ this.setupFog(0);
+ var4.renderParticles(var2, var1);
+ if(this.mc.objectMouseOver != null && var2.isInsideOfMaterial(Material.water)) {
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ var3.drawBlockBreaking(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ var3.drawSelectionBox(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ this.setupFog(0);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ if(this.mc.gameSettings.fancyGraphics) {
+ GL11.glColorMask(false, false, false, false);
+ int var13 = var3.sortAndRender(var2, 1, (double)var1);
+ GL11.glColorMask(true, true, true, true);
+ if(this.mc.gameSettings.anaglyph) {
+ if(var11 == 0) {
+ GL11.glColorMask(false, true, true, false);
+ } else {
+ GL11.glColorMask(true, false, false, false);
+ }
+ }
+
+ if(var13 > 0) {
+ var3.renderAllRenderLists(1, (double)var1);
+ }
+ } else {
+ var3.sortAndRender(var2, 1, (double)var1);
+ }
+
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glDisable(GL11.GL_BLEND);
+ if(this.mc.objectMouseOver != null && !var2.isInsideOfMaterial(Material.water)) {
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ var3.drawBlockBreaking(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ var3.drawSelectionBox(var2, this.mc.objectMouseOver, 0, var2.inventory.getCurrentItem(), var1);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+
+ GL11.glDisable(GL11.GL_FOG);
+ if(this.mc.isRaining) {
+ this.renderRain(var1);
+ }
+
+ if(this.pointedEntity != null) {
+ }
+
+ this.setupFog(0);
+ GL11.glEnable(GL11.GL_FOG);
+ var3.renderClouds(var1);
+ GL11.glDisable(GL11.GL_FOG);
+ this.setupFog(1);
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ this.renderHand(var1, var11);
+ if(!this.mc.gameSettings.anaglyph) {
+ return;
+ }
+ }
+
+ GL11.glColorMask(true, true, true, false);
+ }
+
+ private void addRainParticles() {
+ EntityPlayerSP var1 = this.mc.thePlayer;
+ World var2 = this.mc.theWorld;
+ int var3 = MathHelper.floor_double(var1.posX);
+ int var4 = MathHelper.floor_double(var1.posY);
+ int var5 = MathHelper.floor_double(var1.posZ);
+ byte var6 = 4;
+
+ for(int var7 = 0; var7 < 50; ++var7) {
+ int var8 = var3 + this.random.nextInt(var6 * 2 + 1) - var6;
+ int var9 = var5 + this.random.nextInt(var6 * 2 + 1) - var6;
+ int var10 = var2.getTopSolidOrLiquidBlock(var8, var9);
+ int var11 = var2.getBlockId(var8, var10 - 1, var9);
+ if(var10 <= var4 + var6 && var10 >= var4 - var6) {
+ float var12 = this.random.nextFloat();
+ float var13 = this.random.nextFloat();
+ if(var11 > 0) {
+ this.mc.effectRenderer.addEffect(new EntityRainFX(var2, (double)((float)var8 + var12), (double)((float)var10 + 0.1F) - Block.blocksList[var11].minY, (double)((float)var9 + var13)));
+ }
+ }
+ }
+
+ }
+
+ private void renderRain(float var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ World var3 = this.mc.theWorld;
+ int var4 = MathHelper.floor_double(var2.posX);
+ int var5 = MathHelper.floor_double(var2.posY);
+ int var6 = MathHelper.floor_double(var2.posZ);
+ Tessellator var7 = Tessellator.instance;
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ GL11.glNormal3f(0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/rain.png"));
+ byte var8 = 5;
+
+ for(int var9 = var4 - var8; var9 <= var4 + var8; ++var9) {
+ for(int var10 = var6 - var8; var10 <= var6 + var8; ++var10) {
+ int var11 = var3.getTopSolidOrLiquidBlock(var9, var10);
+ int var12 = var5 - var8;
+ int var13 = var5 + var8;
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ if(var13 < var11) {
+ var13 = var11;
+ }
+
+ float var14 = 2.0F;
+ if(var12 != var13) {
+ float var15 = ((float)((this.rendererUpdateCount + var9 * 3121 + var10 * 418711) % 32) + var1) / 32.0F;
+ double var16 = (double)((float)var9 + 0.5F) - var2.posX;
+ double var18 = (double)((float)var10 + 0.5F) - var2.posZ;
+ float var20 = MathHelper.sqrt_double(var16 * var16 + var18 * var18) / (float)var8;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - var20 * var20) * 0.7F);
+ var7.startDrawingQuads();
+ var7.addVertexWithUV((double)(var9 + 0), (double)var12, (double)(var10 + 0), (double)(0.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var12, (double)(var10 + 1), (double)(1.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var13, (double)(var10 + 1), (double)(1.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 0), (double)var13, (double)(var10 + 0), (double)(0.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 0), (double)var12, (double)(var10 + 1), (double)(0.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var12, (double)(var10 + 0), (double)(1.0F * var14), (double)((float)var12 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 1), (double)var13, (double)(var10 + 0), (double)(1.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.addVertexWithUV((double)(var9 + 0), (double)var13, (double)(var10 + 1), (double)(0.0F * var14), (double)((float)var13 * var14 / 8.0F + var15 * var14));
+ var7.draw();
+ }
+ }
+ }
+
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public void setupOverlayRendering() {
+ ScaledResolution var1 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var2 = var1.getScaledWidth();
+ int var3 = var1.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var2, (double)var3, 0.0D, 1000.0D, 3000.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
+ }
+
+ private void updateFogColor(float var1) {
+ World var2 = this.mc.theWorld;
+ EntityPlayerSP var3 = this.mc.thePlayer;
+ float var4 = 1.0F / (float)(4 - this.mc.gameSettings.renderDistance);
+ var4 = 1.0F - (float)Math.pow((double)var4, 0.25D);
+ Vec3D var5 = var2.getSkyColor(var1);
+ float var6 = (float)var5.xCoord;
+ float var7 = (float)var5.yCoord;
+ float var8 = (float)var5.zCoord;
+ Vec3D var9 = var2.getFogColor(var1);
+ this.fogColorRed = (float)var9.xCoord;
+ this.fogColorGreen = (float)var9.yCoord;
+ this.fogColorBlue = (float)var9.zCoord;
+ this.fogColorRed += (var6 - this.fogColorRed) * var4;
+ this.fogColorGreen += (var7 - this.fogColorGreen) * var4;
+ this.fogColorBlue += (var8 - this.fogColorBlue) * var4;
+ if(var3.isInsideOfMaterial(Material.water)) {
+ this.fogColorRed = 0.02F;
+ this.fogColorGreen = 0.02F;
+ this.fogColorBlue = 0.2F;
+ } else if(var3.isInsideOfMaterial(Material.lava)) {
+ this.fogColorRed = 0.6F;
+ this.fogColorGreen = 0.1F;
+ this.fogColorBlue = 0.0F;
+ }
+
+ float var10 = this.prevFogColor + (this.fogColor - this.prevFogColor) * var1;
+ this.fogColorRed *= var10;
+ this.fogColorGreen *= var10;
+ this.fogColorBlue *= var10;
+ if(this.mc.gameSettings.anaglyph) {
+ float var11 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F;
+ float var12 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F;
+ float var13 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F;
+ this.fogColorRed = var11;
+ this.fogColorGreen = var12;
+ this.fogColorBlue = var13;
+ }
+
+ GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F);
+ }
+
+ private void setupFog(int var1) {
+ EntityPlayerSP var2 = this.mc.thePlayer;
+ 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);
+ float var3;
+ float var4;
+ float var5;
+ float var6;
+ float var7;
+ float var8;
+ if(var2.isInsideOfMaterial(Material.water)) {
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP);
+ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F);
+ var3 = 0.4F;
+ var4 = 0.4F;
+ var5 = 0.9F;
+ if(this.mc.gameSettings.anaglyph) {
+ var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
+ var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
+ var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
+ }
+ } else if(var2.isInsideOfMaterial(Material.lava)) {
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP);
+ GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F);
+ var3 = 0.4F;
+ var4 = 0.3F;
+ var5 = 0.3F;
+ if(this.mc.gameSettings.anaglyph) {
+ var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
+ var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
+ var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
+ }
+ } else {
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR);
+ GL11.glFogf(GL11.GL_FOG_START, this.farPlaneDistance * 0.25F);
+ GL11.glFogf(GL11.GL_FOG_END, this.farPlaneDistance);
+ if(var1 < 0) {
+ GL11.glFogf(GL11.GL_FOG_START, 0.0F);
+ GL11.glFogf(GL11.GL_FOG_END, this.farPlaneDistance * 0.8F);
+ }
+
+ if(GLContext.getCapabilities().GL_NV_fog_distance) {
+ GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV);
+ }
+ }
+
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glColorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT);
+ }
+
+ private FloatBuffer setFogColorBuffer(float var1, float var2, float var3, float var4) {
+ this.fogColorBuffer.clear();
+ this.fogColorBuffer.put(var1).put(var2).put(var3).put(var4);
+ this.fogColorBuffer.flip();
+ return this.fogColorBuffer;
+ }
+}
diff --git a/src/net/minecraft/src/EntitySheep.java b/src/net/minecraft/src/EntitySheep.java
new file mode 100644
index 0000000..33a2bcd
--- /dev/null
+++ b/src/net/minecraft/src/EntitySheep.java
@@ -0,0 +1,49 @@
+package net.minecraft.src;
+
+public class EntitySheep extends EntityAnimal {
+ public boolean sheared = false;
+
+ public EntitySheep(World var1) {
+ super(var1);
+ this.texture = "/mob/sheep.png";
+ this.setSize(0.9F, 1.3F);
+ }
+
+ public boolean attackEntityFrom(Entity var1, int var2) {
+ if(!this.sheared && var1 instanceof EntityLiving) {
+ this.sheared = true;
+ int var3 = 1 + this.rand.nextInt(3);
+
+ for(int var4 = 0; var4 < var3; ++var4) {
+ EntityItem var5 = this.entityDropItem(Block.cloth.blockID, 1, 1.0F);
+ 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);
+ }
+ }
+
+ return super.attackEntityFrom(var1, var2);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ var1.setBoolean("Sheared", this.sheared);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ this.sheared = var1.getBoolean("Sheared");
+ }
+
+ protected String getLivingSound() {
+ return "mob.sheep";
+ }
+
+ protected String getHurtSound() {
+ return "mob.sheep";
+ }
+
+ protected String getDeathSound() {
+ return "mob.sheep";
+ }
+}
diff --git a/src/net/minecraft/src/EntitySkeleton.java b/src/net/minecraft/src/EntitySkeleton.java
new file mode 100644
index 0000000..3508baf
--- /dev/null
+++ b/src/net/minecraft/src/EntitySkeleton.java
@@ -0,0 +1,52 @@
+package net.minecraft.src;
+
+public class EntitySkeleton extends EntityMonster {
+ public EntitySkeleton(World var1) {
+ super(var1);
+ this.texture = "/mob/skeleton.png";
+ }
+
+ public void onLivingUpdate() {
+ if(this.worldObj.isDaytime()) {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 > 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 < (var1 - 0.4F) * 2.0F) {
+ this.fire = 300;
+ }
+ }
+
+ super.onLivingUpdate();
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ if(var2 < 10.0F) {
+ double var3 = var1.posX - this.posX;
+ double var5 = var1.posZ - this.posZ;
+ if(this.attackTime == 0) {
+ EntityArrow var7 = new EntityArrow(this.worldObj, this);
+ var7.posY += (double)1.4F;
+ double var8 = var1.posY - (double)0.2F - var7.posY;
+ float var10 = MathHelper.sqrt_double(var3 * var3 + var5 * var5) * 0.2F;
+ this.worldObj.playSoundAtEntity(this, "random.bow", 1.0F, 1.0F / (this.rand.nextFloat() * 0.4F + 0.8F));
+ this.worldObj.spawnEntityInWorld(var7);
+ var7.setArrowHeading(var3, var8 + (double)var10, var5, 0.6F, 12.0F);
+ this.attackTime = 30;
+ }
+
+ this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / (double)((float)Math.PI)) - 90.0F;
+ this.hasAttacked = true;
+ }
+
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ protected int getDropItemId() {
+ return Item.arrow.shiftedIndex;
+ }
+}
diff --git a/src/net/minecraft/src/EntitySmokeFX.java b/src/net/minecraft/src/EntitySmokeFX.java
new file mode 100644
index 0000000..269a249
--- /dev/null
+++ b/src/net/minecraft/src/EntitySmokeFX.java
@@ -0,0 +1,63 @@
+package net.minecraft.src;
+
+public class EntitySmokeFX extends EntityFX {
+ float smokeParticleScale;
+
+ public EntitySmokeFX(World var1, double var2, double var4, double var6) {
+ this(var1, var2, var4, var6, 1.0F);
+ }
+
+ public EntitySmokeFX(World var1, double var2, double var4, double var6, float var8) {
+ 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.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * (double)0.3F);
+ this.particleScale *= 12.0F / 16.0F;
+ this.particleScale *= var8;
+ this.smokeParticleScale = this.particleScale;
+ this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
+ this.particleMaxAge = (int)((float)this.particleMaxAge * var8);
+ 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) {
+ var8 = 0.0F;
+ }
+
+ if(var8 > 1.0F) {
+ var8 = 1.0F;
+ }
+
+ this.particleScale = this.smokeParticleScale * var8;
+ super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ if(this.particleAge++ >= this.particleMaxAge) {
+ this.setEntityDead();
+ }
+
+ this.particleTextureIndex = 7 - this.particleAge * 8 / this.particleMaxAge;
+ this.motionY += 0.004D;
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ 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;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntitySorter.java b/src/net/minecraft/src/EntitySorter.java
new file mode 100644
index 0000000..f7f866f
--- /dev/null
+++ b/src/net/minecraft/src/EntitySorter.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+import java.util.Comparator;
+
+public class EntitySorter implements Comparator {
+ private Entity comparedEntity;
+
+ public EntitySorter(Entity var1) {
+ this.comparedEntity = var1;
+ }
+
+ public int a(WorldRenderer var1, WorldRenderer var2) {
+ return var1.distanceToEntitySquared(this.comparedEntity) < var2.distanceToEntitySquared(this.comparedEntity) ? -1 : 1;
+ }
+
+ public int compare(Object var1, Object var2) {
+ return this.a((WorldRenderer)var1, (WorldRenderer)var2);
+ }
+}
diff --git a/src/net/minecraft/src/EntitySpider.java b/src/net/minecraft/src/EntitySpider.java
new file mode 100644
index 0000000..98b540f
--- /dev/null
+++ b/src/net/minecraft/src/EntitySpider.java
@@ -0,0 +1,56 @@
+package net.minecraft.src;
+
+public class EntitySpider extends EntityMonster {
+ public EntitySpider(World var1) {
+ super(var1);
+ this.texture = "/mob/spider.png";
+ this.setSize(1.4F, 0.9F);
+ this.moveSpeed = 0.8F;
+ }
+
+ protected Entity findPlayerToAttack() {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 < 0.5F) {
+ double var2 = this.worldObj.playerEntity.getDistanceSqToEntity(this);
+ double var4 = 16.0D;
+ if(var2 < var4 * var4) {
+ return this.worldObj.playerEntity;
+ }
+ }
+
+ return null;
+ }
+
+ protected void attackEntity(Entity var1, float var2) {
+ float var3 = this.getEntityBrightness(1.0F);
+ if(var3 > 0.5F && this.rand.nextInt(100) == 0) {
+ this.playerToAttack = null;
+ } else {
+ if(var2 > 2.0F && var2 < 6.0F && this.rand.nextInt(10) == 0) {
+ if(this.onGround) {
+ double var4 = var1.posX - this.posX;
+ double var6 = var1.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;
+ }
+ } else {
+ super.attackEntity(var1, var2);
+ }
+
+ }
+ }
+
+ public void writeEntityToNBT(NBTTagCompound var1) {
+ super.writeEntityToNBT(var1);
+ }
+
+ public void readEntityFromNBT(NBTTagCompound var1) {
+ super.readEntityFromNBT(var1);
+ }
+
+ protected int getDropItemId() {
+ return Item.silk.shiftedIndex;
+ }
+}
diff --git a/src/net/minecraft/src/EntitySplashFX.java b/src/net/minecraft/src/EntitySplashFX.java
new file mode 100644
index 0000000..1375ad2
--- /dev/null
+++ b/src/net/minecraft/src/EntitySplashFX.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+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);
+ this.particleGravity = 0.04F;
+ ++this.particleTextureIndex;
+ if(var10 == 0.0D && (var8 != 0.0D || var12 != 0.0D)) {
+ this.motionX = var8;
+ this.motionY = var10 + 0.1D;
+ this.motionZ = var12;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/EntityTNTPrimed.java b/src/net/minecraft/src/EntityTNTPrimed.java
new file mode 100644
index 0000000..9e59e00
--- /dev/null
+++ b/src/net/minecraft/src/EntityTNTPrimed.java
@@ -0,0 +1,68 @@
+package net.minecraft.src;
+
+public class EntityTNTPrimed extends Entity {
+ public int fuse;
+
+ public EntityTNTPrimed(World var1) {
+ super(var1);
+ this.fuse = 0;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.98F);
+ this.yOffset = this.height / 2.0F;
+ }
+
+ public EntityTNTPrimed(World var1, float var2, float var3, float var4) {
+ this(var1);
+ this.setPosition((double)var2, (double)var3, (double)var4);
+ float var5 = (float)(Math.random() * (double)((float)Math.PI) * 2.0D);
+ this.motionX = (double)(-MathHelper.sin(var5 * (float)Math.PI / 180.0F) * 0.02F);
+ this.motionY = (double)0.2F;
+ this.motionZ = (double)(-MathHelper.cos(var5 * (float)Math.PI / 180.0F) * 0.02F);
+ this.canTriggerWalking = false;
+ this.fuse = 80;
+ this.prevPosX = (double)var2;
+ this.prevPosY = (double)var3;
+ this.prevPosZ = (double)var4;
+ }
+
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= (double)0.04F;
+ 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.motionY *= -0.5D;
+ }
+
+ if(this.fuse-- <= 0) {
+ this.setEntityDead();
+ this.createExplosion();
+ } else {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ }
+
+ }
+
+ private void createExplosion() {
+ float var1 = 4.0F;
+ this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, var1);
+ }
+
+ protected void writeEntityToNBT(NBTTagCompound var1) {
+ var1.setByte("Fuse", (byte)this.fuse);
+ }
+
+ protected void readEntityFromNBT(NBTTagCompound var1) {
+ this.fuse = var1.getByte("Fuse");
+ }
+}
diff --git a/src/net/minecraft/src/EntityZombie.java b/src/net/minecraft/src/EntityZombie.java
new file mode 100644
index 0000000..5e30538
--- /dev/null
+++ b/src/net/minecraft/src/EntityZombie.java
@@ -0,0 +1,25 @@
+package net.minecraft.src;
+
+public class EntityZombie extends EntityMonster {
+ public EntityZombie(World var1) {
+ super(var1);
+ this.texture = "/mob/zombie.png";
+ this.moveSpeed = 0.5F;
+ this.attackStrength = 5;
+ }
+
+ public void onLivingUpdate() {
+ if(this.worldObj.isDaytime()) {
+ float var1 = this.getEntityBrightness(1.0F);
+ if(var1 > 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 < (var1 - 0.4F) * 2.0F) {
+ this.fire = 300;
+ }
+ }
+
+ super.onLivingUpdate();
+ }
+
+ protected int getDropItemId() {
+ return Item.feather.shiftedIndex;
+ }
+}
diff --git a/src/net/minecraft/src/EnumArt.java b/src/net/minecraft/src/EnumArt.java
new file mode 100644
index 0000000..daa40fa
--- /dev/null
+++ b/src/net/minecraft/src/EnumArt.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public enum EnumArt {
+ Kebab("Kebab", 16, 16, 0, 0),
+ Aztec("Aztec", 16, 16, 16, 0),
+ Alban("Alban", 16, 16, 32, 0),
+ Aztec2("Aztec2", 16, 16, 48, 0),
+ Bomb("Bomb", 16, 16, 64, 0),
+ Plant("Plant", 16, 16, 80, 0),
+ Wasteland("Wasteland", 16, 16, 96, 0),
+ Pool("Pool", 32, 16, 0, 32),
+ Courbet("Courbet", 32, 16, 32, 32),
+ Sea("Sea", 32, 16, 64, 32),
+ Sunset("Sunset", 32, 16, 96, 32),
+ Wanderer("Wanderer", 16, 32, 0, 64),
+ Match("Match", 32, 32, 0, 128),
+ Bust("Bust", 32, 32, 32, 128),
+ Stage("Stage", 32, 32, 64, 128),
+ Void("Void", 32, 32, 96, 128),
+ SkullAndRoses("SkullAndRoses", 32, 32, 128, 128),
+ Fighters("Fighters", 64, 32, 0, 96),
+ Pointer("Pointer", 64, 64, 0, 192);
+
+ 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.title = var3;
+ this.sizeX = var4;
+ this.sizeY = var5;
+ this.offsetX = var6;
+ this.offsetY = var7;
+ }
+}
diff --git a/src/net/minecraft/src/EnumOS.java b/src/net/minecraft/src/EnumOS.java
new file mode 100644
index 0000000..d8447c5
--- /dev/null
+++ b/src/net/minecraft/src/EnumOS.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+enum EnumOS {
+ linux,
+ solaris,
+ windows,
+ macos,
+ unknown;
+}
diff --git a/src/net/minecraft/src/EnumOSIsom.java b/src/net/minecraft/src/EnumOSIsom.java
new file mode 100644
index 0000000..787fa2a
--- /dev/null
+++ b/src/net/minecraft/src/EnumOSIsom.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+enum EnumOSIsom {
+ linux,
+ solaris,
+ windows,
+ macos,
+ unknown;
+}
diff --git a/src/net/minecraft/src/EnumSkyBlock.java b/src/net/minecraft/src/EnumSkyBlock.java
new file mode 100644
index 0000000..92da84b
--- /dev/null
+++ b/src/net/minecraft/src/EnumSkyBlock.java
@@ -0,0 +1,12 @@
+package net.minecraft.src;
+
+public enum EnumSkyBlock {
+ Sky(15),
+ Block(0);
+
+ public final int defaultLightValue;
+
+ private EnumSkyBlock(int var3) {
+ this.defaultLightValue = var3;
+ }
+}
diff --git a/src/net/minecraft/src/Explosion.java b/src/net/minecraft/src/Explosion.java
new file mode 100644
index 0000000..34001ea
--- /dev/null
+++ b/src/net/minecraft/src/Explosion.java
@@ -0,0 +1,130 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+public class Explosion {
+ public void doExplosion(World var1, Entity var2, double var3, double var5, double var7, float var9) {
+ var1.playSoundEffect(var3, var5, var7, "random.explode", 4.0F, (1.0F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.2F) * 0.7F);
+ HashSet var10 = new HashSet();
+ float var11 = var9;
+ byte var12 = 16;
+
+ int var13;
+ int var14;
+ int var15;
+ double var25;
+ double var27;
+ double var29;
+ for(var13 = 0; var13 < var12; ++var13) {
+ for(var14 = 0; var14 < var12; ++var14) {
+ for(var15 = 0; var15 < var12; ++var15) {
+ if(var13 == 0 || var13 == var12 - 1 || var14 == 0 || var14 == var12 - 1 || var15 == 0 || var15 == var12 - 1) {
+ double var16 = (double)((float)var13 / ((float)var12 - 1.0F) * 2.0F - 1.0F);
+ double var18 = (double)((float)var14 / ((float)var12 - 1.0F) * 2.0F - 1.0F);
+ double var20 = (double)((float)var15 / ((float)var12 - 1.0F) * 2.0F - 1.0F);
+ double var22 = Math.sqrt(var16 * var16 + var18 * var18 + var20 * var20);
+ var16 /= var22;
+ var18 /= var22;
+ var20 /= var22;
+ float var24 = var9 * (0.7F + var1.rand.nextFloat() * 0.6F);
+ var25 = var3;
+ var27 = var5;
+ var29 = var7;
+
+ for(float var31 = 0.3F; var24 > 0.0F; var24 -= var31 * (12.0F / 16.0F)) {
+ int var32 = MathHelper.floor_double(var25);
+ int var33 = MathHelper.floor_double(var27);
+ int var34 = MathHelper.floor_double(var29);
+ int var35 = var1.getBlockId(var32, var33, var34);
+ if(var35 > 0) {
+ var24 -= (Block.blocksList[var35].getExplosionResistance(var2) + 0.3F) * var31;
+ }
+
+ if(var24 > 0.0F) {
+ var10.add(new ChunkPosition(var32, var33, var34));
+ }
+
+ var25 += var16 * (double)var31;
+ var27 += var18 * (double)var31;
+ var29 += var20 * (double)var31;
+ }
+ }
+ }
+ }
+ }
+
+ var9 *= 2.0F;
+ var13 = MathHelper.floor_double(var3 - (double)var9 - 1.0D);
+ var14 = MathHelper.floor_double(var3 + (double)var9 + 1.0D);
+ var15 = MathHelper.floor_double(var5 - (double)var9 - 1.0D);
+ int var45 = MathHelper.floor_double(var5 + (double)var9 + 1.0D);
+ int var17 = MathHelper.floor_double(var7 - (double)var9 - 1.0D);
+ int var46 = MathHelper.floor_double(var7 + (double)var9 + 1.0D);
+ List var19 = var1.getEntitiesWithinAABBExcludingEntity(var2, AxisAlignedBB.getBoundingBoxFromPool((double)var13, (double)var15, (double)var17, (double)var14, (double)var45, (double)var46));
+ Vec3D var47 = Vec3D.createVector(var3, var5, var7);
+
+ double var55;
+ double var56;
+ double var57;
+ for(int var21 = 0; var21 < var19.size(); ++var21) {
+ Entity var49 = (Entity)var19.get(var21);
+ double var23 = var49.getDistance(var3, var5, var7) / (double)var9;
+ if(var23 <= 1.0D) {
+ var25 = var49.posX - var3;
+ var27 = var49.posY - var5;
+ var29 = var49.posZ - var7;
+ var55 = (double)MathHelper.sqrt_double(var25 * var25 + var27 * var27 + var29 * var29);
+ var25 /= var55;
+ var27 /= var55;
+ var29 /= var55;
+ var56 = (double)var1.getBlockDensity(var47, var49.boundingBox);
+ var57 = (1.0D - var23) * var56;
+ var49.attackEntityFrom(var2, (int)((var57 * var57 + var57) / 2.0D * 8.0D * (double)var9 + 1.0D));
+ var49.motionX += var25 * var57;
+ var49.motionY += var27 * var57;
+ var49.motionZ += var29 * var57;
+ }
+ }
+
+ var9 = var11;
+ ArrayList var48 = new ArrayList();
+ var48.addAll(var10);
+
+ for(int var50 = var48.size() - 1; var50 >= 0; --var50) {
+ ChunkPosition var51 = (ChunkPosition)var48.get(var50);
+ int var52 = var51.x;
+ int var53 = var51.y;
+ int var26 = var51.z;
+ int var54 = var1.getBlockId(var52, var53, var26);
+
+ for(int var28 = 0; var28 < 1; ++var28) {
+ var29 = (double)((float)var52 + var1.rand.nextFloat());
+ var55 = (double)((float)var53 + var1.rand.nextFloat());
+ var56 = (double)((float)var26 + var1.rand.nextFloat());
+ var57 = var29 - var3;
+ double var37 = var55 - var5;
+ double var39 = var56 - var7;
+ double var41 = (double)MathHelper.sqrt_double(var57 * var57 + var37 * var37 + var39 * var39);
+ var57 /= var41;
+ var37 /= var41;
+ var39 /= var41;
+ double var43 = 0.5D / (var41 / (double)var9 + 0.1D);
+ var43 *= (double)(var1.rand.nextFloat() * var1.rand.nextFloat() + 0.3F);
+ var57 *= var43;
+ var37 *= var43;
+ var39 *= var43;
+ var1.spawnParticle("explode", (var29 + var3 * 1.0D) / 2.0D, (var55 + var5 * 1.0D) / 2.0D, (var56 + var7 * 1.0D) / 2.0D, var57, var37, var39);
+ var1.spawnParticle("smoke", var29, var55, var56, var57, var37, var39);
+ }
+
+ if(var54 > 0) {
+ Block.blocksList[var54].dropBlockAsItemWithChance(var1, var52, var53, var26, var1.getBlockMetadata(var52, var53, var26), 0.3F);
+ var1.setBlockWithNotify(var52, var53, var26, 0);
+ Block.blocksList[var54].onBlockDestroyedByExplosion(var1, var52, var53, var26);
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/FontRenderer.java b/src/net/minecraft/src/FontRenderer.java
new file mode 100644
index 0000000..e8b6015
--- /dev/null
+++ b/src/net/minecraft/src/FontRenderer.java
@@ -0,0 +1,177 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.nio.IntBuffer;
+import javax.imageio.ImageIO;
+import org.lwjgl.opengl.GL11;
+
+public class FontRenderer {
+ private int[] charWidth = new int[256];
+ private int fontTextureName = 0;
+ private int fontDisplayLists;
+ private IntBuffer buffer = GLAllocation.createIntBuffer(1024);
+
+ public FontRenderer(GameSettings var1, String var2, RenderEngine var3) {
+ BufferedImage var4;
+ try {
+ var4 = ImageIO.read(RenderEngine.class.getResourceAsStream(var2));
+ } catch (IOException var18) {
+ throw new RuntimeException(var18);
+ }
+
+ int var5 = var4.getWidth();
+ int var6 = var4.getHeight();
+ int[] var7 = new int[var5 * var6];
+ var4.getRGB(0, 0, var5, var6, var7, 0, var5);
+
+ int var9;
+ int var10;
+ int var11;
+ int var13;
+ int var15;
+ int var16;
+ for(int var8 = 0; var8 < 128; ++var8) {
+ var9 = var8 % 16;
+ var10 = var8 / 16;
+ var11 = 0;
+
+ for(boolean var12 = false; var11 < 8 && !var12; ++var11) {
+ var13 = var9 * 8 + var11;
+ var12 = true;
+
+ for(int var14 = 0; var14 < 8 && var12; ++var14) {
+ var15 = (var10 * 8 + var14) * var5;
+ var16 = var7[var13 + var15] & 255;
+ if(var16 > 128) {
+ var12 = false;
+ }
+ }
+ }
+
+ if(var8 == 32) {
+ var11 = 4;
+ }
+
+ this.charWidth[var8] = var11;
+ }
+
+ this.fontTextureName = var3.getTexture(var2);
+ this.fontDisplayLists = GLAllocation.generateDisplayLists(288);
+ Tessellator var19 = Tessellator.instance;
+
+ for(var9 = 0; var9 < 256; ++var9) {
+ GL11.glNewList(this.fontDisplayLists + var9, GL11.GL_COMPILE);
+ var19.startDrawingQuads();
+ var10 = var9 % 16 * 8;
+ var11 = var9 / 16 * 8;
+ float var20 = 7.99F;
+ var19.addVertexWithUV(0.0D, (double)(0.0F + var20), 0.0D, (double)((float)var10 / 128.0F), (double)(((float)var11 + var20) / 128.0F));
+ var19.addVertexWithUV((double)(0.0F + var20), (double)(0.0F + var20), 0.0D, (double)(((float)var10 + var20) / 128.0F), (double)(((float)var11 + var20) / 128.0F));
+ var19.addVertexWithUV((double)(0.0F + var20), 0.0D, 0.0D, (double)(((float)var10 + var20) / 128.0F), (double)((float)var11 / 128.0F));
+ var19.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)((float)var10 / 128.0F), (double)((float)var11 / 128.0F));
+ var19.draw();
+ GL11.glTranslatef((float)this.charWidth[var9], 0.0F, 0.0F);
+ GL11.glEndList();
+ }
+
+ for(var9 = 0; var9 < 32; ++var9) {
+ var10 = (var9 & 8) * 8;
+ var11 = (var9 & 1) * 191 + var10;
+ int var21 = ((var9 & 2) >> 1) * 191 + var10;
+ var13 = ((var9 & 4) >> 2) * 191 + var10;
+ boolean var22 = var9 >= 16;
+ if(var1.anaglyph) {
+ var15 = (var13 * 30 + var21 * 59 + var11 * 11) / 100;
+ var16 = (var13 * 30 + var21 * 70) / 100;
+ int var17 = (var13 * 30 + var11 * 70) / 100;
+ var13 = var15;
+ var21 = var16;
+ var11 = var17;
+ }
+
+ var9 += 2;
+ if(var22) {
+ var13 /= 4;
+ var21 /= 4;
+ var11 /= 4;
+ }
+
+ GL11.glColor4f((float)var13 / 255.0F, (float)var21 / 255.0F, (float)var11 / 255.0F, 1.0F);
+ }
+
+ }
+
+ public void drawStringWithShadow(String var1, int var2, int var3, int var4) {
+ this.renderString(var1, var2 + 1, var3 + 1, var4, true);
+ this.drawString(var1, var2, var3, var4);
+ }
+
+ public void drawString(String var1, int var2, int var3, int var4) {
+ this.renderString(var1, var2, var3, var4, false);
+ }
+
+ public void renderString(String var1, int var2, int var3, int var4, boolean var5) {
+ if(var1 != null) {
+ if(var5) {
+ var4 = (var4 & 16579836) >> 2;
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.fontTextureName);
+ float var6 = (float)(var4 >> 16 & 255) / 255.0F;
+ float var7 = (float)(var4 >> 8 & 255) / 255.0F;
+ float var8 = (float)(var4 & 255) / 255.0F;
+ float var9 = (float)(var4 >> 24 & 255) / 255.0F;
+ var9 = 1.0F;
+ GL11.glColor4f(var6, var7, var8, var9);
+ this.buffer.clear();
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var3, 0.0F);
+
+ for(int var10 = 0; var10 < var1.length(); ++var10) {
+ for(; var1.charAt(var10) == 38 && var1.length() > var10 + 1; var10 += 2) {
+ int var11 = "0123456789abcdef".indexOf(var1.charAt(var10 + 1));
+ if(var11 < 0 || var11 > 15) {
+ var11 = 15;
+ }
+
+ this.buffer.put(this.fontDisplayLists + 256 + var11 + (var5 ? 16 : 0));
+ if(this.buffer.remaining() == 0) {
+ this.buffer.flip();
+ GL11.glCallLists(this.buffer);
+ this.buffer.clear();
+ }
+ }
+
+ this.buffer.put(this.fontDisplayLists + var1.charAt(var10));
+ if(this.buffer.remaining() == 0) {
+ this.buffer.flip();
+ GL11.glCallLists(this.buffer);
+ this.buffer.clear();
+ }
+ }
+
+ this.buffer.flip();
+ GL11.glCallLists(this.buffer);
+ GL11.glPopMatrix();
+ }
+ }
+
+ public int getStringWidth(String var1) {
+ if(var1 == null) {
+ return 0;
+ } else {
+ int var2 = 0;
+
+ for(int var3 = 0; var3 < var1.length(); ++var3) {
+ if(var1.charAt(var3) == 38) {
+ ++var3;
+ } else {
+ var2 += this.charWidth[var1.charAt(var3)];
+ }
+ }
+
+ return var2;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/Frustrum.java b/src/net/minecraft/src/Frustrum.java
new file mode 100644
index 0000000..ad411d9
--- /dev/null
+++ b/src/net/minecraft/src/Frustrum.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+public class Frustrum implements ICamera {
+ private ClippingHelper clippingHelper = ClippingHelperImplementation.getInstance();
+ private double xPosition;
+ 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);
+ }
+}
diff --git a/src/net/minecraft/src/GLAllocation.java b/src/net/minecraft/src/GLAllocation.java
new file mode 100644
index 0000000..bcde76b
--- /dev/null
+++ b/src/net/minecraft/src/GLAllocation.java
@@ -0,0 +1,62 @@
+package net.minecraft.src;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import org.lwjgl.opengl.GL11;
+
+public class GLAllocation {
+ private static List displayLists = new ArrayList();
+ private static List textureNames = new ArrayList();
+
+ public static synchronized int generateDisplayLists(int var0) {
+ int var1 = GL11.glGenLists(var0);
+ displayLists.add(Integer.valueOf(var1));
+ displayLists.add(Integer.valueOf(var0));
+ return var1;
+ }
+
+ public static synchronized void generateDisplayLists(IntBuffer var0) {
+ GL11.glGenTextures(var0);
+
+ for(int var1 = var0.position(); var1 < var0.limit(); ++var1) {
+ textureNames.add(Integer.valueOf(var0.get(var1)));
+ }
+
+ }
+
+ public static synchronized void deleteTexturesAndDisplayLists() {
+ for(int var0 = 0; var0 < displayLists.size(); var0 += 2) {
+ GL11.glDeleteLists(((Integer)displayLists.get(var0)).intValue(), ((Integer)displayLists.get(var0 + 1)).intValue());
+ }
+
+ IntBuffer var2 = createIntBuffer(textureNames.size());
+ var2.flip();
+ GL11.glDeleteTextures(var2);
+
+ for(int var1 = 0; var1 < textureNames.size(); ++var1) {
+ var2.put(((Integer)textureNames.get(var1)).intValue());
+ }
+
+ var2.flip();
+ GL11.glDeleteTextures(var2);
+ displayLists.clear();
+ textureNames.clear();
+ }
+
+ public static synchronized ByteBuffer createDirectByteBuffer(int var0) {
+ ByteBuffer var1 = ByteBuffer.allocateDirect(var0).order(ByteOrder.nativeOrder());
+ return var1;
+ }
+
+ public static IntBuffer createIntBuffer(int var0) {
+ return createDirectByteBuffer(var0 << 2).asIntBuffer();
+ }
+
+ public static FloatBuffer createFloatBuffer(int var0) {
+ return createDirectByteBuffer(var0 << 2).asFloatBuffer();
+ }
+}
diff --git a/src/net/minecraft/src/GameSettings.java b/src/net/minecraft/src/GameSettings.java
new file mode 100644
index 0000000..9416cfd
--- /dev/null
+++ b/src/net/minecraft/src/GameSettings.java
@@ -0,0 +1,202 @@
+package net.minecraft.src;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import org.lwjgl.input.Keyboard;
+
+public class GameSettings {
+ private static final String[] RENDER_DISTANCES = new String[]{"FAR", "NORMAL", "SHORT", "TINY"};
+ private static final String[] DIFFICULTIES = new String[]{"Peaceful", "Easy", "Normal", "Hard"};
+ public boolean music = true;
+ public boolean sound = true;
+ public boolean invertMouse = false;
+ public boolean showFPS = false;
+ public int renderDistance = 0;
+ public boolean viewBobbing = true;
+ public boolean anaglyph = false;
+ public boolean limitFramerate = false;
+ public boolean fancyGraphics = true;
+ public KeyBinding keyBindForward = new KeyBinding("Forward", 17);
+ public KeyBinding keyBindLeft = new KeyBinding("Left", 30);
+ public KeyBinding keyBindBack = new KeyBinding("Back", 31);
+ public KeyBinding keyBindRight = new KeyBinding("Right", 32);
+ public KeyBinding keyBindJump = new KeyBinding("Jump", 57);
+ public KeyBinding keyBindInventory = new KeyBinding("Inventory", 23);
+ public KeyBinding keyBindDrop = new KeyBinding("Drop", 16);
+ public KeyBinding keyBindChat = new KeyBinding("Chat", 20);
+ public KeyBinding keyBindToggleFog = new KeyBinding("Toggle fog", 33);
+ public KeyBinding keyBindSave = new KeyBinding("Save location", 28);
+ public KeyBinding keyBindLoad = new KeyBinding("Load location", 19);
+ public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog, this.keyBindSave, this.keyBindLoad};
+ protected Minecraft mc;
+ private File optionsFile;
+ public int numberOfOptions = 10;
+ public int difficulty = 2;
+ public boolean thirdPersonView = false;
+
+ public GameSettings(Minecraft var1, File var2) {
+ this.mc = var1;
+ this.optionsFile = new File(var2, "options.txt");
+ this.loadOptions();
+ }
+
+ public String getOptionDisplayString(int var1) {
+ return this.keyBindings[var1].keyDescription + ": " + Keyboard.getKeyName(this.keyBindings[var1].keyCode);
+ }
+
+ public void setKeyBinding(int var1, int var2) {
+ this.keyBindings[var1].keyCode = var2;
+ this.saveOptions();
+ }
+
+ public void setOptionFloatValue(int var1, int var2) {
+ if(var1 == 0) {
+ this.music = !this.music;
+ this.mc.sndManager.onSoundOptionsChanged();
+ }
+
+ if(var1 == 1) {
+ this.sound = !this.sound;
+ this.mc.sndManager.onSoundOptionsChanged();
+ }
+
+ if(var1 == 2) {
+ this.invertMouse = !this.invertMouse;
+ }
+
+ if(var1 == 3) {
+ this.showFPS = !this.showFPS;
+ }
+
+ if(var1 == 4) {
+ this.renderDistance = this.renderDistance + var2 & 3;
+ }
+
+ if(var1 == 5) {
+ this.viewBobbing = !this.viewBobbing;
+ }
+
+ if(var1 == 6) {
+ this.anaglyph = !this.anaglyph;
+ this.mc.renderEngine.refreshTextures();
+ }
+
+ if(var1 == 7) {
+ this.limitFramerate = !this.limitFramerate;
+ }
+
+ if(var1 == 8) {
+ this.difficulty = this.difficulty + var2 & 3;
+ }
+
+ if(var1 == 9) {
+ this.fancyGraphics = !this.fancyGraphics;
+ this.mc.renderGlobal.loadRenderers();
+ }
+
+ this.saveOptions();
+ }
+
+ public String getKeyBinding(int var1) {
+ return var1 == 0 ? "Music: " + (this.music ? "ON" : "OFF") : (var1 == 1 ? "Sound: " + (this.sound ? "ON" : "OFF") : (var1 == 2 ? "Invert mouse: " + (this.invertMouse ? "ON" : "OFF") : (var1 == 3 ? "Show FPS: " + (this.showFPS ? "ON" : "OFF") : (var1 == 4 ? "Render distance: " + RENDER_DISTANCES[this.renderDistance] : (var1 == 5 ? "View bobbing: " + (this.viewBobbing ? "ON" : "OFF") : (var1 == 6 ? "3d anaglyph: " + (this.anaglyph ? "ON" : "OFF") : (var1 == 7 ? "Limit framerate: " + (this.limitFramerate ? "ON" : "OFF") : (var1 == 8 ? "Difficulty: " + DIFFICULTIES[this.difficulty] : (var1 == 9 ? "Graphics: " + (this.fancyGraphics ? "FANCY" : "FAST") : "")))))))));
+ }
+
+ public void loadOptions() {
+ try {
+ if(!this.optionsFile.exists()) {
+ return;
+ }
+
+ BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile));
+ String var2 = "";
+
+ while(true) {
+ var2 = var1.readLine();
+ if(var2 == null) {
+ var1.close();
+ break;
+ }
+
+ String[] var3 = var2.split(":");
+ if(var3[0].equals("music")) {
+ this.music = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("sound")) {
+ this.sound = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("invertYMouse")) {
+ this.invertMouse = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("showFrameRate")) {
+ this.showFPS = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("viewDistance")) {
+ this.renderDistance = Integer.parseInt(var3[1]);
+ }
+
+ if(var3[0].equals("bobView")) {
+ this.viewBobbing = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("anaglyph3d")) {
+ this.anaglyph = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("limitFramerate")) {
+ this.limitFramerate = var3[1].equals("true");
+ }
+
+ if(var3[0].equals("difficulty")) {
+ this.difficulty = Integer.parseInt(var3[1]);
+ }
+
+ if(var3[0].equals("fancyGraphics")) {
+ this.fancyGraphics = var3[1].equals("true");
+ }
+
+ 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]);
+ }
+ }
+ }
+ } catch (Exception var5) {
+ System.out.println("Failed to load options");
+ var5.printStackTrace();
+ }
+
+ }
+
+ public void saveOptions() {
+ try {
+ PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile));
+ var1.println("music:" + this.music);
+ var1.println("sound:" + this.sound);
+ var1.println("invertYMouse:" + this.invertMouse);
+ var1.println("showFrameRate:" + this.showFPS);
+ var1.println("viewDistance:" + this.renderDistance);
+ var1.println("bobView:" + this.viewBobbing);
+ var1.println("anaglyph3d:" + this.anaglyph);
+ var1.println("limitFramerate:" + this.limitFramerate);
+ var1.println("difficulty:" + this.difficulty);
+ var1.println("fancyGraphics:" + this.fancyGraphics);
+
+ for(int var2 = 0; var2 < this.keyBindings.length; ++var2) {
+ var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode);
+ }
+
+ var1.close();
+ } catch (Exception var3) {
+ System.out.println("Failed to save options");
+ var3.printStackTrace();
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/Gui.java b/src/net/minecraft/src/Gui.java
new file mode 100644
index 0000000..8b4c529
--- /dev/null
+++ b/src/net/minecraft/src/Gui.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class Gui {
+ protected float zLevel = 0.0F;
+
+ 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;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Tessellator var15 = Tessellator.instance;
+ var15.startDrawingQuads();
+ var15.setColorRGBA_F(var8, var9, var10, var7);
+ var15.addVertex((double)var3, (double)var2, 0.0D);
+ var15.addVertex((double)var1, (double)var2, 0.0D);
+ var15.setColorRGBA_F(var12, var13, var14, var11);
+ var15.addVertex((double)var1, (double)var4, 0.0D);
+ var15.addVertex((double)var3, (double)var4, 0.0D);
+ var15.draw();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ 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) {
+ 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.draw();
+ }
+}
diff --git a/src/net/minecraft/src/GuiButton.java b/src/net/minecraft/src/GuiButton.java
new file mode 100644
index 0000000..3fbe2be
--- /dev/null
+++ b/src/net/minecraft/src/GuiButton.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiButton extends Gui {
+ private int width;
+ private int height;
+ public int xPosition;
+ public int yPosition;
+ public String displayString;
+ public int id;
+ public boolean enabled;
+ public boolean enabled2;
+
+ public GuiButton(int var1, int var2, int var3, String var4) {
+ this(var1, var2, var3, 200, 20, var4);
+ }
+
+ protected GuiButton(int var1, int var2, int var3, int var4, int var5, String var6) {
+ this.width = 200;
+ this.height = 20;
+ this.enabled = true;
+ this.enabled2 = true;
+ this.id = var1;
+ this.xPosition = var2;
+ this.yPosition = var3;
+ this.width = var4;
+ this.height = var5;
+ this.displayString = var6;
+ }
+
+ public void drawButton(Minecraft var1, int var2, int var3) {
+ if(this.enabled2) {
+ FontRenderer var4 = var1.fontRenderer;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.renderEngine.getTexture("/gui/gui.png"));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ byte var5 = 1;
+ boolean var6 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height;
+ if(!this.enabled) {
+ var5 = 0;
+ } else if(var6) {
+ var5 = 2;
+ }
+
+ 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);
+ if(!this.enabled) {
+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, -6250336);
+ } else if(var6) {
+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 16777120);
+ } else {
+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 14737632);
+ }
+
+ }
+ }
+
+ public boolean mousePressed(int var1, int var2) {
+ return this.enabled && var1 >= this.xPosition && var2 >= this.yPosition && var1 < this.xPosition + this.width && var2 < this.yPosition + this.height;
+ }
+}
diff --git a/src/net/minecraft/src/GuiChest.java b/src/net/minecraft/src/GuiChest.java
new file mode 100644
index 0000000..730e7f4
--- /dev/null
+++ b/src/net/minecraft/src/GuiChest.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiChest extends GuiContainer {
+ private IInventory upperChestInventory;
+ private IInventory lowerChestInventory;
+ private int inventoryRows = 0;
+
+ public GuiChest(IInventory var1, IInventory var2) {
+ this.upperChestInventory = var1;
+ this.lowerChestInventory = var2;
+ this.allowUserInput = false;
+ short var3 = 222;
+ int var4 = var3 - 108;
+ this.inventoryRows = var2.getSizeInventory() / 9;
+ this.ySize = var4 + this.inventoryRows * 18;
+ int var5 = (this.inventoryRows - 4) * 18;
+
+ int var6;
+ int var7;
+ for(var6 = 0; var6 < this.inventoryRows; ++var6) {
+ for(var7 = 0; var7 < 9; ++var7) {
+ this.inventorySlots.add(new Slot(this, var2, var7 + var6 * 9, 8 + var7 * 18, 18 + var6 * 18));
+ }
+ }
+
+ for(var6 = 0; var6 < 3; ++var6) {
+ for(var7 = 0; var7 < 9; ++var7) {
+ this.inventorySlots.add(new Slot(this, var1, var7 + (var6 + 1) * 9, 8 + var7 * 18, 103 + var6 * 18 + var5));
+ }
+ }
+
+ for(var6 = 0; var6 < 9; ++var6) {
+ this.inventorySlots.add(new Slot(this, var1, var6, 8 + var6 * 18, 161 + var5));
+ }
+
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString(this.lowerChestInventory.getInvName(), 8, 6, 4210752);
+ this.fontRenderer.drawString(this.upperChestInventory.getInvName(), 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/container.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
+ this.drawTexturedModalRect(var3, var4 + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
+ }
+}
diff --git a/src/net/minecraft/src/GuiContainer.java b/src/net/minecraft/src/GuiContainer.java
new file mode 100644
index 0000000..4e3e8fe
--- /dev/null
+++ b/src/net/minecraft/src/GuiContainer.java
@@ -0,0 +1,226 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public abstract class GuiContainer extends GuiScreen {
+ private static RenderItem itemRenderer = new RenderItem();
+ private ItemStack draggedItemStack = null;
+ protected int xSize = 176;
+ protected int ySize = 166;
+ protected List inventorySlots = new ArrayList();
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ int var4 = (this.width - this.xSize) / 2;
+ int var5 = (this.height - this.ySize) / 2;
+ this.drawGuiContainerBackgroundLayer(var3);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var4, (float)var5, 0.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+
+ for(int var6 = 0; var6 < this.inventorySlots.size(); ++var6) {
+ Slot var7 = (Slot)this.inventorySlots.get(var6);
+ this.drawSlotInventory(var7);
+ if(var7.getIsMouseOverSlot(var1, var2)) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ int var8 = var7.xDisplayPosition;
+ int var9 = var7.yDisplayPosition;
+ this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ }
+ }
+
+ if(this.draggedItemStack != null) {
+ GL11.glTranslatef(0.0F, 0.0F, 32.0F);
+ itemRenderer.drawItemIntoGui(this.fontRenderer, this.mc.renderEngine, this.draggedItemStack, var1 - var4 - 8, var2 - var5 - 8);
+ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, this.draggedItemStack, var1 - var4 - 8, var2 - var5 - 8);
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ this.drawGuiContainerForegroundLayer();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glPopMatrix();
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ }
+
+ protected abstract void drawGuiContainerBackgroundLayer(float var1);
+
+ private void drawSlotInventory(Slot var1) {
+ IInventory var2 = var1.inventory;
+ int var3 = var1.slotIndex;
+ int var4 = var1.xDisplayPosition;
+ int var5 = var1.yDisplayPosition;
+ ItemStack var6 = var2.getStackInSlot(var3);
+ if(var6 == null) {
+ int var7 = var1.getBackgroundIconIndex();
+ if(var7 >= 0) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/items.png"));
+ this.drawTexturedModalRect(var4, var5, var7 % 16 * 16, var7 / 16 * 16, 16, 16);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ return;
+ }
+ }
+
+ itemRenderer.drawItemIntoGui(this.fontRenderer, this.mc.renderEngine, var6, var4, var5);
+ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var6, var4, var5);
+ }
+
+ private Slot getSlotAtPosition(int var1, int var2) {
+ for(int var3 = 0; var3 < this.inventorySlots.size(); ++var3) {
+ Slot var4 = (Slot)this.inventorySlots.get(var3);
+ if(var4.getIsMouseOverSlot(var1, var2)) {
+ return var4;
+ }
+ }
+
+ return null;
+ }
+
+ protected void mouseClicked(int var1, int var2, int var3) {
+ if(var3 == 0 || var3 == 1) {
+ Slot var4 = this.getSlotAtPosition(var1, var2);
+ int var6;
+ if(var4 != null) {
+ var4.onSlotChanged();
+ ItemStack var5 = var4.getStack();
+ if(var5 != null || this.draggedItemStack != null) {
+ if(var5 != null && this.draggedItemStack == null) {
+ var6 = var3 == 0 ? var5.stackSize : (var5.stackSize + 1) / 2;
+ this.draggedItemStack = var4.inventory.decrStackSize(var4.slotIndex, var6);
+ if(var5.stackSize == 0) {
+ var4.putStack((ItemStack)null);
+ }
+
+ var4.onPickupFromSlot();
+ } else if(var5 == null && this.draggedItemStack != null && var4.isItemValid(this.draggedItemStack)) {
+ var6 = var3 == 0 ? this.draggedItemStack.stackSize : 1;
+ if(var6 > var4.inventory.getInventoryStackLimit()) {
+ var6 = var4.inventory.getInventoryStackLimit();
+ }
+
+ var4.putStack(this.draggedItemStack.splitStack(var6));
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+ } else if(var5 != null && this.draggedItemStack != null) {
+ if(var4.isItemValid(this.draggedItemStack)) {
+ if(var5.itemID != this.draggedItemStack.itemID) {
+ if(this.draggedItemStack.stackSize <= var4.inventory.getInventoryStackLimit()) {
+ var4.putStack(this.draggedItemStack);
+ this.draggedItemStack = var5;
+ }
+ } else if(var5.itemID == this.draggedItemStack.itemID) {
+ if(var3 == 0) {
+ var6 = this.draggedItemStack.stackSize;
+ if(var6 > var4.inventory.getInventoryStackLimit() - var5.stackSize) {
+ var6 = var4.inventory.getInventoryStackLimit() - var5.stackSize;
+ }
+
+ if(var6 > this.draggedItemStack.getMaxStackSize() - var5.stackSize) {
+ var6 = this.draggedItemStack.getMaxStackSize() - var5.stackSize;
+ }
+
+ this.draggedItemStack.splitStack(var6);
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+
+ var5.stackSize += var6;
+ } else if(var3 == 1) {
+ var6 = 1;
+ if(var6 > var4.inventory.getInventoryStackLimit() - var5.stackSize) {
+ var6 = var4.inventory.getInventoryStackLimit() - var5.stackSize;
+ }
+
+ if(var6 > this.draggedItemStack.getMaxStackSize() - var5.stackSize) {
+ var6 = this.draggedItemStack.getMaxStackSize() - var5.stackSize;
+ }
+
+ this.draggedItemStack.splitStack(var6);
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+
+ var5.stackSize += var6;
+ }
+ }
+ } else if(var5.itemID == this.draggedItemStack.itemID && this.draggedItemStack.getMaxStackSize() > 1) {
+ var6 = var5.stackSize;
+ if(var6 > 0 && var6 + this.draggedItemStack.stackSize <= this.draggedItemStack.getMaxStackSize()) {
+ this.draggedItemStack.stackSize += var6;
+ var5.splitStack(var6);
+ if(var5.stackSize == 0) {
+ var4.putStack((ItemStack)null);
+ }
+
+ var4.onPickupFromSlot();
+ }
+ }
+ }
+ }
+ } else if(this.draggedItemStack != null) {
+ int var8 = (this.width - this.xSize) / 2;
+ var6 = (this.height - this.ySize) / 2;
+ if(var1 < var8 || var2 < var6 || var1 >= var8 + this.xSize || var2 >= var6 + this.xSize) {
+ EntityPlayerSP var7 = this.mc.thePlayer;
+ if(var3 == 0) {
+ var7.dropPlayerItem(this.draggedItemStack);
+ this.draggedItemStack = null;
+ }
+
+ if(var3 == 1) {
+ var7.dropPlayerItem(this.draggedItemStack.splitStack(1));
+ if(this.draggedItemStack.stackSize == 0) {
+ this.draggedItemStack = null;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ protected void mouseMovedOrUp(int var1, int var2, int var3) {
+ if(var3 == 0) {
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(var2 == 1 || var2 == this.mc.gameSettings.keyBindInventory.keyCode) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+
+ }
+
+ public void onGuiClosed() {
+ if(this.draggedItemStack != null) {
+ this.mc.thePlayer.dropPlayerItem(this.draggedItemStack);
+ }
+
+ }
+
+ public void onCraftMatrixChanged(IInventory var1) {
+ }
+
+ public boolean doesGuiPauseGame() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/GuiControls.java b/src/net/minecraft/src/GuiControls.java
new file mode 100644
index 0000000..0d185df
--- /dev/null
+++ b/src/net/minecraft/src/GuiControls.java
@@ -0,0 +1,52 @@
+package net.minecraft.src;
+
+public class GuiControls extends GuiScreen {
+ private GuiScreen parentScreen;
+ protected String screenTitle = "Controls";
+ private GameSettings options;
+ private int buttonId = -1;
+
+ public GuiControls(GuiScreen var1, GameSettings var2) {
+ this.parentScreen = var1;
+ this.options = var2;
+ }
+
+ public void initGui() {
+ for(int var1 = 0; var1 < this.options.keyBindings.length; ++var1) {
+ this.controlList.add(new GuiSmallButton(var1, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), this.options.getOptionDisplayString(var1)));
+ }
+
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, "Done"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ for(int var2 = 0; var2 < this.options.keyBindings.length; ++var2) {
+ ((GuiButton)this.controlList.get(var2)).displayString = this.options.getOptionDisplayString(var2);
+ }
+
+ if(var1.id == 200) {
+ this.mc.displayGuiScreen(this.parentScreen);
+ } else {
+ this.buttonId = var1.id;
+ var1.displayString = "> " + this.options.getOptionDisplayString(var1.id) + " <";
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(this.buttonId >= 0) {
+ this.options.setKeyBinding(this.buttonId, var2);
+ ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
+ this.buttonId = -1;
+ } else {
+ super.keyTyped(var1, var2);
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/GuiCrafting.java b/src/net/minecraft/src/GuiCrafting.java
new file mode 100644
index 0000000..81fe8aa
--- /dev/null
+++ b/src/net/minecraft/src/GuiCrafting.java
@@ -0,0 +1,75 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiCrafting extends GuiContainer {
+ private InventoryCrafting inventoryCrafting = new InventoryCrafting(this, 3, 3);
+ private IInventory iInventory = new InventoryCraftResult();
+
+ public GuiCrafting(InventoryPlayer var1) {
+ this.inventorySlots.add(new SlotCrafting(this, this.inventoryCrafting, this.iInventory, 0, 124, 35));
+
+ int var2;
+ int var3;
+ for(var2 = 0; var2 < 3; ++var2) {
+ for(var3 = 0; var3 < 3; ++var3) {
+ this.inventorySlots.add(new Slot(this, this.inventoryCrafting, var3 + var2 * 3, 30 + var3 * 18, 17 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 3; ++var2) {
+ for(var3 = 0; var3 < 9; ++var3) {
+ this.inventorySlots.add(new Slot(this, var1, var3 + (var2 + 1) * 9, 8 + var3 * 18, 84 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 9; ++var2) {
+ this.inventorySlots.add(new Slot(this, var1, var2, 8 + var2 * 18, 142));
+ }
+
+ }
+
+ public void onGuiClosed() {
+ super.onGuiClosed();
+
+ for(int var1 = 0; var1 < 9; ++var1) {
+ ItemStack var2 = this.inventoryCrafting.getStackInSlot(var1);
+ if(var2 != null) {
+ this.mc.thePlayer.dropPlayerItem(var2);
+ }
+ }
+
+ }
+
+ public void onCraftMatrixChanged(IInventory var1) {
+ int[] var2 = new int[9];
+
+ for(int var3 = 0; var3 < 3; ++var3) {
+ for(int var4 = 0; var4 < 3; ++var4) {
+ int var5 = var3 + var4 * 3;
+ ItemStack var6 = this.inventoryCrafting.getStackInSlot(var5);
+ if(var6 == null) {
+ var2[var5] = -1;
+ } else {
+ var2[var5] = var6.itemID;
+ }
+ }
+ }
+
+ this.iInventory.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(var2));
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString("Crafting", 28, 6, 4210752);
+ this.fontRenderer.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/crafting.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/net/minecraft/src/GuiCreateWorld.java b/src/net/minecraft/src/GuiCreateWorld.java
new file mode 100644
index 0000000..9b49486
--- /dev/null
+++ b/src/net/minecraft/src/GuiCreateWorld.java
@@ -0,0 +1,69 @@
+package net.minecraft.src;
+
+import java.io.File;
+
+public class GuiCreateWorld extends GuiScreen {
+ protected GuiScreen parentGuiScreen;
+ protected String screenHeader = "Select world";
+ private boolean createClicked = false;
+
+ public GuiCreateWorld(GuiScreen var1) {
+ this.parentGuiScreen = var1;
+ }
+
+ public void initGui() {
+ File var1 = Minecraft.getMinecraftDir();
+
+ for(int var2 = 0; var2 < 5; ++var2) {
+ NBTTagCompound var3 = World.getLevelData(var1, "World" + (var2 + 1));
+ if(var3 == null) {
+ this.controlList.add(new GuiButton(var2, this.width / 2 - 100, this.height / 6 + 24 * var2, "- empty -"));
+ } else {
+ String var4 = "World " + (var2 + 1);
+ long var5 = var3.getLong("SizeOnDisk");
+ var4 = var4 + " (" + (float)(var5 / 1024L * 100L / 1024L) / 100.0F + " MB)";
+ this.controlList.add(new GuiButton(var2, this.width / 2 - 100, this.height / 6 + 24 * var2, var4));
+ }
+ }
+
+ this.initButtons();
+ }
+
+ protected String getSaveFileName(int var1) {
+ File var2 = Minecraft.getMinecraftDir();
+ return World.getLevelData(var2, "World" + var1) != null ? "World" + var1 : null;
+ }
+
+ public void initButtons() {
+ this.controlList.add(new GuiButton(5, this.width / 2 - 100, this.height / 6 + 120 + 12, "Delete world..."));
+ this.controlList.add(new GuiButton(6, this.width / 2 - 100, this.height / 6 + 168, "Cancel"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.enabled) {
+ if(var1.id < 5) {
+ this.actionPerformed(var1.id + 1);
+ } else if(var1.id == 5) {
+ this.mc.displayGuiScreen(new GuiDeleteWorld(this));
+ } else if(var1.id == 6) {
+ this.mc.displayGuiScreen(this.parentGuiScreen);
+ }
+
+ }
+ }
+
+ public void actionPerformed(int var1) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ if(!this.createClicked) {
+ this.createClicked = true;
+ this.mc.startWorld("World" + var1);
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenHeader, this.width / 2, 20, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/GuiDeleteWorld.java b/src/net/minecraft/src/GuiDeleteWorld.java
new file mode 100644
index 0000000..979aad5
--- /dev/null
+++ b/src/net/minecraft/src/GuiDeleteWorld.java
@@ -0,0 +1,31 @@
+package net.minecraft.src;
+
+import java.io.File;
+
+public class GuiDeleteWorld extends GuiCreateWorld {
+ public GuiDeleteWorld(GuiScreen var1) {
+ super(var1);
+ this.screenHeader = "Delete world";
+ }
+
+ public void initButtons() {
+ this.controlList.add(new GuiButton(6, this.width / 2 - 100, this.height / 6 + 168, "Cancel"));
+ }
+
+ public void actionPerformed(int var1) {
+ String var2 = this.getSaveFileName(var1);
+ if(var2 != null) {
+ this.mc.displayGuiScreen(new GuiYesNo(this, "Are you sure you want to delete this world?", "\'" + var2 + "\' will be lost forever!", var1));
+ }
+
+ }
+
+ public void deleteWorld(boolean var1, int var2) {
+ if(var1) {
+ File var3 = Minecraft.getMinecraftDir();
+ World.deleteWorld(var3, this.getSaveFileName(var2));
+ }
+
+ this.mc.displayGuiScreen(this.parentGuiScreen);
+ }
+}
diff --git a/src/net/minecraft/src/GuiEditSign.java b/src/net/minecraft/src/GuiEditSign.java
new file mode 100644
index 0000000..9ecea6d
--- /dev/null
+++ b/src/net/minecraft/src/GuiEditSign.java
@@ -0,0 +1,77 @@
+package net.minecraft.src;
+
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
+
+public class GuiEditSign extends GuiScreen {
+ protected String screenTitle = "Edit sign message:";
+ private TileEntitySign entitySign;
+ private int updateCounter;
+ private int editLine = 0;
+
+ public GuiEditSign(TileEntitySign var1) {
+ this.entitySign = var1;
+ }
+
+ public void initGui() {
+ this.controlList.clear();
+ Keyboard.enableRepeatEvents(true);
+ this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done"));
+ }
+
+ public void onGuiClosed() {
+ Keyboard.enableRepeatEvents(false);
+ }
+
+ public void updateScreen() {
+ ++this.updateCounter;
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.enabled) {
+ if(var1.id == 0) {
+ this.entitySign.onInventoryChanged();
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+
+ }
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(var2 == 200) {
+ this.editLine = this.editLine - 1 & 3;
+ }
+
+ if(var2 == 208 || var2 == 28) {
+ this.editLine = this.editLine + 1 & 3;
+ }
+
+ if(var2 == 14 && this.entitySign.signText[this.editLine].length() > 0) {
+ this.entitySign.signText[this.editLine] = this.entitySign.signText[this.editLine].substring(0, this.entitySign.signText[this.editLine].length() - 1);
+ }
+
+ if("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_\'*!\"#%/()=+?[]{}<>".indexOf(var1) >= 0 && this.entitySign.signText[this.editLine].length() < 15) {
+ this.entitySign.signText[this.editLine] = this.entitySign.signText[this.editLine] + var1;
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 40, 16777215);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(this.width / 2), (float)(this.height / 2), 50.0F);
+ float var4 = 60.0F;
+ GL11.glScalef(-var4, -var4, -var4);
+ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
+ if(this.updateCounter / 6 % 2 == 0) {
+ this.entitySign.lineBeingEdited = this.editLine;
+ }
+
+ GL11.glRotatef((float)(this.entitySign.getBlockMetadata() * 360) / 16.0F, 0.0F, 1.0F, 0.0F);
+ TileEntityRenderer.instance.renderTileEntityAt(this.entitySign, -0.5D, -0.75D, -0.5D, 0.0F);
+ this.entitySign.lineBeingEdited = -1;
+ GL11.glPopMatrix();
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/GuiErrorScreen.java b/src/net/minecraft/src/GuiErrorScreen.java
new file mode 100644
index 0000000..6707b98
--- /dev/null
+++ b/src/net/minecraft/src/GuiErrorScreen.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class GuiErrorScreen extends GuiScreen {
+ private String title;
+ private String text;
+
+ public void initGui() {
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224);
+ this.drawCenteredString(this.fontRenderer, this.title, this.width / 2, 90, 16777215);
+ this.drawCenteredString(this.fontRenderer, this.text, this.width / 2, 110, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ }
+}
diff --git a/src/net/minecraft/src/GuiFurnace.java b/src/net/minecraft/src/GuiFurnace.java
new file mode 100644
index 0000000..922342d
--- /dev/null
+++ b/src/net/minecraft/src/GuiFurnace.java
@@ -0,0 +1,48 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiFurnace extends GuiContainer {
+ private TileEntityFurnace furnaceInventory;
+
+ public GuiFurnace(InventoryPlayer var1, TileEntityFurnace var2) {
+ this.furnaceInventory = var2;
+ this.inventorySlots.add(new Slot(this, var2, 0, 56, 17));
+ this.inventorySlots.add(new Slot(this, var2, 1, 56, 53));
+ this.inventorySlots.add(new Slot(this, var2, 2, 116, 35));
+
+ int var3;
+ for(var3 = 0; var3 < 3; ++var3) {
+ for(int var4 = 0; var4 < 9; ++var4) {
+ this.inventorySlots.add(new Slot(this, var1, var4 + (var3 + 1) * 9, 8 + var4 * 18, 84 + var3 * 18));
+ }
+ }
+
+ for(var3 = 0; var3 < 9; ++var3) {
+ this.inventorySlots.add(new Slot(this, var1, var3, 8 + var3 * 18, 142));
+ }
+
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString("Furnace", 60, 6, 4210752);
+ this.fontRenderer.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/furnace.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
+ int var5;
+ if(this.furnaceInventory.isBurning()) {
+ var5 = this.furnaceInventory.getBurnTimeRemainingScaled(12);
+ this.drawTexturedModalRect(var3 + 56, var4 + 36 + 12 - var5, 176, 12 - var5, 14, var5 + 2);
+ }
+
+ var5 = this.furnaceInventory.getCookProgressScaled(24);
+ this.drawTexturedModalRect(var3 + 79, var4 + 34, 176, 14, var5 + 1, 16);
+ }
+}
diff --git a/src/net/minecraft/src/GuiGameOver.java b/src/net/minecraft/src/GuiGameOver.java
new file mode 100644
index 0000000..1eb64b0
--- /dev/null
+++ b/src/net/minecraft/src/GuiGameOver.java
@@ -0,0 +1,48 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiGameOver extends GuiScreen {
+ public void initGui() {
+ this.controlList.clear();
+ this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, "Respawn"));
+ this.controlList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, "Title menu"));
+ if(this.mc.session == null) {
+ ((GuiButton)this.controlList.get(1)).enabled = false;
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.id == 0) {
+ }
+
+ if(var1.id == 1) {
+ this.mc.respawn();
+ this.mc.displayGuiScreen((GuiScreen)null);
+ }
+
+ if(var1.id == 2) {
+ this.mc.changeWorld1((World)null);
+ this.mc.displayGuiScreen(new GuiMainMenu());
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792);
+ GL11.glPushMatrix();
+ GL11.glScalef(2.0F, 2.0F, 2.0F);
+ this.drawCenteredString(this.fontRenderer, "Game over!", this.width / 2 / 2, 30, 16777215);
+ GL11.glPopMatrix();
+ this.drawCenteredString(this.fontRenderer, "Score: &e" + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+
+ public boolean doesGuiPauseGame() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/GuiIngame.java b/src/net/minecraft/src/GuiIngame.java
new file mode 100644
index 0000000..f08a0db
--- /dev/null
+++ b/src/net/minecraft/src/GuiIngame.java
@@ -0,0 +1,222 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class GuiIngame extends Gui {
+ private static RenderItem itemRenderer = new RenderItem();
+ private List chatMessageList = new ArrayList();
+ private Random rand = new Random();
+ private Minecraft mc;
+ public String testMessage = null;
+ private int updateCounter = 0;
+ public float damageGuiPartialTime;
+ float prevVignetteBrightness = 1.0F;
+
+ public GuiIngame(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void renderGameOverlay(float var1, boolean var2, int var3, int var4) {
+ ScaledResolution var5 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var6 = var5.getScaledWidth();
+ int var7 = var5.getScaledHeight();
+ FontRenderer var8 = this.mc.fontRenderer;
+ this.mc.entityRenderer.setupOverlayRendering();
+ GL11.glEnable(GL11.GL_BLEND);
+ if(this.mc.gameSettings.fancyGraphics) {
+ this.renderVignette(this.mc.thePlayer.getEntityBrightness(var1), var6, var7);
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/gui.png"));
+ InventoryPlayer var9 = 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 + var9.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/icons.png"));
+ 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);
+ boolean var10 = this.mc.thePlayer.heartsLife / 3 % 2 == 1;
+ if(this.mc.thePlayer.heartsLife < 10) {
+ var10 = false;
+ }
+
+ int var11 = this.mc.thePlayer.health;
+ int var12 = this.mc.thePlayer.prevHealth;
+ this.rand.setSeed((long)(this.updateCounter * 312871));
+ int var13;
+ int var14;
+ int var15;
+ if(this.mc.playerController.shouldDrawHUD()) {
+ var13 = this.mc.thePlayer.getPlayerArmorValue();
+
+ int var16;
+ for(var14 = 0; var14 < 10; ++var14) {
+ var15 = var7 - 32;
+ if(var13 > 0) {
+ var16 = var6 / 2 + 91 - var14 * 8 - 9;
+ if(var14 * 2 + 1 < var13) {
+ this.drawTexturedModalRect(var16, var15, 34, 9, 9, 9);
+ }
+
+ if(var14 * 2 + 1 == var13) {
+ this.drawTexturedModalRect(var16, var15, 25, 9, 9, 9);
+ }
+
+ if(var14 * 2 + 1 > var13) {
+ this.drawTexturedModalRect(var16, var15, 16, 9, 9, 9);
+ }
+ }
+
+ byte var25 = 0;
+ if(var10) {
+ var25 = 1;
+ }
+
+ int var17 = var6 / 2 - 91 + var14 * 8;
+ if(var11 <= 4) {
+ var15 += this.rand.nextInt(2);
+ }
+
+ this.drawTexturedModalRect(var17, var15, 16 + var25 * 9, 0, 9, 9);
+ if(var10) {
+ if(var14 * 2 + 1 < var12) {
+ this.drawTexturedModalRect(var17, var15, 70, 0, 9, 9);
+ }
+
+ if(var14 * 2 + 1 == var12) {
+ this.drawTexturedModalRect(var17, var15, 79, 0, 9, 9);
+ }
+ }
+
+ if(var14 * 2 + 1 < var11) {
+ this.drawTexturedModalRect(var17, var15, 52, 0, 9, 9);
+ }
+
+ if(var14 * 2 + 1 == var11) {
+ this.drawTexturedModalRect(var17, var15, 61, 0, 9, 9);
+ }
+ }
+
+ if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
+ var14 = (int)Math.ceil((double)(this.mc.thePlayer.air - 2) * 10.0D / 300.0D);
+ var15 = (int)Math.ceil((double)this.mc.thePlayer.air * 10.0D / 300.0D) - var14;
+
+ for(var16 = 0; var16 < var14 + var15; ++var16) {
+ if(var16 < var14) {
+ this.drawTexturedModalRect(var6 / 2 - 91 + var16 * 8, var7 - 32 - 9, 16, 18, 9, 9);
+ } else {
+ this.drawTexturedModalRect(var6 / 2 - 91 + var16 * 8, var7 - 32 - 9, 25, 18, 9, 9);
+ }
+ }
+ }
+ }
+
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glPopMatrix();
+
+ for(var13 = 0; var13 < 9; ++var13) {
+ var14 = var6 / 2 - 90 + var13 * 20 + 2;
+ var15 = var7 - 16 - 3;
+ this.renderInventorySlot(var13, var14, var15, var1);
+ }
+
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ if(this.mc.gameSettings.showFPS) {
+ var8.drawStringWithShadow("Minecraft Infdev (" + this.mc.debug + ")", 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);
+ long var22 = Runtime.getRuntime().maxMemory();
+ long var26 = Runtime.getRuntime().totalMemory();
+ long var27 = Runtime.getRuntime().freeMemory();
+ long var19 = var26 - var27;
+ String var21 = "Used memory: " + var19 * 100L / var22 + "% (" + var19 / 1024L / 1024L + "MB) of " + var22 / 1024L / 1024L + "MB";
+ this.drawString(var8, var21, var6 - var8.getStringWidth(var21) - 2, 2, 14737632);
+ var21 = "Allocated memory: " + var26 * 100L / var22 + "% (" + var26 / 1024L / 1024L + "MB)";
+ this.drawString(var8, var21, var6 - var8.getStringWidth(var21) - 2, 12, 14737632);
+ } else {
+ var8.drawStringWithShadow("Minecraft Infdev", 2, 2, 16777215);
+ }
+
+ byte var23 = 10;
+ boolean var24 = false;
+
+ for(var15 = 0; var15 < this.chatMessageList.size() && var15 < var23; ++var15) {
+ if(((ChatLine)this.chatMessageList.get(var15)).updateCounter < 200 || var24) {
+ var8.drawStringWithShadow(((ChatLine)this.chatMessageList.get(var15)).message, 2, var7 - 8 - var15 * 9 - 20, 16777215);
+ }
+ }
+
+ }
+
+ 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);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDepthMask(false);
+ GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
+ GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/misc/vignette.png"));
+ 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, 0.0D, -90.0D, 0.0D, 0.0D);
+ var4.draw();
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ }
+
+ 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) {
+ GL11.glPushMatrix();
+ float var7 = 1.0F + var6 / 5.0F;
+ GL11.glTranslatef((float)(var2 + 8), (float)(var3 + 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);
+ }
+
+ itemRenderer.drawItemIntoGui(this.mc.fontRenderer, this.mc.renderEngine, var5, var2, var3);
+ if(var6 > 0.0F) {
+ GL11.glPopMatrix();
+ }
+
+ itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.renderEngine, var5, var2, var3);
+ }
+ }
+
+ public void updateTick() {
+ ++this.updateCounter;
+
+ for(int var1 = 0; var1 < this.chatMessageList.size(); ++var1) {
+ ++((ChatLine)this.chatMessageList.get(var1)).updateCounter;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/GuiIngameMenu.java b/src/net/minecraft/src/GuiIngameMenu.java
new file mode 100644
index 0000000..a6b46fe
--- /dev/null
+++ b/src/net/minecraft/src/GuiIngameMenu.java
@@ -0,0 +1,50 @@
+package net.minecraft.src;
+
+public class GuiIngameMenu extends GuiScreen {
+ private int updateCounter2 = 0;
+ private int updateCounter = 0;
+
+ public void initGui() {
+ this.updateCounter2 = 0;
+ this.controlList.clear();
+ this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 48, "Save and quit to title.."));
+ this.controlList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24, "Back to game"));
+ this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96, "Options..."));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.id == 0) {
+ this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
+ }
+
+ if(var1.id == 1) {
+ this.mc.changeWorld1((World)null);
+ this.mc.displayGuiScreen(new GuiMainMenu());
+ }
+
+ if(var1.id == 4) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ this.mc.setIngameFocus();
+ }
+
+ }
+
+ public void updateScreen() {
+ super.updateScreen();
+ ++this.updateCounter;
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ boolean var4 = !this.mc.theWorld.saveWorld(this.updateCounter2++);
+ if(var4 || this.updateCounter < 20) {
+ float var5 = ((float)(this.updateCounter % 10) + var3) / 10.0F;
+ var5 = MathHelper.sin(var5 * (float)Math.PI * 2.0F) * 0.2F + 0.8F;
+ int var6 = (int)(255.0F * var5);
+ this.drawString(this.fontRenderer, "Saving level..", 8, this.height - 16, var6 << 16 | var6 << 8 | var6);
+ }
+
+ this.drawCenteredString(this.fontRenderer, "Game menu", this.width / 2, 40, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/GuiInventory.java b/src/net/minecraft/src/GuiInventory.java
new file mode 100644
index 0000000..a145409
--- /dev/null
+++ b/src/net/minecraft/src/GuiInventory.java
@@ -0,0 +1,117 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class GuiInventory extends GuiContainer {
+ private InventoryCrafting craftingInventory = new InventoryCrafting(this, 2, 2);
+ private IInventory craftingResultInventory = new InventoryCraftResult();
+ private float xSize_lo;
+ private float ySize_lo;
+
+ public GuiInventory(IInventory var1) {
+ this.allowUserInput = true;
+ this.inventorySlots.add(new SlotCrafting(this, this.craftingInventory, this.craftingResultInventory, 0, 144, 36));
+
+ int var2;
+ int var3;
+ for(var2 = 0; var2 < 2; ++var2) {
+ for(var3 = 0; var3 < 2; ++var3) {
+ this.inventorySlots.add(new Slot(this, this.craftingInventory, var3 + var2 * 2, 88 + var3 * 18, 26 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 4; ++var2) {
+ this.inventorySlots.add(new SlotArmor(this, this, var1, var1.getSizeInventory() - 1 - var2, 8, 8 + var2 * 18, var2));
+ }
+
+ for(var2 = 0; var2 < 3; ++var2) {
+ for(var3 = 0; var3 < 9; ++var3) {
+ this.inventorySlots.add(new Slot(this, var1, var3 + (var2 + 1) * 9, 8 + var3 * 18, 84 + var2 * 18));
+ }
+ }
+
+ for(var2 = 0; var2 < 9; ++var2) {
+ this.inventorySlots.add(new Slot(this, var1, var2, 8 + var2 * 18, 142));
+ }
+
+ }
+
+ public void onGuiClosed() {
+ super.onGuiClosed();
+
+ for(int var1 = 0; var1 < this.craftingInventory.getSizeInventory(); ++var1) {
+ ItemStack var2 = this.craftingInventory.getStackInSlot(var1);
+ if(var2 != null) {
+ this.mc.thePlayer.dropPlayerItem(var2);
+ }
+ }
+
+ }
+
+ public void onCraftMatrixChanged(IInventory var1) {
+ int[] var2 = new int[9];
+
+ for(int var3 = 0; var3 < 3; ++var3) {
+ for(int var4 = 0; var4 < 3; ++var4) {
+ int var5 = -1;
+ if(var3 < 2 && var4 < 2) {
+ ItemStack var6 = this.craftingInventory.getStackInSlot(var3 + var4 * 2);
+ if(var6 != null) {
+ var5 = var6.itemID;
+ }
+ }
+
+ var2[var3 + var4 * 3] = var5;
+ }
+ }
+
+ this.craftingResultInventory.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(var2));
+ }
+
+ protected void drawGuiContainerForegroundLayer() {
+ this.fontRenderer.drawString("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;
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float var1) {
+ int var2 = this.mc.renderEngine.getTexture("/gui/inventory.png");
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(var2);
+ int var3 = (this.width - this.xSize) / 2;
+ int var4 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(var3, var4, 0, 0, this.xSize, this.ySize);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(var3 + 51), (float)(var4 + 75), 50.0F);
+ float var5 = 30.0F;
+ GL11.glScalef(-var5, var5, var5);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ float var6 = this.mc.thePlayer.renderYawOffset;
+ float var7 = this.mc.thePlayer.rotationYaw;
+ float var8 = this.mc.thePlayer.rotationPitch;
+ float var9 = (float)(var3 + 51) - this.xSize_lo;
+ float var10 = (float)(var4 + 75 - 50) - this.ySize_lo;
+ 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)(var10 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
+ this.mc.thePlayer.renderYawOffset = (float)Math.atan((double)(var9 / 40.0F)) * 20.0F;
+ this.mc.thePlayer.rotationYaw = (float)Math.atan((double)(var9 / 40.0F)) * 40.0F;
+ this.mc.thePlayer.rotationPitch = -((float)Math.atan((double)(var10 / 40.0F))) * 20.0F;
+ GL11.glTranslatef(0.0F, this.mc.thePlayer.yOffset, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(this.mc.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ this.mc.thePlayer.renderYawOffset = var6;
+ this.mc.thePlayer.rotationYaw = var7;
+ this.mc.thePlayer.rotationPitch = var8;
+ GL11.glPopMatrix();
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ }
+}
diff --git a/src/net/minecraft/src/GuiMainMenu.java b/src/net/minecraft/src/GuiMainMenu.java
new file mode 100644
index 0000000..2b4f8ad
--- /dev/null
+++ b/src/net/minecraft/src/GuiMainMenu.java
@@ -0,0 +1,71 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class GuiMainMenu extends GuiScreen {
+ private float updateCounter = 0.0F;
+ private String[] splashes = new String[]{"Pre-beta!", "As seen on TV!", "Awesome!", "100% pure!", "May contain nuts!", "Better than Prey!", "More polygons!", "Sexy!", "Limited edition!", "Flashing letters!", "Made by Notch!", "Coming soon!", "Best in class!", "When it\'s finished!", "Absolutely dragon free!", "Excitement!", "More than 5000 sold!", "One of a kind!", "700+ hits on YouTube!", "Indev!", "Spiders everywhere!", "Check it out!", "Holy cow, man!", "It\'s a game!", "Made in Sweden!", "Uses LWJGL!", "Reticulating splines!", "Minecraft!", "Yaaay!", "Alpha version!", "Singleplayer!", "Keyboard compatible!", "Undocumented!", "Ingots!", "Exploding creepers!", "That\'s not a moon!", "l33t!", "Create!", "Survive!", "Dungeon!", "Exclusive!", "The bee\'s knees!", "Down with O.P.P.!", "Closed source!", "Classy!", "Wow!", "Not on steam!", "9.95 euro!", "Half price!", "Oh man!", "Check it out!", "Awesome community!", "Pixels!", "Teetsuuuuoooo!", "Kaaneeeedaaaa!", "Now with difficulty!", "Enhanced!", "90% bug free!", "Pretty!", "12 herbs and spices!", "Fat free!", "Absolutely no memes!", "Free dental!", "Ask your doctor!", "Minors welcome!", "Cloud computing!", "Legal in Finland!", "Hard to label!", "Technically good!", "Bringing home the bacon!", "Indie!", "GOTY!", "Ceci n\'est pas une title screen!", "Euclidian!", "Now in 3D!", "Inspirational!", "Herregud!", "Complex cellular automata!", "Yes, sir!", "Played by cowboys!", "OpenGL 1.1!", "Thousands of colors!", "Try it!", "Age of Wonders is better!", "Try the mushroom stew!", "Sensational!", "Hot tamale, hot hot tamale!", "Play him off, keyboard cat!", "Guaranteed!", "Macroscopic!", "Bring it on!", "Random splash!", "Call your mother!", "Monster infighting!", "Loved by millions!", "Ultimate edition!", "Freaky!", "You\'ve got a brand new key!", "Water proof!", "Uninflammable!", "Whoa, dude!", "All inclusive!", "Tell your friends!", "NP is not in P!", "Notch <3 Ez!", "Music by C418!"};
+ private String splashString = this.splashes[(int)(Math.random() * (double)this.splashes.length)];
+
+ public void updateScreen() {
+ this.updateCounter += 0.01F;
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ }
+
+ public void initGui() {
+ this.controlList.clear();
+ this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 48, "Single player"));
+ this.controlList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 72, "Multi player"));
+ this.controlList.add(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 96, "Play tutorial level"));
+ this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Options..."));
+ ((GuiButton)this.controlList.get(1)).enabled = false;
+ ((GuiButton)this.controlList.get(2)).enabled = false;
+ if(this.mc.session == null) {
+ ((GuiButton)this.controlList.get(1)).enabled = false;
+ }
+
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.id == 0) {
+ this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
+ }
+
+ if(var1.id == 1) {
+ this.mc.displayGuiScreen(new GuiCreateWorld(this));
+ }
+
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ Tessellator var4 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/logo.png"));
+ short var5 = 256;
+ byte var6 = 49;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ var4.setColorOpaque_I(16777215);
+ this.drawTexturedModalRect((this.width - var5) / 2, 30, 0, 0, var5, var6);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
+ GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
+ float var7 = 1.8F - MathHelper.abs(MathHelper.sin((float)(System.currentTimeMillis() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
+ var7 = var7 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashString) + 32);
+ GL11.glScalef(var7, var7, var7);
+ this.drawCenteredString(this.fontRenderer, this.splashString, 0, -8, 16776960);
+ GL11.glPopMatrix();
+ String var8 = "Copyright Mojang Specifications. Do not distribute.";
+ this.drawString(this.fontRenderer, var8, this.width - this.fontRenderer.getStringWidth(var8) - 2, this.height - 10, 16777215);
+ long var9 = Runtime.getRuntime().maxMemory();
+ long var11 = Runtime.getRuntime().totalMemory();
+ long var13 = Runtime.getRuntime().freeMemory();
+ long var15 = var9 - var13;
+ var8 = "Free memory: " + var15 * 100L / var9 + "% of " + var9 / 1024L / 1024L + "MB";
+ this.drawString(this.fontRenderer, var8, this.width - this.fontRenderer.getStringWidth(var8) - 2, 2, 8421504);
+ var8 = "Allocated memory: " + var11 * 100L / var9 + "% (" + var11 / 1024L / 1024L + "MB)";
+ this.drawString(this.fontRenderer, var8, this.width - this.fontRenderer.getStringWidth(var8) - 2, 12, 8421504);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/GuiOptions.java b/src/net/minecraft/src/GuiOptions.java
new file mode 100644
index 0000000..a6b73eb
--- /dev/null
+++ b/src/net/minecraft/src/GuiOptions.java
@@ -0,0 +1,45 @@
+package net.minecraft.src;
+
+public class GuiOptions extends GuiScreen {
+ private GuiScreen parentScreen;
+ protected String screenTitle = "Options";
+ private GameSettings options;
+
+ public GuiOptions(GuiScreen var1, GameSettings var2) {
+ this.parentScreen = var1;
+ this.options = var2;
+ }
+
+ public void initGui() {
+ for(int var1 = 0; var1 < this.options.numberOfOptions; ++var1) {
+ this.controlList.add(new GuiSmallButton(var1, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), this.options.getKeyBinding(var1)));
+ }
+
+ this.controlList.add(new GuiButton(100, this.width / 2 - 100, this.height / 6 + 120 + 12, "Controls..."));
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, "Done"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ if(var1.enabled) {
+ if(var1.id < 100) {
+ this.options.setOptionFloatValue(var1.id, 1);
+ var1.displayString = this.options.getKeyBinding(var1.id);
+ }
+
+ if(var1.id == 100) {
+ this.mc.displayGuiScreen(new GuiControls(this, this.options));
+ }
+
+ if(var1.id == 200) {
+ this.mc.displayGuiScreen(this.parentScreen);
+ }
+
+ }
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/GuiScreen.java b/src/net/minecraft/src/GuiScreen.java
new file mode 100644
index 0000000..392f9fc
--- /dev/null
+++ b/src/net/minecraft/src/GuiScreen.java
@@ -0,0 +1,138 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.GL11;
+
+public class GuiScreen extends Gui {
+ protected Minecraft mc;
+ public int width;
+ public int height;
+ protected List controlList = new ArrayList();
+ public boolean allowUserInput = false;
+ protected FontRenderer fontRenderer;
+
+ public void drawScreen(int var1, int var2, float var3) {
+ for(int var4 = 0; var4 < this.controlList.size(); ++var4) {
+ GuiButton var5 = (GuiButton)this.controlList.get(var4);
+ var5.drawButton(this.mc, var1, var2);
+ }
+
+ }
+
+ protected void keyTyped(char var1, int var2) {
+ if(var2 == 1) {
+ this.mc.displayGuiScreen((GuiScreen)null);
+ this.mc.setIngameFocus();
+ }
+
+ }
+
+ protected void mouseClicked(int var1, int var2, int var3) {
+ if(var3 == 0) {
+ for(int var4 = 0; var4 < this.controlList.size(); ++var4) {
+ GuiButton var5 = (GuiButton)this.controlList.get(var4);
+ if(var5.mousePressed(var1, var2)) {
+ this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
+ this.actionPerformed(var5);
+ }
+ }
+ }
+
+ }
+
+ protected void mouseMovedOrUp(int var1, int var2, int var3) {
+ }
+
+ 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.initGui();
+ }
+
+ public void initGui() {
+ }
+
+ public void handleInput() {
+ while(Mouse.next()) {
+ this.handleMouseInput();
+ }
+
+ while(Keyboard.next()) {
+ this.handleKeyboardInput();
+ }
+
+ }
+
+ public void handleMouseInput() {
+ int var1;
+ int var2;
+ if(Mouse.getEventButtonState()) {
+ var1 = Mouse.getEventX() * this.width / this.mc.displayWidth;
+ var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
+ this.mouseClicked(var1, var2, Mouse.getEventButton());
+ } else {
+ var1 = Mouse.getEventX() * this.width / this.mc.displayWidth;
+ var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
+ this.mouseMovedOrUp(var1, var2, Mouse.getEventButton());
+ }
+
+ }
+
+ public void handleKeyboardInput() {
+ if(Keyboard.getEventKeyState()) {
+ if(Keyboard.getEventKey() == Keyboard.KEY_F11) {
+ this.mc.toggleFullscreen();
+ return;
+ }
+
+ this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
+ }
+
+ }
+
+ public void updateScreen() {
+ }
+
+ public void onGuiClosed() {
+ }
+
+ public void drawDefaultBackground() {
+ this.drawWorldBackground(0);
+ }
+
+ public void drawWorldBackground(int var1) {
+ if(this.mc.theWorld != null) {
+ this.drawGradientRect(0, 0, this.width, this.height, 1610941696, -1607454656);
+ } else {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_FOG);
+ Tessellator var2 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/dirt.png"));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ 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)(0 + var1));
+ var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)(0 + var1));
+ var2.draw();
+ }
+
+ }
+
+ public boolean doesGuiPauseGame() {
+ return true;
+ }
+
+ public void deleteWorld(boolean var1, int var2) {
+ }
+}
diff --git a/src/net/minecraft/src/GuiSmallButton.java b/src/net/minecraft/src/GuiSmallButton.java
new file mode 100644
index 0000000..e64c277
--- /dev/null
+++ b/src/net/minecraft/src/GuiSmallButton.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+public class GuiSmallButton extends GuiButton {
+ public GuiSmallButton(int var1, int var2, int var3, String var4) {
+ super(var1, var2, var3, 150, 20, var4);
+ }
+}
diff --git a/src/net/minecraft/src/GuiYesNo.java b/src/net/minecraft/src/GuiYesNo.java
new file mode 100644
index 0000000..3c22273
--- /dev/null
+++ b/src/net/minecraft/src/GuiYesNo.java
@@ -0,0 +1,31 @@
+package net.minecraft.src;
+
+public class GuiYesNo extends GuiScreen {
+ private GuiScreen parentScreen;
+ private String message1;
+ private String message2;
+ private int worldNumber;
+
+ public GuiYesNo(GuiScreen var1, String var2, String var3, int var4) {
+ this.parentScreen = var1;
+ this.message1 = var2;
+ this.message2 = var3;
+ this.worldNumber = var4;
+ }
+
+ public void initGui() {
+ this.controlList.add(new GuiSmallButton(0, this.width / 2 - 155 + 0, this.height / 6 + 96, "Yes"));
+ this.controlList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, "No"));
+ }
+
+ protected void actionPerformed(GuiButton var1) {
+ this.parentScreen.deleteWorld(var1.id == 0, this.worldNumber);
+ }
+
+ public void drawScreen(int var1, int var2, float var3) {
+ this.drawDefaultBackground();
+ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 70, 16777215);
+ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 90, 16777215);
+ super.drawScreen(var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/IBlockAccess.java b/src/net/minecraft/src/IBlockAccess.java
new file mode 100644
index 0000000..007ce98
--- /dev/null
+++ b/src/net/minecraft/src/IBlockAccess.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public interface IBlockAccess {
+ int getBlockId(int var1, int var2, int var3);
+
+ TileEntity getBlockTileEntity(int var1, int var2, int var3);
+
+ float getBrightness(int var1, int var2, int var3);
+
+ int getBlockMetadata(int var1, int var2, int var3);
+
+ Material getBlockMaterial(int var1, int var2, int var3);
+
+ boolean isBlockNormalCube(int var1, int var2, int var3);
+}
diff --git a/src/net/minecraft/src/ICamera.java b/src/net/minecraft/src/ICamera.java
new file mode 100644
index 0000000..fb186f4
--- /dev/null
+++ b/src/net/minecraft/src/ICamera.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+public interface ICamera {
+ boolean isBoundingBoxInFrustum(AxisAlignedBB var1);
+
+ void setPosition(double var1, double var3, double var5);
+}
diff --git a/src/net/minecraft/src/IChunkLoader.java b/src/net/minecraft/src/IChunkLoader.java
new file mode 100644
index 0000000..c197feb
--- /dev/null
+++ b/src/net/minecraft/src/IChunkLoader.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+import java.io.IOException;
+
+public interface IChunkLoader {
+ Chunk loadChunk(World var1, int var2, int var3) throws IOException;
+
+ void saveChunk(World var1, Chunk var2) throws IOException;
+
+ void saveExtraChunkData(World var1, Chunk var2);
+
+ void chunkTick();
+
+ void saveExtraData();
+}
diff --git a/src/net/minecraft/src/IChunkProvider.java b/src/net/minecraft/src/IChunkProvider.java
new file mode 100644
index 0000000..37743c9
--- /dev/null
+++ b/src/net/minecraft/src/IChunkProvider.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public interface IChunkProvider {
+ boolean chunkExists(int var1, int var2);
+
+ Chunk provideChunk(int var1, int var2);
+
+ void populate(IChunkProvider var1, int var2, int var3);
+
+ boolean saveChunks(boolean var1, IProgressUpdate var2);
+
+ boolean unload100OldestChunks();
+
+ boolean canSave();
+}
diff --git a/src/net/minecraft/src/IInventory.java b/src/net/minecraft/src/IInventory.java
new file mode 100644
index 0000000..b4564c7
--- /dev/null
+++ b/src/net/minecraft/src/IInventory.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public interface IInventory {
+ int getSizeInventory();
+
+ ItemStack getStackInSlot(int var1);
+
+ ItemStack decrStackSize(int var1, int var2);
+
+ void setInventorySlotContents(int var1, ItemStack var2);
+
+ String getInvName();
+
+ int getInventoryStackLimit();
+
+ void onInventoryChanged();
+}
diff --git a/src/net/minecraft/src/IProgressUpdate.java b/src/net/minecraft/src/IProgressUpdate.java
new file mode 100644
index 0000000..1fb3c60
--- /dev/null
+++ b/src/net/minecraft/src/IProgressUpdate.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+public interface IProgressUpdate {
+ void displayProgressMessage(String var1);
+
+ void displayLoadingString(String var1);
+
+ void setLoadingProgress(int var1);
+}
diff --git a/src/net/minecraft/src/IWorldAccess.java b/src/net/minecraft/src/IWorldAccess.java
new file mode 100644
index 0000000..abcfcea
--- /dev/null
+++ b/src/net/minecraft/src/IWorldAccess.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public interface IWorldAccess {
+ void markBlockAndNeighborsNeedsUpdate(int var1, int var2, int var3);
+
+ void markBlockRangeNeedsUpdate(int var1, int var2, int var3, int var4, int var5, int var6);
+
+ void playSound(String var1, double var2, double var4, double var6, float var8, float var9);
+
+ void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12);
+
+ void obtainEntitySkin(Entity var1);
+
+ void releaseEntitySkin(Entity var1);
+
+ void updateAllRenderers();
+}
diff --git a/src/net/minecraft/src/ImageBuffer.java b/src/net/minecraft/src/ImageBuffer.java
new file mode 100644
index 0000000..149f101
--- /dev/null
+++ b/src/net/minecraft/src/ImageBuffer.java
@@ -0,0 +1,7 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+
+public interface ImageBuffer {
+ BufferedImage parseUserSkin(BufferedImage var1);
+}
diff --git a/src/net/minecraft/src/ImageBufferDownload.java b/src/net/minecraft/src/ImageBufferDownload.java
new file mode 100644
index 0000000..39d9761
--- /dev/null
+++ b/src/net/minecraft/src/ImageBufferDownload.java
@@ -0,0 +1,88 @@
+package net.minecraft.src;
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferInt;
+import java.awt.image.ImageObserver;
+
+public class ImageBufferDownload implements ImageBuffer {
+ private int[] imageData;
+ private int imageWidth;
+ private int imageHeight;
+
+ public BufferedImage parseUserSkin(BufferedImage var1) {
+ if(var1 == 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.dispose();
+ this.imageData = ((DataBufferInt)var2.getRaster().getDataBuffer()).getData();
+ this.setAreaOpaque(0, 0, 32, 16);
+ this.setAreaTransparent(32, 0, 64, 32);
+ this.setAreaOpaque(0, 16, 64, 32);
+ boolean var4 = false;
+
+ int var5;
+ int var6;
+ int var7;
+ for(var5 = 32; var5 < 64; ++var5) {
+ for(var6 = 0; var6 < 16; ++var6) {
+ var7 = this.imageData[var5 + var6 * 64];
+ if((var7 >> 24 & 255) < 128) {
+ var4 = true;
+ }
+ }
+ }
+
+ if(!var4) {
+ for(var5 = 32; var5 < 64; ++var5) {
+ for(var6 = 0; var6 < 16; ++var6) {
+ var7 = this.imageData[var5 + var6 * 64];
+ if((var7 >> 24 & 255) < 128) {
+ var4 = true;
+ }
+ }
+ }
+ }
+
+ return var2;
+ }
+ }
+
+ 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) {
+ 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) {
+ 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) {
+ int var7 = this.imageData[var5 + var6 * this.imageWidth];
+ if((var7 >> 24 & 255) < 128) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/InventoryCraftResult.java b/src/net/minecraft/src/InventoryCraftResult.java
new file mode 100644
index 0000000..de21b2a
--- /dev/null
+++ b/src/net/minecraft/src/InventoryCraftResult.java
@@ -0,0 +1,38 @@
+package net.minecraft.src;
+
+public class InventoryCraftResult implements IInventory {
+ private ItemStack[] stackResult = new ItemStack[1];
+
+ public int getSizeInventory() {
+ return 1;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.stackResult[var1];
+ }
+
+ public String getInvName() {
+ return "Result";
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.stackResult[var1] != null) {
+ ItemStack var3 = this.stackResult[var1];
+ this.stackResult[var1] = null;
+ return var3;
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ this.stackResult[var1] = var2;
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public void onInventoryChanged() {
+ }
+}
diff --git a/src/net/minecraft/src/InventoryCrafting.java b/src/net/minecraft/src/InventoryCrafting.java
new file mode 100644
index 0000000..b5b78c3
--- /dev/null
+++ b/src/net/minecraft/src/InventoryCrafting.java
@@ -0,0 +1,59 @@
+package net.minecraft.src;
+
+public class InventoryCrafting implements IInventory {
+ private ItemStack[] stackList;
+ private int gridSize;
+ private GuiContainer craftingInventory;
+
+ public InventoryCrafting(GuiContainer var1, int var2, int var3) {
+ this.gridSize = var2 * var3;
+ this.stackList = new ItemStack[this.gridSize];
+ this.craftingInventory = var1;
+ }
+
+ public int getSizeInventory() {
+ return this.gridSize;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.stackList[var1];
+ }
+
+ public String getInvName() {
+ return "Crafting";
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.stackList[var1] != null) {
+ ItemStack var3;
+ if(this.stackList[var1].stackSize <= var2) {
+ var3 = this.stackList[var1];
+ this.stackList[var1] = null;
+ this.craftingInventory.onCraftMatrixChanged(this);
+ return var3;
+ } else {
+ var3 = this.stackList[var1].splitStack(var2);
+ if(this.stackList[var1].stackSize == 0) {
+ this.stackList[var1] = null;
+ }
+
+ this.craftingInventory.onCraftMatrixChanged(this);
+ return var3;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ this.stackList[var1] = var2;
+ this.craftingInventory.onCraftMatrixChanged(this);
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public void onInventoryChanged() {
+ }
+}
diff --git a/src/net/minecraft/src/InventoryLargeChest.java b/src/net/minecraft/src/InventoryLargeChest.java
new file mode 100644
index 0000000..daced98
--- /dev/null
+++ b/src/net/minecraft/src/InventoryLargeChest.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class InventoryLargeChest implements IInventory {
+ private String name;
+ private IInventory upperChest;
+ private IInventory lowerChest;
+
+ public InventoryLargeChest(String var1, IInventory var2, IInventory var3) {
+ this.name = var1;
+ this.upperChest = var2;
+ this.lowerChest = var3;
+ }
+
+ public int getSizeInventory() {
+ return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory();
+ }
+
+ public String getInvName() {
+ return this.name;
+ }
+
+ 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 void setInventorySlotContents(int var1, ItemStack var2) {
+ if(var1 >= this.upperChest.getSizeInventory()) {
+ this.lowerChest.setInventorySlotContents(var1 - this.upperChest.getSizeInventory(), var2);
+ } else {
+ this.upperChest.setInventorySlotContents(var1, var2);
+ }
+
+ }
+
+ public int getInventoryStackLimit() {
+ return this.upperChest.getInventoryStackLimit();
+ }
+
+ public void onInventoryChanged() {
+ this.upperChest.onInventoryChanged();
+ this.lowerChest.onInventoryChanged();
+ }
+}
diff --git a/src/net/minecraft/src/InventoryPlayer.java b/src/net/minecraft/src/InventoryPlayer.java
new file mode 100644
index 0000000..3c5e832
--- /dev/null
+++ b/src/net/minecraft/src/InventoryPlayer.java
@@ -0,0 +1,329 @@
+package net.minecraft.src;
+
+public class InventoryPlayer implements IInventory {
+ public ItemStack[] mainInventory = new ItemStack[36];
+ public ItemStack[] armorInventory = new ItemStack[4];
+ public int currentItem = 0;
+ private EntityPlayer player;
+
+ public InventoryPlayer(EntityPlayer var1) {
+ this.player = var1;
+ }
+
+ public ItemStack getCurrentItem() {
+ return this.mainInventory[this.currentItem];
+ }
+
+ private int getInventorySlotContainItem(int var1) {
+ for(int var2 = 0; var2 < this.mainInventory.length; ++var2) {
+ if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1) {
+ return var2;
+ }
+ }
+
+ return -1;
+ }
+
+ private int storeItemStack(int var1) {
+ for(int var2 = 0; var2 < this.mainInventory.length; ++var2) {
+ if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1 && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit()) {
+ return var2;
+ }
+ }
+
+ return -1;
+ }
+
+ private int getFirstEmptyStack() {
+ for(int var1 = 0; var1 < this.mainInventory.length; ++var1) {
+ if(this.mainInventory[var1] == null) {
+ return var1;
+ }
+ }
+
+ return -1;
+ }
+
+ public void setCurrentItem(int var1, boolean var2) {
+ int var3 = this.getInventorySlotContainItem(var1);
+ if(var3 >= 0 && var3 < 9) {
+ this.currentItem = var3;
+ }
+ }
+
+ 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) {
+ this.currentItem -= 9;
+ }
+
+ }
+
+ private int storePartialItemStack(int var1, int var2) {
+ int var3 = this.storeItemStack(var1);
+ if(var3 < 0) {
+ var3 = this.getFirstEmptyStack();
+ }
+
+ if(var3 < 0) {
+ return var2;
+ } else {
+ if(this.mainInventory[var3] == null) {
+ this.mainInventory[var3] = new ItemStack(var1, 0);
+ }
+
+ int var4 = var2;
+ if(var2 > this.mainInventory[var3].getMaxStackSize() - this.mainInventory[var3].stackSize) {
+ var4 = this.mainInventory[var3].getMaxStackSize() - this.mainInventory[var3].stackSize;
+ }
+
+ if(var4 > this.getInventoryStackLimit() - this.mainInventory[var3].stackSize) {
+ var4 = this.getInventoryStackLimit() - this.mainInventory[var3].stackSize;
+ }
+
+ if(var4 == 0) {
+ return var2;
+ } else {
+ var2 -= var4;
+ this.mainInventory[var3].stackSize += var4;
+ this.mainInventory[var3].animationsToGo = 5;
+ return var2;
+ }
+ }
+ }
+
+ public void decrementAnimations() {
+ for(int var1 = 0; var1 < this.mainInventory.length; ++var1) {
+ if(this.mainInventory[var1] != null && this.mainInventory[var1].animationsToGo > 0) {
+ --this.mainInventory[var1].animationsToGo;
+ }
+ }
+
+ }
+
+ public boolean consumeInventoryItem(int var1) {
+ int var2 = this.getInventorySlotContainItem(var1);
+ if(var2 < 0) {
+ return false;
+ } else {
+ if(--this.mainInventory[var2].stackSize <= 0) {
+ this.mainInventory[var2] = null;
+ }
+
+ return true;
+ }
+ }
+
+ public boolean addItemStackToInventory(ItemStack var1) {
+ if(var1.itemDmg == 0) {
+ var1.stackSize = this.storePartialItemStack(var1.itemID, var1.stackSize);
+ if(var1.stackSize == 0) {
+ return true;
+ }
+ }
+
+ int var2 = this.getFirstEmptyStack();
+ if(var2 >= 0) {
+ this.mainInventory[var2] = var1;
+ this.mainInventory[var2].animationsToGo = 5;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ ItemStack[] var3 = this.mainInventory;
+ if(var1 >= this.mainInventory.length) {
+ var3 = this.armorInventory;
+ var1 -= this.mainInventory.length;
+ }
+
+ if(var3[var1] != null) {
+ ItemStack var4;
+ if(var3[var1].stackSize <= var2) {
+ var4 = var3[var1];
+ var3[var1] = null;
+ return var4;
+ } else {
+ var4 = var3[var1].splitStack(var2);
+ if(var3[var1].stackSize == 0) {
+ var3[var1] = null;
+ }
+
+ return var4;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void setInventorySlotContents(int var1, ItemStack var2) {
+ ItemStack[] var3 = this.mainInventory;
+ if(var1 >= this.mainInventory.length) {
+ var3 = this.armorInventory;
+ var1 -= this.mainInventory.length;
+ }
+
+ var3[var1] = var2;
+ }
+
+ public float getStrVsBlock(Block var1) {
+ float var2 = 1.0F;
+ if(this.mainInventory[this.currentItem] != null) {
+ var2 *= this.mainInventory[this.currentItem].getStrVsBlock(var1);
+ }
+
+ return var2;
+ }
+
+ public NBTTagList writeToNBT(NBTTagList var1) {
+ int var2;
+ NBTTagCompound var3;
+ 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.setTag(var3);
+ }
+ }
+
+ 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.setTag(var3);
+ }
+ }
+
+ return var1;
+ }
+
+ public void readFromNBT(NBTTagList var1) {
+ this.mainInventory = new ItemStack[36];
+ this.armorInventory = new ItemStack[4];
+
+ for(int var2 = 0; var2 < var1.tagCount(); ++var2) {
+ NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2);
+ int var4 = var3.getByte("Slot") & 255;
+ if(var4 >= 0 && var4 < this.mainInventory.length) {
+ this.mainInventory[var4] = new ItemStack(var3);
+ }
+
+ if(var4 >= 100 && var4 < this.armorInventory.length + 100) {
+ this.armorInventory[var4 - 100] = new ItemStack(var3);
+ }
+ }
+
+ }
+
+ public int getSizeInventory() {
+ return this.mainInventory.length + 4;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ ItemStack[] var2 = this.mainInventory;
+ if(var1 >= this.mainInventory.length) {
+ var2 = this.armorInventory;
+ var1 -= this.mainInventory.length;
+ }
+
+ return var2[var1];
+ }
+
+ public String getInvName() {
+ return "Inventory";
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ ItemStack var2 = this.getStackInSlot(this.currentItem);
+ return var2 != null ? var2.getDamageVsEntity(var1) : 1;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ if(var1.blockMaterial != Material.rock && var1.blockMaterial != Material.iron) {
+ return true;
+ } else {
+ ItemStack var2 = this.getStackInSlot(this.currentItem);
+ return var2 != null ? var2.canHarvestBlock(var1) : false;
+ }
+ }
+
+ public ItemStack armorItemInSlot(int var1) {
+ return this.armorInventory[var1];
+ }
+
+ public int getTotalArmorValue() {
+ int var1 = 0;
+ int var2 = 0;
+ int var3 = 0;
+
+ for(int var4 = 0; var4 < this.armorInventory.length; ++var4) {
+ if(this.armorInventory[var4] != null && this.armorInventory[var4].getItem() instanceof ItemArmor) {
+ int var5 = this.armorInventory[var4].getMaxDamage();
+ int var6 = this.armorInventory[var4].itemDmg;
+ int var7 = var5 - var6;
+ var2 += var7;
+ var3 += var5;
+ int var8 = ((ItemArmor)this.armorInventory[var4].getItem()).damageReduceAmount;
+ var1 += var8;
+ }
+ }
+
+ if(var3 == 0) {
+ return 0;
+ } else {
+ return (var1 - 1) * var2 / var3 + 1;
+ }
+ }
+
+ public void damageArmor(int var1) {
+ for(int var2 = 0; var2 < this.armorInventory.length; ++var2) {
+ if(this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) {
+ this.armorInventory[var2].damageItem(var1);
+ if(this.armorInventory[var2].stackSize == 0) {
+ this.armorInventory[var2].onItemDestroyedByUse(this.player);
+ this.armorInventory[var2] = null;
+ }
+ }
+ }
+
+ }
+
+ public void dropAllItems() {
+ int var1;
+ 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) {
+ this.player.dropPlayerItemWithRandomChoice(this.armorInventory[var1], true);
+ this.armorInventory[var1] = null;
+ }
+ }
+
+ }
+
+ public void onInventoryChanged() {
+ }
+}
diff --git a/src/net/minecraft/src/IsoImageBuffer.java b/src/net/minecraft/src/IsoImageBuffer.java
new file mode 100644
index 0000000..51bd4c2
--- /dev/null
+++ b/src/net/minecraft/src/IsoImageBuffer.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+
+public class IsoImageBuffer {
+ public BufferedImage image;
+ public World level;
+ public int chunkX;
+ public int chunkZ;
+ public boolean rendered = false;
+ public boolean noContent = false;
+ public int lastVisible = 0;
+ public boolean addedToRenderQueue = false;
+
+ public IsoImageBuffer(World var1, int var2, int var3) {
+ this.level = var1;
+ this.setChunkPosition(var2, var3);
+ }
+
+ public void setChunkPosition(int var1, int var2) {
+ this.rendered = false;
+ this.chunkX = var1;
+ this.chunkZ = var2;
+ this.lastVisible = 0;
+ this.addedToRenderQueue = false;
+ }
+
+ public void setWorldAndChunkPosition(World var1, int var2, int var3) {
+ this.level = var1;
+ this.setChunkPosition(var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/Item.java b/src/net/minecraft/src/Item.java
new file mode 100644
index 0000000..5f953d1
--- /dev/null
+++ b/src/net/minecraft/src/Item.java
@@ -0,0 +1,141 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class Item {
+ protected static Random itemRand = new Random();
+ public static Item[] itemsList = new Item[1024];
+ public static Item shovel = (new ItemSpade(0, 2)).setIconIndex(82);
+ public static Item pickaxeSteel = (new ItemPickaxe(1, 2)).setIconIndex(98);
+ public static Item axeSteel = (new ItemAxe(2, 2)).setIconIndex(114);
+ public static Item striker = (new ItemFlintAndSteel(3)).setIconIndex(5);
+ public static Item appleRed = (new ItemFood(4, 4)).setIconIndex(10);
+ public static Item bow = (new ItemBow(5)).setIconIndex(21);
+ public static Item arrow = (new Item(6)).setIconIndex(37);
+ public static Item coal = (new Item(7)).setIconIndex(7);
+ public static Item diamond = (new Item(8)).setIconIndex(55);
+ public static Item ingotIron = (new Item(9)).setIconIndex(23);
+ public static Item ingotGold = (new Item(10)).setIconIndex(39);
+ public static Item swordSteel = (new ItemSword(11, 2)).setIconIndex(66);
+ public static Item swordWood = (new ItemSword(12, 0)).setIconIndex(64);
+ public static Item shovelWood = (new ItemSpade(13, 0)).setIconIndex(80);
+ public static Item pickaxeWood = (new ItemPickaxe(14, 0)).setIconIndex(96);
+ public static Item axeWood = (new ItemAxe(15, 0)).setIconIndex(112);
+ public static Item swordStone = (new ItemSword(16, 1)).setIconIndex(65);
+ public static Item shovelStone = (new ItemSpade(17, 1)).setIconIndex(81);
+ public static Item pickaxeStone = (new ItemPickaxe(18, 1)).setIconIndex(97);
+ public static Item axeStone = (new ItemAxe(19, 1)).setIconIndex(113);
+ public static Item swordDiamond = (new ItemSword(20, 3)).setIconIndex(67);
+ public static Item shovelDiamond = (new ItemSpade(21, 3)).setIconIndex(83);
+ public static Item pickaxeDiamond = (new ItemPickaxe(22, 3)).setIconIndex(99);
+ public static Item axeDiamond = (new ItemAxe(23, 3)).setIconIndex(115);
+ public static Item stick = (new Item(24)).setIconIndex(53);
+ public static Item bowlEmpty = (new Item(25)).setIconIndex(71);
+ public static Item bowlSoup = (new ItemSoup(26, 10)).setIconIndex(72);
+ public static Item swordGold = (new ItemSword(27, 0)).setIconIndex(68);
+ public static Item shovelGold = (new ItemSpade(28, 0)).setIconIndex(84);
+ public static Item pickaxeGold = (new ItemPickaxe(29, 0)).setIconIndex(100);
+ public static Item axeGold = (new ItemAxe(30, 0)).setIconIndex(116);
+ public static Item silk = (new Item(31)).setIconIndex(8);
+ public static Item feather = (new Item(32)).setIconIndex(24);
+ public static Item gunpowder = (new Item(33)).setIconIndex(40);
+ public static Item hoeWood = (new ItemHoe(34, 0)).setIconIndex(128);
+ public static Item hoeStone = (new ItemHoe(35, 1)).setIconIndex(129);
+ public static Item hoeSteel = (new ItemHoe(36, 2)).setIconIndex(130);
+ public static Item hoeDiamond = (new ItemHoe(37, 3)).setIconIndex(131);
+ public static Item hoeGold = (new ItemHoe(38, 4)).setIconIndex(132);
+ public static Item seeds = (new ItemSeeds(39, Block.crops.blockID)).setIconIndex(9);
+ public static Item wheat = (new Item(40)).setIconIndex(25);
+ public static Item bread = (new ItemFood(41, 5)).setIconIndex(41);
+ public static Item helmetLeather = (new ItemArmor(42, 0, 0, 0)).setIconIndex(0);
+ public static Item plateLeather = (new ItemArmor(43, 0, 0, 1)).setIconIndex(16);
+ public static Item legsLeather = (new ItemArmor(44, 0, 0, 2)).setIconIndex(32);
+ public static Item bootsLeather = (new ItemArmor(45, 0, 0, 3)).setIconIndex(48);
+ public static Item helmetChain = (new ItemArmor(46, 1, 1, 0)).setIconIndex(1);
+ public static Item plateChain = (new ItemArmor(47, 1, 1, 1)).setIconIndex(17);
+ public static Item legsChain = (new ItemArmor(48, 1, 1, 2)).setIconIndex(33);
+ public static Item bootsChain = (new ItemArmor(49, 1, 1, 3)).setIconIndex(49);
+ public static Item helmetSteel = (new ItemArmor(50, 2, 2, 0)).setIconIndex(2);
+ public static Item plateSteel = (new ItemArmor(51, 2, 2, 1)).setIconIndex(18);
+ public static Item legsSteel = (new ItemArmor(52, 2, 2, 2)).setIconIndex(34);
+ public static Item bootsSteel = (new ItemArmor(53, 2, 2, 3)).setIconIndex(50);
+ public static Item helmetDiamond = (new ItemArmor(54, 3, 3, 0)).setIconIndex(3);
+ public static Item plateDiamonhd = (new ItemArmor(55, 3, 3, 1)).setIconIndex(19);
+ public static Item legsDiamond = (new ItemArmor(56, 3, 3, 2)).setIconIndex(35);
+ public static Item bootsDiamond = (new ItemArmor(57, 3, 3, 3)).setIconIndex(51);
+ public static Item helmetGold = (new ItemArmor(58, 1, 4, 0)).setIconIndex(4);
+ public static Item plateGold = (new ItemArmor(59, 1, 4, 1)).setIconIndex(20);
+ public static Item legsGold = (new ItemArmor(60, 1, 4, 2)).setIconIndex(36);
+ public static Item bootsGold = (new ItemArmor(61, 1, 4, 3)).setIconIndex(52);
+ public static Item flint = (new Item(62)).setIconIndex(6);
+ public static Item porkRaw = (new ItemFood(63, 3)).setIconIndex(87);
+ public static Item porkCooked = (new ItemFood(64, 8)).setIconIndex(88);
+ public static Item painting = (new ItemPainting(65)).setIconIndex(26);
+ public static Item appleGold = (new ItemFood(66, 42)).setIconIndex(11);
+ public static Item sign = (new ItemSign(67)).setIconIndex(42);
+ public static Item door = (new ItemDoor(68)).setIconIndex(43);
+ public static Item bucketEmpty = (new ItemBucket(69, 0)).setIconIndex(74);
+ public static Item bucketWater = (new ItemBucket(70, Block.waterMoving.blockID)).setIconIndex(75);
+ public static Item bucketLava = (new ItemBucket(71, Block.lavaMoving.blockID)).setIconIndex(76);
+ public static Item minecart = (new ItemMinecart(72)).setIconIndex(135);
+ public static Item saddle = (new ItemSaddle(73)).setIconIndex(104);
+ public final int shiftedIndex;
+ protected int maxStackSize = 64;
+ protected int maxDamage = 32;
+ protected int iconIndex;
+
+ protected Item(int var1) {
+ this.shiftedIndex = 256 + var1;
+ if(itemsList[256 + var1] != null) {
+ System.out.println("CONFLICT @ " + var1);
+ }
+
+ itemsList[256 + var1] = this;
+ }
+
+ public Item setIconIndex(int var1) {
+ this.iconIndex = var1;
+ return this;
+ }
+
+ public int getIconFromDamage(ItemStack var1) {
+ return this.iconIndex;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ return false;
+ }
+
+ public float getStrVsBlock(ItemStack var1, Block var2) {
+ return 1.0F;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ return var1;
+ }
+
+ public int getItemStackLimit() {
+ return this.maxStackSize;
+ }
+
+ public int getMaxDamage() {
+ return this.maxDamage;
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ }
+
+ public void onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5) {
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return 1;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return false;
+ }
+
+ public void saddleEntity(ItemStack var1, EntityLiving var2) {
+ }
+}
diff --git a/src/net/minecraft/src/ItemArmor.java b/src/net/minecraft/src/ItemArmor.java
new file mode 100644
index 0000000..e267b4d
--- /dev/null
+++ b/src/net/minecraft/src/ItemArmor.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+public class ItemArmor extends Item {
+ private static final int[] damageReduceAmountArray = new int[]{3, 8, 6, 3};
+ private static final int[] maxDamageArray = new int[]{11, 16, 15, 13};
+ public final int armorLevel;
+ public final int armorType;
+ public final int damageReduceAmount;
+ public final int renderIndex;
+
+ public ItemArmor(int var1, int var2, int var3, int var4) {
+ super(var1);
+ this.armorLevel = var2;
+ this.armorType = var4;
+ this.renderIndex = var3;
+ this.damageReduceAmount = damageReduceAmountArray[var4];
+ this.maxDamage = maxDamageArray[var4] * 3 << var2;
+ this.maxStackSize = 1;
+ }
+}
diff --git a/src/net/minecraft/src/ItemAxe.java b/src/net/minecraft/src/ItemAxe.java
new file mode 100644
index 0000000..69fdc7d
--- /dev/null
+++ b/src/net/minecraft/src/ItemAxe.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+public class ItemAxe extends ItemTool {
+ private static Block[] blocksEffectiveAgainst = new Block[]{Block.planks, Block.bookshelf, Block.wood, Block.chest};
+
+ public ItemAxe(int var1, int var2) {
+ super(var1, 3, var2, blocksEffectiveAgainst);
+ }
+}
diff --git a/src/net/minecraft/src/ItemBlock.java b/src/net/minecraft/src/ItemBlock.java
new file mode 100644
index 0000000..5d15793
--- /dev/null
+++ b/src/net/minecraft/src/ItemBlock.java
@@ -0,0 +1,52 @@
+package net.minecraft.src;
+
+public class ItemBlock extends Item {
+ private int blockID;
+
+ public ItemBlock(int var1) {
+ super(var1);
+ this.blockID = var1 + 256;
+ this.setIconIndex(Block.blocksList[var1 + 256].getBlockTextureFromSide(2));
+ }
+
+ public boolean onItemUse(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;
+ }
+
+ if(var1.stackSize == 0) {
+ return false;
+ } else {
+ if(var3.canBlockBePlacedAt(this.blockID, var4, var5, var6, false)) {
+ Block var8 = Block.blocksList[this.blockID];
+ if(var3.setBlockWithNotify(var4, var5, var6, this.blockID)) {
+ Block.blocksList[this.blockID].onBlockPlaced(var3, var4, var5, var6, var7);
+ var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var8.stepSound.getStepSound(), (var8.stepSound.getVolume() + 1.0F) / 2.0F, var8.stepSound.getPitch() * 0.8F);
+ --var1.stackSize;
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemBow.java b/src/net/minecraft/src/ItemBow.java
new file mode 100644
index 0000000..3b7d240
--- /dev/null
+++ b/src/net/minecraft/src/ItemBow.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class ItemBow extends Item {
+ public ItemBow(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ if(var3.inventory.consumeInventoryItem(Item.arrow.shiftedIndex)) {
+ var2.playSoundAtEntity(var3, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F));
+ var2.spawnEntityInWorld(new EntityArrow(var2, var3));
+ }
+
+ return var1;
+ }
+}
diff --git a/src/net/minecraft/src/ItemBucket.java b/src/net/minecraft/src/ItemBucket.java
new file mode 100644
index 0000000..47af484
--- /dev/null
+++ b/src/net/minecraft/src/ItemBucket.java
@@ -0,0 +1,82 @@
+package net.minecraft.src;
+
+public class ItemBucket extends Item {
+ private int isFull;
+
+ public ItemBucket(int var1, int var2) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 64;
+ this.isFull = var2;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ 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;
+ double var11 = var3.prevPosZ + (var3.posZ - var3.prevPosZ) * (double)var4;
+ Vec3D var13 = Vec3D.createVector(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 var18 = var15 * var16;
+ float var20 = var14 * var16;
+ double var21 = 5.0D;
+ Vec3D var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
+ MovingObjectPosition var24 = var2.rayTraceBlocks_do(var13, var23, this.isFull == 0);
+ if(var24 == null) {
+ return var1;
+ } else {
+ if(var24.typeOfHit == 0) {
+ int var25 = var24.blockX;
+ int var26 = var24.blockY;
+ int var27 = var24.blockZ;
+ if(this.isFull == 0) {
+ if(var2.getBlockMaterial(var25, var26, var27) == Material.water && var2.getBlockMetadata(var25, var26, var27) == 0) {
+ var2.setBlockWithNotify(var25, var26, var27, 0);
+ return new ItemStack(Item.bucketWater);
+ }
+
+ if(var2.getBlockMaterial(var25, var26, var27) == Material.lava && var2.getBlockMetadata(var25, var26, var27) == 0) {
+ var2.setBlockWithNotify(var25, var26, var27, 0);
+ return new ItemStack(Item.bucketLava);
+ }
+ } else {
+ if(var24.sideHit == 0) {
+ --var26;
+ }
+
+ if(var24.sideHit == 1) {
+ ++var26;
+ }
+
+ if(var24.sideHit == 2) {
+ --var27;
+ }
+
+ if(var24.sideHit == 3) {
+ ++var27;
+ }
+
+ if(var24.sideHit == 4) {
+ --var25;
+ }
+
+ if(var24.sideHit == 5) {
+ ++var25;
+ }
+
+ if(var2.getBlockId(var25, var26, var27) == 0 || !var2.getBlockMaterial(var25, var26, var27).isSolid()) {
+ var2.setBlockAndMetadataWithNotify(var25, var26, var27, this.isFull, 0);
+ return new ItemStack(Item.bucketEmpty);
+ }
+ }
+ }
+
+ return var1;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemDoor.java b/src/net/minecraft/src/ItemDoor.java
new file mode 100644
index 0000000..95d9d03
--- /dev/null
+++ b/src/net/minecraft/src/ItemDoor.java
@@ -0,0 +1,62 @@
+package net.minecraft.src;
+
+public class ItemDoor extends Item {
+ public ItemDoor(int var1) {
+ super(var1);
+ this.maxDamage = 64;
+ this.maxStackSize = 1;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 != 1) {
+ return false;
+ } else {
+ ++var5;
+ if(!Block.doorWood.canPlaceBlockAt(var3, var4, var5, var6)) {
+ return false;
+ } else {
+ int var8 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
+ byte var9 = 0;
+ byte var10 = 0;
+ if(var8 == 0) {
+ var10 = 1;
+ }
+
+ if(var8 == 1) {
+ var9 = -1;
+ }
+
+ if(var8 == 2) {
+ var10 = -1;
+ }
+
+ if(var8 == 3) {
+ var9 = 1;
+ }
+
+ int var11 = (var3.isBlockNormalCube(var4 - var9, var5, var6 - var10) ? 1 : 0) + (var3.isBlockNormalCube(var4 - var9, var5 + 1, var6 - var10) ? 1 : 0);
+ int var12 = (var3.isBlockNormalCube(var4 + var9, var5, var6 + var10) ? 1 : 0) + (var3.isBlockNormalCube(var4 + var9, var5 + 1, var6 + var10) ? 1 : 0);
+ boolean var13 = var3.getBlockId(var4 - var9, var5, var6 - var10) == Block.doorWood.blockID || var3.getBlockId(var4 - var9, var5 + 1, var6 - var10) == Block.doorWood.blockID;
+ boolean var14 = var3.getBlockId(var4 + var9, var5, var6 + var10) == Block.doorWood.blockID || var3.getBlockId(var4 + var9, var5 + 1, var6 + var10) == Block.doorWood.blockID;
+ boolean var15 = false;
+ if(var13 && !var14) {
+ var15 = true;
+ } else if(var12 > var11) {
+ var15 = true;
+ }
+
+ if(var15) {
+ var8 = var8 - 1 & 3;
+ var8 += 4;
+ }
+
+ var3.setBlockWithNotify(var4, var5, var6, Block.doorWood.blockID);
+ var3.setBlockMetadataWithNotify(var4, var5, var6, var8);
+ var3.setBlockWithNotify(var4, var5 + 1, var6, Block.doorWood.blockID);
+ var3.setBlockMetadataWithNotify(var4, var5 + 1, var6, var8 + 8);
+ --var1.stackSize;
+ return true;
+ }
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemFlintAndSteel.java b/src/net/minecraft/src/ItemFlintAndSteel.java
new file mode 100644
index 0000000..cd682fc
--- /dev/null
+++ b/src/net/minecraft/src/ItemFlintAndSteel.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class ItemFlintAndSteel extends Item {
+ public ItemFlintAndSteel(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 64;
+ }
+
+ public boolean onItemUse(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);
+ if(var8 == 0) {
+ var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
+ var3.setBlockWithNotify(var4, var5, var6, Block.fire.blockID);
+ }
+
+ var1.damageItem(1);
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/ItemFood.java b/src/net/minecraft/src/ItemFood.java
new file mode 100644
index 0000000..d0b8bf9
--- /dev/null
+++ b/src/net/minecraft/src/ItemFood.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class ItemFood extends Item {
+ private int healAmount;
+
+ public ItemFood(int var1, int var2) {
+ super(var1);
+ this.healAmount = var2;
+ this.maxStackSize = 1;
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ --var1.stackSize;
+ var3.heal(this.healAmount);
+ return var1;
+ }
+}
diff --git a/src/net/minecraft/src/ItemHoe.java b/src/net/minecraft/src/ItemHoe.java
new file mode 100644
index 0000000..6e2a795
--- /dev/null
+++ b/src/net/minecraft/src/ItemHoe.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public class ItemHoe extends Item {
+ public ItemHoe(int var1, int var2) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 32 << var2;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ int var8 = var3.getBlockId(var4, var5, var6);
+ Material var9 = var3.getBlockMaterial(var4, var5 + 1, var6);
+ if((var9.isSolid() || var8 != Block.grass.blockID) && var8 != Block.dirt.blockID) {
+ return false;
+ } else {
+ Block var10 = Block.tilledField;
+ var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var10.stepSound.getStepSound(), (var10.stepSound.getVolume() + 1.0F) / 2.0F, var10.stepSound.getPitch() * 0.8F);
+ var3.setBlockWithNotify(var4, var5, var6, var10.blockID);
+ var1.damageItem(1);
+ if(var3.rand.nextInt(8) == 0 && var8 == Block.grass.blockID) {
+ byte var11 = 1;
+
+ for(int var12 = 0; var12 < var11; ++var12) {
+ float var13 = 0.7F;
+ float var14 = var3.rand.nextFloat() * var13 + (1.0F - var13) * 0.5F;
+ float var15 = 1.2F;
+ float var16 = var3.rand.nextFloat() * var13 + (1.0F - var13) * 0.5F;
+ EntityItem var17 = new EntityItem(var3, (double)((float)var4 + var14), (double)((float)var5 + var15), (double)((float)var6 + var16), new ItemStack(Item.seeds));
+ var17.delayBeforeCanPickup = 10;
+ var3.spawnEntityInWorld(var17);
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemMinecart.java b/src/net/minecraft/src/ItemMinecart.java
new file mode 100644
index 0000000..2aa4d3f
--- /dev/null
+++ b/src/net/minecraft/src/ItemMinecart.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+public class ItemMinecart extends Item {
+ public ItemMinecart(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ int var8 = var3.getBlockId(var4, var5, var6);
+ if(var8 == Block.minecartTrack.blockID) {
+ var3.spawnEntityInWorld(new EntityMinecart(var3, (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F)));
+ --var1.stackSize;
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemPainting.java b/src/net/minecraft/src/ItemPainting.java
new file mode 100644
index 0000000..8cfa711
--- /dev/null
+++ b/src/net/minecraft/src/ItemPainting.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public class ItemPainting extends Item {
+ public ItemPainting(int var1) {
+ super(var1);
+ this.maxDamage = 64;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 == 0) {
+ return false;
+ } else if(var7 == 1) {
+ return false;
+ } else {
+ byte var8 = 0;
+ if(var7 == 4) {
+ var8 = 1;
+ }
+
+ if(var7 == 3) {
+ var8 = 2;
+ }
+
+ if(var7 == 5) {
+ var8 = 3;
+ }
+
+ EntityPainting var9 = new EntityPainting(var3, var4, var5, var6, var8);
+ if(var9.onValidSurface()) {
+ var3.spawnEntityInWorld(var9);
+ --var1.stackSize;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemPickaxe.java b/src/net/minecraft/src/ItemPickaxe.java
new file mode 100644
index 0000000..a5a9ab6
--- /dev/null
+++ b/src/net/minecraft/src/ItemPickaxe.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class ItemPickaxe extends ItemTool {
+ private static Block[] blocksEffectiveAgainst = new Block[]{Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond};
+ private int getHarvestLevel;
+
+ public ItemPickaxe(int var1, int var2) {
+ super(var1, 2, var2, blocksEffectiveAgainst);
+ this.getHarvestLevel = var2;
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return var1 == Block.obsidian ? this.getHarvestLevel == 3 : (var1 != Block.blockDiamond && var1 != Block.oreDiamond ? (var1 != Block.blockGold && var1 != Block.oreGold ? (var1 != Block.blockSteel && var1 != Block.oreIron ? (var1.blockMaterial == Material.rock ? true : var1.blockMaterial == Material.iron) : this.getHarvestLevel >= 1) : this.getHarvestLevel >= 2) : this.getHarvestLevel >= 2);
+ }
+}
diff --git a/src/net/minecraft/src/ItemRenderer.java b/src/net/minecraft/src/ItemRenderer.java
new file mode 100644
index 0000000..1d1a353
--- /dev/null
+++ b/src/net/minecraft/src/ItemRenderer.java
@@ -0,0 +1,361 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class ItemRenderer {
+ private Minecraft mc;
+ private ItemStack itemToRender = null;
+ private float equippedProgress = 0.0F;
+ private float prevEquippedProgress = 0.0F;
+ private int swingProgress = 0;
+ private boolean itemSwingState = false;
+ private RenderBlocks renderBlocksInstance = new RenderBlocks();
+
+ public ItemRenderer(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void renderItemInFirstPerson(float var1) {
+ float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * var1;
+ EntityPlayerSP var3 = this.mc.thePlayer;
+ GL11.glPushMatrix();
+ GL11.glRotatef(var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var1, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var1, 0.0F, 1.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glPopMatrix();
+ float var4 = this.mc.theWorld.getBrightness(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ));
+ GL11.glColor4f(var4, var4, var4, 1.0F);
+ float var5;
+ float var6;
+ float var7;
+ float var8;
+ if(this.itemToRender != null) {
+ GL11.glPushMatrix();
+ var5 = 0.8F;
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glTranslatef(-var8 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI * 2.0F) * 0.2F, -var7 * 0.2F);
+ }
+
+ GL11.glTranslatef(0.7F * var5, -0.65F * var5 - (1.0F - var2) * 0.6F, -0.9F * var5);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glRotatef(-var7 * 20.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var8 * 20.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(-var8 * 80.0F, 1.0F, 0.0F, 0.0F);
+ }
+
+ var6 = 0.4F;
+ GL11.glScalef(var6, var6, var6);
+ if(this.itemToRender.itemID < 256 && Block.blocksList[this.itemToRender.itemID].getRenderType() == 0) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ this.renderBlocksInstance.renderBlockOnInventory(Block.blocksList[this.itemToRender.itemID]);
+ } else {
+ if(this.itemToRender.itemID < 256) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ } else {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
+ }
+
+ Tessellator var22 = Tessellator.instance;
+ var8 = (float)(this.itemToRender.getIconIndex() % 16 * 16 + 0) / 256.0F;
+ float var9 = (float)(this.itemToRender.getIconIndex() % 16 * 16 + 16) / 256.0F;
+ float var10 = (float)(this.itemToRender.getIconIndex() / 16 * 16 + 0) / 256.0F;
+ float var11 = (float)(this.itemToRender.getIconIndex() / 16 * 16 + 16) / 256.0F;
+ float var12 = 1.0F;
+ float var13 = 0.0F;
+ float var14 = 0.3F;
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glTranslatef(-var13, -var14, 0.0F);
+ float var15 = 1.5F;
+ GL11.glScalef(var15, var15, var15);
+ 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);
+ float var16 = 1.0F / 16.0F;
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, 0.0F, 1.0F);
+ var22.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)var9, (double)var11);
+ var22.addVertexWithUV((double)var12, 0.0D, 0.0D, (double)var8, (double)var11);
+ var22.addVertexWithUV((double)var12, 1.0D, 0.0D, (double)var8, (double)var10);
+ var22.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)var9, (double)var10);
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, 0.0F, -1.0F);
+ var22.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - var16), (double)var9, (double)var10);
+ var22.addVertexWithUV((double)var12, 1.0D, (double)(0.0F - var16), (double)var8, (double)var10);
+ var22.addVertexWithUV((double)var12, 0.0D, (double)(0.0F - var16), (double)var8, (double)var11);
+ var22.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - var16), (double)var9, (double)var11);
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(-1.0F, 0.0F, 0.0F);
+
+ int var17;
+ float var18;
+ float var19;
+ float var20;
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var9 + (var8 - var9) * var18 - 0.001953125F;
+ var20 = var12 * var18;
+ var22.addVertexWithUV((double)var20, 0.0D, (double)(0.0F - var16), (double)var19, (double)var11);
+ var22.addVertexWithUV((double)var20, 0.0D, 0.0D, (double)var19, (double)var11);
+ var22.addVertexWithUV((double)var20, 1.0D, 0.0D, (double)var19, (double)var10);
+ var22.addVertexWithUV((double)var20, 1.0D, (double)(0.0F - var16), (double)var19, (double)var10);
+ }
+
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(1.0F, 0.0F, 0.0F);
+
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var9 + (var8 - var9) * var18 - 0.001953125F;
+ var20 = var12 * var18 + 1.0F / 16.0F;
+ var22.addVertexWithUV((double)var20, 1.0D, (double)(0.0F - var16), (double)var19, (double)var10);
+ var22.addVertexWithUV((double)var20, 1.0D, 0.0D, (double)var19, (double)var10);
+ var22.addVertexWithUV((double)var20, 0.0D, 0.0D, (double)var19, (double)var11);
+ var22.addVertexWithUV((double)var20, 0.0D, (double)(0.0F - var16), (double)var19, (double)var11);
+ }
+
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, 1.0F, 0.0F);
+
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var11 + (var10 - var11) * var18 - 0.001953125F;
+ var20 = var12 * var18 + 1.0F / 16.0F;
+ var22.addVertexWithUV(0.0D, (double)var20, 0.0D, (double)var9, (double)var19);
+ var22.addVertexWithUV((double)var12, (double)var20, 0.0D, (double)var8, (double)var19);
+ var22.addVertexWithUV((double)var12, (double)var20, (double)(0.0F - var16), (double)var8, (double)var19);
+ var22.addVertexWithUV(0.0D, (double)var20, (double)(0.0F - var16), (double)var9, (double)var19);
+ }
+
+ var22.draw();
+ var22.startDrawingQuads();
+ var22.setNormal(0.0F, -1.0F, 0.0F);
+
+ for(var17 = 0; var17 < 16; ++var17) {
+ var18 = (float)var17 / 16.0F;
+ var19 = var11 + (var10 - var11) * var18 - 0.001953125F;
+ var20 = var12 * var18;
+ var22.addVertexWithUV((double)var12, (double)var20, 0.0D, (double)var8, (double)var19);
+ var22.addVertexWithUV(0.0D, (double)var20, 0.0D, (double)var9, (double)var19);
+ var22.addVertexWithUV(0.0D, (double)var20, (double)(0.0F - var16), (double)var9, (double)var19);
+ var22.addVertexWithUV((double)var12, (double)var20, (double)(0.0F - var16), (double)var8, (double)var19);
+ }
+
+ var22.draw();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ }
+
+ GL11.glPopMatrix();
+ } else {
+ GL11.glPushMatrix();
+ var5 = 0.8F;
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glTranslatef(-var8 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI * 2.0F) * 0.4F, -var7 * 0.4F);
+ }
+
+ GL11.glTranslatef(0.8F * var5, -(12.0F / 16.0F) * var5 - (1.0F - var2) * 0.6F, -0.9F * var5);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ if(this.itemSwingState) {
+ var6 = ((float)this.swingProgress + var1) / 8.0F;
+ var7 = MathHelper.sin(var6 * var6 * (float)Math.PI);
+ var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * (float)Math.PI);
+ GL11.glRotatef(var8 * 70.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var7 * 20.0F, 0.0F, 0.0F, 1.0F);
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTextureForDownloadableImage(this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));
+ GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
+ GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
+ 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);
+ Render var21 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
+ RenderPlayer var23 = (RenderPlayer)var21;
+ var8 = 1.0F;
+ GL11.glScalef(var8, var8, var8);
+ var23.drawFirstPersonHand();
+ GL11.glPopMatrix();
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ RenderHelper.disableStandardItemLighting();
+ }
+
+ public void renderOverlays(float var1) {
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ int var2;
+ if(this.mc.thePlayer.fire > 0) {
+ var2 = this.mc.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
+ this.renderFireInFirstPerson(var1);
+ }
+
+ if(this.mc.theWorld.playerEntity.isEntityInsideOpaqueBlock()) {
+ 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 var5 = this.mc.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var5);
+ int var6 = this.mc.theWorld.getBlockId(var2, var3, var4);
+ if(Block.blocksList[var6] != null) {
+ this.renderInsideOfBlock(var1, Block.blocksList[var6].getBlockTextureFromSide(2));
+ }
+ }
+
+ if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
+ var2 = this.mc.renderEngine.getTexture("/water.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
+ this.renderWarpedTextureOverlay(var1);
+ }
+
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+
+ private void renderInsideOfBlock(float var1, int var2) {
+ Tessellator var3 = Tessellator.instance;
+ this.mc.thePlayer.getEntityBrightness(var1);
+ float var4 = 0.1F;
+ GL11.glColor4f(var4, var4, var4, 0.5F);
+ GL11.glPushMatrix();
+ float var5 = -1.0F;
+ float var6 = 1.0F;
+ float var7 = -1.0F;
+ float var8 = 1.0F;
+ float var9 = -0.5F;
+ float var10 = 0.0078125F;
+ float var11 = (float)(var2 % 16) / 256.0F - var10;
+ float var12 = ((float)(var2 % 16) + 15.99F) / 256.0F + var10;
+ float var13 = (float)(var2 / 16) / 256.0F - var10;
+ float var14 = ((float)(var2 / 16) + 15.99F) / 256.0F + var10;
+ var3.startDrawingQuads();
+ var3.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)var12, (double)var14);
+ var3.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)var11, (double)var14);
+ var3.addVertexWithUV((double)var6, (double)var8, (double)var9, (double)var11, (double)var13);
+ var3.addVertexWithUV((double)var5, (double)var8, (double)var9, (double)var12, (double)var13);
+ var3.draw();
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ private void renderWarpedTextureOverlay(float var1) {
+ Tessellator var2 = Tessellator.instance;
+ float var3 = this.mc.thePlayer.getEntityBrightness(var1);
+ GL11.glColor4f(var3, var3, var3, 0.5F);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glPushMatrix();
+ float var4 = 4.0F;
+ float var5 = -1.0F;
+ float var6 = 1.0F;
+ float var7 = -1.0F;
+ float var8 = 1.0F;
+ float var9 = -0.5F;
+ float var10 = -this.mc.thePlayer.rotationYaw / 64.0F;
+ float var11 = this.mc.thePlayer.rotationPitch / 64.0F;
+ var2.startDrawingQuads();
+ var2.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)(var4 + var10), (double)(var4 + var11));
+ var2.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)(0.0F + var10), (double)(var4 + var11));
+ var2.addVertexWithUV((double)var6, (double)var8, (double)var9, (double)(0.0F + var10), (double)(0.0F + var11));
+ var2.addVertexWithUV((double)var5, (double)var8, (double)var9, (double)(var4 + var10), (double)(0.0F + var11));
+ var2.draw();
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ private void renderFireInFirstPerson(float var1) {
+ 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) {
+ GL11.glPushMatrix();
+ int var5 = Block.fire.blockIndexInTexture + var4 * 16;
+ int var6 = (var5 & 15) << 4;
+ int var7 = var5 & 240;
+ float var8 = (float)var6 / 256.0F;
+ float var9 = ((float)var6 + 15.99F) / 256.0F;
+ float var10 = (float)var7 / 256.0F;
+ float var11 = ((float)var7 + 15.99F) / 256.0F;
+ float var12 = (0.0F - var3) / 2.0F;
+ float var13 = var12 + var3;
+ float var14 = 0.0F - var3 / 2.0F;
+ float var15 = var14 + var3;
+ float var16 = -0.5F;
+ GL11.glTranslatef((float)(-(var4 * 2 - 1)) * 0.24F, -0.3F, 0.0F);
+ GL11.glRotatef((float)(var4 * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
+ var2.startDrawingQuads();
+ var2.addVertexWithUV((double)var12, (double)var14, (double)var16, (double)var9, (double)var11);
+ var2.addVertexWithUV((double)var13, (double)var14, (double)var16, (double)var8, (double)var11);
+ var2.addVertexWithUV((double)var13, (double)var15, (double)var16, (double)var8, (double)var10);
+ var2.addVertexWithUV((double)var12, (double)var15, (double)var16, (double)var9, (double)var10);
+ var2.draw();
+ GL11.glPopMatrix();
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public void updateEquippedItem() {
+ this.prevEquippedProgress = this.equippedProgress;
+ if(this.itemSwingState) {
+ ++this.swingProgress;
+ if(this.swingProgress == 8) {
+ this.swingProgress = 0;
+ this.itemSwingState = false;
+ }
+ }
+
+ EntityPlayerSP var1 = this.mc.thePlayer;
+ ItemStack var2 = var1.inventory.getCurrentItem();
+ float var4 = 0.4F;
+ float var5 = var2 == this.itemToRender ? 1.0F : 0.0F;
+ float var6 = var5 - this.equippedProgress;
+ if(var6 < -var4) {
+ var6 = -var4;
+ }
+
+ if(var6 > var4) {
+ var6 = var4;
+ }
+
+ this.equippedProgress += var6;
+ if(this.equippedProgress < 0.1F) {
+ this.itemToRender = var2;
+ }
+
+ }
+
+ public void resetEquippedProgress() {
+ this.equippedProgress = 0.0F;
+ }
+
+ public void swing() {
+ this.swingProgress = -1;
+ this.itemSwingState = true;
+ }
+
+ public void resetEquippedProgress2() {
+ this.equippedProgress = 0.0F;
+ }
+}
diff --git a/src/net/minecraft/src/ItemSaddle.java b/src/net/minecraft/src/ItemSaddle.java
new file mode 100644
index 0000000..9bb552f
--- /dev/null
+++ b/src/net/minecraft/src/ItemSaddle.java
@@ -0,0 +1,24 @@
+package net.minecraft.src;
+
+public class ItemSaddle extends Item {
+ public ItemSaddle(int var1) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 64;
+ }
+
+ public void saddleEntity(ItemStack var1, EntityLiving var2) {
+ if(var2 instanceof EntityPig) {
+ EntityPig var3 = (EntityPig)var2;
+ if(!var3.saddled) {
+ var3.saddled = true;
+ --var1.stackSize;
+ }
+ }
+
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ this.saddleEntity(var1, var2);
+ }
+}
diff --git a/src/net/minecraft/src/ItemSeeds.java b/src/net/minecraft/src/ItemSeeds.java
new file mode 100644
index 0000000..91ad225
--- /dev/null
+++ b/src/net/minecraft/src/ItemSeeds.java
@@ -0,0 +1,25 @@
+package net.minecraft.src;
+
+public class ItemSeeds extends Item {
+ private int blockType;
+
+ public ItemSeeds(int var1, int var2) {
+ super(var1);
+ this.blockType = var2;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 != 1) {
+ return false;
+ } else {
+ int var8 = var3.getBlockId(var4, var5, var6);
+ if(var8 == Block.tilledField.blockID) {
+ var3.setBlockWithNotify(var4, var5 + 1, var6, this.blockType);
+ --var1.stackSize;
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemSign.java b/src/net/minecraft/src/ItemSign.java
new file mode 100644
index 0000000..f760b3e
--- /dev/null
+++ b/src/net/minecraft/src/ItemSign.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ItemSign extends Item {
+ public ItemSign(int var1) {
+ super(var1);
+ this.maxDamage = 64;
+ this.maxStackSize = 1;
+ }
+
+ public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
+ if(var7 != 1) {
+ return false;
+ } else {
+ ++var5;
+ if(!Block.signStanding.canPlaceBlockAt(var3, var4, var5, var6)) {
+ return false;
+ } else {
+ var3.setBlockWithNotify(var4, var5, var6, Block.signStanding.blockID);
+ var3.setBlockMetadataWithNotify(var4, var5, var6, MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 16.0F / 360.0F) - 0.5D) & 15);
+ --var1.stackSize;
+ var2.displayGUIEditSign((TileEntitySign)var3.getBlockTileEntity(var4, var5, var6));
+ return true;
+ }
+ }
+ }
+}
diff --git a/src/net/minecraft/src/ItemSoup.java b/src/net/minecraft/src/ItemSoup.java
new file mode 100644
index 0000000..7143549
--- /dev/null
+++ b/src/net/minecraft/src/ItemSoup.java
@@ -0,0 +1,12 @@
+package net.minecraft.src;
+
+public class ItemSoup extends ItemFood {
+ public ItemSoup(int var1, int var2) {
+ super(var1, var2);
+ }
+
+ public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
+ super.onItemRightClick(var1, var2, var3);
+ return new ItemStack(Item.bowlEmpty);
+ }
+}
diff --git a/src/net/minecraft/src/ItemSpade.java b/src/net/minecraft/src/ItemSpade.java
new file mode 100644
index 0000000..5328e68
--- /dev/null
+++ b/src/net/minecraft/src/ItemSpade.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+public class ItemSpade extends ItemTool {
+ private static Block[] blocksEffectiveAgainst = new Block[]{Block.grass, Block.dirt, Block.sand, Block.gravel};
+
+ public ItemSpade(int var1, int var2) {
+ super(var1, 1, var2, blocksEffectiveAgainst);
+ }
+}
diff --git a/src/net/minecraft/src/ItemStack.java b/src/net/minecraft/src/ItemStack.java
new file mode 100644
index 0000000..83d7a12
--- /dev/null
+++ b/src/net/minecraft/src/ItemStack.java
@@ -0,0 +1,128 @@
+package net.minecraft.src;
+
+public final class ItemStack {
+ public int stackSize;
+ public int animationsToGo;
+ public int itemID;
+ public int itemDmg;
+
+ public ItemStack(Block var1) {
+ this((Block)var1, 1);
+ }
+
+ public ItemStack(Block var1, int var2) {
+ this(var1.blockID, var2);
+ }
+
+ public ItemStack(Item var1) {
+ this((Item)var1, 1);
+ }
+
+ public ItemStack(Item var1, int var2) {
+ this(var1.shiftedIndex, var2);
+ }
+
+ public ItemStack(int var1) {
+ this(var1, 1);
+ }
+
+ public ItemStack(int var1, int var2) {
+ this.stackSize = 0;
+ this.itemID = var1;
+ this.stackSize = var2;
+ }
+
+ public ItemStack(int var1, int var2, int var3) {
+ this.stackSize = 0;
+ this.itemID = var1;
+ this.stackSize = var2;
+ this.itemDmg = var3;
+ }
+
+ public ItemStack(NBTTagCompound var1) {
+ this.stackSize = 0;
+ this.readFromNBT(var1);
+ }
+
+ public ItemStack splitStack(int var1) {
+ this.stackSize -= var1;
+ return new ItemStack(this.itemID, var1, this.itemDmg);
+ }
+
+ public Item getItem() {
+ return Item.itemsList[this.itemID];
+ }
+
+ public int getIconIndex() {
+ return this.getItem().getIconFromDamage(this);
+ }
+
+ public boolean useItem(EntityPlayer var1, World var2, int var3, int var4, int var5, int var6) {
+ return this.getItem().onItemUse(this, var1, var2, var3, var4, var5, var6);
+ }
+
+ 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 NBTTagCompound writeToNBT(NBTTagCompound var1) {
+ var1.setShort("id", (short)this.itemID);
+ var1.setByte("Count", (byte)this.stackSize);
+ var1.setShort("Damage", (short)this.itemDmg);
+ return var1;
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ this.itemID = var1.getShort("id");
+ this.stackSize = var1.getByte("Count");
+ this.itemDmg = var1.getShort("Damage");
+ }
+
+ public int getMaxStackSize() {
+ return this.getItem().getItemStackLimit();
+ }
+
+ public int getMaxDamage() {
+ return Item.itemsList[this.itemID].getMaxDamage();
+ }
+
+ public void damageItem(int var1) {
+ this.itemDmg += var1;
+ if(this.itemDmg > this.getMaxDamage()) {
+ --this.stackSize;
+ if(this.stackSize < 0) {
+ this.stackSize = 0;
+ }
+
+ this.itemDmg = 0;
+ }
+
+ }
+
+ public void hitEntity(EntityLiving var1) {
+ Item.itemsList[this.itemID].hitEntity(this, var1);
+ }
+
+ public void onDestroyBlock(int var1, int var2, int var3, int var4) {
+ Item.itemsList[this.itemID].onBlockDestroyed(this, var1, var2, var3, var4);
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return Item.itemsList[this.itemID].getDamageVsEntity(var1);
+ }
+
+ public boolean canHarvestBlock(Block var1) {
+ return Item.itemsList[this.itemID].canHarvestBlock(var1);
+ }
+
+ public void onItemDestroyedByUse(EntityPlayer var1) {
+ }
+
+ public void useItemOnEntity(EntityLiving var1) {
+ Item.itemsList[this.itemID].saddleEntity(this, var1);
+ }
+}
diff --git a/src/net/minecraft/src/ItemSword.java b/src/net/minecraft/src/ItemSword.java
new file mode 100644
index 0000000..a7c1046
--- /dev/null
+++ b/src/net/minecraft/src/ItemSword.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+public class ItemSword extends Item {
+ private int weaponDamage;
+
+ public ItemSword(int var1, int var2) {
+ super(var1);
+ this.maxStackSize = 1;
+ this.maxDamage = 32 << var2;
+ this.weaponDamage = 4 + var2 * 2;
+ }
+
+ public float getStrVsBlock(ItemStack var1, Block var2) {
+ return 1.5F;
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ var1.damageItem(1);
+ }
+
+ public void onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5) {
+ var1.damageItem(2);
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return this.weaponDamage;
+ }
+}
diff --git a/src/net/minecraft/src/ItemTool.java b/src/net/minecraft/src/ItemTool.java
new file mode 100644
index 0000000..9c231e1
--- /dev/null
+++ b/src/net/minecraft/src/ItemTool.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class ItemTool extends Item {
+ private Block[] blocksEffectiveAgainst;
+ private float efficiencyOnProperMaterial = 4.0F;
+ private int damageVsEntity;
+ protected int toolMaterial;
+
+ public ItemTool(int var1, int var2, int var3, Block[] var4) {
+ super(var1);
+ this.toolMaterial = var3;
+ this.blocksEffectiveAgainst = var4;
+ this.maxStackSize = 1;
+ this.maxDamage = 32 << var3;
+ if(var3 == 3) {
+ this.maxDamage *= 2;
+ }
+
+ this.efficiencyOnProperMaterial = (float)((var3 + 1) * 2);
+ this.damageVsEntity = var2 + var3;
+ }
+
+ public float getStrVsBlock(ItemStack var1, Block var2) {
+ for(int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3) {
+ if(this.blocksEffectiveAgainst[var3] == var2) {
+ return this.efficiencyOnProperMaterial;
+ }
+ }
+
+ return 1.0F;
+ }
+
+ public void hitEntity(ItemStack var1, EntityLiving var2) {
+ var1.damageItem(2);
+ }
+
+ public void onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5) {
+ var1.damageItem(1);
+ }
+
+ public int getDamageVsEntity(Entity var1) {
+ return this.damageVsEntity;
+ }
+}
diff --git a/src/net/minecraft/src/KeyBinding.java b/src/net/minecraft/src/KeyBinding.java
new file mode 100644
index 0000000..6d27b38
--- /dev/null
+++ b/src/net/minecraft/src/KeyBinding.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class KeyBinding {
+ public String keyDescription;
+ public int keyCode;
+
+ public KeyBinding(String var1, int var2) {
+ this.keyDescription = var1;
+ this.keyCode = var2;
+ }
+}
diff --git a/src/net/minecraft/src/LoadingScreenRenderer.java b/src/net/minecraft/src/LoadingScreenRenderer.java
new file mode 100644
index 0000000..435c9ac
--- /dev/null
+++ b/src/net/minecraft/src/LoadingScreenRenderer.java
@@ -0,0 +1,124 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+
+public class LoadingScreenRenderer implements IProgressUpdate {
+ private String currentlyDisplayedProgress = "";
+ private Minecraft mc;
+ private String currentlyDisplayedText = "";
+ private long systemTime = System.currentTimeMillis();
+ private boolean printText = false;
+
+ public LoadingScreenRenderer(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void printText(String var1) {
+ this.printText = false;
+ this.drawScreen(var1);
+ }
+
+ public void displayProgressMessage(String var1) {
+ this.printText = true;
+ this.drawScreen(this.currentlyDisplayedText);
+ }
+
+ public void drawScreen(String var1) {
+ if(!this.mc.running) {
+ if(!this.printText) {
+ throw new MinecraftError();
+ }
+ } else {
+ this.currentlyDisplayedText = var1;
+ ScaledResolution var2 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var3 = var2.getScaledWidth();
+ int var4 = var2.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var3, (double)var4, 0.0D, 100.0D, 300.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -200.0F);
+ }
+ }
+
+ public void displayLoadingString(String var1) {
+ if(!this.mc.running) {
+ if(!this.printText) {
+ throw new MinecraftError();
+ }
+ } else {
+ this.systemTime = 0L;
+ this.currentlyDisplayedProgress = var1;
+ this.setLoadingProgress(-1);
+ this.systemTime = 0L;
+ }
+ }
+
+ public void setLoadingProgress(int var1) {
+ if(!this.mc.running) {
+ if(!this.printText) {
+ throw new MinecraftError();
+ }
+ } else {
+ long var2 = System.currentTimeMillis();
+ if(var2 - this.systemTime >= 20L) {
+ this.systemTime = var2;
+ ScaledResolution var4 = new ScaledResolution(this.mc.displayWidth, this.mc.displayHeight);
+ int var5 = var4.getScaledWidth();
+ int var6 = var4.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var5, (double)var6, 0.0D, 100.0D, 300.0D);
+ 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);
+ Tessellator var7 = Tessellator.instance;
+ int var8 = this.mc.renderEngine.getTexture("/dirt.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var8);
+ float var9 = 32.0F;
+ var7.startDrawingQuads();
+ var7.setColorOpaque_I(4210752);
+ var7.addVertexWithUV(0.0D, (double)var6, 0.0D, 0.0D, (double)((float)var6 / var9));
+ var7.addVertexWithUV((double)var5, (double)var6, 0.0D, (double)((float)var5 / var9), (double)((float)var6 / var9));
+ var7.addVertexWithUV((double)var5, 0.0D, 0.0D, (double)((float)var5 / var9), 0.0D);
+ var7.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
+ var7.draw();
+ if(var1 >= 0) {
+ byte var10 = 100;
+ byte var11 = 2;
+ int var12 = var5 / 2 - var10 / 2;
+ int var13 = var6 / 2 + 16;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ var7.startDrawingQuads();
+ var7.setColorOpaque_I(8421504);
+ var7.addVertex((double)var12, (double)var13, 0.0D);
+ var7.addVertex((double)var12, (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var10), (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var10), (double)var13, 0.0D);
+ var7.setColorOpaque_I(8454016);
+ var7.addVertex((double)var12, (double)var13, 0.0D);
+ var7.addVertex((double)var12, (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var1), (double)(var13 + var11), 0.0D);
+ var7.addVertex((double)(var12 + var1), (double)var13, 0.0D);
+ var7.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, var6 / 2 - 4 - 16, 16777215);
+ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedProgress, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedProgress)) / 2, var6 / 2 - 4 + 8, 16777215);
+ Display.update();
+
+ try {
+ Thread.yield();
+ } catch (Exception var14) {
+ }
+
+ }
+ }
+ }
+}
diff --git a/src/net/minecraft/src/Material.java b/src/net/minecraft/src/Material.java
new file mode 100644
index 0000000..1f1bf08
--- /dev/null
+++ b/src/net/minecraft/src/Material.java
@@ -0,0 +1,37 @@
+package net.minecraft.src;
+
+public class Material {
+ public static final Material air = new MaterialTransparent();
+ public static final Material ground = new Material();
+ public static final Material wood = new Material();
+ public static final Material rock = new Material();
+ public static final Material iron = new Material();
+ public static final Material water = new MaterialLiquid();
+ public static final Material lava = new MaterialLiquid();
+ public static final Material leaves = new Material();
+ public static final Material plants = new MaterialLogic();
+ public static final Material sponge = new Material();
+ public static final Material cloth = new Material();
+ public static final Material fire = new MaterialTransparent();
+ public static final Material sand = new Material();
+ public static final Material circuits = new MaterialLogic();
+ public static final Material glass = new Material();
+ public static final Material tnt = new Material();
+ public static final Material unused = new Material();
+
+ public boolean getIsLiquid() {
+ return false;
+ }
+
+ public boolean isSolid() {
+ return true;
+ }
+
+ public boolean getCanBlockGrass() {
+ return true;
+ }
+
+ public boolean getIsSolid() {
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/MaterialLiquid.java b/src/net/minecraft/src/MaterialLiquid.java
new file mode 100644
index 0000000..54efda3
--- /dev/null
+++ b/src/net/minecraft/src/MaterialLiquid.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class MaterialLiquid extends Material {
+ public boolean getIsLiquid() {
+ return true;
+ }
+
+ public boolean isSolid() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/MaterialLogic.java b/src/net/minecraft/src/MaterialLogic.java
new file mode 100644
index 0000000..19d5b0d
--- /dev/null
+++ b/src/net/minecraft/src/MaterialLogic.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class MaterialLogic extends Material {
+ public boolean isSolid() {
+ return false;
+ }
+
+ public boolean getCanBlockGrass() {
+ return false;
+ }
+
+ public boolean getIsSolid() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/MaterialTransparent.java b/src/net/minecraft/src/MaterialTransparent.java
new file mode 100644
index 0000000..a475877
--- /dev/null
+++ b/src/net/minecraft/src/MaterialTransparent.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class MaterialTransparent extends Material {
+ public boolean isSolid() {
+ return false;
+ }
+
+ public boolean getCanBlockGrass() {
+ return false;
+ }
+
+ public boolean getIsSolid() {
+ return false;
+ }
+}
diff --git a/src/net/minecraft/src/MathHelper.java b/src/net/minecraft/src/MathHelper.java
new file mode 100644
index 0000000..bd32d54
--- /dev/null
+++ b/src/net/minecraft/src/MathHelper.java
@@ -0,0 +1,58 @@
+package net.minecraft.src;
+
+public class MathHelper {
+ 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 floor_double(double var0) {
+ int var2 = (int)var0;
+ return var0 < (double)var2 ? var2 - 1 : var2;
+ }
+
+ public static float abs(float var0) {
+ return var0 >= 0.0F ? var0 : -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;
+ }
+
+ static {
+ for(int var0 = 0; var0 < 65536; ++var0) {
+ SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D);
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/MetadataChunkBlock.java b/src/net/minecraft/src/MetadataChunkBlock.java
new file mode 100644
index 0000000..6f9e4d9
--- /dev/null
+++ b/src/net/minecraft/src/MetadataChunkBlock.java
@@ -0,0 +1,153 @@
+package net.minecraft.src;
+
+public class MetadataChunkBlock {
+ public final EnumSkyBlock skyBlock;
+ public int x;
+ public int y;
+ public int z;
+ public int maxX;
+ public int maxY;
+ public int maxZ;
+
+ public MetadataChunkBlock(EnumSkyBlock var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ this.skyBlock = var1;
+ this.x = var2;
+ this.y = var3;
+ this.z = var4;
+ this.maxX = var5;
+ this.maxY = var6;
+ this.maxZ = var7;
+ }
+
+ public void updateLight(World var1) {
+ for(int var2 = this.x; var2 <= this.maxX; ++var2) {
+ for(int var3 = this.z; var3 <= this.maxZ; ++var3) {
+ if(var1.blockExists(var2, 0, var3)) {
+ for(int var4 = this.y; var4 <= this.maxY; ++var4) {
+ if(var4 >= 0 && var4 < 128) {
+ int var5 = var1.getSavedLightValue(this.skyBlock, var2, var4, var3);
+ boolean var6 = false;
+ int var7 = var1.getBlockId(var2, var4, var3);
+ int var8 = Block.lightOpacity[var7];
+ if(var8 == 0) {
+ var8 = 1;
+ }
+
+ int var9 = 0;
+ if(this.skyBlock == EnumSkyBlock.Sky) {
+ if(var1.canExistingBlockSeeTheSky(var2, var4, var3)) {
+ var9 = 15;
+ }
+ } else if(this.skyBlock == EnumSkyBlock.Block) {
+ var9 = Block.lightValue[var7];
+ }
+
+ int var10;
+ int var16;
+ if(var8 >= 15 && var9 == 0) {
+ var16 = 0;
+ } else {
+ var10 = var1.getSavedLightValue(this.skyBlock, var2 - 1, var4, var3);
+ int var11 = var1.getSavedLightValue(this.skyBlock, var2 + 1, var4, var3);
+ int var12 = var1.getSavedLightValue(this.skyBlock, var2, var4 - 1, var3);
+ int var13 = var1.getSavedLightValue(this.skyBlock, var2, var4 + 1, var3);
+ int var14 = var1.getSavedLightValue(this.skyBlock, var2, var4, var3 - 1);
+ int var15 = var1.getSavedLightValue(this.skyBlock, var2, var4, var3 + 1);
+ var16 = var10;
+ if(var11 > var10) {
+ var16 = var11;
+ }
+
+ if(var12 > var16) {
+ var16 = var12;
+ }
+
+ if(var13 > var16) {
+ var16 = var13;
+ }
+
+ if(var14 > var16) {
+ var16 = var14;
+ }
+
+ if(var15 > var16) {
+ var16 = var15;
+ }
+
+ var16 -= var8;
+ if(var16 < 0) {
+ var16 = 0;
+ }
+
+ if(var9 > var16) {
+ var16 = var9;
+ }
+ }
+
+ if(var5 != var16) {
+ var1.setLightValue(this.skyBlock, var2, var4, var3, var16);
+ var10 = var16 - 1;
+ if(var10 < 0) {
+ var10 = 0;
+ }
+
+ var1.neighborLightPropagationChanged(this.skyBlock, var2 - 1, var4, var3, var10);
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4 - 1, var3, var10);
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4, var3 - 1, var10);
+ if(var2 + 1 >= this.maxX) {
+ var1.neighborLightPropagationChanged(this.skyBlock, var2 + 1, var4, var3, var10);
+ }
+
+ if(var4 + 1 >= this.maxY) {
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4 + 1, var3, var10);
+ }
+
+ if(var3 + 1 >= this.maxZ) {
+ var1.neighborLightPropagationChanged(this.skyBlock, var2, var4, var3 + 1, var10);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ public boolean getLightUpdated(int var1, int var2, int var3, int var4, int var5, int var6) {
+ if(var1 >= this.x && var2 >= this.y && var3 >= this.z && var4 <= this.maxX && var5 <= this.maxY && var6 <= this.maxZ) {
+ return true;
+ } else {
+ byte var7 = 1;
+ if(var1 >= this.x - var7 && var2 >= this.y - var7 && var3 >= this.z - var7 && var4 <= this.maxX + var7 && var5 <= this.maxY + var7 && var6 <= this.maxZ + var7) {
+ if(var1 < this.x) {
+ this.x = var1;
+ }
+
+ if(var2 < this.y) {
+ this.y = var2;
+ }
+
+ if(var3 < this.z) {
+ this.z = var3;
+ }
+
+ if(var4 > this.maxX) {
+ this.maxX = var4;
+ }
+
+ if(var5 > this.maxY) {
+ this.maxY = var5;
+ }
+
+ if(var6 > this.maxZ) {
+ this.maxZ = var6;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+}
diff --git a/src/net/minecraft/src/MinecartTrackLogic.java b/src/net/minecraft/src/MinecartTrackLogic.java
new file mode 100644
index 0000000..87e209a
--- /dev/null
+++ b/src/net/minecraft/src/MinecartTrackLogic.java
@@ -0,0 +1,250 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class MinecartTrackLogic {
+ private World worldObj;
+ private int trackX;
+ private int trackY;
+ private int trackZ;
+ private int trackMetadata;
+ private List connectedTracks;
+ final BlockMinecartTrack minecartTrack;
+
+ public MinecartTrackLogic(BlockMinecartTrack var1, World var2, int var3, int var4, int var5) {
+ this.minecartTrack = var1;
+ this.connectedTracks = new ArrayList();
+ this.worldObj = var2;
+ this.trackX = var3;
+ this.trackY = var4;
+ this.trackZ = var5;
+ this.trackMetadata = var2.getBlockMetadata(var3, var4, var5);
+ this.calculateConnectedTracks();
+ }
+
+ private void calculateConnectedTracks() {
+ this.connectedTracks.clear();
+ if(this.trackMetadata == 0) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 1) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ } else if(this.trackMetadata == 2) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY + 1, this.trackZ));
+ } else if(this.trackMetadata == 3) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY + 1, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ } else if(this.trackMetadata == 4) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY + 1, this.trackZ - 1));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 5) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY + 1, this.trackZ + 1));
+ } else if(this.trackMetadata == 6) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 7) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ + 1));
+ } else if(this.trackMetadata == 8) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX - 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ } else if(this.trackMetadata == 9) {
+ this.connectedTracks.add(new ChunkPosition(this.trackX + 1, this.trackY, this.trackZ));
+ this.connectedTracks.add(new ChunkPosition(this.trackX, this.trackY, this.trackZ - 1));
+ }
+
+ }
+
+ private void refreshConnectedTracks() {
+ for(int var1 = 0; var1 < this.connectedTracks.size(); ++var1) {
+ MinecartTrackLogic var2 = this.getMinecartTrackLogic((ChunkPosition)this.connectedTracks.get(var1));
+ if(var2 != null && var2.isConnectedTo(this)) {
+ this.connectedTracks.set(var1, new ChunkPosition(var2.trackX, var2.trackY, var2.trackZ));
+ } else {
+ this.connectedTracks.remove(var1--);
+ }
+ }
+
+ }
+
+ private MinecartTrackLogic getMinecartTrackLogic(ChunkPosition var1) {
+ return this.worldObj.getBlockId(var1.x, var1.y, var1.z) == this.minecartTrack.blockID ? new MinecartTrackLogic(this.minecartTrack, this.worldObj, var1.x, var1.y, var1.z) : (this.worldObj.getBlockId(var1.x, var1.y + 1, var1.z) == this.minecartTrack.blockID ? new MinecartTrackLogic(this.minecartTrack, this.worldObj, var1.x, var1.y + 1, var1.z) : (this.worldObj.getBlockId(var1.x, var1.y - 1, var1.z) == this.minecartTrack.blockID ? new MinecartTrackLogic(this.minecartTrack, this.worldObj, var1.x, var1.y - 1, var1.z) : null));
+ }
+
+ private boolean isConnectedTo(MinecartTrackLogic var1) {
+ for(int var2 = 0; var2 < this.connectedTracks.size(); ++var2) {
+ ChunkPosition var3 = (ChunkPosition)this.connectedTracks.get(var2);
+ if(var3.x == var1.trackX && var3.z == var1.trackZ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean isInTrack(int var1, int var2, int var3) {
+ for(int var4 = 0; var4 < this.connectedTracks.size(); ++var4) {
+ ChunkPosition var5 = (ChunkPosition)this.connectedTracks.get(var4);
+ if(var5.x == var1 && var5.z == var3) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean handleKeyPress(MinecartTrackLogic var1) {
+ if(this.isConnectedTo(var1)) {
+ return true;
+ } else if(this.connectedTracks.size() == 2) {
+ return false;
+ } else if(this.connectedTracks.size() == 0) {
+ return true;
+ } else {
+ ChunkPosition var2 = (ChunkPosition)this.connectedTracks.get(0);
+ return var1.trackY == this.trackY && var2.y == this.trackY ? true : true;
+ }
+ }
+
+ private void connectToNeighbor(MinecartTrackLogic var1) {
+ this.connectedTracks.add(new ChunkPosition(var1.trackX, var1.trackY, var1.trackZ));
+ boolean var2 = this.isInTrack(this.trackX, this.trackY, this.trackZ - 1);
+ boolean var3 = this.isInTrack(this.trackX, this.trackY, this.trackZ + 1);
+ boolean var4 = this.isInTrack(this.trackX - 1, this.trackY, this.trackZ);
+ boolean var5 = this.isInTrack(this.trackX + 1, this.trackY, this.trackZ);
+ byte var6 = -1;
+ if(var2 || var3) {
+ var6 = 0;
+ }
+
+ if(var4 || var5) {
+ var6 = 1;
+ }
+
+ if(var3 && var5 && !var2 && !var4) {
+ var6 = 6;
+ }
+
+ if(var3 && var4 && !var2 && !var5) {
+ var6 = 7;
+ }
+
+ if(var2 && var4 && !var3 && !var5) {
+ var6 = 8;
+ }
+
+ if(var2 && var5 && !var3 && !var4) {
+ var6 = 9;
+ }
+
+ if(var6 == 0) {
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ - 1) == this.minecartTrack.blockID) {
+ var6 = 4;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ + 1) == this.minecartTrack.blockID) {
+ var6 = 5;
+ }
+ }
+
+ if(var6 == 1) {
+ if(this.worldObj.getBlockId(this.trackX + 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var6 = 2;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX - 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var6 = 3;
+ }
+ }
+
+ if(var6 < 0) {
+ var6 = 0;
+ }
+
+ this.worldObj.setBlockMetadataWithNotify(this.trackX, this.trackY, this.trackZ, var6);
+ }
+
+ private boolean canConnectFrom(int var1, int var2, int var3) {
+ MinecartTrackLogic var4 = this.getMinecartTrackLogic(new ChunkPosition(var1, var2, var3));
+ if(var4 == null) {
+ return false;
+ } else {
+ var4.refreshConnectedTracks();
+ return var4.handleKeyPress(this);
+ }
+ }
+
+ public void place() {
+ boolean var1 = this.canConnectFrom(this.trackX, this.trackY, this.trackZ - 1);
+ boolean var2 = this.canConnectFrom(this.trackX, this.trackY, this.trackZ + 1);
+ boolean var3 = this.canConnectFrom(this.trackX - 1, this.trackY, this.trackZ);
+ boolean var4 = this.canConnectFrom(this.trackX + 1, this.trackY, this.trackZ);
+ byte var5 = -1;
+ if(var1 || var2) {
+ var5 = 0;
+ }
+
+ if(var3 || var4) {
+ var5 = 1;
+ }
+
+ if(var2 && var4 && !var1 && !var3) {
+ var5 = 6;
+ }
+
+ if(var2 && var3 && !var1 && !var4) {
+ var5 = 7;
+ }
+
+ if(var1 && var3 && !var2 && !var4) {
+ var5 = 8;
+ }
+
+ if(var1 && var4 && !var2 && !var3) {
+ var5 = 9;
+ }
+
+ if(var5 == 0) {
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ - 1) == this.minecartTrack.blockID) {
+ var5 = 4;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX, this.trackY + 1, this.trackZ + 1) == this.minecartTrack.blockID) {
+ var5 = 5;
+ }
+ }
+
+ if(var5 == 1) {
+ if(this.worldObj.getBlockId(this.trackX + 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var5 = 2;
+ }
+
+ if(this.worldObj.getBlockId(this.trackX - 1, this.trackY + 1, this.trackZ) == this.minecartTrack.blockID) {
+ var5 = 3;
+ }
+ }
+
+ if(var5 < 0) {
+ var5 = 0;
+ }
+
+ this.trackMetadata = var5;
+ this.calculateConnectedTracks();
+ this.worldObj.setBlockMetadataWithNotify(this.trackX, this.trackY, this.trackZ, var5);
+
+ for(int var6 = 0; var6 < this.connectedTracks.size(); ++var6) {
+ MinecartTrackLogic var7 = this.getMinecartTrackLogic((ChunkPosition)this.connectedTracks.get(var6));
+ if(var7 != null) {
+ var7.refreshConnectedTracks();
+ if(var7.handleKeyPress(this)) {
+ var7.connectToNeighbor(this);
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/Minecraft.java b/src/net/minecraft/src/Minecraft.java
new file mode 100644
index 0000000..b16dd43
--- /dev/null
+++ b/src/net/minecraft/src/Minecraft.java
@@ -0,0 +1,1025 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.io.File;
+import net.minecraft.client.MinecraftApplet;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Controllers;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+
+public abstract class Minecraft implements Runnable {
+ public PlayerController playerController = new PlayerControllerSP(this);
+ private boolean fullscreen = false;
+ public int displayWidth;
+ public int displayHeight;
+ private OpenGlCapsChecker glCapabilities;
+ private Timer timer = new Timer(20.0F);
+ public World theWorld;
+ public RenderGlobal renderGlobal;
+ public EntityPlayerSP thePlayer;
+ public EffectRenderer effectRenderer;
+ public Session session = null;
+ public String minecraftUri;
+ public Canvas mcCanvas;
+ public boolean appletMode = true;
+ public volatile boolean isGamePaused = false;
+ public RenderEngine renderEngine;
+ public FontRenderer fontRenderer;
+ public GuiScreen currentScreen = null;
+ public LoadingScreenRenderer loadingScreen = new LoadingScreenRenderer(this);
+ public EntityRenderer entityRenderer = new EntityRenderer(this);
+ private ThreadDownloadResources downloadResourcesThread;
+ private int ticksRan = 0;
+ private int leftClickCounter = 0;
+ private int tempDisplayWidth;
+ private int tempDisplayHeight;
+ public String objectMouseOverString = null;
+ public int rightClickDelayTimer = 0;
+ public GuiIngame ingameGUI;
+ public boolean skipRenderWorld = false;
+ public ModelBiped playerModelBiped = new ModelBiped(0.0F);
+ public MovingObjectPosition objectMouseOver = null;
+ public GameSettings gameSettings;
+ protected MinecraftApplet mcApplet;
+ public SoundManager sndManager = new SoundManager();
+ public MouseHelper mouseHelper;
+ public File mcDataDir;
+ public static long[] tickTimes = new long[512];
+ public static int numRecordedFrameTimes = 0;
+ private TextureWaterFX textureWaterFX = new TextureWaterFX();
+ private TextureLavaFX textureLavaFX = new TextureLavaFX();
+ private static File minecraftDir = null;
+ volatile boolean running = true;
+ public String debug = "";
+ long prevFrameTime = -1L;
+ public boolean inGameHasFocus = false;
+ private int mouseTicksRan = 0;
+ public boolean isRaining = false;
+ long systemTime = System.currentTimeMillis();
+
+ public Minecraft(Component var1, Canvas var2, MinecraftApplet var3, int var4, int var5, boolean var6) {
+ this.tempDisplayWidth = var4;
+ this.tempDisplayHeight = var5;
+ this.fullscreen = var6;
+ this.mcApplet = var3;
+ new ThreadSleepForever(this, "Timer hack thread");
+ this.mcCanvas = var2;
+ this.displayWidth = var4;
+ this.displayHeight = var5;
+ this.fullscreen = var6;
+ }
+
+ public abstract void displayUnexpectedThrowable(UnexpectedThrowable var1);
+
+ public void setServer(String var1, int var2) {
+ }
+
+ public void startGame() throws LWJGLException {
+ if(this.mcCanvas != null) {
+ Graphics var1 = this.mcCanvas.getGraphics();
+ if(var1 != null) {
+ var1.setColor(Color.BLACK);
+ var1.fillRect(0, 0, this.displayWidth, this.displayHeight);
+ var1.dispose();
+ }
+
+ Display.setParent(this.mcCanvas);
+ } else if(this.fullscreen) {
+ Display.setFullscreen(true);
+ this.displayWidth = Display.getDisplayMode().getWidth();
+ this.displayHeight = Display.getDisplayMode().getHeight();
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+ } else {
+ Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight));
+ }
+
+ Display.setTitle("Minecraft Minecraft Infdev");
+
+ try {
+ Display.create();
+ } catch (LWJGLException var6) {
+ var6.printStackTrace();
+
+ try {
+ Thread.sleep(1000L);
+ } catch (InterruptedException var5) {
+ }
+
+ Display.create();
+ }
+
+ this.mcDataDir = getMinecraftDir();
+ this.gameSettings = new GameSettings(this, this.mcDataDir);
+ this.renderEngine = new RenderEngine(this.gameSettings);
+ this.fontRenderer = new FontRenderer(this.gameSettings, "/default.png", this.renderEngine);
+ this.loadScreen();
+ Keyboard.create();
+ Mouse.create();
+ this.mouseHelper = new MouseHelper(this.mcCanvas);
+
+ try {
+ Controllers.create();
+ } catch (Exception var4) {
+ var4.printStackTrace();
+ }
+
+ this.checkGLError("Pre startup");
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+ GL11.glClearDepth(1.0D);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
+ GL11.glCullFace(GL11.GL_BACK);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ this.checkGLError("Startup");
+ this.glCapabilities = new OpenGlCapsChecker();
+ this.sndManager.loadSoundSettings(this.gameSettings);
+ this.renderEngine.registerTextureFX(this.textureLavaFX);
+ this.renderEngine.registerTextureFX(this.textureWaterFX);
+ this.renderEngine.registerTextureFX(new TextureWaterFlowFX());
+ this.renderEngine.registerTextureFX(new TextureLavaFlowFX());
+ this.renderEngine.registerTextureFX(new TextureFlamesFX(0));
+ this.renderEngine.registerTextureFX(new TextureFlamesFX(1));
+ this.renderEngine.registerTextureFX(new TextureGearsFX(0));
+ this.renderEngine.registerTextureFX(new TextureGearsFX(1));
+ this.renderGlobal = new RenderGlobal(this, this.renderEngine);
+ GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
+ this.displayGuiScreen(new GuiMainMenu());
+ this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
+
+ try {
+ this.downloadResourcesThread = new ThreadDownloadResources(this.mcDataDir, this);
+ this.downloadResourcesThread.start();
+ } catch (Exception var3) {
+ }
+
+ this.checkGLError("Post startup");
+ this.ingameGUI = new GuiIngame(this);
+ this.playerController.init();
+ }
+
+ private void loadScreen() throws LWJGLException {
+ ScaledResolution var1 = new ScaledResolution(this.displayWidth, this.displayHeight);
+ int var2 = var1.getScaledWidth();
+ int var3 = var1.getScaledHeight();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)var2, (double)var3, 0.0D, 1000.0D, 3000.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
+ GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
+ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_FOG);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ Tessellator var4 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/dirt.png"));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ float var5 = 32.0F;
+ var4.startDrawingQuads();
+ var4.setColorOpaque_I(4210752);
+ var4.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, (double)((float)this.displayHeight / var5 + 0.0F));
+ var4.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, (double)((float)this.displayWidth / var5), (double)((float)this.displayHeight / var5 + 0.0F));
+ var4.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, (double)((float)this.displayWidth / var5), 0.0D);
+ var4.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
+ var4.draw();
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
+ this.fontRenderer.drawStringWithShadow("Loading...", 8, this.displayHeight / 2 - 16, -1);
+ Display.swapBuffers();
+ }
+
+ public static File getMinecraftDir() {
+ if(minecraftDir == null) {
+ minecraftDir = getAppDir("minecraft");
+ }
+
+ return minecraftDir;
+ }
+
+ public static File getAppDir(String var0) {
+ String var1 = System.getProperty("user.home", ".");
+ File var2;
+ switch(OSMap.osValues[getOs().ordinal()]) {
+ case 1:
+ case 2:
+ var2 = new File(var1, '.' + var0 + '/');
+ break;
+ case 3:
+ String var3 = System.getenv("APPDATA");
+ if(var3 != null) {
+ var2 = new File(var3, "." + var0 + '/');
+ } else {
+ var2 = new File(var1, '.' + var0 + '/');
+ }
+ break;
+ case 4:
+ var2 = new File(var1, "Library/Application Support/" + var0);
+ break;
+ default:
+ var2 = new File(var1, var0 + '/');
+ }
+
+ if(!var2.exists() && !var2.mkdirs()) {
+ throw new RuntimeException("The working directory could not be created: " + var2);
+ } else {
+ return var2;
+ }
+ }
+
+ private static EnumOS getOs() {
+ String var0 = System.getProperty("os.name").toLowerCase();
+ return var0.contains("win") ? EnumOS.windows : (var0.contains("mac") ? EnumOS.macos : (var0.contains("solaris") ? EnumOS.solaris : (var0.contains("sunos") ? EnumOS.solaris : (var0.contains("linux") ? EnumOS.linux : (var0.contains("unix") ? EnumOS.linux : EnumOS.unknown)))));
+ }
+
+ public void displayGuiScreen(GuiScreen var1) {
+ if(!(this.currentScreen instanceof GuiErrorScreen)) {
+ if(this.currentScreen != null) {
+ this.currentScreen.onGuiClosed();
+ }
+
+ if(var1 == null && this.theWorld == null) {
+ var1 = new GuiMainMenu();
+ } else if(var1 == null && this.thePlayer.health <= 0) {
+ var1 = new GuiGameOver();
+ }
+
+ this.currentScreen = (GuiScreen)var1;
+ if(var1 != null) {
+ this.setIngameNotInFocus();
+ ScaledResolution var2 = new ScaledResolution(this.displayWidth, this.displayHeight);
+ int var3 = var2.getScaledWidth();
+ int var4 = var2.getScaledHeight();
+ ((GuiScreen)var1).setWorldAndResolution(this, var3, var4);
+ this.skipRenderWorld = false;
+ } else {
+ this.setIngameFocus();
+ }
+
+ }
+ }
+
+ private void checkGLError(String var1) {
+ int var2 = GL11.glGetError();
+ if(var2 != 0) {
+ String var3 = GLU.gluErrorString(var2);
+ System.out.println("########## GL ERROR ##########");
+ System.out.println("@ " + var1);
+ System.out.println(var2 + ": " + var3);
+ System.exit(0);
+ }
+
+ }
+
+ public void shutdownMinecraftApplet() {
+ if(this.mcApplet != null) {
+ this.mcApplet.clearApplet();
+ }
+
+ try {
+ if(this.downloadResourcesThread != null) {
+ this.downloadResourcesThread.closeMinecraft();
+ }
+ } catch (Exception var8) {
+ }
+
+ try {
+ System.out.println("Stopping!");
+ this.changeWorld1((World)null);
+
+ try {
+ GLAllocation.deleteTexturesAndDisplayLists();
+ } catch (Exception var6) {
+ }
+
+ this.sndManager.closeMinecraft();
+ Mouse.destroy();
+ Keyboard.destroy();
+ } finally {
+ Display.destroy();
+ }
+
+ System.gc();
+ }
+
+ public void run() {
+ this.running = true;
+
+ try {
+ this.startGame();
+ } catch (Exception var10) {
+ var10.printStackTrace();
+ this.displayUnexpectedThrowable(new UnexpectedThrowable("Failed to start game", var10));
+ return;
+ }
+
+ try {
+ long var1 = System.currentTimeMillis();
+ int var3 = 0;
+
+ while(this.running && (this.mcApplet == null || this.mcApplet.isActive())) {
+ AxisAlignedBB.clearBoundingBoxPool();
+ Vec3D.initialize();
+ if(this.mcCanvas == null && Display.isCloseRequested()) {
+ this.shutdown();
+ }
+
+ if(this.isGamePaused) {
+ float var4 = this.timer.renderPartialTicks;
+ this.timer.updateTimer();
+ this.timer.renderPartialTicks = var4;
+ } else {
+ this.timer.updateTimer();
+ }
+
+ for(int var14 = 0; var14 < this.timer.elapsedTicks; ++var14) {
+ ++this.ticksRan;
+ this.runTick();
+ }
+
+ this.checkGLError("Pre render");
+ if(this.isGamePaused) {
+ this.timer.renderPartialTicks = 1.0F;
+ }
+
+ this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ if(this.theWorld != null) {
+ while(this.theWorld.updatingLighting()) {
+ }
+ }
+
+ if(!this.skipRenderWorld) {
+ this.playerController.setPartialTime(this.timer.renderPartialTicks);
+ this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
+ }
+
+ if(!Display.isActive() && this.fullscreen) {
+ this.toggleFullscreen();
+ }
+
+ if(Keyboard.isKeyDown(Keyboard.KEY_F6)) {
+ this.displayDebugInfo();
+ } else {
+ this.prevFrameTime = System.nanoTime();
+ }
+
+ Thread.yield();
+ Display.update();
+ if(this.mcCanvas != null && !this.fullscreen && (this.mcCanvas.getWidth() != this.displayWidth || this.mcCanvas.getHeight() != this.displayHeight)) {
+ this.displayWidth = this.mcCanvas.getWidth();
+ this.displayHeight = this.mcCanvas.getHeight();
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+
+ this.resize(this.displayWidth, this.displayHeight);
+ }
+
+ if(this.gameSettings.limitFramerate) {
+ Thread.sleep(5L);
+ }
+
+ this.checkGLError("Post render");
+ ++var3;
+
+ for(this.isGamePaused = !this.isMultiplayerWorld() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame(); System.currentTimeMillis() >= var1 + 1000L; var3 = 0) {
+ this.debug = var3 + " fps, " + WorldRenderer.chunksUpdated + " chunk updates";
+ WorldRenderer.chunksUpdated = 0;
+ var1 += 1000L;
+ }
+ }
+ } catch (MinecraftError var11) {
+ } catch (Exception var12) {
+ var12.printStackTrace();
+ this.displayUnexpectedThrowable(new UnexpectedThrowable("Unexpected error", var12));
+ } finally {
+ this.shutdownMinecraftApplet();
+ }
+
+ }
+
+ private void displayDebugInfo() {
+ if(this.prevFrameTime == -1L) {
+ this.prevFrameTime = System.nanoTime();
+ }
+
+ long var1 = System.nanoTime();
+ tickTimes[numRecordedFrameTimes++ & tickTimes.length - 1] = var1 - this.prevFrameTime;
+ this.prevFrameTime = var1;
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
+ GL11.glLineWidth(1.0F);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Tessellator var3 = Tessellator.instance;
+ var3.startDrawing(7);
+ var3.setColorOpaque_I(538968064);
+ var3.addVertex(0.0D, (double)(this.displayHeight - 100), 0.0D);
+ var3.addVertex(0.0D, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)(this.displayHeight - 100), 0.0D);
+ var3.draw();
+ long var4 = 0L;
+
+ int var6;
+ for(var6 = 0; var6 < tickTimes.length; ++var6) {
+ var4 += tickTimes[var6];
+ }
+
+ var6 = (int)(var4 / 200000L / (long)tickTimes.length);
+ var3.startDrawing(7);
+ var3.setColorOpaque_I(541065216);
+ var3.addVertex(0.0D, (double)(this.displayHeight - var6), 0.0D);
+ var3.addVertex(0.0D, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)this.displayHeight, 0.0D);
+ var3.addVertex((double)tickTimes.length, (double)(this.displayHeight - var6), 0.0D);
+ var3.draw();
+ var3.startDrawing(1);
+
+ for(int var7 = 0; var7 < tickTimes.length; ++var7) {
+ int var8 = (var7 - numRecordedFrameTimes & tickTimes.length - 1) * 255 / tickTimes.length;
+ int var9 = var8 * var8 / 255;
+ var9 = var9 * var9 / 255;
+ int var10 = var9 * var9 / 255;
+ var10 = var10 * var10 / 255;
+ var3.setColorOpaque_I(-16777216 + var10 + var9 * 256 + var8 * 65536);
+ long var11 = tickTimes[var7] / 200000L;
+ var3.addVertex((double)((float)var7 + 0.5F), (double)((float)((long)this.displayHeight - var11) + 0.5F), 0.0D);
+ var3.addVertex((double)((float)var7 + 0.5F), (double)((float)this.displayHeight + 0.5F), 0.0D);
+ }
+
+ var3.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ public void shutdown() {
+ this.running = false;
+ }
+
+ public void setIngameFocus() {
+ if(Display.isActive()) {
+ if(!this.inGameHasFocus) {
+ this.inGameHasFocus = true;
+ this.mouseHelper.grabMouseCursor();
+ this.displayGuiScreen((GuiScreen)null);
+ this.mouseTicksRan = this.ticksRan + 10000;
+ }
+ }
+ }
+
+ public void setIngameNotInFocus() {
+ if(this.inGameHasFocus) {
+ if(this.thePlayer != null) {
+ this.thePlayer.resetPlayerKeyState();
+ }
+
+ this.inGameHasFocus = false;
+ this.mouseHelper.ungrabMouseCursor();
+ }
+ }
+
+ public void displayInGameMenu() {
+ if(this.currentScreen == null) {
+ this.displayGuiScreen(new GuiIngameMenu());
+ }
+ }
+
+ private void sendClickBlockToController(int var1, boolean var2) {
+ if(!this.playerController.isInTestMode) {
+ if(var1 != 0 || this.leftClickCounter <= 0) {
+ if(var2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == 0 && var1 == 0) {
+ int var3 = this.objectMouseOver.blockX;
+ int var4 = this.objectMouseOver.blockY;
+ int var5 = this.objectMouseOver.blockZ;
+ this.playerController.sendBlockRemoving(var3, var4, var5, this.objectMouseOver.sideHit);
+ this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit);
+ } else {
+ this.playerController.resetBlockRemoving();
+ }
+
+ }
+ }
+ }
+
+ private void clickMouse(int var1) {
+ if(var1 != 0 || this.leftClickCounter <= 0) {
+ if(var1 == 0) {
+ this.entityRenderer.itemRenderer.swing();
+ }
+
+ int var3;
+ if(this.objectMouseOver == null) {
+ if(var1 == 0 && !(this.playerController instanceof PlayerControllerCreative)) {
+ this.leftClickCounter = 10;
+ }
+ } else if(this.objectMouseOver.typeOfHit == 1) {
+ if(var1 == 0) {
+ this.thePlayer.attackEntity(this.objectMouseOver.entityHit);
+ }
+
+ if(var1 == 1) {
+ this.thePlayer.interactWithEntity(this.objectMouseOver.entityHit);
+ }
+ } else if(this.objectMouseOver.typeOfHit == 0) {
+ int var2 = this.objectMouseOver.blockX;
+ var3 = this.objectMouseOver.blockY;
+ int var4 = this.objectMouseOver.blockZ;
+ int var5 = this.objectMouseOver.sideHit;
+ Block var6 = Block.blocksList[this.theWorld.getBlockId(var2, var3, var4)];
+ if(var1 == 0) {
+ this.theWorld.extinguishFire(var2, var3, var4, this.objectMouseOver.sideHit);
+ if(var6 != Block.bedrock || this.thePlayer.unusedMiningCooldown >= 100) {
+ this.playerController.clickBlock(var2, var3, var4);
+ }
+ } else {
+ ItemStack var7 = this.thePlayer.inventory.getCurrentItem();
+ int var8 = this.theWorld.getBlockId(var2, var3, var4);
+ if(var8 > 0 && Block.blocksList[var8].blockActivated(this.theWorld, var2, var3, var4, this.thePlayer)) {
+ return;
+ }
+
+ if(var7 == null) {
+ return;
+ }
+
+ int var9 = var7.stackSize;
+ if(var7.useItem(this.thePlayer, this.theWorld, var2, var3, var4, var5)) {
+ this.entityRenderer.itemRenderer.swing();
+ }
+
+ if(var7.stackSize == 0) {
+ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null;
+ } else if(var7.stackSize != var9) {
+ this.entityRenderer.itemRenderer.resetEquippedProgress();
+ }
+ }
+ }
+
+ if(var1 == 1) {
+ ItemStack var10 = this.thePlayer.inventory.getCurrentItem();
+ if(var10 != null) {
+ var3 = var10.stackSize;
+ ItemStack var11 = var10.useItemRightClick(this.theWorld, this.thePlayer);
+ if(var11 != var10 || var11 != null && var11.stackSize != var3) {
+ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = var11;
+ this.entityRenderer.itemRenderer.resetEquippedProgress2();
+ if(var11.stackSize == 0) {
+ this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null;
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ public void toggleFullscreen() {
+ try {
+ this.fullscreen = !this.fullscreen;
+ System.out.println("Toggle fullscreen!");
+ if(this.fullscreen) {
+ Display.setDisplayMode(Display.getDesktopDisplayMode());
+ this.displayWidth = Display.getDisplayMode().getWidth();
+ this.displayHeight = Display.getDisplayMode().getHeight();
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+ } else {
+ if(this.mcCanvas != null) {
+ this.displayWidth = this.mcCanvas.getWidth();
+ this.displayHeight = this.mcCanvas.getHeight();
+ } else {
+ this.displayWidth = this.tempDisplayWidth;
+ this.displayHeight = this.tempDisplayHeight;
+ }
+
+ if(this.displayWidth <= 0) {
+ this.displayWidth = 1;
+ }
+
+ if(this.displayHeight <= 0) {
+ this.displayHeight = 1;
+ }
+
+ Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight));
+ }
+
+ this.setIngameNotInFocus();
+ Display.setFullscreen(this.fullscreen);
+ Display.update();
+ Thread.sleep(1000L);
+ if(this.fullscreen) {
+ this.setIngameFocus();
+ }
+
+ if(this.currentScreen != null) {
+ this.setIngameNotInFocus();
+ this.resize(this.displayWidth, this.displayHeight);
+ }
+
+ System.out.println("Size: " + this.displayWidth + ", " + this.displayHeight);
+ } catch (Exception var2) {
+ var2.printStackTrace();
+ }
+
+ }
+
+ private void resize(int var1, int var2) {
+ if(var1 <= 0) {
+ var1 = 1;
+ }
+
+ if(var2 <= 0) {
+ var2 = 1;
+ }
+
+ this.displayWidth = var1;
+ this.displayHeight = var2;
+ if(this.currentScreen != null) {
+ ScaledResolution var3 = new ScaledResolution(var1, var2);
+ int var4 = var3.getScaledWidth();
+ int var5 = var3.getScaledHeight();
+ this.currentScreen.setWorldAndResolution(this, var4, var5);
+ }
+
+ }
+
+ private void clickMiddleMouseButton() {
+ if(this.objectMouseOver != null) {
+ int var1 = this.theWorld.getBlockId(this.objectMouseOver.blockX, this.objectMouseOver.blockY, this.objectMouseOver.blockZ);
+ if(var1 == Block.grass.blockID) {
+ var1 = Block.dirt.blockID;
+ }
+
+ if(var1 == Block.stairDouble.blockID) {
+ var1 = Block.stairSingle.blockID;
+ }
+
+ if(var1 == Block.bedrock.blockID) {
+ var1 = Block.stone.blockID;
+ }
+
+ this.thePlayer.inventory.setCurrentItem(var1, this.playerController instanceof PlayerControllerCreative);
+ }
+
+ }
+
+ public void runTick() {
+ this.ingameGUI.updateTick();
+ if(!this.isGamePaused && this.theWorld != null) {
+ this.playerController.onUpdate();
+ }
+
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain.png"));
+ if(!this.isGamePaused) {
+ this.renderEngine.updateDynamicTextures();
+ }
+
+ if(this.currentScreen == null && this.thePlayer != null && this.thePlayer.health <= 0) {
+ this.displayGuiScreen((GuiScreen)null);
+ }
+
+ if(this.currentScreen == null || this.currentScreen.allowUserInput) {
+ label226:
+ while(true) {
+ while(true) {
+ while(true) {
+ long var1;
+ do {
+ if(!Mouse.next()) {
+ if(this.leftClickCounter > 0) {
+ --this.leftClickCounter;
+ }
+
+ while(true) {
+ while(true) {
+ do {
+ if(!Keyboard.next()) {
+ if(this.currentScreen == null) {
+ if(Mouse.isButtonDown(0) && (float)(this.ticksRan - this.mouseTicksRan) >= this.timer.ticksPerSecond / 4.0F && this.inGameHasFocus) {
+ this.clickMouse(0);
+ this.mouseTicksRan = this.ticksRan;
+ }
+
+ if(Mouse.isButtonDown(1) && (float)(this.ticksRan - this.mouseTicksRan) >= this.timer.ticksPerSecond / 4.0F && this.inGameHasFocus) {
+ this.clickMouse(1);
+ this.mouseTicksRan = this.ticksRan;
+ }
+ }
+
+ this.sendClickBlockToController(0, this.currentScreen == null && Mouse.isButtonDown(0) && this.inGameHasFocus);
+ break label226;
+ }
+
+ this.thePlayer.handleKeyPress(Keyboard.getEventKey(), Keyboard.getEventKeyState());
+ } while(!Keyboard.getEventKeyState());
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_F11) {
+ this.toggleFullscreen();
+ } else {
+ if(this.currentScreen != null) {
+ this.currentScreen.handleKeyboardInput();
+ } else {
+ if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
+ this.displayInGameMenu();
+ }
+
+ if(this.playerController instanceof PlayerControllerCreative) {
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindLoad.keyCode) {
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindSave.keyCode) {
+ }
+ }
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_F5) {
+ this.gameSettings.thirdPersonView = !this.gameSettings.thirdPersonView;
+ this.isRaining = !this.isRaining;
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindInventory.keyCode) {
+ this.displayGuiScreen(new GuiInventory(this.thePlayer.inventory));
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindDrop.keyCode) {
+ this.thePlayer.dropPlayerItemWithRandomChoice(this.thePlayer.inventory.decrStackSize(this.thePlayer.inventory.currentItem, 1), false);
+ }
+ }
+
+ for(int var4 = 0; var4 < 9; ++var4) {
+ if(Keyboard.getEventKey() == Keyboard.KEY_1 + var4) {
+ this.thePlayer.inventory.currentItem = var4;
+ }
+ }
+
+ if(Keyboard.getEventKey() == this.gameSettings.keyBindToggleFog.keyCode) {
+ this.gameSettings.setOptionFloatValue(4, !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) ? 1 : -1);
+ }
+ }
+ }
+ }
+ }
+
+ var1 = System.currentTimeMillis() - this.systemTime;
+ } while(var1 > 200L);
+
+ int var3 = Mouse.getEventDWheel();
+ if(var3 != 0) {
+ this.thePlayer.inventory.changeCurrentItem(var3);
+ }
+
+ if(this.currentScreen == null) {
+ if(!this.inGameHasFocus && Mouse.getEventButtonState()) {
+ this.setIngameFocus();
+ } else {
+ if(Mouse.getEventButton() == 0 && Mouse.getEventButtonState()) {
+ this.clickMouse(0);
+ this.mouseTicksRan = this.ticksRan;
+ }
+
+ if(Mouse.getEventButton() == 1 && Mouse.getEventButtonState()) {
+ this.clickMouse(1);
+ this.mouseTicksRan = this.ticksRan;
+ }
+
+ if(Mouse.getEventButton() == 2 && Mouse.getEventButtonState()) {
+ this.clickMiddleMouseButton();
+ }
+ }
+ } else if(this.currentScreen != null) {
+ this.currentScreen.handleMouseInput();
+ }
+ }
+ }
+ }
+ }
+
+ if(this.currentScreen != null) {
+ this.mouseTicksRan = this.ticksRan + 10000;
+ }
+
+ if(this.currentScreen != null) {
+ this.currentScreen.handleInput();
+ if(this.currentScreen != null) {
+ this.currentScreen.updateScreen();
+ }
+ }
+
+ if(this.theWorld != null) {
+ this.theWorld.difficultySetting = this.gameSettings.difficulty;
+ if(!this.isGamePaused) {
+ this.entityRenderer.updateRenderer();
+ }
+
+ if(!this.isGamePaused) {
+ this.renderGlobal.updateClouds();
+ }
+
+ if(!this.isGamePaused) {
+ this.theWorld.updateEntities();
+ }
+
+ if(!this.isGamePaused && !this.isMultiplayerWorld()) {
+ this.theWorld.tick();
+ }
+
+ if(!this.isGamePaused) {
+ this.theWorld.randomDisplayUpdates(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ));
+ }
+
+ if(!this.isGamePaused) {
+ this.effectRenderer.updateEffects();
+ }
+ }
+
+ this.systemTime = System.currentTimeMillis();
+ }
+
+ public boolean isMultiplayerWorld() {
+ return false;
+ }
+
+ public void startWorld(String var1) {
+ this.changeWorld1((World)null);
+ System.gc();
+ World var2 = new World(new File(getMinecraftDir(), "saves"), var1);
+ if(var2.isNewWorld) {
+ this.changeWorld2(var2, "Generating level");
+ } else {
+ this.changeWorld2(var2, "Loading level");
+ }
+
+ }
+
+ public void changeWorld1(World var1) {
+ this.changeWorld2(var1, "");
+ }
+
+ public void changeWorld2(World var1, String var2) {
+ if(this.theWorld != null) {
+ this.theWorld.saveWorldIndirectly(this.loadingScreen);
+ }
+
+ this.theWorld = var1;
+ if(var1 != null) {
+ this.playerController.onWorldChange(var1);
+ var1.fontRenderer = this.fontRenderer;
+ if(!this.isMultiplayerWorld()) {
+ this.thePlayer = (EntityPlayerSP)var1.createDebugPlayer(EntityPlayerSP.class);
+ var1.playerEntity = this.thePlayer;
+ } else if(this.thePlayer != null) {
+ this.thePlayer.preparePlayerToSpawn();
+ if(var1 != null) {
+ var1.playerEntity = this.thePlayer;
+ var1.spawnEntityInWorld(this.thePlayer);
+ }
+ }
+
+ this.preloadWorld(var2);
+ if(this.thePlayer == null) {
+ this.thePlayer = new EntityPlayerSP(this, var1, this.session);
+ this.thePlayer.preparePlayerToSpawn();
+ this.playerController.flipPlayer(this.thePlayer);
+ }
+
+ this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
+ if(this.renderGlobal != null) {
+ this.renderGlobal.changeWorld(var1);
+ }
+
+ if(this.effectRenderer != null) {
+ this.effectRenderer.clearEffects(var1);
+ }
+
+ this.playerController.onRespawn(this.thePlayer);
+ var1.playerEntity = this.thePlayer;
+ var1.spawnPlayerWithLoadedChunks();
+ if(var1.isNewWorld) {
+ var1.saveWorldIndirectly(this.loadingScreen);
+ }
+ }
+
+ System.gc();
+ this.systemTime = 0L;
+ }
+
+ private void preloadWorld(String var1) {
+ this.loadingScreen.printText(var1);
+ this.loadingScreen.displayLoadingString("Building terrain");
+ short var2 = 128;
+ int var3 = 0;
+ int var4 = var2 * 2 / 16 + 1;
+ var4 *= var4;
+
+ int var5;
+ for(var5 = -var2; var5 <= var2; var5 += 16) {
+ int var6 = this.theWorld.spawnX;
+ int var7 = this.theWorld.spawnZ;
+ if(this.theWorld.playerEntity != null) {
+ var6 = (int)this.theWorld.playerEntity.posX;
+ var7 = (int)this.theWorld.playerEntity.posZ;
+ }
+
+ for(int var8 = -var2; var8 <= var2; var8 += 16) {
+ this.loadingScreen.setLoadingProgress(var3++ * 100 / var4);
+ this.theWorld.getBlockId(var6 + var5, 64, var7 + var8);
+
+ while(this.theWorld.updatingLighting()) {
+ }
+ }
+ }
+
+ this.loadingScreen.displayLoadingString("Simulating world for a bit");
+ short var9 = 2000;
+ BlockSand.fallInstantly = true;
+
+ for(var5 = 0; var5 < var9; ++var5) {
+ this.theWorld.tickUpdates(true);
+ }
+
+ this.theWorld.dropOldChunks();
+ BlockSand.fallInstantly = false;
+ }
+
+ public void installResource(String var1, File var2) {
+ int var3 = var1.indexOf("/");
+ String var4 = var1.substring(0, var3);
+ var1 = var1.substring(var3 + 1);
+ if(var4.equalsIgnoreCase("sound")) {
+ this.sndManager.addSound(var1, var2);
+ } else if(var4.equalsIgnoreCase("newsound")) {
+ this.sndManager.addSound(var1, var2);
+ } else if(var4.equalsIgnoreCase("music")) {
+ this.sndManager.addMusic(var1, var2);
+ }
+
+ }
+
+ public OpenGlCapsChecker getOpenGlCapsChecker() {
+ return this.glCapabilities;
+ }
+
+ public String debugInfoRenders() {
+ return this.renderGlobal.getDebugInfoRenders();
+ }
+
+ public String getEntityDebug() {
+ return this.renderGlobal.getDebugInfoEntities();
+ }
+
+ public String debugInfoEntities() {
+ return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities();
+ }
+
+ public void respawn() {
+ if(this.thePlayer != null && this.theWorld != null) {
+ this.theWorld.setEntityDead(this.thePlayer);
+ }
+
+ this.theWorld.setSpawnLocation();
+ this.thePlayer = new EntityPlayerSP(this, this.theWorld, this.session);
+ this.thePlayer.preparePlayerToSpawn();
+ this.playerController.flipPlayer(this.thePlayer);
+ if(this.theWorld != null) {
+ this.theWorld.playerEntity = this.thePlayer;
+ this.theWorld.spawnPlayerWithLoadedChunks();
+ }
+
+ this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
+ this.playerController.onRespawn(this.thePlayer);
+ this.preloadWorld("Respawning");
+ }
+}
diff --git a/src/net/minecraft/src/MinecraftAppletImpl.java b/src/net/minecraft/src/MinecraftAppletImpl.java
new file mode 100644
index 0000000..647fd9b
--- /dev/null
+++ b/src/net/minecraft/src/MinecraftAppletImpl.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+import java.awt.Canvas;
+import java.awt.Component;
+import net.minecraft.client.MinecraftApplet;
+
+public class MinecraftAppletImpl extends Minecraft {
+ final MinecraftApplet mainFrame;
+
+ public MinecraftAppletImpl(MinecraftApplet var1, Component var2, Canvas var3, MinecraftApplet var4, int var5, int var6, boolean var7) {
+ super(var2, var3, var4, var5, var6, var7);
+ this.mainFrame = var1;
+ }
+
+ public void displayUnexpectedThrowable(UnexpectedThrowable var1) {
+ this.mainFrame.removeAll();
+ this.mainFrame.add(new PanelCrashReport(var1), "Center");
+ this.mainFrame.validate();
+ }
+}
diff --git a/src/net/minecraft/src/MinecraftError.java b/src/net/minecraft/src/MinecraftError.java
new file mode 100644
index 0000000..9a75dec
--- /dev/null
+++ b/src/net/minecraft/src/MinecraftError.java
@@ -0,0 +1,4 @@
+package net.minecraft.src;
+
+public class MinecraftError extends Error {
+}
diff --git a/src/net/minecraft/src/ModelBase.java b/src/net/minecraft/src/ModelBase.java
new file mode 100644
index 0000000..06d3a6f
--- /dev/null
+++ b/src/net/minecraft/src/ModelBase.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public abstract class ModelBase {
+ public float swingProgress;
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ }
+}
diff --git a/src/net/minecraft/src/ModelBiped.java b/src/net/minecraft/src/ModelBiped.java
new file mode 100644
index 0000000..5a2b40b
--- /dev/null
+++ b/src/net/minecraft/src/ModelBiped.java
@@ -0,0 +1,73 @@
+package net.minecraft.src;
+
+public class ModelBiped extends ModelBase {
+ public ModelRenderer bipedHead;
+ public ModelRenderer bipedHeadwear;
+ public ModelRenderer bipedBody;
+ public ModelRenderer bipedRightArm;
+ public ModelRenderer bipedLeftArm;
+ public ModelRenderer bipedRightLeg;
+ public ModelRenderer bipedLeftLeg;
+
+ public ModelBiped() {
+ this(0.0F);
+ }
+
+ public ModelBiped(float var1) {
+ this(var1, 0.0F);
+ }
+
+ public ModelBiped(float var1, float var2) {
+ this.bipedHead = new ModelRenderer(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.bipedHeadwear = new ModelRenderer(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.bipedBody = new ModelRenderer(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.bipedRightArm = new ModelRenderer(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.bipedLeftArm = new ModelRenderer(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.bipedRightLeg = new ModelRenderer(0, 16);
+ this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1);
+ this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + var2, 0.0F);
+ this.bipedLeftLeg = new ModelRenderer(0, 16);
+ this.bipedLeftLeg.mirror = true;
+ this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1);
+ this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var2, 0.0F);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.bipedHead.render(var6);
+ this.bipedBody.render(var6);
+ this.bipedRightArm.render(var6);
+ this.bipedLeftArm.render(var6);
+ this.bipedRightLeg.render(var6);
+ this.bipedLeftLeg.render(var6);
+ this.bipedHeadwear.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.bipedHead.rotateAngleY = var4 / (180.0F / (float)Math.PI);
+ this.bipedHead.rotateAngleX = var5 / (180.0F / (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;
+ this.bipedRightArm.rotateAngleZ = (MathHelper.cos(var1 * 0.2312F) + 1.0F) * 1.0F * var2;
+ this.bipedLeftArm.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 2.0F * var2;
+ this.bipedLeftArm.rotateAngleZ = (MathHelper.cos(var1 * 0.2812F) - 1.0F) * 1.0F * var2;
+ 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.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;
+ }
+}
diff --git a/src/net/minecraft/src/ModelCreeper.java b/src/net/minecraft/src/ModelCreeper.java
new file mode 100644
index 0000000..eac89c4
--- /dev/null
+++ b/src/net/minecraft/src/ModelCreeper.java
@@ -0,0 +1,56 @@
+package net.minecraft.src;
+
+public class ModelCreeper extends ModelBase {
+ public ModelRenderer head;
+ public ModelRenderer headwear;
+ public ModelRenderer body;
+ public ModelRenderer leg1;
+ public ModelRenderer leg2;
+ public ModelRenderer leg3;
+ public ModelRenderer leg4;
+
+ public ModelCreeper() {
+ float var1 = 0.0F;
+ byte var2 = 4;
+ this.head = new ModelRenderer(0, 0);
+ this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1);
+ this.head.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.headwear = new ModelRenderer(32, 0);
+ this.headwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1 + 0.5F);
+ this.headwear.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.body = new ModelRenderer(16, 16);
+ this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var1);
+ this.body.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.leg1 = new ModelRenderer(0, 16);
+ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg1.setRotationPoint(-2.0F, (float)(12 + var2), 4.0F);
+ this.leg2 = new ModelRenderer(0, 16);
+ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg2.setRotationPoint(2.0F, (float)(12 + var2), 4.0F);
+ this.leg3 = new ModelRenderer(0, 16);
+ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg3.setRotationPoint(-2.0F, (float)(12 + var2), -4.0F);
+ this.leg4 = new ModelRenderer(0, 16);
+ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg4.setRotationPoint(2.0F, (float)(12 + var2), -4.0F);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.head.render(var6);
+ this.body.render(var6);
+ this.leg1.render(var6);
+ this.leg2.render(var6);
+ this.leg3.render(var6);
+ this.leg4.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ 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;
+ }
+}
diff --git a/src/net/minecraft/src/ModelMinecart.java b/src/net/minecraft/src/ModelMinecart.java
new file mode 100644
index 0000000..68425ee
--- /dev/null
+++ b/src/net/minecraft/src/ModelMinecart.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class ModelMinecart extends ModelBase {
+ public ModelRenderer[] sideModels = new ModelRenderer[7];
+
+ public ModelMinecart() {
+ this.sideModels[0] = new ModelRenderer(0, 10);
+ this.sideModels[1] = new ModelRenderer(0, 0);
+ this.sideModels[2] = new ModelRenderer(0, 0);
+ this.sideModels[3] = new ModelRenderer(0, 0);
+ this.sideModels[4] = new ModelRenderer(0, 0);
+ this.sideModels[5] = new ModelRenderer(44, 10);
+ byte var1 = 20;
+ byte var2 = 8;
+ byte var3 = 16;
+ byte var4 = 4;
+ this.sideModels[0].addBox((float)(-var1 / 2), (float)(-var3 / 2), -1.0F, var1, var3, 2, 0.0F);
+ this.sideModels[0].setRotationPoint(0.0F, (float)(0 + var4), 0.0F);
+ this.sideModels[5].addBox((float)(-var1 / 2 + 1), (float)(-var3 / 2 + 1), -1.0F, var1 - 2, var3 - 2, 1, 0.0F);
+ this.sideModels[5].setRotationPoint(0.0F, (float)(0 + var4), 0.0F);
+ this.sideModels[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
+ this.sideModels[1].setRotationPoint((float)(-var1 / 2 + 1), (float)(0 + var4), 0.0F);
+ this.sideModels[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
+ this.sideModels[2].setRotationPoint((float)(var1 / 2 - 1), (float)(0 + var4), 0.0F);
+ this.sideModels[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F);
+ this.sideModels[3].setRotationPoint(0.0F, (float)(0 + 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)(0 + 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[3].rotateAngleY = (float)Math.PI;
+ this.sideModels[5].rotateAngleX = (float)Math.PI * -0.5F;
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.sideModels[5].rotationPointY = 4.0F - var3;
+
+ for(int var7 = 0; var7 < 6; ++var7) {
+ this.sideModels[var7].render(var6);
+ }
+
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ }
+}
diff --git a/src/net/minecraft/src/ModelPig.java b/src/net/minecraft/src/ModelPig.java
new file mode 100644
index 0000000..c300bd4
--- /dev/null
+++ b/src/net/minecraft/src/ModelPig.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class ModelPig extends ModelQuadruped {
+ public ModelPig() {
+ super(6, 0.0F);
+ }
+
+ public ModelPig(float var1) {
+ super(6, var1);
+ }
+}
diff --git a/src/net/minecraft/src/ModelQuadruped.java b/src/net/minecraft/src/ModelQuadruped.java
new file mode 100644
index 0000000..d37c549
--- /dev/null
+++ b/src/net/minecraft/src/ModelQuadruped.java
@@ -0,0 +1,49 @@
+package net.minecraft.src;
+
+public class ModelQuadruped extends ModelBase {
+ public ModelRenderer head = new ModelRenderer(0, 0);
+ public ModelRenderer body;
+ public ModelRenderer leg1;
+ public ModelRenderer leg2;
+ public ModelRenderer leg3;
+ public ModelRenderer leg4;
+
+ 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);
+ this.body = new ModelRenderer(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.leg1 = new ModelRenderer(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.leg2 = new ModelRenderer(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.leg3 = new ModelRenderer(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.leg4 = new ModelRenderer(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);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.head.render(var6);
+ this.body.render(var6);
+ this.leg1.render(var6);
+ this.leg2.render(var6);
+ this.leg3.render(var6);
+ this.leg4.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ 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;
+ }
+}
diff --git a/src/net/minecraft/src/ModelRenderer.java b/src/net/minecraft/src/ModelRenderer.java
new file mode 100644
index 0000000..20b1eb0
--- /dev/null
+++ b/src/net/minecraft/src/ModelRenderer.java
@@ -0,0 +1,131 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class ModelRenderer {
+ private PositionTextureVertex[] corners;
+ private TexturedQuad[] faces;
+ private int textureOffsetX;
+ private int textureOffsetY;
+ public float rotationPointX;
+ public float rotationPointY;
+ public float rotationPointZ;
+ public float rotateAngleX;
+ public float rotateAngleY;
+ public float rotateAngleZ;
+ private boolean compiled = false;
+ private int displayList = 0;
+ public boolean mirror = false;
+ public boolean showModel = true;
+ public boolean isHidden = false;
+
+ public ModelRenderer(int var1, int var2) {
+ this.textureOffsetX = var1;
+ this.textureOffsetY = var2;
+ }
+
+ public void addBox(float var1, float var2, float var3, int var4, int var5, int var6, float var7) {
+ this.corners = new PositionTextureVertex[8];
+ this.faces = new TexturedQuad[6];
+ float var8 = var1 + (float)var4;
+ float var9 = var2 + (float)var5;
+ float var10 = var3 + (float)var6;
+ var1 -= var7;
+ var2 -= var7;
+ var3 -= var7;
+ var8 += var7;
+ var9 += var7;
+ var10 += var7;
+ if(this.mirror) {
+ float var11 = var8;
+ var8 = var1;
+ var1 = var11;
+ }
+
+ PositionTextureVertex var20 = new PositionTextureVertex(var1, var2, var3, 0.0F, 0.0F);
+ PositionTextureVertex var12 = new PositionTextureVertex(var8, var2, var3, 0.0F, 8.0F);
+ PositionTextureVertex var13 = new PositionTextureVertex(var8, var9, var3, 8.0F, 8.0F);
+ PositionTextureVertex var14 = new PositionTextureVertex(var1, var9, var3, 8.0F, 0.0F);
+ PositionTextureVertex var15 = new PositionTextureVertex(var1, var2, var10, 0.0F, 0.0F);
+ PositionTextureVertex var16 = new PositionTextureVertex(var8, var2, var10, 0.0F, 8.0F);
+ PositionTextureVertex var17 = new PositionTextureVertex(var8, var9, var10, 8.0F, 8.0F);
+ PositionTextureVertex var18 = new PositionTextureVertex(var1, var9, var10, 8.0F, 0.0F);
+ this.corners[0] = var20;
+ this.corners[1] = var12;
+ this.corners[2] = var13;
+ this.corners[3] = var14;
+ this.corners[4] = var15;
+ this.corners[5] = var16;
+ this.corners[6] = var17;
+ this.corners[7] = var18;
+ this.faces[0] = new TexturedQuad(new PositionTextureVertex[]{var16, var12, var13, var17}, this.textureOffsetX + var6 + var4, this.textureOffsetY + var6, this.textureOffsetX + var6 + var4 + var6, this.textureOffsetY + var6 + var5);
+ this.faces[1] = new TexturedQuad(new PositionTextureVertex[]{var20, var15, var18, var14}, this.textureOffsetX + 0, this.textureOffsetY + var6, this.textureOffsetX + var6, this.textureOffsetY + var6 + var5);
+ this.faces[2] = new TexturedQuad(new PositionTextureVertex[]{var16, var15, var20, var12}, this.textureOffsetX + var6, this.textureOffsetY + 0, this.textureOffsetX + var6 + var4, this.textureOffsetY + var6);
+ this.faces[3] = new TexturedQuad(new PositionTextureVertex[]{var13, var14, var18, var17}, this.textureOffsetX + var6 + var4, this.textureOffsetY + 0, this.textureOffsetX + var6 + var4 + var4, this.textureOffsetY + var6);
+ this.faces[4] = new TexturedQuad(new PositionTextureVertex[]{var12, var20, var14, var13}, this.textureOffsetX + var6, this.textureOffsetY + var6, this.textureOffsetX + var6 + var4, this.textureOffsetY + var6 + var5);
+ this.faces[5] = new TexturedQuad(new PositionTextureVertex[]{var15, var16, var17, var18}, this.textureOffsetX + var6 + var4 + var6, this.textureOffsetY + var6, this.textureOffsetX + var6 + var4 + var6 + var4, this.textureOffsetY + var6 + var5);
+ if(this.mirror) {
+ for(int var19 = 0; var19 < this.faces.length; ++var19) {
+ this.faces[var19].flipFace();
+ }
+ }
+
+ }
+
+ 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);
+ }
+
+ 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);
+ } else {
+ GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1);
+ GL11.glCallList(this.displayList);
+ GL11.glTranslatef(-this.rotationPointX * var1, -this.rotationPointY * var1, -this.rotationPointZ * var1);
+ }
+ } 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.glCallList(this.displayList);
+ GL11.glPopMatrix();
+ }
+
+ }
+ }
+ }
+
+ private void compileDisplayList(float var1) {
+ this.displayList = GLAllocation.generateDisplayLists(1);
+ GL11.glNewList(this.displayList, GL11.GL_COMPILE);
+ Tessellator var2 = Tessellator.instance;
+
+ for(int var3 = 0; var3 < this.faces.length; ++var3) {
+ this.faces[var3].draw(var2, var1);
+ }
+
+ GL11.glEndList();
+ this.compiled = true;
+ }
+}
diff --git a/src/net/minecraft/src/ModelSheep.java b/src/net/minecraft/src/ModelSheep.java
new file mode 100644
index 0000000..df1c1c4
--- /dev/null
+++ b/src/net/minecraft/src/ModelSheep.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+public class ModelSheep extends ModelQuadruped {
+ public ModelSheep() {
+ super(12, 0.0F);
+ this.head = new ModelRenderer(0, 0);
+ this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F);
+ this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
+ this.body = new ModelRenderer(28, 8);
+ this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F);
+ this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
+ }
+}
diff --git a/src/net/minecraft/src/ModelSheepFur.java b/src/net/minecraft/src/ModelSheepFur.java
new file mode 100644
index 0000000..55bc761
--- /dev/null
+++ b/src/net/minecraft/src/ModelSheepFur.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ModelSheepFur extends ModelQuadruped {
+ public ModelSheepFur() {
+ super(12, 0.0F);
+ this.head = new ModelRenderer(0, 0);
+ this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F);
+ this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
+ this.body = new ModelRenderer(28, 8);
+ this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F);
+ this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
+ float var1 = 0.5F;
+ this.leg1 = new ModelRenderer(0, 16);
+ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F);
+ this.leg2 = new ModelRenderer(0, 16);
+ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F);
+ this.leg3 = new ModelRenderer(0, 16);
+ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F);
+ this.leg4 = new ModelRenderer(0, 16);
+ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1);
+ this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F);
+ }
+}
diff --git a/src/net/minecraft/src/ModelSkeleton.java b/src/net/minecraft/src/ModelSkeleton.java
new file mode 100644
index 0000000..e9447b8
--- /dev/null
+++ b/src/net/minecraft/src/ModelSkeleton.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+public class ModelSkeleton extends ModelZombie {
+ public ModelSkeleton() {
+ float var1 = 0.0F;
+ this.bipedRightArm = new ModelRenderer(40, 16);
+ this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
+ this.bipedLeftArm = new ModelRenderer(40, 16);
+ this.bipedLeftArm.mirror = true;
+ this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
+ this.bipedRightLeg = new ModelRenderer(0, 16);
+ this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
+ this.bipedLeftLeg = new ModelRenderer(0, 16);
+ this.bipedLeftLeg.mirror = true;
+ this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1);
+ this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
+ }
+}
diff --git a/src/net/minecraft/src/ModelSpider.java b/src/net/minecraft/src/ModelSpider.java
new file mode 100644
index 0000000..ee7e099
--- /dev/null
+++ b/src/net/minecraft/src/ModelSpider.java
@@ -0,0 +1,116 @@
+package net.minecraft.src;
+
+public class ModelSpider extends ModelBase {
+ public ModelRenderer spiderHead;
+ public ModelRenderer spiderNeck;
+ public ModelRenderer spiderBody;
+ public ModelRenderer spiderLeg1;
+ public ModelRenderer spiderLeg2;
+ public ModelRenderer spiderLeg3;
+ public ModelRenderer spiderLeg4;
+ public ModelRenderer spiderLeg5;
+ public ModelRenderer spiderLeg6;
+ public ModelRenderer spiderLeg7;
+ public ModelRenderer spiderLeg8;
+
+ public ModelSpider() {
+ float var1 = 0.0F;
+ byte var2 = 15;
+ this.spiderHead = new ModelRenderer(32, 4);
+ this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, var1);
+ this.spiderHead.setRotationPoint(0.0F, (float)(0 + var2), -3.0F);
+ this.spiderNeck = new ModelRenderer(0, 0);
+ this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1);
+ this.spiderNeck.setRotationPoint(0.0F, (float)var2, 0.0F);
+ this.spiderBody = new ModelRenderer(0, 12);
+ this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1);
+ this.spiderBody.setRotationPoint(0.0F, (float)(0 + var2), 9.0F);
+ this.spiderLeg1 = new ModelRenderer(18, 0);
+ this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg1.setRotationPoint(-4.0F, (float)(0 + var2), 2.0F);
+ this.spiderLeg2 = new ModelRenderer(18, 0);
+ this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg2.setRotationPoint(4.0F, (float)(0 + var2), 2.0F);
+ this.spiderLeg3 = new ModelRenderer(18, 0);
+ this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg3.setRotationPoint(-4.0F, (float)(0 + var2), 1.0F);
+ this.spiderLeg4 = new ModelRenderer(18, 0);
+ this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg4.setRotationPoint(4.0F, (float)(0 + var2), 1.0F);
+ this.spiderLeg5 = new ModelRenderer(18, 0);
+ this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg5.setRotationPoint(-4.0F, (float)(0 + var2), 0.0F);
+ this.spiderLeg6 = new ModelRenderer(18, 0);
+ this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg6.setRotationPoint(4.0F, (float)(0 + var2), 0.0F);
+ this.spiderLeg7 = new ModelRenderer(18, 0);
+ this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg7.setRotationPoint(-4.0F, (float)(0 + var2), -1.0F);
+ this.spiderLeg8 = new ModelRenderer(18, 0);
+ this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
+ this.spiderLeg8.setRotationPoint(4.0F, (float)(0 + var2), -1.0F);
+ }
+
+ public void render(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ this.spiderHead.render(var6);
+ this.spiderNeck.render(var6);
+ this.spiderBody.render(var6);
+ this.spiderLeg1.render(var6);
+ this.spiderLeg2.render(var6);
+ this.spiderLeg3.render(var6);
+ this.spiderLeg4.render(var6);
+ this.spiderLeg5.render(var6);
+ this.spiderLeg6.render(var6);
+ this.spiderLeg7.render(var6);
+ this.spiderLeg8.render(var6);
+ }
+
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ this.spiderHead.rotateAngleY = var4 / (180.0F / (float)Math.PI);
+ this.spiderHead.rotateAngleX = var5 / (180.0F / (float)Math.PI);
+ float var7 = (float)Math.PI * 0.25F;
+ this.spiderLeg1.rotateAngleZ = -var7;
+ this.spiderLeg2.rotateAngleZ = var7;
+ this.spiderLeg3.rotateAngleZ = -var7 * 0.74F;
+ this.spiderLeg4.rotateAngleZ = var7 * 0.74F;
+ this.spiderLeg5.rotateAngleZ = -var7 * 0.74F;
+ this.spiderLeg6.rotateAngleZ = var7 * 0.74F;
+ this.spiderLeg7.rotateAngleZ = -var7;
+ this.spiderLeg8.rotateAngleZ = var7;
+ float var8 = -0.0F;
+ float var9 = (float)Math.PI * 0.125F;
+ this.spiderLeg1.rotateAngleY = var9 * 2.0F + var8;
+ this.spiderLeg2.rotateAngleY = -var9 * 2.0F - var8;
+ this.spiderLeg3.rotateAngleY = var9 * 1.0F + var8;
+ this.spiderLeg4.rotateAngleY = -var9 * 1.0F - var8;
+ this.spiderLeg5.rotateAngleY = -var9 * 1.0F + var8;
+ this.spiderLeg6.rotateAngleY = var9 * 1.0F - var8;
+ this.spiderLeg7.rotateAngleY = -var9 * 2.0F + var8;
+ this.spiderLeg8.rotateAngleY = var9 * 2.0F - var8;
+ float var10 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * var2;
+ float var11 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * var2;
+ float var12 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 0.5F) * 0.4F) * var2;
+ float var13 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2;
+ float var14 = Math.abs(MathHelper.sin(var1 * 0.6662F + 0.0F) * 0.4F) * var2;
+ float var15 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI) * 0.4F) * var2;
+ float var16 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 0.5F) * 0.4F) * var2;
+ float var17 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2;
+ this.spiderLeg1.rotateAngleY += var10;
+ this.spiderLeg2.rotateAngleY += -var10;
+ this.spiderLeg3.rotateAngleY += var11;
+ this.spiderLeg4.rotateAngleY += -var11;
+ this.spiderLeg5.rotateAngleY += var12;
+ this.spiderLeg6.rotateAngleY += -var12;
+ this.spiderLeg7.rotateAngleY += var13;
+ this.spiderLeg8.rotateAngleY += -var13;
+ this.spiderLeg1.rotateAngleZ += var14;
+ this.spiderLeg2.rotateAngleZ += -var14;
+ this.spiderLeg3.rotateAngleZ += var15;
+ this.spiderLeg4.rotateAngleZ += -var15;
+ this.spiderLeg5.rotateAngleZ += var16;
+ this.spiderLeg6.rotateAngleZ += -var16;
+ this.spiderLeg7.rotateAngleZ += var17;
+ this.spiderLeg8.rotateAngleZ += -var17;
+ }
+}
diff --git a/src/net/minecraft/src/ModelZombie.java b/src/net/minecraft/src/ModelZombie.java
new file mode 100644
index 0000000..b0e93e1
--- /dev/null
+++ b/src/net/minecraft/src/ModelZombie.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+public class ModelZombie extends ModelBiped {
+ public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6) {
+ super.setRotationAngles(var1, var2, var3, var4, var5, var6);
+ float var7 = MathHelper.sin(this.swingProgress * (float)Math.PI);
+ float var8 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
+ this.bipedRightArm.rotateAngleZ = 0.0F;
+ this.bipedLeftArm.rotateAngleZ = 0.0F;
+ this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F);
+ this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F;
+ this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F;
+ this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F;
+ this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F;
+ this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 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;
+ }
+}
diff --git a/src/net/minecraft/src/MouseHelper.java b/src/net/minecraft/src/MouseHelper.java
new file mode 100644
index 0000000..d1671d3
--- /dev/null
+++ b/src/net/minecraft/src/MouseHelper.java
@@ -0,0 +1,81 @@
+package net.minecraft.src;
+
+import java.awt.AWTException;
+import java.awt.Component;
+import java.awt.MouseInfo;
+import java.awt.Point;
+import java.awt.Robot;
+import java.nio.IntBuffer;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.input.Cursor;
+import org.lwjgl.input.Mouse;
+
+public class MouseHelper {
+ private Component windowComponent;
+ private Robot robot;
+ private int componentWidth;
+ private int componentHeight;
+ private Cursor cursor;
+ public int deltaX;
+ public int deltaY;
+ private int mouseInt = 10;
+
+ public MouseHelper(Component var1) {
+ this.windowComponent = var1;
+
+ try {
+ this.robot = new Robot();
+ } catch (AWTException var6) {
+ var6.printStackTrace();
+ }
+
+ IntBuffer var2 = GLAllocation.createIntBuffer(1);
+ var2.put(0);
+ var2.flip();
+ IntBuffer var3 = GLAllocation.createIntBuffer(1024);
+
+ try {
+ this.cursor = new Cursor(32, 32, 16, 16, 1, var3, var2);
+ } catch (LWJGLException var5) {
+ var5.printStackTrace();
+ }
+
+ }
+
+ public void grabMouseCursor() {
+ try {
+ Mouse.setNativeCursor(this.cursor);
+ } catch (LWJGLException var2) {
+ var2.printStackTrace();
+ }
+
+ this.mouseXYChange();
+ this.deltaX = 0;
+ this.deltaY = 0;
+ }
+
+ public void ungrabMouseCursor() {
+ try {
+ Mouse.setNativeCursor((Cursor)null);
+ } catch (LWJGLException var2) {
+ var2.printStackTrace();
+ }
+
+ }
+
+ public void mouseXYChange() {
+ Point var1 = MouseInfo.getPointerInfo().getLocation();
+ Point var2 = this.windowComponent.getLocationOnScreen();
+ this.robot.mouseMove(this.componentWidth, this.componentHeight);
+ this.componentWidth = var2.x + this.windowComponent.getWidth() / 2;
+ this.componentHeight = var2.y + this.windowComponent.getHeight() / 2;
+ if(this.mouseInt == 0) {
+ this.deltaX = var1.x - this.componentWidth;
+ this.deltaY = var1.y - this.componentHeight;
+ } else {
+ this.deltaX = this.deltaY = 0;
+ --this.mouseInt;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/MovementInput.java b/src/net/minecraft/src/MovementInput.java
new file mode 100644
index 0000000..0b511d4
--- /dev/null
+++ b/src/net/minecraft/src/MovementInput.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class MovementInput {
+ public float moveStrafe = 0.0F;
+ public float moveForward = 0.0F;
+ public boolean unused = false;
+ public boolean jump = false;
+
+ public void updatePlayerMoveState(EntityPlayer var1) {
+ }
+
+ public void resetKeyState() {
+ }
+
+ public void checkKeyForMovementInput(int var1, boolean var2) {
+ }
+}
diff --git a/src/net/minecraft/src/MovementInputFromOptions.java b/src/net/minecraft/src/MovementInputFromOptions.java
new file mode 100644
index 0000000..e92f2ec
--- /dev/null
+++ b/src/net/minecraft/src/MovementInputFromOptions.java
@@ -0,0 +1,67 @@
+package net.minecraft.src;
+
+public class MovementInputFromOptions extends MovementInput {
+ private boolean[] movementKeyStates = new boolean[10];
+ private GameSettings gameSettings;
+
+ public MovementInputFromOptions(GameSettings var1) {
+ this.gameSettings = var1;
+ }
+
+ public void checkKeyForMovementInput(int var1, boolean var2) {
+ byte var3 = -1;
+ if(var1 == this.gameSettings.keyBindForward.keyCode) {
+ var3 = 0;
+ }
+
+ if(var1 == this.gameSettings.keyBindBack.keyCode) {
+ var3 = 1;
+ }
+
+ if(var1 == this.gameSettings.keyBindLeft.keyCode) {
+ var3 = 2;
+ }
+
+ if(var1 == this.gameSettings.keyBindRight.keyCode) {
+ var3 = 3;
+ }
+
+ if(var1 == this.gameSettings.keyBindJump.keyCode) {
+ var3 = 4;
+ }
+
+ if(var3 >= 0) {
+ this.movementKeyStates[var3] = var2;
+ }
+
+ }
+
+ public void resetKeyState() {
+ for(int var1 = 0; var1 < 10; ++var1) {
+ this.movementKeyStates[var1] = false;
+ }
+
+ }
+
+ public void updatePlayerMoveState(EntityPlayer var1) {
+ this.moveStrafe = 0.0F;
+ this.moveForward = 0.0F;
+ if(this.movementKeyStates[0]) {
+ ++this.moveForward;
+ }
+
+ if(this.movementKeyStates[1]) {
+ --this.moveForward;
+ }
+
+ if(this.movementKeyStates[2]) {
+ ++this.moveStrafe;
+ }
+
+ if(this.movementKeyStates[3]) {
+ --this.moveStrafe;
+ }
+
+ this.jump = this.movementKeyStates[4];
+ }
+}
diff --git a/src/net/minecraft/src/MovingObjectPosition.java b/src/net/minecraft/src/MovingObjectPosition.java
new file mode 100644
index 0000000..764010a
--- /dev/null
+++ b/src/net/minecraft/src/MovingObjectPosition.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class MovingObjectPosition {
+ public int typeOfHit;
+ public int blockX;
+ public int blockY;
+ public int blockZ;
+ public int sideHit;
+ public Vec3D hitVec;
+ public Entity entityHit;
+
+ public MovingObjectPosition(int var1, int var2, int var3, int var4, Vec3D var5) {
+ this.typeOfHit = 0;
+ this.blockX = var1;
+ this.blockY = var2;
+ this.blockZ = var3;
+ this.sideHit = var4;
+ this.hitVec = Vec3D.createVector(var5.xCoord, var5.yCoord, var5.zCoord);
+ }
+
+ public MovingObjectPosition(Entity var1) {
+ this.typeOfHit = 1;
+ this.entityHit = var1;
+ this.hitVec = Vec3D.createVector(var1.posX, var1.posY, var1.posZ);
+ }
+}
diff --git a/src/net/minecraft/src/NBTBase.java b/src/net/minecraft/src/NBTBase.java
new file mode 100644
index 0000000..ba02104
--- /dev/null
+++ b/src/net/minecraft/src/NBTBase.java
@@ -0,0 +1,102 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public abstract class NBTBase {
+ private String key = null;
+
+ abstract void writeTagContents(DataOutput var1) throws IOException;
+
+ abstract void readTagContents(DataInput var1) throws IOException;
+
+ public abstract byte getType();
+
+ public String getKey() {
+ return this.key == null ? "" : this.key;
+ }
+
+ public NBTBase setKey(String var1) {
+ this.key = var1;
+ return this;
+ }
+
+ public static NBTBase readNamedTag(DataInput var0) throws IOException {
+ byte var1 = var0.readByte();
+ if(var1 == 0) {
+ return new NBTTagEnd();
+ } else {
+ NBTBase var2 = createTagOfType(var1);
+ var2.key = var0.readUTF();
+ var2.readTagContents(var0);
+ return var2;
+ }
+ }
+
+ public static void writeNamedTag(NBTBase var0, DataOutput var1) throws IOException {
+ var1.writeByte(var0.getType());
+ if(var0.getType() != 0) {
+ var1.writeUTF(var0.getKey());
+ var0.writeTagContents(var1);
+ }
+ }
+
+ public static NBTBase createTagOfType(byte var0) {
+ switch(var0) {
+ case 0:
+ return new NBTTagEnd();
+ case 1:
+ return new NBTTagByte();
+ case 2:
+ return new NBTTagShort();
+ case 3:
+ return new NBTTagInt();
+ case 4:
+ return new NBTTagLong();
+ case 5:
+ return new NBTTagFloat();
+ case 6:
+ return new NBTTagDouble();
+ case 7:
+ return new NBTTagByteArray();
+ case 8:
+ return new NBTTagString();
+ case 9:
+ return new NBTTagList();
+ case 10:
+ return new NBTTagCompound();
+ 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";
+ default:
+ return "UNKNOWN";
+ }
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagByte.java b/src/net/minecraft/src/NBTTagByte.java
new file mode 100644
index 0000000..3260724
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagByte.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagByte extends NBTBase {
+ public byte byteValue;
+
+ public NBTTagByte() {
+ }
+
+ public NBTTagByte(byte var1) {
+ this.byteValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeByte(this.byteValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.byteValue = var1.readByte();
+ }
+
+ public byte getType() {
+ return (byte)1;
+ }
+
+ public String toString() {
+ return "" + this.byteValue;
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagByteArray.java b/src/net/minecraft/src/NBTTagByteArray.java
new file mode 100644
index 0000000..0f58fe1
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagByteArray.java
@@ -0,0 +1,35 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagByteArray extends NBTBase {
+ public byte[] byteArray;
+
+ public NBTTagByteArray() {
+ }
+
+ public NBTTagByteArray(byte[] var1) {
+ this.byteArray = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeInt(this.byteArray.length);
+ var1.write(this.byteArray);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ int var2 = var1.readInt();
+ this.byteArray = new byte[var2];
+ var1.readFully(this.byteArray);
+ }
+
+ public byte getType() {
+ return (byte)7;
+ }
+
+ public String toString() {
+ return "[" + this.byteArray.length + " bytes]";
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagCompound.java b/src/net/minecraft/src/NBTTagCompound.java
new file mode 100644
index 0000000..a7fa2f8
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagCompound.java
@@ -0,0 +1,128 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+public class NBTTagCompound extends NBTBase {
+ private Map tagMap = new HashMap();
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ Iterator var2 = this.tagMap.values().iterator();
+
+ while(var2.hasNext()) {
+ NBTBase var3 = (NBTBase)var2.next();
+ NBTBase.writeNamedTag(var3, var1);
+ }
+
+ var1.writeByte(0);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.tagMap.clear();
+
+ while(true) {
+ NBTBase var2 = NBTBase.readNamedTag(var1);
+ if(var2.getType() == 0) {
+ return;
+ }
+
+ this.tagMap.put(var2.getKey(), var2);
+ }
+ }
+
+ public byte getType() {
+ return (byte)10;
+ }
+
+ public void setTag(String var1, NBTBase var2) {
+ this.tagMap.put(var1, var2.setKey(var1));
+ }
+
+ public void setByte(String var1, byte var2) {
+ this.tagMap.put(var1, (new NBTTagByte(var2)).setKey(var1));
+ }
+
+ public void setShort(String var1, short var2) {
+ this.tagMap.put(var1, (new NBTTagShort(var2)).setKey(var1));
+ }
+
+ public void setInteger(String var1, int var2) {
+ this.tagMap.put(var1, (new NBTTagInt(var2)).setKey(var1));
+ }
+
+ public void setLong(String var1, long var2) {
+ this.tagMap.put(var1, (new NBTTagLong(var2)).setKey(var1));
+ }
+
+ public void setFloat(String var1, float var2) {
+ this.tagMap.put(var1, (new NBTTagFloat(var2)).setKey(var1));
+ }
+
+ public void setString(String var1, String var2) {
+ this.tagMap.put(var1, (new NBTTagString(var2)).setKey(var1));
+ }
+
+ public void setByteArray(String var1, byte[] var2) {
+ this.tagMap.put(var1, (new NBTTagByteArray(var2)).setKey(var1));
+ }
+
+ public void setCompoundTag(String var1, NBTTagCompound var2) {
+ this.tagMap.put(var1, var2.setKey(var1));
+ }
+
+ public void setBoolean(String var1, boolean var2) {
+ this.setByte(var1, (byte)(var2 ? 1 : 0));
+ }
+
+ public boolean hasKey(String var1) {
+ return this.tagMap.containsKey(var1);
+ }
+
+ public byte getByte(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0 : ((NBTTagByte)this.tagMap.get(var1)).byteValue;
+ }
+
+ public short getShort(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0 : ((NBTTagShort)this.tagMap.get(var1)).shortValue;
+ }
+
+ public int getInteger(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0 : ((NBTTagInt)this.tagMap.get(var1)).intValue;
+ }
+
+ public long getLong(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0L : ((NBTTagLong)this.tagMap.get(var1)).longValue;
+ }
+
+ public float getFloat(String var1) {
+ return !this.tagMap.containsKey(var1) ? 0.0F : ((NBTTagFloat)this.tagMap.get(var1)).floatValue;
+ }
+
+ public String getString(String var1) {
+ return !this.tagMap.containsKey(var1) ? "" : ((NBTTagString)this.tagMap.get(var1)).stringValue;
+ }
+
+ public byte[] getByteArray(String var1) {
+ return !this.tagMap.containsKey(var1) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(var1)).byteArray;
+ }
+
+ public NBTTagCompound getCompoundTag(String var1) {
+ return !this.tagMap.containsKey(var1) ? new NBTTagCompound() : (NBTTagCompound)this.tagMap.get(var1);
+ }
+
+ public NBTTagList getTagList(String var1) {
+ return !this.tagMap.containsKey(var1) ? new NBTTagList() : (NBTTagList)this.tagMap.get(var1);
+ }
+
+ public boolean getBoolean(String var1) {
+ return this.getByte(var1) != 0;
+ }
+
+ public String toString() {
+ return "" + this.tagMap.size() + " entries";
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagDouble.java b/src/net/minecraft/src/NBTTagDouble.java
new file mode 100644
index 0000000..cd00968
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagDouble.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagDouble extends NBTBase {
+ public double doubleValue;
+
+ public NBTTagDouble() {
+ }
+
+ public NBTTagDouble(double var1) {
+ this.doubleValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeDouble(this.doubleValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.doubleValue = var1.readDouble();
+ }
+
+ public byte getType() {
+ return (byte)6;
+ }
+
+ public String toString() {
+ return "" + this.doubleValue;
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagEnd.java b/src/net/minecraft/src/NBTTagEnd.java
new file mode 100644
index 0000000..a04e7d6
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagEnd.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagEnd extends NBTBase {
+ void readTagContents(DataInput var1) throws IOException {
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ }
+
+ public byte getType() {
+ return (byte)0;
+ }
+
+ public String toString() {
+ return "END";
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagFloat.java b/src/net/minecraft/src/NBTTagFloat.java
new file mode 100644
index 0000000..cf59c93
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagFloat.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagFloat extends NBTBase {
+ public float floatValue;
+
+ public NBTTagFloat() {
+ }
+
+ public NBTTagFloat(float var1) {
+ this.floatValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeFloat(this.floatValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.floatValue = var1.readFloat();
+ }
+
+ public byte getType() {
+ return (byte)5;
+ }
+
+ public String toString() {
+ return "" + this.floatValue;
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagInt.java b/src/net/minecraft/src/NBTTagInt.java
new file mode 100644
index 0000000..6dfdfe6
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagInt.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagInt extends NBTBase {
+ public int intValue;
+
+ public NBTTagInt() {
+ }
+
+ public NBTTagInt(int var1) {
+ this.intValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeInt(this.intValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.intValue = var1.readInt();
+ }
+
+ public byte getType() {
+ return (byte)3;
+ }
+
+ public String toString() {
+ return "" + this.intValue;
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagList.java b/src/net/minecraft/src/NBTTagList.java
new file mode 100644
index 0000000..3ee8caf
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagList.java
@@ -0,0 +1,62 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class NBTTagList extends NBTBase {
+ private List tagList = new ArrayList();
+ private byte tagType;
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ if(this.tagList.size() > 0) {
+ this.tagType = ((NBTBase)this.tagList.get(0)).getType();
+ } else {
+ this.tagType = 1;
+ }
+
+ var1.writeByte(this.tagType);
+ var1.writeInt(this.tagList.size());
+
+ for(int var2 = 0; var2 < this.tagList.size(); ++var2) {
+ ((NBTBase)this.tagList.get(var2)).writeTagContents(var1);
+ }
+
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.tagType = var1.readByte();
+ int var2 = var1.readInt();
+ this.tagList = new ArrayList();
+
+ for(int var3 = 0; var3 < var2; ++var3) {
+ NBTBase var4 = NBTBase.createTagOfType(this.tagType);
+ var4.readTagContents(var1);
+ this.tagList.add(var4);
+ }
+
+ }
+
+ public byte getType() {
+ return (byte)9;
+ }
+
+ public String toString() {
+ return "" + this.tagList.size() + " entries of type " + NBTBase.getTagName(this.tagType);
+ }
+
+ public void setTag(NBTBase var1) {
+ this.tagType = var1.getType();
+ this.tagList.add(var1);
+ }
+
+ public NBTBase tagAt(int var1) {
+ return (NBTBase)this.tagList.get(var1);
+ }
+
+ public int tagCount() {
+ return this.tagList.size();
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagLong.java b/src/net/minecraft/src/NBTTagLong.java
new file mode 100644
index 0000000..646f80d
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagLong.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagLong extends NBTBase {
+ public long longValue;
+
+ public NBTTagLong() {
+ }
+
+ public NBTTagLong(long var1) {
+ this.longValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeLong(this.longValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.longValue = var1.readLong();
+ }
+
+ public byte getType() {
+ return (byte)4;
+ }
+
+ public String toString() {
+ return "" + this.longValue;
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagShort.java b/src/net/minecraft/src/NBTTagShort.java
new file mode 100644
index 0000000..3345229
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagShort.java
@@ -0,0 +1,32 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagShort extends NBTBase {
+ public short shortValue;
+
+ public NBTTagShort() {
+ }
+
+ public NBTTagShort(short var1) {
+ this.shortValue = var1;
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeShort(this.shortValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.shortValue = var1.readShort();
+ }
+
+ public byte getType() {
+ return (byte)2;
+ }
+
+ public String toString() {
+ return "" + this.shortValue;
+ }
+}
diff --git a/src/net/minecraft/src/NBTTagString.java b/src/net/minecraft/src/NBTTagString.java
new file mode 100644
index 0000000..93fca6e
--- /dev/null
+++ b/src/net/minecraft/src/NBTTagString.java
@@ -0,0 +1,35 @@
+package net.minecraft.src;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public class NBTTagString extends NBTBase {
+ public String stringValue;
+
+ public NBTTagString() {
+ }
+
+ public NBTTagString(String var1) {
+ this.stringValue = var1;
+ if(var1 == null) {
+ throw new IllegalArgumentException("Empty string not allowed");
+ }
+ }
+
+ void writeTagContents(DataOutput var1) throws IOException {
+ var1.writeUTF(this.stringValue);
+ }
+
+ void readTagContents(DataInput var1) throws IOException {
+ this.stringValue = var1.readUTF();
+ }
+
+ public byte getType() {
+ return (byte)8;
+ }
+
+ public String toString() {
+ return "" + this.stringValue;
+ }
+}
diff --git a/src/net/minecraft/src/NextTickListEntry.java b/src/net/minecraft/src/NextTickListEntry.java
new file mode 100644
index 0000000..3870d49
--- /dev/null
+++ b/src/net/minecraft/src/NextTickListEntry.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class NextTickListEntry implements Comparable {
+ private static long nextTickEntryID = 0L;
+ public int xCoord;
+ public int yCoord;
+ public int zCoord;
+ public int blockID;
+ public long scheduledTime;
+ 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;
+ }
+
+ public boolean equals(Object var1) {
+ if(!(var1 instanceof NextTickListEntry)) {
+ return false;
+ } else {
+ NextTickListEntry var2 = (NextTickListEntry)var1;
+ return this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord && this.blockID == var2.blockID;
+ }
+ }
+
+ public int hashCode() {
+ return (this.xCoord * 128 * 1024 + this.zCoord * 128 + this.yCoord) * 256 + this.blockID;
+ }
+
+ public NextTickListEntry setScheduledTime(long var1) {
+ this.scheduledTime = var1;
+ return this;
+ }
+
+ public int a(NextTickListEntry var1) {
+ return this.scheduledTime < var1.scheduledTime ? -1 : (this.scheduledTime > var1.scheduledTime ? 1 : (this.tickEntryID < var1.tickEntryID ? -1 : (this.tickEntryID > var1.tickEntryID ? 1 : 0)));
+ }
+
+ public int compareTo(Object var1) {
+ return this.a((NextTickListEntry)var1);
+ }
+}
diff --git a/src/net/minecraft/src/NibbleArray.java b/src/net/minecraft/src/NibbleArray.java
new file mode 100644
index 0000000..56a0293
--- /dev/null
+++ b/src/net/minecraft/src/NibbleArray.java
@@ -0,0 +1,36 @@
+package net.minecraft.src;
+
+public class NibbleArray {
+ public final byte[] data;
+
+ public NibbleArray(int var1) {
+ this.data = new byte[var1 >> 1];
+ }
+
+ public NibbleArray(byte[] var1) {
+ this.data = var1;
+ }
+
+ public int get(int var1, int var2, int var3) {
+ int var4 = var1 << 11 | var3 << 7 | var2;
+ 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 = var1 << 11 | var3 << 7 | var2;
+ int var6 = var5 >> 1;
+ int var7 = var5 & 1;
+ if(var7 == 0) {
+ this.data[var6] = (byte)(this.data[var6] & 240 | var4 & 15);
+ } else {
+ this.data[var6] = (byte)(this.data[var6] & 15 | (var4 & 15) << 4);
+ }
+
+ }
+
+ public boolean isValid() {
+ return this.data != null;
+ }
+}
diff --git a/src/net/minecraft/src/NoiseGenerator.java b/src/net/minecraft/src/NoiseGenerator.java
new file mode 100644
index 0000000..53e6d05
--- /dev/null
+++ b/src/net/minecraft/src/NoiseGenerator.java
@@ -0,0 +1,4 @@
+package net.minecraft.src;
+
+public abstract class NoiseGenerator {
+}
diff --git a/src/net/minecraft/src/NoiseGeneratorOctaves.java b/src/net/minecraft/src/NoiseGeneratorOctaves.java
new file mode 100644
index 0000000..b58f601
--- /dev/null
+++ b/src/net/minecraft/src/NoiseGeneratorOctaves.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class NoiseGeneratorOctaves extends NoiseGenerator {
+ private NoiseGeneratorPerlin[] generatorCollection;
+ private int octaves;
+
+ public NoiseGeneratorOctaves(Random var1, int var2) {
+ this.octaves = var2;
+ this.generatorCollection = new NoiseGeneratorPerlin[var2];
+
+ for(int var3 = 0; var3 < var2; ++var3) {
+ this.generatorCollection[var3] = new NoiseGeneratorPerlin(var1);
+ }
+
+ }
+
+ public double generateNoiseOctaves(double var1, double var3) {
+ double var5 = 0.0D;
+ double var7 = 1.0D;
+
+ for(int var9 = 0; var9 < this.octaves; ++var9) {
+ var5 += this.generatorCollection[var9].generateNoise(var1 * var7, var3 * var7) / var7;
+ var7 /= 2.0D;
+ }
+
+ return var5;
+ }
+
+ public double a(double var1, double var3, double var5) {
+ double var7 = 0.0D;
+ double var9 = 1.0D;
+
+ for(int var11 = 0; var11 < this.octaves; ++var11) {
+ var7 += this.generatorCollection[var11].c(var1 * var9, var3 * var9, var5 * var9) / var9;
+ var9 /= 2.0D;
+ }
+
+ return var7;
+ }
+
+ public double[] a(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];
+ } else {
+ for(int var14 = 0; var14 < var1.length; ++var14) {
+ var1[var14] = 0.0D;
+ }
+ }
+
+ double var17 = 1.0D;
+
+ for(int var16 = 0; var16 < this.octaves; ++var16) {
+ this.generatorCollection[var16].a(var1, var2, var3, var4, var5, var6, var7, var8 * var17, var10 * var17, var12 * var17, var17);
+ var17 /= 2.0D;
+ }
+
+ return var1;
+ }
+}
diff --git a/src/net/minecraft/src/NoiseGeneratorPerlin.java b/src/net/minecraft/src/NoiseGeneratorPerlin.java
new file mode 100644
index 0000000..29fb064
--- /dev/null
+++ b/src/net/minecraft/src/NoiseGeneratorPerlin.java
@@ -0,0 +1,162 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class NoiseGeneratorPerlin extends NoiseGenerator {
+ private int[] permutations;
+ public double xCoord;
+ public double yCoord;
+ public double zCoord;
+
+ public NoiseGeneratorPerlin() {
+ this(new Random());
+ }
+
+ public NoiseGeneratorPerlin(Random var1) {
+ this.permutations = new int[512];
+ this.xCoord = var1.nextDouble() * 256.0D;
+ this.yCoord = var1.nextDouble() * 256.0D;
+ this.zCoord = var1.nextDouble() * 256.0D;
+
+ int var2;
+ for(var2 = 0; var2 < 256; this.permutations[var2] = var2++) {
+ }
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ int var3 = var1.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 double generateNoise(double var1, double var3, double var5) {
+ double var7 = var1 + this.xCoord;
+ double var9 = var3 + this.yCoord;
+ double var11 = var5 + this.zCoord;
+ int var13 = (int)var7;
+ int var14 = (int)var9;
+ int var15 = (int)var11;
+ if(var7 < (double)var13) {
+ --var13;
+ }
+
+ if(var9 < (double)var14) {
+ --var14;
+ }
+
+ if(var11 < (double)var15) {
+ --var15;
+ }
+
+ int var16 = var13 & 255;
+ int var17 = var14 & 255;
+ int var18 = var15 & 255;
+ var7 -= (double)var13;
+ var9 -= (double)var14;
+ var11 -= (double)var15;
+ double var19 = var7 * var7 * var7 * (var7 * (var7 * 6.0D - 15.0D) + 10.0D);
+ double var21 = var9 * var9 * var9 * (var9 * (var9 * 6.0D - 15.0D) + 10.0D);
+ double var23 = var11 * var11 * var11 * (var11 * (var11 * 6.0D - 15.0D) + 10.0D);
+ int var25 = this.permutations[var16] + var17;
+ int var26 = this.permutations[var25] + var18;
+ int var27 = this.permutations[var25 + 1] + var18;
+ int var28 = this.permutations[var16 + 1] + var17;
+ int var29 = this.permutations[var28] + var18;
+ int var30 = this.permutations[var28 + 1] + var18;
+ return this.lerp(var23, this.lerp(var21, this.lerp(var19, this.grad(this.permutations[var26], var7, var9, var11), this.grad(this.permutations[var29], var7 - 1.0D, var9, var11)), this.lerp(var19, this.grad(this.permutations[var27], var7, var9 - 1.0D, var11), this.grad(this.permutations[var30], var7 - 1.0D, var9 - 1.0D, var11))), this.lerp(var21, this.lerp(var19, this.grad(this.permutations[var26 + 1], var7, var9, var11 - 1.0D), this.grad(this.permutations[var29 + 1], var7 - 1.0D, var9, var11 - 1.0D)), this.lerp(var19, this.grad(this.permutations[var27 + 1], var7, var9 - 1.0D, var11 - 1.0D), this.grad(this.permutations[var30 + 1], var7 - 1.0D, var9 - 1.0D, var11 - 1.0D))));
+ }
+
+ public double lerp(double var1, double var3, double var5) {
+ return var3 + var1 * (var5 - var3);
+ }
+
+ public 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);
+ return ((var8 & 1) == 0 ? var9 : -var9) + ((var8 & 2) == 0 ? var11 : -var11);
+ }
+
+ public double generateNoise(double var1, double var3) {
+ return this.generateNoise(var1, var3, 0.0D);
+ }
+
+ public double c(double var1, double var3, double var5) {
+ return this.generateNoise(var1, var3, var5);
+ }
+
+ public void a(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7, double var8, double var10, double var12, double var14) {
+ int var16 = 0;
+ double var17 = 1.0D / var14;
+ int var19 = -1;
+ boolean var20 = false;
+ boolean var21 = false;
+ boolean var22 = false;
+ boolean var23 = false;
+ boolean var24 = false;
+ boolean var25 = false;
+ double var26 = 0.0D;
+ double var28 = 0.0D;
+ double var30 = 0.0D;
+ double var32 = 0.0D;
+
+ for(int var34 = 0; var34 < var5; ++var34) {
+ double var35 = (double)(var2 + var34) * var8 + this.xCoord;
+ int var37 = (int)var35;
+ if(var35 < (double)var37) {
+ --var37;
+ }
+
+ int var38 = var37 & 255;
+ var35 -= (double)var37;
+ double var39 = var35 * var35 * var35 * (var35 * (var35 * 6.0D - 15.0D) + 10.0D);
+
+ for(int var41 = 0; var41 < var7; ++var41) {
+ double var42 = (double)(var4 + var41) * var12 + this.zCoord;
+ int var44 = (int)var42;
+ if(var42 < (double)var44) {
+ --var44;
+ }
+
+ int var45 = var44 & 255;
+ var42 -= (double)var44;
+ double var46 = var42 * var42 * var42 * (var42 * (var42 * 6.0D - 15.0D) + 10.0D);
+
+ for(int var48 = 0; var48 < var6; ++var48) {
+ double var49 = (double)(var3 + var48) * var10 + this.yCoord;
+ int var51 = (int)var49;
+ if(var49 < (double)var51) {
+ --var51;
+ }
+
+ int var52 = var51 & 255;
+ var49 -= (double)var51;
+ double var53 = var49 * var49 * var49 * (var49 * (var49 * 6.0D - 15.0D) + 10.0D);
+ if(var48 == 0 || var52 != var19) {
+ var19 = var52;
+ int var61 = this.permutations[var38] + var52;
+ int var62 = this.permutations[var61] + var45;
+ int var63 = this.permutations[var61 + 1] + var45;
+ int var64 = this.permutations[var38 + 1] + var52;
+ int var65 = this.permutations[var64] + var45;
+ int var66 = this.permutations[var64 + 1] + var45;
+ var26 = this.lerp(var39, this.grad(this.permutations[var62], var35, var49, var42), this.grad(this.permutations[var65], var35 - 1.0D, var49, var42));
+ var28 = this.lerp(var39, this.grad(this.permutations[var63], var35, var49 - 1.0D, var42), this.grad(this.permutations[var66], var35 - 1.0D, var49 - 1.0D, var42));
+ var30 = this.lerp(var39, this.grad(this.permutations[var62 + 1], var35, var49, var42 - 1.0D), this.grad(this.permutations[var65 + 1], var35 - 1.0D, var49, var42 - 1.0D));
+ var32 = this.lerp(var39, this.grad(this.permutations[var63 + 1], var35, var49 - 1.0D, var42 - 1.0D), this.grad(this.permutations[var66 + 1], var35 - 1.0D, var49 - 1.0D, var42 - 1.0D));
+ }
+
+ double var55 = this.lerp(var53, var26, var28);
+ double var57 = this.lerp(var53, var30, var32);
+ double var59 = this.lerp(var46, var55, var57);
+ int var10001 = var16++;
+ var1[var10001] += var59 * var17;
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/OSMap.java b/src/net/minecraft/src/OSMap.java
new file mode 100644
index 0000000..c183c05
--- /dev/null
+++ b/src/net/minecraft/src/OSMap.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+class OSMap {
+ static final int[] osValues = new int[EnumOS.values().length];
+
+ static {
+ try {
+ osValues[EnumOS.linux.ordinal()] = 1;
+ } catch (NoSuchFieldError var4) {
+ }
+
+ try {
+ osValues[EnumOS.solaris.ordinal()] = 2;
+ } catch (NoSuchFieldError var3) {
+ }
+
+ try {
+ osValues[EnumOS.windows.ordinal()] = 3;
+ } catch (NoSuchFieldError var2) {
+ }
+
+ try {
+ osValues[EnumOS.macos.ordinal()] = 4;
+ } catch (NoSuchFieldError var1) {
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/OSMapIsom.java b/src/net/minecraft/src/OSMapIsom.java
new file mode 100644
index 0000000..16687c5
--- /dev/null
+++ b/src/net/minecraft/src/OSMapIsom.java
@@ -0,0 +1,28 @@
+package net.minecraft.src;
+
+class OSMapIsom {
+ static final int[] osValues = new int[EnumOSIsom.values().length];
+
+ static {
+ try {
+ osValues[EnumOSIsom.linux.ordinal()] = 1;
+ } catch (NoSuchFieldError var4) {
+ }
+
+ try {
+ osValues[EnumOSIsom.solaris.ordinal()] = 2;
+ } catch (NoSuchFieldError var3) {
+ }
+
+ try {
+ osValues[EnumOSIsom.windows.ordinal()] = 3;
+ } catch (NoSuchFieldError var2) {
+ }
+
+ try {
+ osValues[EnumOSIsom.macos.ordinal()] = 4;
+ } catch (NoSuchFieldError var1) {
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/OpenGlCapsChecker.java b/src/net/minecraft/src/OpenGlCapsChecker.java
new file mode 100644
index 0000000..eaf1238
--- /dev/null
+++ b/src/net/minecraft/src/OpenGlCapsChecker.java
@@ -0,0 +1,9 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GLContext;
+
+public class OpenGlCapsChecker {
+ public boolean checkARBOcclusion() {
+ return false & GLContext.getCapabilities().GL_ARB_occlusion_query;
+ }
+}
diff --git a/src/net/minecraft/src/PanelCrashReport.java b/src/net/minecraft/src/PanelCrashReport.java
new file mode 100644
index 0000000..59d6613
--- /dev/null
+++ b/src/net/minecraft/src/PanelCrashReport.java
@@ -0,0 +1,85 @@
+package net.minecraft.src;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Panel;
+import java.awt.TextArea;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.GL11;
+
+public class PanelCrashReport extends Panel {
+ public PanelCrashReport(UnexpectedThrowable var1) {
+ this.setBackground(new Color(3028036));
+ this.setLayout(new BorderLayout());
+ StringWriter var2 = new StringWriter();
+ var1.exception.printStackTrace(new PrintWriter(var2));
+ String var3 = var2.toString();
+ String var4 = "";
+ String var5 = "";
+
+ try {
+ var5 = var5 + "Generated " + (new SimpleDateFormat()).format(new Date()) + "\n";
+ var5 = var5 + "\n";
+ var5 = var5 + "Minecraft: Minecraft Infdev\n";
+ var5 = var5 + "OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n";
+ var5 = var5 + "Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n";
+ var5 = var5 + "VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor") + "\n";
+ var5 = var5 + "LWJGL: " + Sys.getVersion() + "\n";
+ var4 = GL11.glGetString(GL11.GL_VENDOR);
+ var5 = var5 + "OpenGL: " + GL11.glGetString(GL11.GL_RENDERER) + " version " + GL11.glGetString(GL11.GL_VERSION) + ", " + GL11.glGetString(GL11.GL_VENDOR) + "\n";
+ } catch (Throwable var8) {
+ var5 = var5 + "[failed to get system properties]\n";
+ }
+
+ var5 = var5 + "\n";
+ var5 = var5 + var3;
+ String var6 = "";
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ if(var3.contains("Pixel format not accelerated")) {
+ var6 = var6 + " Bad video card drivers! \n";
+ var6 = var6 + " ----------------------- \n";
+ var6 = var6 + "\n";
+ var6 = var6 + "Minecraft was unable to start because it failed to find an accelerated OpenGL mode.\n";
+ var6 = var6 + "This can usually be fixed by updating the video card drivers.\n";
+ if(var4.toLowerCase().contains("nvidia")) {
+ var6 = var6 + "\n";
+ var6 = var6 + "You might be able to find drivers for your video card here:\n";
+ var6 = var6 + " http://www.nvidia.com/\n";
+ } else if(var4.toLowerCase().contains("ati")) {
+ var6 = var6 + "\n";
+ var6 = var6 + "You might be able to find drivers for your video card here:\n";
+ var6 = var6 + " http://www.amd.com/\n";
+ }
+ } else {
+ var6 = var6 + " Minecraft has crashed! \n";
+ var6 = var6 + " ---------------------- \n";
+ var6 = var6 + "\n";
+ var6 = var6 + "Minecraft has stopped running because it encountered a problem.\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "If you wish to report this, please copy this entire text and email it to support@mojang.com.\n";
+ var6 = var6 + "Please include a description of what you did when the error occured.\n";
+ }
+
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "--- BEGIN ERROR REPORT " + Integer.toHexString(var6.hashCode()) + " --------\n";
+ var6 = var6 + var5;
+ var6 = var6 + "--- END ERROR REPORT " + Integer.toHexString(var6.hashCode()) + " ----------\n";
+ var6 = var6 + "\n";
+ var6 = var6 + "\n";
+ TextArea var7 = new TextArea(var6, 0, 0, 1);
+ var7.setFont(new Font("Monospaced", 0, 12));
+ this.add(new CanvasMojangLogo(), "North");
+ this.add(new CanvasCrashReport(80), "East");
+ this.add(new CanvasCrashReport(80), "West");
+ this.add(new CanvasCrashReport(100), "South");
+ this.add(var7, "Center");
+ }
+}
diff --git a/src/net/minecraft/src/Path.java b/src/net/minecraft/src/Path.java
new file mode 100644
index 0000000..ce289f0
--- /dev/null
+++ b/src/net/minecraft/src/Path.java
@@ -0,0 +1,119 @@
+package net.minecraft.src;
+
+public class Path {
+ private PathPoint[] pathPoints = new PathPoint[1024];
+ private int count = 0;
+
+ public PathPoint addPoint(PathPoint var1) {
+ if(var1.index >= 0) {
+ throw new IllegalStateException("OW KNOWS!");
+ } else {
+ 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.sortBack(this.count++);
+ return var1;
+ }
+ }
+
+ public void clearPath() {
+ this.count = 0;
+ }
+
+ public PathPoint dequeue() {
+ PathPoint var1 = this.pathPoints[0];
+ this.pathPoints[0] = this.pathPoints[--this.count];
+ this.pathPoints[this.count] = null;
+ if(this.count > 0) {
+ this.sortForward(0);
+ }
+
+ var1.index = -1;
+ return var1;
+ }
+
+ public void changeDistance(PathPoint var1, float var2) {
+ float var3 = var1.distanceToTarget;
+ var1.distanceToTarget = var2;
+ if(var2 < var3) {
+ this.sortBack(var1.index);
+ } else {
+ this.sortForward(var1.index);
+ }
+
+ }
+
+ private void sortBack(int var1) {
+ PathPoint var2 = this.pathPoints[var1];
+
+ int var4;
+ for(float var3 = var2.distanceToTarget; var1 > 0; var1 = var4) {
+ var4 = var1 - 1 >> 1;
+ PathPoint var5 = this.pathPoints[var4];
+ if(var3 >= var5.distanceToTarget) {
+ break;
+ }
+
+ this.pathPoints[var1] = var5;
+ var5.index = var1;
+ }
+
+ this.pathPoints[var1] = var2;
+ var2.index = var1;
+ }
+
+ private void sortForward(int var1) {
+ PathPoint var2 = this.pathPoints[var1];
+ float var3 = var2.distanceToTarget;
+
+ while(true) {
+ int var4 = 1 + (var1 << 1);
+ int var5 = var4 + 1;
+ if(var4 >= this.count) {
+ break;
+ }
+
+ PathPoint var6 = this.pathPoints[var4];
+ float var7 = var6.distanceToTarget;
+ PathPoint var8;
+ float var9;
+ if(var5 >= this.count) {
+ var8 = null;
+ var9 = Float.POSITIVE_INFINITY;
+ } else {
+ var8 = this.pathPoints[var5];
+ var9 = var8.distanceToTarget;
+ }
+
+ if(var7 < var9) {
+ if(var7 >= var3) {
+ break;
+ }
+
+ this.pathPoints[var1] = var6;
+ var6.index = var1;
+ var1 = var4;
+ } else {
+ if(var9 >= var3) {
+ break;
+ }
+
+ this.pathPoints[var1] = var8;
+ var8.index = var1;
+ var1 = var5;
+ }
+ }
+
+ this.pathPoints[var1] = var2;
+ var2.index = var1;
+ }
+
+ public boolean isPathEmpty() {
+ return this.count == 0;
+ }
+}
diff --git a/src/net/minecraft/src/PathEntity.java b/src/net/minecraft/src/PathEntity.java
new file mode 100644
index 0000000..e1994b1
--- /dev/null
+++ b/src/net/minecraft/src/PathEntity.java
@@ -0,0 +1,27 @@
+package net.minecraft.src;
+
+public class PathEntity {
+ private final PathPoint[] points;
+ public final int pathLength;
+ private int pathIndex;
+
+ public PathEntity(PathPoint[] var1) {
+ this.points = var1;
+ this.pathLength = var1.length;
+ }
+
+ public void incrementPathIndex() {
+ ++this.pathIndex;
+ }
+
+ public boolean isFinished() {
+ return this.pathIndex >= this.points.length;
+ }
+
+ public Vec3D getPosition(Entity var1) {
+ float var2 = (float)this.points[this.pathIndex].xCoord + (float)((int)(var1.width + 1.0F)) * 0.5F;
+ float var3 = (float)this.points[this.pathIndex].yCoord;
+ float var4 = (float)this.points[this.pathIndex].zCoord + (float)((int)(var1.width + 1.0F)) * 0.5F;
+ return Vec3D.createVector((double)var2, (double)var3, (double)var4);
+ }
+}
diff --git a/src/net/minecraft/src/PathPoint.java b/src/net/minecraft/src/PathPoint.java
new file mode 100644
index 0000000..7df70dd
--- /dev/null
+++ b/src/net/minecraft/src/PathPoint.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+public class PathPoint {
+ public final int xCoord;
+ public final int yCoord;
+ public final int zCoord;
+ public final int hash;
+ int index = -1;
+ float totalPathDistance;
+ float distanceToNext;
+ float distanceToTarget;
+ PathPoint previous;
+ public boolean isFirst = false;
+
+ public PathPoint(int var1, int var2, int var3) {
+ this.xCoord = var1;
+ this.yCoord = var2;
+ this.zCoord = var3;
+ this.hash = var1 | var2 << 10 | var3 << 20;
+ }
+
+ 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);
+ return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4);
+ }
+
+ public boolean equals(Object var1) {
+ return ((PathPoint)var1).hash == this.hash;
+ }
+
+ public int hashCode() {
+ return this.hash;
+ }
+
+ public boolean isAssigned() {
+ return this.index >= 0;
+ }
+
+ public String toString() {
+ return this.xCoord + ", " + this.yCoord + ", " + this.zCoord;
+ }
+}
diff --git a/src/net/minecraft/src/Pathfinder.java b/src/net/minecraft/src/Pathfinder.java
new file mode 100644
index 0000000..7887c4f
--- /dev/null
+++ b/src/net/minecraft/src/Pathfinder.java
@@ -0,0 +1,205 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Pathfinder {
+ private IBlockAccess worldMap;
+ private Path path = new Path();
+ private Map pointMap = new HashMap();
+ private PathPoint[] pathOptions = new PathPoint[32];
+
+ public Pathfinder(IBlockAccess var1) {
+ this.worldMap = var1;
+ }
+
+ 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) {
+ this.path.clearPath();
+ this.pointMap.clear();
+ PathPoint var9 = this.openPoint(MathHelper.floor_double(var1.boundingBox.minX), MathHelper.floor_double(var1.boundingBox.minY), MathHelper.floor_double(var1.boundingBox.minZ));
+ PathPoint var10 = 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 var11 = new PathPoint(MathHelper.floor_float(var1.width + 1.0F), MathHelper.floor_float(var1.height + 1.0F), MathHelper.floor_float(var1.width + 1.0F));
+ PathEntity var12 = this.addToPath(var1, var9, var10, var11, var8);
+ return var12;
+ }
+
+ private PathEntity addToPath(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) {
+ var2.totalPathDistance = 0.0F;
+ var2.distanceToNext = var2.distanceTo(var3);
+ var2.distanceToTarget = var2.distanceToNext;
+ this.path.clearPath();
+ this.path.addPoint(var2);
+ PathPoint var6 = var2;
+
+ while(!this.path.isPathEmpty()) {
+ PathPoint var7 = this.path.dequeue();
+ if(var7.hash == var3.hash) {
+ return this.createEntityPath(var2, var3);
+ }
+
+ if(var7.distanceTo(var3) < var6.distanceTo(var3)) {
+ var6 = var7;
+ }
+
+ var7.isFirst = true;
+ int var8 = this.findPathOptions(var1, var7, var4, var3, var5);
+
+ for(int var9 = 0; var9 < var8; ++var9) {
+ PathPoint var10 = this.pathOptions[var9];
+ float var11 = var7.totalPathDistance + var7.distanceTo(var10);
+ if(!var10.isAssigned() || var11 < var10.totalPathDistance) {
+ var10.previous = var7;
+ var10.totalPathDistance = var11;
+ var10.distanceToNext = var10.distanceTo(var3);
+ if(var10.isAssigned()) {
+ this.path.changeDistance(var10, var10.totalPathDistance + var10.distanceToNext);
+ } else {
+ var10.distanceToTarget = var10.totalPathDistance + var10.distanceToNext;
+ this.path.addPoint(var10);
+ }
+ }
+ }
+ }
+
+ if(var6 == var2) {
+ return null;
+ } else {
+ return this.createEntityPath(var2, var6);
+ }
+ }
+
+ private int findPathOptions(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) {
+ int var6 = 0;
+ byte var7 = 0;
+ if(this.getVerticalOffset(var1, var2.xCoord, var2.yCoord + 1, var2.zCoord, var3) > 0) {
+ 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) {
+ this.pathOptions[var6++] = var8;
+ }
+
+ if(var9 != null && !var9.isFirst && var9.distanceTo(var4) < var5) {
+ this.pathOptions[var6++] = var9;
+ }
+
+ if(var10 != null && !var10.isFirst && var10.distanceTo(var4) < var5) {
+ this.pathOptions[var6++] = var10;
+ }
+
+ if(var11 != null && !var11.isFirst && var11.distanceTo(var4) < var5) {
+ this.pathOptions[var6++] = var11;
+ }
+
+ return var6;
+ }
+
+ private PathPoint getSafePoint(Entity var1, int var2, int var3, int var4, PathPoint var5, int var6) {
+ PathPoint var7 = null;
+ if(this.getVerticalOffset(var1, var2, var3, var4, var5) > 0) {
+ var7 = this.openPoint(var2, var3, var4);
+ }
+
+ if(var7 == null && this.getVerticalOffset(var1, var2, var3 + var6, var4, var5) > 0) {
+ var7 = this.openPoint(var2, var3 + var6, var4);
+ }
+
+ if(var7 != null) {
+ int var8 = 0;
+ boolean var9 = false;
+
+ while(true) {
+ if(var3 > 0) {
+ int var11 = this.getVerticalOffset(var1, var2, var3 - 1, var4, var5);
+ if(var11 > 0) {
+ if(var11 < 0) {
+ return null;
+ }
+
+ ++var8;
+ if(var8 >= 4) {
+ return null;
+ }
+
+ --var3;
+ continue;
+ }
+ }
+
+ if(var3 > 0) {
+ var7 = this.openPoint(var2, var3, var4);
+ }
+
+ Material var10 = this.worldMap.getBlockMaterial(var2, var3 - 1, var4);
+ if(var10 == Material.water || var10 == Material.lava) {
+ return null;
+ }
+ break;
+ }
+ }
+
+ return var7;
+ }
+
+ private final PathPoint openPoint(int var1, int var2, int var3) {
+ int var4 = var1 | var2 << 10 | var3 << 20;
+ PathPoint var5 = (PathPoint)this.pointMap.get(Integer.valueOf(var4));
+ if(var5 == null) {
+ var5 = new PathPoint(var1, var2, var3);
+ this.pointMap.put(Integer.valueOf(var4), var5);
+ }
+
+ return var5;
+ }
+
+ private int getVerticalOffset(Entity var1, int var2, int var3, int var4, PathPoint var5) {
+ for(int var6 = var2; var6 < var2 + var5.xCoord; ++var6) {
+ for(int var7 = var3; var7 < var3 + var5.yCoord; ++var7) {
+ for(int var8 = var4; var8 < var4 + var5.zCoord; ++var8) {
+ Material var9 = this.worldMap.getBlockMaterial(var2, var3, var4);
+ if(var9.getIsSolid()) {
+ return 0;
+ }
+
+ if(var9 == Material.water || var9 == Material.lava) {
+ return -1;
+ }
+ }
+ }
+ }
+
+ return 1;
+ }
+
+ private PathEntity createEntityPath(PathPoint var1, PathPoint var2) {
+ int var3 = 1;
+
+ PathPoint var4;
+ for(var4 = var2; var4.previous != null; var4 = var4.previous) {
+ ++var3;
+ }
+
+ PathPoint[] var5 = new PathPoint[var3];
+ var4 = var2;
+ --var3;
+
+ for(var5[var3] = var2; var4.previous != null; var5[var3] = var4) {
+ var4 = var4.previous;
+ --var3;
+ }
+
+ return new PathEntity(var5);
+ }
+}
diff --git a/src/net/minecraft/src/PlayerController.java b/src/net/minecraft/src/PlayerController.java
new file mode 100644
index 0000000..4abc7dc
--- /dev/null
+++ b/src/net/minecraft/src/PlayerController.java
@@ -0,0 +1,60 @@
+package net.minecraft.src;
+
+public class PlayerController {
+ protected final Minecraft mc;
+ public boolean isInTestMode = false;
+
+ public PlayerController(Minecraft var1) {
+ this.mc = var1;
+ }
+
+ public void init() {
+ }
+
+ public void onWorldChange(World var1) {
+ }
+
+ public void clickBlock(int var1, int var2, int var3) {
+ this.sendBlockRemoved(var1, var2, var3);
+ }
+
+ public boolean sendBlockRemoved(int var1, int var2, int var3) {
+ this.mc.effectRenderer.addBlockDestroyEffects(var1, var2, var3);
+ World var4 = this.mc.theWorld;
+ Block var5 = Block.blocksList[var4.getBlockId(var1, var2, var3)];
+ int var6 = var4.getBlockMetadata(var1, var2, var3);
+ boolean var7 = var4.setBlockWithNotify(var1, var2, var3, 0);
+ if(var5 != null && var7) {
+ this.mc.sndManager.playSound(var5.stepSound.getBreakSound(), (float)var1 + 0.5F, (float)var2 + 0.5F, (float)var3 + 0.5F, (var5.stepSound.getVolume() + 1.0F) / 2.0F, var5.stepSound.getPitch() * 0.8F);
+ var5.onBlockDestroyedByPlayer(var4, var1, var2, var3, var6);
+ }
+
+ return var7;
+ }
+
+ public void sendBlockRemoving(int var1, int var2, int var3, int var4) {
+ }
+
+ public void resetBlockRemoving() {
+ }
+
+ public void setPartialTime(float var1) {
+ }
+
+ public float getBlockReachDistance() {
+ return 5.0F;
+ }
+
+ public void flipPlayer(EntityPlayer var1) {
+ }
+
+ public void onUpdate() {
+ }
+
+ public boolean shouldDrawHUD() {
+ return true;
+ }
+
+ public void onRespawn(EntityPlayer var1) {
+ }
+}
diff --git a/src/net/minecraft/src/PlayerControllerCreative.java b/src/net/minecraft/src/PlayerControllerCreative.java
new file mode 100644
index 0000000..960d62a
--- /dev/null
+++ b/src/net/minecraft/src/PlayerControllerCreative.java
@@ -0,0 +1,33 @@
+package net.minecraft.src;
+
+public class PlayerControllerCreative extends PlayerController {
+ public PlayerControllerCreative(Minecraft var1) {
+ super(var1);
+ this.isInTestMode = true;
+ }
+
+ public void init() {
+ }
+
+ public void onRespawn(EntityPlayer var1) {
+ for(int var2 = 0; var2 < 9; ++var2) {
+ if(var1.inventory.mainInventory[var2] == null) {
+ this.mc.thePlayer.inventory.mainInventory[var2] = new ItemStack(((Block)Session.registeredBlocksList.get(var2)).blockID);
+ } else {
+ this.mc.thePlayer.inventory.mainInventory[var2].stackSize = 1;
+ }
+ }
+
+ }
+
+ public boolean shouldDrawHUD() {
+ return false;
+ }
+
+ public void onWorldChange(World var1) {
+ super.onWorldChange(var1);
+ }
+
+ public void onUpdate() {
+ }
+}
diff --git a/src/net/minecraft/src/PlayerControllerSP.java b/src/net/minecraft/src/PlayerControllerSP.java
new file mode 100644
index 0000000..845c644
--- /dev/null
+++ b/src/net/minecraft/src/PlayerControllerSP.java
@@ -0,0 +1,124 @@
+package net.minecraft.src;
+
+public class PlayerControllerSP extends PlayerController {
+ private int curBlockX = -1;
+ private int curBlockY = -1;
+ private int curBlockZ = -1;
+ private float curBlockDamage = 0.0F;
+ private float prevBlockDamage = 0.0F;
+ private float blockDestroySoundCounter = 0.0F;
+ private int blockHitWait = 0;
+ private SpawnerAnimals monsterSpawner = new SpawnerMonsters(this, 100, EntityMonster.class, new Class[]{EntityZombie.class, EntitySkeleton.class, EntityCreeper.class, EntitySpider.class});
+ private SpawnerAnimals animalSpawner = new SpawnerAnimals(20, EntityAnimal.class, new Class[]{EntitySheep.class, EntityPig.class});
+
+ public PlayerControllerSP(Minecraft var1) {
+ super(var1);
+ }
+
+ public void flipPlayer(EntityPlayer var1) {
+ var1.rotationYaw = -180.0F;
+ }
+
+ public void init() {
+ }
+
+ public boolean sendBlockRemoved(int var1, int var2, int var3) {
+ int var4 = this.mc.theWorld.getBlockId(var1, var2, var3);
+ int var5 = this.mc.theWorld.getBlockMetadata(var1, var2, var3);
+ boolean var6 = super.sendBlockRemoved(var1, var2, var3);
+ ItemStack var7 = this.mc.thePlayer.getCurrentEquippedItem();
+ if(var7 != null) {
+ var7.onDestroyBlock(var4, var1, var2, var3);
+ if(var7.stackSize == 0) {
+ var7.onItemDestroyedByUse(this.mc.thePlayer);
+ this.mc.thePlayer.displayGUIInventory();
+ }
+ }
+
+ if(var6 && this.mc.thePlayer.canHarvestBlock(Block.blocksList[var4])) {
+ Block.blocksList[var4].dropBlockAsItem(this.mc.theWorld, var1, var2, var3, var5);
+ }
+
+ return var6;
+ }
+
+ public void clickBlock(int var1, int var2, int var3) {
+ int var4 = this.mc.theWorld.getBlockId(var1, var2, var3);
+ if(var4 > 0 && this.curBlockDamage == 0.0F) {
+ Block.blocksList[var4].onBlockClicked(this.mc.theWorld, var1, var2, var3, this.mc.thePlayer);
+ }
+
+ if(var4 > 0 && Block.blocksList[var4].blockStrength(this.mc.thePlayer) >= 1.0F) {
+ this.sendBlockRemoved(var1, var2, var3);
+ }
+
+ }
+
+ public void resetBlockRemoving() {
+ this.curBlockDamage = 0.0F;
+ this.blockHitWait = 0;
+ }
+
+ public void sendBlockRemoving(int var1, int var2, int var3, int var4) {
+ if(this.blockHitWait > 0) {
+ --this.blockHitWait;
+ } else {
+ super.sendBlockRemoving(var1, var2, var3, var4);
+ if(var1 == this.curBlockX && var2 == this.curBlockY && var3 == this.curBlockZ) {
+ int var5 = this.mc.theWorld.getBlockId(var1, var2, var3);
+ if(var5 == 0) {
+ return;
+ }
+
+ Block var6 = Block.blocksList[var5];
+ this.curBlockDamage += var6.blockStrength(this.mc.thePlayer);
+ if(this.blockDestroySoundCounter % 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);
+ }
+
+ ++this.blockDestroySoundCounter;
+ if(this.curBlockDamage >= 1.0F) {
+ this.sendBlockRemoved(var1, var2, var3);
+ this.curBlockDamage = 0.0F;
+ this.prevBlockDamage = 0.0F;
+ this.blockDestroySoundCounter = 0.0F;
+ this.blockHitWait = 5;
+ }
+ } else {
+ this.curBlockDamage = 0.0F;
+ this.prevBlockDamage = 0.0F;
+ this.blockDestroySoundCounter = 0.0F;
+ this.curBlockX = var1;
+ this.curBlockY = var2;
+ this.curBlockZ = var3;
+ }
+
+ }
+ }
+
+ public void setPartialTime(float var1) {
+ if(this.curBlockDamage <= 0.0F) {
+ this.mc.ingameGUI.damageGuiPartialTime = 0.0F;
+ this.mc.renderGlobal.damagePartialTime = 0.0F;
+ } else {
+ float var2 = this.prevBlockDamage + (this.curBlockDamage - this.prevBlockDamage) * var1;
+ this.mc.ingameGUI.damageGuiPartialTime = var2;
+ this.mc.renderGlobal.damagePartialTime = var2;
+ }
+
+ }
+
+ public float getBlockReachDistance() {
+ return 4.0F;
+ }
+
+ public void onWorldChange(World var1) {
+ super.onWorldChange(var1);
+ }
+
+ public void onUpdate() {
+ this.prevBlockDamage = this.curBlockDamage;
+ this.monsterSpawner.onUpdate(this.mc.theWorld);
+ this.animalSpawner.onUpdate(this.mc.theWorld);
+ }
+}
diff --git a/src/net/minecraft/src/PositionTextureVertex.java b/src/net/minecraft/src/PositionTextureVertex.java
new file mode 100644
index 0000000..767c8bf
--- /dev/null
+++ b/src/net/minecraft/src/PositionTextureVertex.java
@@ -0,0 +1,27 @@
+package net.minecraft.src;
+
+public class PositionTextureVertex {
+ public Vec3D vector3D;
+ public float texturePositionX;
+ public float texturePositionY;
+
+ public PositionTextureVertex(float var1, float var2, float var3, float var4, float var5) {
+ this(Vec3D.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(Vec3D var1, float var2, float var3) {
+ this.vector3D = var1;
+ this.texturePositionX = var2;
+ this.texturePositionY = var3;
+ }
+}
diff --git a/src/net/minecraft/src/RecipeSorter.java b/src/net/minecraft/src/RecipeSorter.java
new file mode 100644
index 0000000..e74a04e
--- /dev/null
+++ b/src/net/minecraft/src/RecipeSorter.java
@@ -0,0 +1,19 @@
+package net.minecraft.src;
+
+import java.util.Comparator;
+
+class RecipeSorter implements Comparator {
+ final CraftingManager craftingManager;
+
+ RecipeSorter(CraftingManager var1) {
+ this.craftingManager = var1;
+ }
+
+ public int a(CraftingRecipe var1, CraftingRecipe var2) {
+ return var2.getRecipeSize() < var1.getRecipeSize() ? -1 : (var2.getRecipeSize() > var1.getRecipeSize() ? 1 : 0);
+ }
+
+ public int compare(Object var1, Object var2) {
+ return this.a((CraftingRecipe)var1, (CraftingRecipe)var2);
+ }
+}
diff --git a/src/net/minecraft/src/RecipesArmor.java b/src/net/minecraft/src/RecipesArmor.java
new file mode 100644
index 0000000..5393870
--- /dev/null
+++ b/src/net/minecraft/src/RecipesArmor.java
@@ -0,0 +1,18 @@
+package net.minecraft.src;
+
+public class RecipesArmor {
+ private String[][] recipePatterns = new String[][]{{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}};
+ private Object[][] recipeItems = new Object[][]{{Block.cloth, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetSteel, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateSteel, Item.plateDiamonhd, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsSteel, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsSteel, Item.bootsDiamond, Item.bootsGold}};
+
+ public void addRecipes(CraftingManager var1) {
+ 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];
+ var1.addRecipe(new ItemStack(var5), new Object[]{this.recipePatterns[var4], Character.valueOf('X'), var3});
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/RecipesCrafting.java b/src/net/minecraft/src/RecipesCrafting.java
new file mode 100644
index 0000000..85015bd
--- /dev/null
+++ b/src/net/minecraft/src/RecipesCrafting.java
@@ -0,0 +1,9 @@
+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.stoneOvenIdle), new Object[]{"###", "# #", "###", Character.valueOf('#'), Block.cobblestone});
+ var1.addRecipe(new ItemStack(Block.workbench), new Object[]{"##", "##", Character.valueOf('#'), Block.planks});
+ }
+}
diff --git a/src/net/minecraft/src/RecipesFood.java b/src/net/minecraft/src/RecipesFood.java
new file mode 100644
index 0000000..b4adb74
--- /dev/null
+++ b/src/net/minecraft/src/RecipesFood.java
@@ -0,0 +1,8 @@
+package net.minecraft.src;
+
+public class RecipesFood {
+ public void addRecipes(CraftingManager var1) {
+ var1.addRecipe(new ItemStack(Item.bowlSoup), new Object[]{"Y", "X", "#", Character.valueOf('X'), Block.mushroomBrown, Character.valueOf('Y'), Block.mushroomRed, Character.valueOf('#'), Item.bowlEmpty});
+ var1.addRecipe(new ItemStack(Item.bowlSoup), new Object[]{"Y", "X", "#", Character.valueOf('X'), Block.mushroomRed, Character.valueOf('Y'), Block.mushroomBrown, Character.valueOf('#'), Item.bowlEmpty});
+ }
+}
diff --git a/src/net/minecraft/src/RecipesIngots.java b/src/net/minecraft/src/RecipesIngots.java
new file mode 100644
index 0000000..22802d6
--- /dev/null
+++ b/src/net/minecraft/src/RecipesIngots.java
@@ -0,0 +1,15 @@
+package net.minecraft.src;
+
+public class RecipesIngots {
+ private Object[][] recipeItems = new Object[][]{{Block.blockGold, Item.ingotGold}, {Block.blockSteel, Item.ingotIron}, {Block.blockDiamond, Item.diamond}};
+
+ public void addRecipes(CraftingManager var1) {
+ for(int var2 = 0; var2 < this.recipeItems.length; ++var2) {
+ Block var3 = (Block)this.recipeItems[var2][0];
+ Item var4 = (Item)this.recipeItems[var2][1];
+ var1.addRecipe(new ItemStack(var3), new Object[]{"###", "###", "###", Character.valueOf('#'), var4});
+ var1.addRecipe(new ItemStack(var4, 9), new Object[]{"#", Character.valueOf('#'), var3});
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/RecipesTools.java b/src/net/minecraft/src/RecipesTools.java
new file mode 100644
index 0000000..d011907
--- /dev/null
+++ b/src/net/minecraft/src/RecipesTools.java
@@ -0,0 +1,18 @@
+package net.minecraft.src;
+
+public class RecipesTools {
+ private String[][] recipePatterns = new String[][]{{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}};
+ private Object[][] recipeItems = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeSteel, Item.pickaxeDiamond, Item.pickaxeGold}, {Item.shovelWood, Item.shovelStone, Item.shovel, Item.shovelDiamond, Item.shovelGold}, {Item.axeWood, Item.axeStone, Item.axeSteel, Item.axeDiamond, Item.axeGold}, {Item.hoeWood, Item.hoeStone, Item.hoeSteel, Item.hoeDiamond, Item.hoeGold}};
+
+ public void addRecipes(CraftingManager var1) {
+ 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];
+ var1.addRecipe(new ItemStack(var5), new Object[]{this.recipePatterns[var4], Character.valueOf('#'), Item.stick, Character.valueOf('X'), var3});
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/RecipesWeapons.java b/src/net/minecraft/src/RecipesWeapons.java
new file mode 100644
index 0000000..34d76c0
--- /dev/null
+++ b/src/net/minecraft/src/RecipesWeapons.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+public class RecipesWeapons {
+ private String[][] recipePatterns = new String[][]{{"X", "X", "#"}};
+ private Object[][] recipeItems = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordSteel, Item.swordDiamond, Item.swordGold}};
+
+ public void addRecipe(CraftingManager var1) {
+ 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];
+ var1.addRecipe(new ItemStack(var5), new Object[]{this.recipePatterns[var4], Character.valueOf('#'), Item.stick, Character.valueOf('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.ingotIron, Character.valueOf('#'), Item.stick});
+ }
+}
diff --git a/src/net/minecraft/src/Render.java b/src/net/minecraft/src/Render.java
new file mode 100644
index 0000000..df43848
--- /dev/null
+++ b/src/net/minecraft/src/Render.java
@@ -0,0 +1,224 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public abstract class Render {
+ protected RenderManager renderManager;
+ private ModelBase modelBase = new ModelBiped();
+ private RenderBlocks renderBlocksVar = new RenderBlocks();
+ protected float shadowSize = 0.0F;
+ protected float shadowOpaque = 1.0F;
+
+ public abstract void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9);
+
+ protected void loadTexture(String var1) {
+ RenderEngine var2 = this.renderManager.renderEngine;
+ var2.bindTexture(var2.getTexture(var1));
+ }
+
+ protected void loadDownloadableImageTexture(String var1, String var2) {
+ RenderEngine var3 = this.renderManager.renderEngine;
+ var3.bindTexture(var3.getTextureForDownloadableImage(var1, var2));
+ }
+
+ private void renderEntityOnFire(Entity var1, double var2, double var4, double var6, float var8) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ int var9 = Block.fire.blockIndexInTexture;
+ int var10 = (var9 & 15) << 4;
+ int var11 = var9 & 240;
+ float var12 = (float)var10 / 256.0F;
+ float var13 = ((float)var10 + 15.99F) / 256.0F;
+ float var14 = (float)var11 / 256.0F;
+ float var15 = ((float)var11 + 15.99F) / 256.0F;
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ float var16 = var1.width * 1.4F;
+ GL11.glScalef(var16, var16, var16);
+ this.loadTexture("/terrain.png");
+ Tessellator var17 = Tessellator.instance;
+ float var18 = 1.0F;
+ float var19 = 0.5F;
+ float var20 = 0.0F;
+ float var21 = var1.height / var1.width;
+ GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(0.0F, 0.0F, 0.4F + (float)((int)var21) * 0.02F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ var17.startDrawingQuads();
+
+ while(var21 > 0.0F) {
+ var17.addVertexWithUV((double)(var18 - var19), (double)(0.0F - var20), 0.0D, (double)var13, (double)var15);
+ var17.addVertexWithUV((double)(0.0F - var19), (double)(0.0F - var20), 0.0D, (double)var12, (double)var15);
+ var17.addVertexWithUV((double)(0.0F - var19), (double)(1.4F - var20), 0.0D, (double)var12, (double)var14);
+ var17.addVertexWithUV((double)(var18 - var19), (double)(1.4F - var20), 0.0D, (double)var13, (double)var14);
+ --var21;
+ --var20;
+ var18 *= 0.9F;
+ GL11.glTranslatef(0.0F, 0.0F, -0.04F);
+ }
+
+ var17.draw();
+ GL11.glPopMatrix();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ }
+
+ private void renderShadow(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ RenderEngine var10 = this.renderManager.renderEngine;
+ var10.bindTexture(var10.getTexture("%%/shadow.png"));
+ World var11 = this.getWorldFromRenderManager();
+ GL11.glDepthMask(false);
+ float var12 = this.shadowSize;
+ double var13 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9;
+ double var15 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9;
+ double var17 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9;
+ int var19 = MathHelper.floor_double(var13 - (double)var12);
+ int var20 = MathHelper.floor_double(var13 + (double)var12);
+ int var21 = MathHelper.floor_double(var15 - (double)var12);
+ int var22 = MathHelper.floor_double(var15);
+ int var23 = MathHelper.floor_double(var17 - (double)var12);
+ int var24 = MathHelper.floor_double(var17 + (double)var12);
+ double var25 = var2 - var13;
+ double var27 = var4 - var15;
+ double var29 = var6 - var17;
+ Tessellator var31 = Tessellator.instance;
+ var31.startDrawingQuads();
+
+ for(int var32 = var19; var32 <= var20; ++var32) {
+ for(int var33 = var21; var33 <= var22; ++var33) {
+ for(int var34 = var23; var34 <= var24; ++var34) {
+ int var35 = var11.getBlockId(var32, var33 - 1, var34);
+ if(var35 > 0 && var11.getBlockLightValue(var32, var33, var34) > 3) {
+ this.renderShadowOnBlock(Block.blocksList[var35], var2, var4, var6, var32, var33, var34, var8, var12, var25, var27, var29);
+ }
+ }
+ }
+ }
+
+ var31.draw();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDepthMask(true);
+ }
+
+ 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) {
+ Tessellator var19 = Tessellator.instance;
+ if(var1.renderAsNormalBlock()) {
+ double var20 = ((double)var11 - (var4 - ((double)var9 + var15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getBrightness(var8, var9, var10);
+ 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.minX + var13;
+ double var24 = (double)var8 + var1.maxX + var13;
+ double var26 = (double)var9 + var1.minY + var15 + 1.0D / 64.0D;
+ double var28 = (double)var10 + var1.minZ + var17;
+ double var30 = (double)var10 + var1.maxZ + 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);
+ 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);
+ var19.addVertexWithUV(var24, var26, var28, (double)var33, (double)var34);
+ }
+ }
+ }
+
+ public static void renderOffsetAABB(AxisAlignedBB var0, double var1, double var3, double var5) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Tessellator var7 = Tessellator.instance;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ var7.startDrawingQuads();
+ var7.setTranslationD(var1, var3, var5);
+ 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.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.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.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.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.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.setTranslationD(0.0D, 0.0D, 0.0D);
+ var7.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ public static void renderAABB(AxisAlignedBB var0) {
+ 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.draw();
+ }
+
+ public void setRenderManager(RenderManager var1) {
+ this.renderManager = var1;
+ }
+
+ public void doRenderShadowAndFire(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ if(this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F) {
+ double var10 = this.renderManager.getDistanceToCamera(var1.posX, var1.posY, var1.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(var1.fire > 0) {
+ this.renderEntityOnFire(var1, var2, var4, var6, var9);
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/RenderArrow.java b/src/net/minecraft/src/RenderArrow.java
new file mode 100644
index 0000000..6a50043
--- /dev/null
+++ b/src/net/minecraft/src/RenderArrow.java
@@ -0,0 +1,67 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderArrow extends Render {
+ public void a(EntityArrow var1, double var2, double var4, double var6, float var8, float var9) {
+ this.loadTexture("/item/arrows.png");
+ 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);
+ Tessellator var10 = Tessellator.instance;
+ byte var11 = 0;
+ float var12 = 0.0F;
+ float var13 = 0.5F;
+ float var14 = (float)(0 + var11 * 10) / 32.0F;
+ float var15 = (float)(5 + var11 * 10) / 32.0F;
+ float var16 = 0.0F;
+ float var17 = 0.15625F;
+ float var18 = (float)(5 + var11 * 10) / 32.0F;
+ 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 var22 = -MathHelper.sin(var21 * 3.0F) * var21;
+ GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F);
+ }
+
+ GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
+ GL11.glScalef(var20, var20, var20);
+ GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
+ GL11.glNormal3f(var20, 0.0F, 0.0F);
+ var10.startDrawingQuads();
+ var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18);
+ var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18);
+ var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19);
+ var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19);
+ var10.draw();
+ GL11.glNormal3f(-var20, 0.0F, 0.0F);
+ var10.startDrawingQuads();
+ var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18);
+ var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18);
+ var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19);
+ var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19);
+ var10.draw();
+
+ 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();
+ var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14);
+ var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14);
+ var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15);
+ var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15);
+ var10.draw();
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityArrow)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderBlocks.java b/src/net/minecraft/src/RenderBlocks.java
new file mode 100644
index 0000000..2c17d6d
--- /dev/null
+++ b/src/net/minecraft/src/RenderBlocks.java
@@ -0,0 +1,1401 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderBlocks {
+ private IBlockAccess blockAccess;
+ private int overrideBlockTexture = -1;
+ private boolean flipTexture = false;
+ private boolean renderAllFaces = false;
+
+ public RenderBlocks(IBlockAccess var1) {
+ this.blockAccess = var1;
+ }
+
+ public RenderBlocks() {
+ }
+
+ public void renderBlockUsingTexture(Block var1, int var2, int var3, int var4, int var5) {
+ this.overrideBlockTexture = var5;
+ this.renderBlockByRenderType(var1, var2, var3, var4);
+ this.overrideBlockTexture = -1;
+ }
+
+ public boolean renderBlockByRenderType(Block var1, int var2, int var3, int var4) {
+ int var5 = var1.getRenderType();
+ var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4);
+ return var5 == 0 ? this.renderStandardBlock(var1, var2, var3, var4) : (var5 == 4 ? this.renderBlockFluids(var1, var2, var3, var4) : (var5 == 1 ? this.renderBlockReed(var1, var2, var3, var4) : (var5 == 6 ? this.renderBlockCrops(var1, var2, var3, var4) : (var5 == 2 ? this.renderBlockTorch(var1, var2, var3, var4) : (var5 == 3 ? this.renderBlockFire(var1, var2, var3, var4) : (var5 == 5 ? this.renderBlockGears(var1, var2, var3, var4) : (var5 == 8 ? this.renderBlockLadder(var1, var2, var3, var4) : (var5 == 7 ? this.renderBlockDoor(var1, var2, var3, var4) : (var5 == 9 ? this.renderBlockMinecartTrack(var1, var2, var3, var4) : (var5 == 10 ? this.renderBlockStairs(var1, var2, var3, var4) : (var5 == 11 ? this.renderBlockFence(var1, var2, var3, var4) : false)))))))))));
+ }
+
+ public boolean renderBlockTorch(Block var1, int var2, int var3, int var4) {
+ int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ Tessellator var6 = Tessellator.instance;
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ if(Block.lightValue[var1.blockID] > 0) {
+ var7 = 1.0F;
+ }
+
+ var6.setColorOpaque_F(var7, var7, var7);
+ double var8 = (double)0.4F;
+ double var10 = 0.5D - var8;
+ double var12 = (double)0.2F;
+ if(var5 == 1) {
+ this.renderTorchAtAngle(var1, (double)var2 - var10, (double)var3 + var12, (double)var4, -var8, 0.0D);
+ } else if(var5 == 2) {
+ this.renderTorchAtAngle(var1, (double)var2 + var10, (double)var3 + var12, (double)var4, var8, 0.0D);
+ } else if(var5 == 3) {
+ this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var12, (double)var4 - var10, 0.0D, -var8);
+ } else if(var5 == 4) {
+ this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var12, (double)var4 + var10, 0.0D, var8);
+ } else {
+ this.renderTorchAtAngle(var1, (double)var2, (double)var3, (double)var4, 0.0D, 0.0D);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockFire(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var6 = this.overrideBlockTexture;
+ }
+
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var7, var7, var7);
+ int var8 = (var6 & 15) << 4;
+ int var9 = var6 & 240;
+ double var10 = (double)((float)var8 / 256.0F);
+ double var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ double var14 = (double)((float)var9 / 256.0F);
+ double var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ float var18 = 1.4F;
+ double var21;
+ double var23;
+ double var25;
+ double var27;
+ double var29;
+ double var31;
+ double var33;
+ if(!this.blockAccess.isBlockNormalCube(var2, var3 - 1, var4) && !Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 - 1, var4)) {
+ float var37 = 0.2F;
+ float var20 = 1.0F / 16.0F;
+ if((var2 + var3 + var4 & 1) == 1) {
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ }
+
+ if((var2 / 2 + var3 / 2 + var4 / 2 & 1) == 1) {
+ var21 = var12;
+ var12 = var10;
+ var10 = var21;
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2 - 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)((float)var2 + var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2 + 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var37), (double)((float)var3 + var18 + var20), (double)(var4 + 0), var10, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 - 1)) {
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)var4 + var37), var12, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 + 1)) {
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var20), (double)(var4 + 1 - 0), var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18 + var20), (double)((float)(var4 + 1) - var37), var10, var14);
+ }
+
+ if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 + 1, var4)) {
+ var21 = (double)var2 + 0.5D + 0.5D;
+ var23 = (double)var2 + 0.5D - 0.5D;
+ var25 = (double)var4 + 0.5D + 0.5D;
+ var27 = (double)var4 + 0.5D - 0.5D;
+ var29 = (double)var2 + 0.5D - 0.5D;
+ var31 = (double)var2 + 0.5D + 0.5D;
+ var33 = (double)var4 + 0.5D - 0.5D;
+ double var35 = (double)var4 + 0.5D + 0.5D;
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)var9 / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ ++var3;
+ var18 = -0.2F;
+ if((var2 + var3 + var4 & 1) == 0) {
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 0), var12, var14);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 1), var10, var16);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 1), var10, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ var5.addVertexWithUV(var31, (double)((float)var3 + var18), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV(var23, (double)(var3 + 0), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV(var23, (double)(var3 + 0), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV(var31, (double)((float)var3 + var18), (double)(var4 + 0), var10, var14);
+ } else {
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var35, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var27, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var27, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var35, var10, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var33, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var25, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var25, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var33, var10, var14);
+ }
+ }
+ } else {
+ double var19 = (double)var2 + 0.5D + 0.2D;
+ var21 = (double)var2 + 0.5D - 0.2D;
+ var23 = (double)var4 + 0.5D + 0.2D;
+ var25 = (double)var4 + 0.5D - 0.2D;
+ var27 = (double)var2 + 0.5D - 0.3D;
+ var29 = (double)var2 + 0.5D + 0.3D;
+ var31 = (double)var4 + 0.5D - 0.3D;
+ var33 = (double)var4 + 0.5D + 0.3D;
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 0), var12, var14);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 1), var10, var16);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 1), var10, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)(var9 + 16) / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F + 16.0F) / 256.0F);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var33, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var25, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var25, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var33, var10, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var31, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var23, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var23, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var31, var10, var14);
+ var19 = (double)var2 + 0.5D - 0.5D;
+ var21 = (double)var2 + 0.5D + 0.5D;
+ var23 = (double)var4 + 0.5D - 0.5D;
+ var25 = (double)var4 + 0.5D + 0.5D;
+ var27 = (double)var2 + 0.5D - 0.4D;
+ var29 = (double)var2 + 0.5D + 0.4D;
+ var31 = (double)var4 + 0.5D - 0.4D;
+ var33 = (double)var4 + 0.5D + 0.4D;
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 0), var10, var14);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 0), var10, var16);
+ var5.addVertexWithUV(var19, (double)(var3 + 0), (double)(var4 + 1), var12, var16);
+ var5.addVertexWithUV(var27, (double)((float)var3 + var18), (double)(var4 + 1), var12, var14);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 1), var10, var14);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 1), var10, var16);
+ var5.addVertexWithUV(var21, (double)(var3 + 0), (double)(var4 + 0), var12, var16);
+ var5.addVertexWithUV(var29, (double)((float)var3 + var18), (double)(var4 + 0), var12, var14);
+ var10 = (double)((float)var8 / 256.0F);
+ var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ var14 = (double)((float)var9 / 256.0F);
+ var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var33, var10, var14);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var25, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var25, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var33, var12, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var18), var31, var10, var14);
+ var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var23, var10, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var23, var12, var16);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var18), var31, var12, var14);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockGears(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var6 = this.overrideBlockTexture;
+ }
+
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var7, var7, var7);
+ int var8 = ((var6 & 15) << 4) + 16;
+ int var9 = (var6 & 15) << 4;
+ int var10 = var6 & 240;
+ if((var2 + var3 + var4 & 1) == 1) {
+ var8 = (var6 & 15) << 4;
+ var9 = ((var6 & 15) << 4) + 16;
+ }
+
+ double var11 = (double)((float)var8 / 256.0F);
+ double var13 = (double)(((float)var8 + 15.99F) / 256.0F);
+ double var15 = (double)((float)var10 / 256.0F);
+ double var17 = (double)(((float)var10 + 15.99F) / 256.0F);
+ double var19 = (double)((float)var9 / 256.0F);
+ double var21 = (double)(((float)var9 + 15.99F) / 256.0F);
+ double var23 = (double)((float)var10 / 256.0F);
+ double var25 = (double)(((float)var10 + 15.99F) / 256.0F);
+ float var27 = 2.0F / 16.0F;
+ float var28 = 0.05F;
+ if(this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) + var27), var11, var15);
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) + var27), var11, var17);
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 0) - var27), var13, var17);
+ var5.addVertexWithUV((double)((float)var2 + var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 0) - var27), var13, var15);
+ }
+
+ if(this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) + var27), var13, var17);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) + var27), var13, var15);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 0) - var27), var11, var15);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var28), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 0) - var27), var11, var17);
+ }
+
+ if(this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 0) - var27), (double)((float)var4 + var28), var21, var25);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 1) + var27), (double)((float)var4 + var28), var21, var23);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 1) + var27), (double)((float)var4 + var28), var19, var23);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 0) - var27), (double)((float)var4 + var28), var19, var25);
+ }
+
+ if(this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1)) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) - var28), var19, var23);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var27), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) - var28), var19, var25);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 0) - var27), (double)((float)(var4 + 1) - var28), var21, var25);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var27), (double)((float)(var3 + 1) + var27), (double)((float)(var4 + 1) - var28), var21, var23);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockMinecartTrack(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ int var7 = var1.getBlockTextureFromSideAndMetadata(0, var6);
+ if(this.overrideBlockTexture >= 0) {
+ var7 = this.overrideBlockTexture;
+ }
+
+ float var8 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var8, var8, var8);
+ int var9 = (var7 & 15) << 4;
+ int var10 = var7 & 240;
+ double var11 = (double)((float)var9 / 256.0F);
+ double var13 = (double)(((float)var9 + 15.99F) / 256.0F);
+ double var15 = (double)((float)var10 / 256.0F);
+ double var17 = (double)(((float)var10 + 15.99F) / 256.0F);
+ float var19 = 1.0F / 16.0F;
+ float var20 = (float)(var2 + 1);
+ float var21 = (float)(var2 + 1);
+ float var22 = (float)(var2 + 0);
+ float var23 = (float)(var2 + 0);
+ float var24 = (float)(var4 + 0);
+ float var25 = (float)(var4 + 1);
+ float var26 = (float)(var4 + 1);
+ float var27 = (float)(var4 + 0);
+ float var28 = (float)var3 + var19;
+ float var29 = (float)var3 + var19;
+ float var30 = (float)var3 + var19;
+ float var31 = (float)var3 + var19;
+ if(var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) {
+ if(var6 == 8) {
+ var21 = (float)(var2 + 0);
+ var20 = var21;
+ var23 = (float)(var2 + 1);
+ var22 = var23;
+ var27 = (float)(var4 + 1);
+ var24 = var27;
+ var26 = (float)(var4 + 0);
+ var25 = var26;
+ } else if(var6 == 9) {
+ var23 = (float)(var2 + 0);
+ var20 = var23;
+ var22 = (float)(var2 + 1);
+ var21 = var22;
+ var25 = (float)(var4 + 0);
+ var24 = var25;
+ var27 = (float)(var4 + 1);
+ var26 = var27;
+ }
+ } else {
+ var23 = (float)(var2 + 1);
+ var20 = var23;
+ var22 = (float)(var2 + 0);
+ var21 = var22;
+ var25 = (float)(var4 + 1);
+ var24 = var25;
+ var27 = (float)(var4 + 0);
+ var26 = var27;
+ }
+
+ if(var6 != 2 && var6 != 4) {
+ if(var6 == 3 || var6 == 5) {
+ ++var29;
+ ++var30;
+ }
+ } else {
+ ++var28;
+ ++var31;
+ }
+
+ var5.addVertexWithUV((double)var20, (double)var28, (double)var24, var13, var15);
+ var5.addVertexWithUV((double)var21, (double)var29, (double)var25, var13, var17);
+ var5.addVertexWithUV((double)var22, (double)var30, (double)var26, var11, var17);
+ var5.addVertexWithUV((double)var23, (double)var31, (double)var27, var11, var15);
+ var5.addVertexWithUV((double)var23, (double)var31, (double)var27, var11, var15);
+ var5.addVertexWithUV((double)var22, (double)var30, (double)var26, var11, var17);
+ var5.addVertexWithUV((double)var21, (double)var29, (double)var25, var13, var17);
+ var5.addVertexWithUV((double)var20, (double)var28, (double)var24, var13, var15);
+ return true;
+ }
+
+ public boolean renderBlockLadder(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ int var6 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var6 = this.overrideBlockTexture;
+ }
+
+ float var7 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var7, var7, var7);
+ int var8 = (var6 & 15) << 4;
+ int var9 = var6 & 240;
+ double var10 = (double)((float)var8 / 256.0F);
+ double var12 = (double)(((float)var8 + 15.99F) / 256.0F);
+ double var14 = (double)((float)var9 / 256.0F);
+ double var16 = (double)(((float)var9 + 15.99F) / 256.0F);
+ int var18 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ float var19 = 0.0F;
+ float var20 = 0.05F;
+ if(var18 == 5) {
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) + var19), var10, var14);
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) + var19), var10, var16);
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 0) - var19), var12, var16);
+ var5.addVertexWithUV((double)((float)var2 + var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 0) - var19), var12, var14);
+ }
+
+ if(var18 == 4) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) + var19), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) + var19), var12, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 0) - var19), var10, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) - var20), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 0) - var19), var10, var16);
+ }
+
+ if(var18 == 3) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 0) - var19), (double)((float)var4 + var20), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 1) + var19), (double)((float)var4 + var20), var12, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 1) + var19), (double)((float)var4 + var20), var10, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 0) - var19), (double)((float)var4 + var20), var10, var16);
+ }
+
+ if(var18 == 2) {
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) - var20), var10, var14);
+ var5.addVertexWithUV((double)((float)(var2 + 1) + var19), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) - var20), var10, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 0) - var19), (double)((float)(var4 + 1) - var20), var12, var16);
+ var5.addVertexWithUV((double)((float)(var2 + 0) - var19), (double)((float)(var3 + 1) + var19), (double)((float)(var4 + 1) - var20), var12, var14);
+ }
+
+ return true;
+ }
+
+ public boolean renderBlockReed(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ float var6 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var6, var6, var6);
+ this.renderCrossedSquares(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), (double)var2, (double)var3, (double)var4);
+ return true;
+ }
+
+ public boolean renderBlockCrops(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ float var6 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var6, var6, var6);
+ this.renderBlockCropsImpl(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4);
+ return true;
+ }
+
+ public void renderTorchAtAngle(Block var1, double var2, double var4, double var6, double var8, double var10) {
+ Tessellator var12 = Tessellator.instance;
+ int var13 = var1.getBlockTextureFromSide(0);
+ if(this.overrideBlockTexture >= 0) {
+ var13 = this.overrideBlockTexture;
+ }
+
+ int var14 = (var13 & 15) << 4;
+ int var15 = var13 & 240;
+ float var16 = (float)var14 / 256.0F;
+ float var17 = ((float)var14 + 15.99F) / 256.0F;
+ float var18 = (float)var15 / 256.0F;
+ float var19 = ((float)var15 + 15.99F) / 256.0F;
+ double var20 = (double)var16 + 1.75D / 64.0D;
+ double var22 = (double)var18 + 6.0D / 256.0D;
+ double var24 = (double)var16 + 9.0D / 256.0D;
+ double var26 = (double)var18 + 1.0D / 32.0D;
+ var2 += 0.5D;
+ var6 += 0.5D;
+ double var28 = var2 - 0.5D;
+ double var30 = var2 + 0.5D;
+ double var32 = var6 - 0.5D;
+ double var34 = var6 + 0.5D;
+ double var36 = 1.0D / 16.0D;
+ double var38 = 0.625D;
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) - var36, var4 + var38, var6 + var10 * (1.0D - var38) - var36, var20, var22);
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) - var36, var4 + var38, var6 + var10 * (1.0D - var38) + var36, var20, var26);
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) + var36, var4 + var38, var6 + var10 * (1.0D - var38) + var36, var24, var26);
+ var12.addVertexWithUV(var2 + var8 * (1.0D - var38) + var36, var4 + var38, var6 + var10 * (1.0D - var38) - var36, var24, var22);
+ var12.addVertexWithUV(var2 - var36, var4 + 1.0D, var32, (double)var16, (double)var18);
+ var12.addVertexWithUV(var2 - var36 + var8, var4 + 0.0D, var32 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var2 - var36 + var8, var4 + 0.0D, var34 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var2 - var36, var4 + 1.0D, var34, (double)var17, (double)var18);
+ var12.addVertexWithUV(var2 + var36, var4 + 1.0D, var34, (double)var16, (double)var18);
+ var12.addVertexWithUV(var2 + var8 + var36, var4 + 0.0D, var34 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var2 + var8 + var36, var4 + 0.0D, var32 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var2 + var36, var4 + 1.0D, var32, (double)var17, (double)var18);
+ var12.addVertexWithUV(var28, var4 + 1.0D, var6 + var36, (double)var16, (double)var18);
+ var12.addVertexWithUV(var28 + var8, var4 + 0.0D, var6 + var36 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var30 + var8, var4 + 0.0D, var6 + var36 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var30, var4 + 1.0D, var6 + var36, (double)var17, (double)var18);
+ var12.addVertexWithUV(var30, var4 + 1.0D, var6 - var36, (double)var16, (double)var18);
+ var12.addVertexWithUV(var30 + var8, var4 + 0.0D, var6 - var36 + var10, (double)var16, (double)var19);
+ var12.addVertexWithUV(var28 + var8, var4 + 0.0D, var6 - var36 + var10, (double)var17, (double)var19);
+ var12.addVertexWithUV(var28, var4 + 1.0D, var6 - var36, (double)var17, (double)var18);
+ }
+
+ public void renderCrossedSquares(Block var1, int var2, double var3, double var5, double var7) {
+ Tessellator var9 = Tessellator.instance;
+ int var10 = var1.getBlockTextureFromSideAndMetadata(0, var2);
+ if(this.overrideBlockTexture >= 0) {
+ var10 = this.overrideBlockTexture;
+ }
+
+ int var11 = (var10 & 15) << 4;
+ int var12 = var10 & 240;
+ double var13 = (double)((float)var11 / 256.0F);
+ double var15 = (double)(((float)var11 + 15.99F) / 256.0F);
+ double var17 = (double)((float)var12 / 256.0F);
+ double var19 = (double)(((float)var12 + 15.99F) / 256.0F);
+ double var21 = var3 + 0.5D - (double)0.45F;
+ double var23 = var3 + 0.5D + (double)0.45F;
+ double var25 = var7 + 0.5D - (double)0.45F;
+ double var27 = var7 + 0.5D + (double)0.45F;
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var15, var17);
+ }
+
+ public void renderBlockCropsImpl(Block var1, int var2, double var3, double var5, double var7) {
+ Tessellator var9 = Tessellator.instance;
+ int var10 = var1.getBlockTextureFromSideAndMetadata(0, var2);
+ if(this.overrideBlockTexture >= 0) {
+ var10 = this.overrideBlockTexture;
+ }
+
+ int var11 = (var10 & 15) << 4;
+ int var12 = var10 & 240;
+ double var13 = (double)((float)var11 / 256.0F);
+ double var15 = (double)(((float)var11 + 15.99F) / 256.0F);
+ double var17 = (double)((float)var12 / 256.0F);
+ double var19 = (double)(((float)var12 + 15.99F) / 256.0F);
+ double var21 = var3 + 0.5D - 0.25D;
+ double var23 = var3 + 0.5D + 0.25D;
+ double var25 = var7 + 0.5D - 0.5D;
+ double var27 = var7 + 0.5D + 0.5D;
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var15, var17);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var15, var17);
+ var21 = var3 + 0.5D - 0.5D;
+ var23 = var3 + 0.5D + 0.5D;
+ var25 = var7 + 0.5D - 0.25D;
+ var27 = var7 + 0.5D + 0.25D;
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var25, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var25, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var17);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var15, var17);
+ var9.addVertexWithUV(var21, var5 + 1.0D, var27, var13, var17);
+ var9.addVertexWithUV(var21, var5 + 0.0D, var27, var13, var19);
+ var9.addVertexWithUV(var23, var5 + 0.0D, var27, var15, var19);
+ var9.addVertexWithUV(var23, var5 + 1.0D, var27, var15, var17);
+ }
+
+ public boolean renderBlockFluids(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ boolean var6 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1);
+ boolean var7 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0);
+ boolean[] var8 = 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(!var6 && !var7 && !var8[0] && !var8[1] && !var8[2] && !var8[3]) {
+ return false;
+ } else {
+ boolean var9 = false;
+ float var10 = 0.5F;
+ float var11 = 1.0F;
+ float var12 = 0.8F;
+ float var13 = 0.6F;
+ double var14 = 0.0D;
+ double var16 = 1.0D;
+ Material var18 = var1.blockMaterial;
+ int var19 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ float var20 = this.getFluidHeight(var2, var3, var4, var18);
+ float var21 = this.getFluidHeight(var2, var3, var4 + 1, var18);
+ float var22 = this.getFluidHeight(var2 + 1, var3, var4 + 1, var18);
+ float var23 = this.getFluidHeight(var2 + 1, var3, var4, var18);
+ int var24;
+ int var27;
+ float var32;
+ float var33;
+ float var34;
+ if(this.renderAllFaces || var6) {
+ var9 = true;
+ var24 = var1.getBlockTextureFromSideAndMetadata(1, var19);
+ float var25 = (float)BlockFluid.getFlowDirection(this.blockAccess, var2, var3, var4, var18);
+ if(var25 > -999.0F) {
+ var24 = var1.getBlockTextureFromSideAndMetadata(2, var19);
+ }
+
+ int var26 = (var24 & 15) << 4;
+ var27 = var24 & 240;
+ double var28 = ((double)var26 + 8.0D) / 256.0D;
+ double var30 = ((double)var27 + 8.0D) / 256.0D;
+ if(var25 < -999.0F) {
+ var25 = 0.0F;
+ } else {
+ var28 = (double)((float)(var26 + 16) / 256.0F);
+ var30 = (double)((float)(var27 + 16) / 256.0F);
+ }
+
+ var32 = MathHelper.sin(var25) * 8.0F / 256.0F;
+ var33 = MathHelper.cos(var25) * 8.0F / 256.0F;
+ var34 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ var5.setColorOpaque_F(var11 * var34, var11 * var34, var11 * var34);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var20), (double)(var4 + 0), var28 - (double)var33 - (double)var32, var30 - (double)var33 + (double)var32);
+ var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var21), (double)(var4 + 1), var28 - (double)var33 + (double)var32, var30 + (double)var33 + (double)var32);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var22), (double)(var4 + 1), var28 + (double)var33 + (double)var32, var30 + (double)var33 - (double)var32);
+ var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var23), (double)(var4 + 0), var28 + (double)var33 - (double)var32, var30 - (double)var33 - (double)var32);
+ }
+
+ if(this.renderAllFaces || var7) {
+ float var48 = var1.getBlockBrightness(this.blockAccess, var2, var3 - 1, var4);
+ var5.setColorOpaque_F(var10 * var48, var10 * var48, var10 * var48);
+ this.renderBottomFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureFromSide(0));
+ var9 = true;
+ }
+
+ for(var24 = 0; var24 < 4; ++var24) {
+ int var49 = var2;
+ var27 = var4;
+ if(var24 == 0) {
+ var27 = var4 - 1;
+ }
+
+ if(var24 == 1) {
+ ++var27;
+ }
+
+ if(var24 == 2) {
+ var49 = var2 - 1;
+ }
+
+ if(var24 == 3) {
+ ++var49;
+ }
+
+ int var50 = var1.getBlockTextureFromSideAndMetadata(var24 + 2, var19);
+ int var29 = (var50 & 15) << 4;
+ int var51 = var50 & 240;
+ if(this.renderAllFaces || var8[var24]) {
+ float var31;
+ float var35;
+ float var36;
+ if(var24 == 0) {
+ var31 = var20;
+ var32 = var23;
+ var33 = (float)var2;
+ var35 = (float)(var2 + 1);
+ var34 = (float)var4;
+ var36 = (float)var4;
+ } else if(var24 == 1) {
+ var31 = var22;
+ var32 = var21;
+ var33 = (float)(var2 + 1);
+ var35 = (float)var2;
+ var34 = (float)(var4 + 1);
+ var36 = (float)(var4 + 1);
+ } else if(var24 == 2) {
+ var31 = var21;
+ var32 = var20;
+ var33 = (float)var2;
+ var35 = (float)var2;
+ var34 = (float)(var4 + 1);
+ var36 = (float)var4;
+ } else {
+ var31 = var23;
+ var32 = var22;
+ var33 = (float)(var2 + 1);
+ var35 = (float)(var2 + 1);
+ var34 = (float)var4;
+ var36 = (float)(var4 + 1);
+ }
+
+ var9 = true;
+ double var37 = (double)((float)(var29 + 0) / 256.0F);
+ double var39 = ((double)(var29 + 16) - 0.01D) / 256.0D;
+ double var41 = (double)(((float)var51 + (1.0F - var31) * 16.0F) / 256.0F);
+ double var43 = (double)(((float)var51 + (1.0F - var32) * 16.0F) / 256.0F);
+ double var45 = ((double)(var51 + 16) - 0.01D) / 256.0D;
+ float var47 = var1.getBlockBrightness(this.blockAccess, var49, var3, var27);
+ if(var24 < 2) {
+ var47 *= var12;
+ } else {
+ var47 *= var13;
+ }
+
+ var5.setColorOpaque_F(var11 * var47, var11 * var47, var11 * var47);
+ var5.addVertexWithUV((double)var33, (double)((float)var3 + var31), (double)var34, var37, var41);
+ var5.addVertexWithUV((double)var35, (double)((float)var3 + var32), (double)var36, var39, var43);
+ var5.addVertexWithUV((double)var35, (double)(var3 + 0), (double)var36, var39, var45);
+ var5.addVertexWithUV((double)var33, (double)(var3 + 0), (double)var34, var37, var45);
+ }
+ }
+
+ var1.minY = var14;
+ var1.maxY = var16;
+ return var9;
+ }
+ }
+
+ private float getFluidHeight(int var1, int var2, int var3, Material var4) {
+ 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) {
+ 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) {
+ var6 += BlockFluid.getPercentAir(var12) * 10.0F;
+ var5 += 10;
+ }
+
+ var6 += BlockFluid.getPercentAir(var12);
+ ++var5;
+ }
+ }
+
+ return 1.0F - var6 / (float)var5;
+ }
+
+ public void renderBlockFallingSand(Block var1, World var2, int var3, int var4, int var5) {
+ float var6 = 0.5F;
+ float var7 = 1.0F;
+ float var8 = 0.8F;
+ float var9 = 0.6F;
+ Tessellator var10 = Tessellator.instance;
+ var10.startDrawingQuads();
+ float var11 = var1.getBlockBrightness(var2, var3, var4, var5);
+ float var12 = var1.getBlockBrightness(var2, var3, var4 - 1, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var6 * var12, var6 * var12, var6 * var12);
+ this.renderBottomFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(0));
+ var12 = var1.getBlockBrightness(var2, var3, var4 + 1, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var7 * var12, var7 * var12, var7 * var12);
+ this.renderTopFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(1));
+ var12 = var1.getBlockBrightness(var2, var3, var4, var5 - 1);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var8 * var12, var8 * var12, var8 * var12);
+ this.renderEastFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(2));
+ var12 = var1.getBlockBrightness(var2, var3, var4, var5 + 1);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var8 * var12, var8 * var12, var8 * var12);
+ this.renderWestFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(3));
+ var12 = var1.getBlockBrightness(var2, var3 - 1, var4, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var9 * var12, var9 * var12, var9 * var12);
+ this.renderNorthFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(4));
+ var12 = var1.getBlockBrightness(var2, var3 + 1, var4, var5);
+ if(var12 < var11) {
+ var12 = var11;
+ }
+
+ var10.setColorOpaque_F(var9 * var12, var9 * var12, var9 * var12);
+ this.renderSouthFace(var1, -0.5D, -0.5D, -0.5D, var1.getBlockTextureFromSide(5));
+ var10.draw();
+ }
+
+ public boolean renderStandardBlock(Block var1, int var2, int var3, int var4) {
+ int var5 = var1.getRenderColor(this.blockAccess, var2, var3, var4);
+ float var6 = (float)(var5 >> 16 & 255) / 255.0F;
+ float var7 = (float)(var5 >> 8 & 255) / 255.0F;
+ float var8 = (float)(var5 & 255) / 255.0F;
+ return this.renderStandardBlockWithColorMultiplier(var1, var2, var3, var4, var6, var7, var8);
+ }
+
+ public boolean renderStandardBlockWithColorMultiplier(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) {
+ 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 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ float var27;
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3 - 1, var4);
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var14 * var27, var18 * var27, var22 * var27);
+ this.renderBottomFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 0));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3 + 1, var4);
+ if(var1.maxY != 1.0D && !var1.blockMaterial.getIsLiquid()) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var15 * var27, var19 * var27, var23 * var27);
+ this.renderTopFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 1));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 - 1);
+ if(var1.minZ > 0.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var16 * var27, var20 * var27, var24 * var27);
+ this.renderEastFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 2));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 + 1);
+ if(var1.maxZ < 1.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var16 * var27, var20 * var27, var24 * var27);
+ this.renderWestFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 3));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2 - 1, var3, var4);
+ if(var1.minX > 0.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var17 * var27, var21 * var27, var25 * var27);
+ this.renderNorthFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 4));
+ var9 = true;
+ }
+
+ if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) {
+ var27 = var1.getBlockBrightness(this.blockAccess, var2 + 1, var3, var4);
+ if(var1.maxX < 1.0D) {
+ var27 = var26;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var27 = 1.0F;
+ }
+
+ var8.setColorOpaque_F(var17 * var27, var21 * var27, var25 * var27);
+ this.renderSouthFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 5));
+ var9 = true;
+ }
+
+ return var9;
+ }
+
+ public boolean renderBlockFence(Block var1, int var2, int var3, int var4) {
+ boolean var5 = false;
+ float var6 = 6.0F / 16.0F;
+ float var7 = 10.0F / 16.0F;
+ var1.setBlockBounds(var6, 0.0F, var6, var7, 1.0F, var7);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ boolean var8 = false;
+ boolean var9 = false;
+ if(this.blockAccess.getBlockId(var2 - 1, var3, var4) == var1.blockID || this.blockAccess.getBlockId(var2 + 1, var3, var4) == var1.blockID) {
+ var8 = true;
+ }
+
+ if(this.blockAccess.getBlockId(var2, var3, var4 - 1) == var1.blockID || this.blockAccess.getBlockId(var2, var3, var4 + 1) == var1.blockID) {
+ var9 = true;
+ }
+
+ if(!var8 && !var9) {
+ var8 = true;
+ }
+
+ var6 = 7.0F / 16.0F;
+ var7 = 9.0F / 16.0F;
+ float var10 = 12.0F / 16.0F;
+ float var11 = 15.0F / 16.0F;
+ if(var8) {
+ var1.setBlockBounds(0.0F, var10, var6, 1.0F, var11, var7);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ if(var9) {
+ var1.setBlockBounds(var6, var10, 0.0F, var7, var11, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ var10 = 6.0F / 16.0F;
+ var11 = 9.0F / 16.0F;
+ if(var8) {
+ var1.setBlockBounds(0.0F, var10, var6, 1.0F, var11, var7);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ if(var9) {
+ var1.setBlockBounds(var6, var10, 0.0F, var7, var11, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ return var5;
+ }
+
+ public boolean renderBlockStairs(Block var1, int var2, int var3, int var4) {
+ boolean var5 = false;
+ int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4);
+ if(var6 == 0) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ } else if(var6 == 1) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ } else if(var6 == 2) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ } else if(var6 == 3) {
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ var1.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
+ this.renderStandardBlock(var1, var2, var3, var4);
+ }
+
+ var1.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ return var5;
+ }
+
+ public boolean renderBlockDoor(Block var1, int var2, int var3, int var4) {
+ Tessellator var5 = Tessellator.instance;
+ BlockDoor var6 = (BlockDoor)var1;
+ boolean var7 = false;
+ float var8 = 0.5F;
+ float var9 = 1.0F;
+ float var10 = 0.8F;
+ float var11 = 0.6F;
+ float var12 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4);
+ float var13 = var1.getBlockBrightness(this.blockAccess, var2, var3 - 1, var4);
+ if(var6.minY > 0.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var8 * var13, var8 * var13, var8 * var13);
+ this.renderBottomFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 0));
+ var7 = true;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2, var3 + 1, var4);
+ if(var6.maxY < 1.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13);
+ this.renderTopFace(var1, (double)var2, (double)var3, (double)var4, var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 1));
+ var7 = true;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 - 1);
+ if(var6.minZ > 0.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13);
+ int var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 2);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderEastFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4 + 1);
+ if(var6.maxZ < 1.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13);
+ var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 3);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderWestFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2 - 1, var3, var4);
+ if(var6.minX > 0.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var11 * var13, var11 * var13, var11 * var13);
+ var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 4);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderNorthFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ var13 = var1.getBlockBrightness(this.blockAccess, var2 + 1, var3, var4);
+ if(var6.maxX < 1.0D) {
+ var13 = var12;
+ }
+
+ if(Block.lightValue[var1.blockID] > 0) {
+ var13 = 1.0F;
+ }
+
+ var5.setColorOpaque_F(var11 * var13, var11 * var13, var11 * var13);
+ var14 = var1.getBlockTextureGeneric(this.blockAccess, var2, var3, var4, 5);
+ if(var14 < 0) {
+ this.flipTexture = true;
+ var14 = -var14;
+ }
+
+ this.renderSouthFace(var1, (double)var2, (double)var3, (double)var4, var14);
+ var7 = true;
+ this.flipTexture = false;
+ return var7;
+ }
+
+ public void renderBottomFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minZ * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ double var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.minY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var24, var28, var12, var18);
+ var9.addVertexWithUV(var20, var24, var26, var12, var16);
+ var9.addVertexWithUV(var22, var24, var26, var14, var16);
+ var9.addVertexWithUV(var22, var24, var28, var14, var18);
+ }
+
+ public void renderTopFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minZ * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ double var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.maxY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var22, var24, var28, var14, var18);
+ var9.addVertexWithUV(var22, var24, var26, var14, var16);
+ var9.addVertexWithUV(var20, var24, var26, var12, var16);
+ var9.addVertexWithUV(var20, var24, var28, var12, var18);
+ }
+
+ public void renderEastFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.minY;
+ double var26 = var4 + var1.maxY;
+ double var28 = var6 + var1.minZ;
+ var9.addVertexWithUV(var20, var26, var28, var14, var16);
+ var9.addVertexWithUV(var22, var26, var28, var12, var16);
+ var9.addVertexWithUV(var22, var24, var28, var12, var18);
+ var9.addVertexWithUV(var20, var24, var28, var14, var18);
+ }
+
+ public void renderWestFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minX * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxX * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minX < 0.0D || var1.maxX > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.minX;
+ double var22 = var2 + var1.maxX;
+ double var24 = var4 + var1.minY;
+ double var26 = var4 + var1.maxY;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var26, var28, var12, var16);
+ var9.addVertexWithUV(var20, var24, var28, var12, var18);
+ var9.addVertexWithUV(var22, var24, var28, var14, var18);
+ var9.addVertexWithUV(var22, var26, var28, var14, var16);
+ }
+
+ public void renderNorthFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minZ * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.minX;
+ double var22 = var4 + var1.minY;
+ double var24 = var4 + var1.maxY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var24, var28, var14, var16);
+ var9.addVertexWithUV(var20, var24, var26, var12, var16);
+ var9.addVertexWithUV(var20, var22, var26, var12, var18);
+ var9.addVertexWithUV(var20, var22, var28, var14, var18);
+ }
+
+ public void renderSouthFace(Block var1, double var2, double var4, double var6, int var8) {
+ Tessellator var9 = Tessellator.instance;
+ if(this.overrideBlockTexture >= 0) {
+ var8 = this.overrideBlockTexture;
+ }
+
+ int var10 = (var8 & 15) << 4;
+ int var11 = var8 & 240;
+ double var12 = ((double)var10 + var1.minZ * 16.0D) / 256.0D;
+ double var14 = ((double)var10 + var1.maxZ * 16.0D - 0.01D) / 256.0D;
+ double var16 = ((double)var11 + var1.minY * 16.0D) / 256.0D;
+ double var18 = ((double)var11 + var1.maxY * 16.0D - 0.01D) / 256.0D;
+ double var20;
+ if(this.flipTexture) {
+ var20 = var12;
+ var12 = var14;
+ var14 = var20;
+ }
+
+ if(var1.minZ < 0.0D || var1.maxZ > 1.0D) {
+ var12 = (double)(((float)var10 + 0.0F) / 256.0F);
+ var14 = (double)(((float)var10 + 15.99F) / 256.0F);
+ }
+
+ if(var1.minY < 0.0D || var1.maxY > 1.0D) {
+ var16 = (double)(((float)var11 + 0.0F) / 256.0F);
+ var18 = (double)(((float)var11 + 15.99F) / 256.0F);
+ }
+
+ var20 = var2 + var1.maxX;
+ double var22 = var4 + var1.minY;
+ double var24 = var4 + var1.maxY;
+ double var26 = var6 + var1.minZ;
+ double var28 = var6 + var1.maxZ;
+ var9.addVertexWithUV(var20, var22, var28, var12, var18);
+ var9.addVertexWithUV(var20, var22, var26, var14, var18);
+ var9.addVertexWithUV(var20, var24, var26, var14, var16);
+ var9.addVertexWithUV(var20, var24, var28, var12, var16);
+ }
+
+ public void renderBlockOnInventory(Block var1) {
+ byte var2 = -1;
+ Tessellator var3 = Tessellator.instance;
+ int var4 = var1.getRenderType();
+ if(var4 == 0) {
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderBottomFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(0));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, 1.0F, 0.0F);
+ this.renderTopFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(1));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, 0.0F, -1.0F);
+ this.renderEastFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(2));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, 0.0F, 1.0F);
+ this.renderWestFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(3));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(-1.0F, 0.0F, 0.0F);
+ this.renderNorthFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(4));
+ var3.draw();
+ var3.startDrawingQuads();
+ var3.setNormal(1.0F, 0.0F, 0.0F);
+ this.renderSouthFace(var1, 0.0D, 0.0D, 0.0D, var1.getBlockTextureFromSide(5));
+ var3.draw();
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ } else if(var4 == 1) {
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderCrossedSquares(var1, var2, -0.5D, -0.5D, -0.5D);
+ var3.draw();
+ } else if(var4 == 6) {
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderBlockCropsImpl(var1, var2, -0.5D, -0.5D, -0.5D);
+ var3.draw();
+ } else if(var4 == 2) {
+ var3.startDrawingQuads();
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ this.renderTorchAtAngle(var1, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D);
+ var3.draw();
+ } else if(var4 != 3 && var4 == 5) {
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/RenderCreeper.java b/src/net/minecraft/src/RenderCreeper.java
new file mode 100644
index 0000000..1790664
--- /dev/null
+++ b/src/net/minecraft/src/RenderCreeper.java
@@ -0,0 +1,56 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderCreeper extends RenderLiving {
+ public RenderCreeper() {
+ super(new ModelCreeper(), 0.5F);
+ }
+
+ protected void a(EntityCreeper var1, float var2) {
+ float var4 = var1.setCreeperFlashTime(var2);
+ float var5 = 1.0F + MathHelper.sin(var4 * 100.0F) * var4 * 0.01F;
+ if(var4 < 0.0F) {
+ var4 = 0.0F;
+ }
+
+ if(var4 > 1.0F) {
+ var4 = 1.0F;
+ }
+
+ var4 *= var4;
+ var4 *= var4;
+ float var6 = (1.0F + var4 * 0.4F) * var5;
+ float var7 = (1.0F + var4 * 0.1F) / var5;
+ GL11.glScalef(var6, var7, var6);
+ }
+
+ protected int a(EntityCreeper var1, float var2, float var3) {
+ float var5 = var1.setCreeperFlashTime(var3);
+ if((int)(var5 * 10.0F) % 2 == 0) {
+ return 0;
+ } else {
+ int var6 = (int)(var5 * 0.2F * 255.0F);
+ if(var6 < 0) {
+ var6 = 0;
+ }
+
+ if(var6 > 255) {
+ var6 = 255;
+ }
+
+ short var7 = 255;
+ short var8 = 255;
+ short var9 = 255;
+ return var6 << 24 | var7 << 16 | var8 << 8 | var9;
+ }
+ }
+
+ protected void preRenderCallback(EntityLiving var1, float var2) {
+ this.a((EntityCreeper)var1, var2);
+ }
+
+ protected int getColorMultiplier(EntityLiving var1, float var2, float var3) {
+ return this.a((EntityCreeper)var1, var2, var3);
+ }
+}
diff --git a/src/net/minecraft/src/RenderEngine.java b/src/net/minecraft/src/RenderEngine.java
new file mode 100644
index 0000000..eacb516
--- /dev/null
+++ b/src/net/minecraft/src/RenderEngine.java
@@ -0,0 +1,254 @@
+package net.minecraft.src;
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import javax.imageio.ImageIO;
+import org.lwjgl.opengl.GL11;
+
+public class RenderEngine {
+ private HashMap textureMap = new HashMap();
+ private HashMap textureContentsMap = new HashMap();
+ private IntBuffer singleIntBuffer = GLAllocation.createIntBuffer(1);
+ private ByteBuffer imageData = GLAllocation.createDirectByteBuffer(262144);
+ private List textureList = new ArrayList();
+ private Map urlToImageDataMap = new HashMap();
+ private GameSettings options;
+ private boolean clampTexture = false;
+
+ public RenderEngine(GameSettings var1) {
+ this.options = var1;
+ }
+
+ public int getTexture(String var1) {
+ Integer var2 = (Integer)this.textureMap.get(var1);
+ if(var2 != null) {
+ return var2.intValue();
+ } else {
+ try {
+ this.singleIntBuffer.clear();
+ GLAllocation.generateDisplayLists(this.singleIntBuffer);
+ int var4 = this.singleIntBuffer.get(0);
+ if(var1.startsWith("##")) {
+ this.setupTexture(this.unwrapImageByColumns(ImageIO.read(RenderEngine.class.getResourceAsStream(var1.substring(2)))), var4);
+ } else if(var1.startsWith("%%")) {
+ this.clampTexture = true;
+ this.setupTexture(ImageIO.read(RenderEngine.class.getResourceAsStream(var1.substring(2))), var4);
+ this.clampTexture = false;
+ } else {
+ this.setupTexture(ImageIO.read(RenderEngine.class.getResourceAsStream(var1)), var4);
+ }
+
+ this.textureMap.put(var1, Integer.valueOf(var4));
+ return var4;
+ } catch (IOException var3) {
+ throw new RuntimeException("!!");
+ }
+ }
+ }
+
+ private BufferedImage unwrapImageByColumns(BufferedImage var1) {
+ int var2 = var1.getWidth() / 16;
+ BufferedImage var3 = new BufferedImage(16, var1.getHeight() * var2, 2);
+ Graphics var4 = var3.getGraphics();
+
+ for(int var5 = 0; var5 < var2; ++var5) {
+ var4.drawImage(var1, -var5 * 16, var5 * var1.getHeight(), (ImageObserver)null);
+ }
+
+ var4.dispose();
+ return var3;
+ }
+
+ public int allocateAndSetupTexture(BufferedImage var1) {
+ this.singleIntBuffer.clear();
+ GLAllocation.generateDisplayLists(this.singleIntBuffer);
+ int var2 = this.singleIntBuffer.get(0);
+ this.setupTexture(var1, var2);
+ this.textureContentsMap.put(Integer.valueOf(var2), var1);
+ return var2;
+ }
+
+ public void setupTexture(BufferedImage var1, int var2) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2);
+ 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);
+ if(this.clampTexture) {
+ 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);
+ }
+
+ int var3 = var1.getWidth();
+ int var4 = var1.getHeight();
+ int[] var5 = new int[var3 * var4];
+ byte[] var6 = new byte[var3 * var4 * 4];
+ var1.getRGB(0, 0, var3, var4, var5, 0, var3);
+
+ for(int var7 = 0; var7 < var5.length; ++var7) {
+ int var8 = var5[var7] >> 24 & 255;
+ int var9 = var5[var7] >> 16 & 255;
+ int var10 = var5[var7] >> 8 & 255;
+ int var11 = var5[var7] & 255;
+ if(this.options != null && this.options.anaglyph) {
+ int var12 = (var9 * 30 + var10 * 59 + var11 * 11) / 100;
+ int var13 = (var9 * 30 + var10 * 70) / 100;
+ int var14 = (var9 * 30 + var11 * 70) / 100;
+ var9 = var12;
+ var10 = var13;
+ var11 = var14;
+ }
+
+ var6[var7 * 4 + 0] = (byte)var9;
+ var6[var7 * 4 + 1] = (byte)var10;
+ var6[var7 * 4 + 2] = (byte)var11;
+ var6[var7 * 4 + 3] = (byte)var8;
+ }
+
+ this.imageData.clear();
+ this.imageData.put(var6);
+ this.imageData.position(0).limit(var6.length);
+ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, var3, var4, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
+ }
+
+ public void deleteTexture(int var1) {
+ this.textureContentsMap.remove(Integer.valueOf(var1));
+ this.singleIntBuffer.clear();
+ this.singleIntBuffer.put(var1);
+ this.singleIntBuffer.flip();
+ GL11.glDeleteTextures(this.singleIntBuffer);
+ }
+
+ public int getTextureForDownloadableImage(String var1, String var2) {
+ ThreadDownloadImageData var3 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
+ if(var3 != null && var3.image != null && !var3.textureSetupComplete) {
+ if(var3.textureName < 0) {
+ var3.textureName = this.allocateAndSetupTexture(var3.image);
+ } else {
+ this.setupTexture(var3.image, var3.textureName);
+ }
+
+ var3.textureSetupComplete = true;
+ }
+
+ return var3 != null && var3.textureName >= 0 ? var3.textureName : this.getTexture(var2);
+ }
+
+ public ThreadDownloadImageData obtainImageData(String var1, ImageBuffer var2) {
+ ThreadDownloadImageData var3 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
+ if(var3 == null) {
+ this.urlToImageDataMap.put(var1, new ThreadDownloadImageData(var1, var2));
+ } else {
+ ++var3.referenceCount;
+ }
+
+ return var3;
+ }
+
+ public void releaseImageData(String var1) {
+ ThreadDownloadImageData var2 = (ThreadDownloadImageData)this.urlToImageDataMap.get(var1);
+ if(var2 != null) {
+ --var2.referenceCount;
+ if(var2.referenceCount == 0) {
+ if(var2.textureName >= 0) {
+ this.deleteTexture(var2.textureName);
+ }
+
+ this.urlToImageDataMap.remove(var1);
+ }
+ }
+
+ }
+
+ public void registerTextureFX(TextureFX var1) {
+ this.textureList.add(var1);
+ var1.onTick();
+ }
+
+ public void updateDynamicTextures() {
+ int var1;
+ TextureFX var2;
+ for(var1 = 0; var1 < this.textureList.size(); ++var1) {
+ var2 = (TextureFX)this.textureList.get(var1);
+ var2.anaglyphEnabled = this.options.anaglyph;
+ var2.onTick();
+ this.imageData.clear();
+ this.imageData.put(var2.imageData);
+ this.imageData.position(0).limit(var2.imageData.length);
+
+ for(int var3 = 0; var3 < var2.tileSize; ++var3) {
+ for(int var4 = 0; var4 < var2.tileSize; ++var4) {
+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var2.iconIndex % 16 * 16 + var3 * 16, var2.iconIndex / 16 * 16 + var4 * 16, 16, 16, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
+ }
+ }
+ }
+
+ for(var1 = 0; var1 < this.textureList.size(); ++var1) {
+ var2 = (TextureFX)this.textureList.get(var1);
+ if(var2.textureId > 0) {
+ this.imageData.clear();
+ this.imageData.put(var2.imageData);
+ this.imageData.position(0).limit(var2.imageData.length);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var2.textureId);
+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 16, 16, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
+ }
+ }
+
+ }
+
+ public void refreshTextures() {
+ Iterator var1 = this.textureContentsMap.keySet().iterator();
+
+ BufferedImage var3;
+ while(var1.hasNext()) {
+ int var2 = ((Integer)var1.next()).intValue();
+ var3 = (BufferedImage)this.textureContentsMap.get(Integer.valueOf(var2));
+ this.setupTexture(var3, var2);
+ }
+
+ ThreadDownloadImageData var6;
+ for(var1 = this.urlToImageDataMap.values().iterator(); var1.hasNext(); var6.textureSetupComplete = false) {
+ var6 = (ThreadDownloadImageData)var1.next();
+ }
+
+ var1 = this.textureMap.keySet().iterator();
+
+ while(var1.hasNext()) {
+ String var7 = (String)var1.next();
+
+ try {
+ if(var7.startsWith("##")) {
+ var3 = this.unwrapImageByColumns(ImageIO.read(RenderEngine.class.getResourceAsStream(var7.substring(2))));
+ } else if(var7.startsWith("%%")) {
+ this.clampTexture = true;
+ var3 = ImageIO.read(RenderEngine.class.getResourceAsStream(var7.substring(2)));
+ this.clampTexture = false;
+ } else {
+ var3 = ImageIO.read(RenderEngine.class.getResourceAsStream(var7));
+ }
+
+ int var4 = ((Integer)this.textureMap.get(var7)).intValue();
+ this.setupTexture(var3, var4);
+ } catch (IOException var5) {
+ var5.printStackTrace();
+ }
+ }
+
+ }
+
+ public void bindTexture(int var1) {
+ if(var1 >= 0) {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1);
+ }
+ }
+}
diff --git a/src/net/minecraft/src/RenderEntity.java b/src/net/minecraft/src/RenderEntity.java
new file mode 100644
index 0000000..52836e9
--- /dev/null
+++ b/src/net/minecraft/src/RenderEntity.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+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) {
+ GL11.glPushMatrix();
+ renderOffsetAABB(var1.boundingBox, var2 - var1.lastTickPosX, var4 - var1.lastTickPosY, var6 - var1.lastTickPosZ);
+ GL11.glPopMatrix();
+ }
+}
diff --git a/src/net/minecraft/src/RenderFallingSand.java b/src/net/minecraft/src/RenderFallingSand.java
new file mode 100644
index 0000000..3f633d1
--- /dev/null
+++ b/src/net/minecraft/src/RenderFallingSand.java
@@ -0,0 +1,27 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderFallingSand extends Render {
+ private RenderBlocks sandRenderBlocks = new RenderBlocks();
+
+ public RenderFallingSand() {
+ this.shadowSize = 0.5F;
+ }
+
+ public void a(EntityFallingSand var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ this.loadTexture("/terrain.png");
+ Block var10 = Block.blocksList[var1.blockID];
+ World var11 = var1.getWorld();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.sandRenderBlocks.renderBlockFallingSand(var10, var11, MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ));
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityFallingSand)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderGiantZombie.java b/src/net/minecraft/src/RenderGiantZombie.java
new file mode 100644
index 0000000..b0614da
--- /dev/null
+++ b/src/net/minecraft/src/RenderGiantZombie.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderGiantZombie extends RenderLiving {
+ private float scale;
+
+ public RenderGiantZombie(ModelBase var1, float var2, float var3) {
+ super(var1, var2 * var3);
+ this.scale = var3;
+ }
+
+ protected void a(EntityGiant var1, float var2) {
+ GL11.glScalef(this.scale, this.scale, this.scale);
+ }
+
+ protected void preRenderCallback(EntityLiving var1, float var2) {
+ this.a((EntityGiant)var1, var2);
+ }
+}
diff --git a/src/net/minecraft/src/RenderGlobal.java b/src/net/minecraft/src/RenderGlobal.java
new file mode 100644
index 0000000..2de314c
--- /dev/null
+++ b/src/net/minecraft/src/RenderGlobal.java
@@ -0,0 +1,1083 @@
+package net.minecraft.src;
+
+import java.nio.IntBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+import org.lwjgl.opengl.ARBOcclusionQuery;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL15;
+
+public class RenderGlobal implements IWorldAccess {
+ public List tileEntities = new ArrayList();
+ private World theWorld;
+ private RenderEngine renderEngine;
+ private List worldRenderersToUpdate = new ArrayList();
+ private WorldRenderer[] sortedWorldRenderers;
+ private WorldRenderer[] worldRenderers;
+ private int renderChunksWide;
+ private int renderChunksTall;
+ private int renderChunksDeep;
+ private int glRenderListBase;
+ private Minecraft mc;
+ private RenderBlocks globalRenderBlocks;
+ private IntBuffer glOcclusionQueryBase;
+ private boolean occlusionEnabled = false;
+ private int cloudTickCounter = 0;
+ private int starGLCallList;
+ private int glSkyList;
+ private int glSkyList2;
+ private int minBlockX;
+ private int minBlockY;
+ private int minBlockZ;
+ private int maxBlockX;
+ private int maxBlockY;
+ private int maxBlockZ;
+ private int renderDistance = -1;
+ private int countEntitiesTotal;
+ private int countEntitiesRendered;
+ private int countEntitiesHidden;
+ int[] dummyBuf50k = new int['\uc350'];
+ IntBuffer occlusionResult = GLAllocation.createIntBuffer(64);
+ private int renderersLoaded;
+ private int renderersBeingClipped;
+ private int renderersBeingOccluded;
+ private int renderersBeingRendered;
+ private int renderersSkippingRenderPass;
+ private List glRenderLists = new ArrayList();
+ private RenderList[] allRenderLists = new RenderList[]{new RenderList(), new RenderList(), new RenderList(), new RenderList()};
+ int dummyRenderInt = 0;
+ int unusedGLCallList = GLAllocation.generateDisplayLists(1);
+ double prevSortX = -9999.0D;
+ double prevSortY = -9999.0D;
+ double prevSortZ = -9999.0D;
+ public float damagePartialTime;
+ int frustumCheckOffset = 0;
+
+ public RenderGlobal(Minecraft var1, RenderEngine var2) {
+ this.mc = var1;
+ this.renderEngine = var2;
+ byte var3 = 64;
+ this.glRenderListBase = GLAllocation.generateDisplayLists(var3 * var3 * var3 * 3);
+ this.occlusionEnabled = var1.getOpenGlCapsChecker().checkARBOcclusion();
+ if(this.occlusionEnabled) {
+ this.occlusionResult.clear();
+ this.glOcclusionQueryBase = GLAllocation.createIntBuffer(var3 * var3 * var3);
+ this.glOcclusionQueryBase.clear();
+ this.glOcclusionQueryBase.position(0);
+ this.glOcclusionQueryBase.limit(var3 * var3 * var3);
+ ARBOcclusionQuery.glGenQueriesARB(this.glOcclusionQueryBase);
+ }
+
+ this.starGLCallList = GLAllocation.generateDisplayLists(3);
+ GL11.glPushMatrix();
+ GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
+ this.renderStars();
+ GL11.glEndList();
+ GL11.glPopMatrix();
+ Tessellator var4 = Tessellator.instance;
+ this.glSkyList = this.starGLCallList + 1;
+ GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
+ 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) {
+ var4.startDrawingQuads();
+ var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + 0));
+ var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + 0));
+ var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + var6));
+ var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + var6));
+ var4.draw();
+ }
+ }
+
+ GL11.glEndList();
+ this.glSkyList2 = this.starGLCallList + 2;
+ GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
+ var5 = -16.0F;
+ var4.startDrawingQuads();
+
+ 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));
+ var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + var6));
+ }
+ }
+
+ var4.draw();
+ GL11.glEndList();
+ }
+
+ private void renderStars() {
+ Random var1 = new Random(10842L);
+ Tessellator var2 = Tessellator.instance;
+ var2.startDrawingQuads();
+
+ for(int var3 = 0; var3 < 1500; ++var3) {
+ 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.25F + var1.nextFloat() * 0.25F);
+ double var12 = var4 * var4 + var6 * var6 + var8 * var8;
+ if(var12 < 1.0D && var12 > 0.01D) {
+ var12 = 1.0D / Math.sqrt(var12);
+ var4 *= var12;
+ var6 *= var12;
+ var8 *= var12;
+ double var14 = var4 * 100.0D;
+ double var16 = var6 * 100.0D;
+ double var18 = var8 * 100.0D;
+ double var20 = Math.atan2(var4, var8);
+ double var22 = Math.sin(var20);
+ double var24 = Math.cos(var20);
+ double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6);
+ double var28 = Math.sin(var26);
+ double var30 = Math.cos(var26);
+ double var32 = var1.nextDouble() * Math.PI * 2.0D;
+ double var34 = Math.sin(var32);
+ double var36 = Math.cos(var32);
+
+ 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;
+ double var47 = var41 * var36 - var43 * var34;
+ double var49 = var43 * var36 + var41 * var34;
+ double var53 = var47 * var28 + var39 * var30;
+ double var55 = var39 * var28 - var47 * var30;
+ double var57 = var55 * var22 - var49 * var24;
+ double var61 = var49 * var22 + var55 * var24;
+ var2.addVertex(var14 + var57, var16 + var53, var18 + var61);
+ }
+ }
+ }
+
+ var2.draw();
+ }
+
+ public void changeWorld(World var1) {
+ 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);
+ this.loadRenderers();
+ }
+
+ }
+
+ public void loadRenderers() {
+ Block.leaves.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
+ this.renderDistance = this.mc.gameSettings.renderDistance;
+ int 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) {
+ var1 = 400;
+ }
+
+ this.renderChunksWide = var1 / 16 + 1;
+ this.renderChunksTall = 8;
+ this.renderChunksDeep = var1 / 16 + 1;
+ this.worldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep];
+ this.sortedWorldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep];
+ int var2 = 0;
+ int var3 = 0;
+ this.minBlockX = 0;
+ this.minBlockY = 0;
+ this.minBlockZ = 0;
+ this.maxBlockX = this.renderChunksWide;
+ this.maxBlockY = this.renderChunksTall;
+ this.maxBlockZ = this.renderChunksDeep;
+
+ int var4;
+ for(var4 = 0; var4 < this.worldRenderersToUpdate.size(); ++var4) {
+ ((WorldRenderer)this.worldRenderersToUpdate.get(var4)).needsUpdate = false;
+ }
+
+ this.worldRenderersToUpdate.clear();
+
+ for(var4 = 0; var4 < this.renderChunksWide; ++var4) {
+ for(int var5 = 0; var5 < this.renderChunksTall; ++var5) {
+ for(int var6 = 0; var6 < this.renderChunksDeep; ++var6) {
+ if(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] != null) {
+ this.tileEntities.removeAll(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].tileEntityRenderers);
+ }
+
+ this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] = new WorldRenderer(this.theWorld, this.tileEntities, var4 * 16, var5 * 16, var6 * 16, 16, this.glRenderListBase + var2);
+ if(this.occlusionEnabled) {
+ this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].glOcclusionQuery = this.glOcclusionQueryBase.get(var3);
+ }
+
+ 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.worldRenderersToUpdate.add(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4]);
+ var2 += 3;
+ }
+ }
+ }
+
+ if(this.theWorld != null) {
+ Entity var7 = this.theWorld.playerEntity;
+ this.markRenderersForNewPosition(MathHelper.floor_double(var7.posX), MathHelper.floor_double(var7.posY), MathHelper.floor_double(var7.posZ));
+ Arrays.sort(this.sortedWorldRenderers, new EntitySorter(var7));
+ }
+
+ }
+
+ public void renderEntities(Vec3D var1, ICamera var2, float var3) {
+ TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.thePlayer, var3);
+ RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.thePlayer, this.mc.gameSettings, var3);
+ this.countEntitiesTotal = 0;
+ this.countEntitiesRendered = 0;
+ this.countEntitiesHidden = 0;
+ Entity var4 = this.theWorld.playerEntity;
+ 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;
+ List var5 = this.theWorld.getLoadedEntityList();
+ this.countEntitiesTotal = var5.size();
+
+ int var6;
+ for(var6 = 0; var6 < var5.size(); ++var6) {
+ Entity var7 = (Entity)var5.get(var6);
+ if(var7.isInRangeToRenderVec3D(var1) && var2.isBoundingBoxInFrustum(var7.boundingBox) && (var7 != this.theWorld.playerEntity || this.mc.gameSettings.thirdPersonView)) {
+ ++this.countEntitiesRendered;
+ RenderManager.instance.renderEntity(var7, var3);
+ }
+ }
+
+ for(var6 = 0; var6 < this.tileEntities.size(); ++var6) {
+ TileEntityRenderer.instance.renderTileEntity((TileEntity)this.tileEntities.get(var6), var3);
+ }
+
+ }
+
+ public String getDebugInfoRenders() {
+ return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + ". F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass;
+ }
+
+ 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;
+ this.minBlockX = Integer.MAX_VALUE;
+ this.minBlockY = Integer.MAX_VALUE;
+ this.minBlockZ = Integer.MAX_VALUE;
+ this.maxBlockX = Integer.MIN_VALUE;
+ this.maxBlockY = Integer.MIN_VALUE;
+ this.maxBlockZ = Integer.MIN_VALUE;
+ int var4 = this.renderChunksWide * 16;
+ int var5 = var4 / 2;
+
+ for(int var6 = 0; var6 < this.renderChunksWide; ++var6) {
+ int var7 = var6 * 16;
+ int var8 = var7 + var5 - var1;
+ if(var8 < 0) {
+ var8 -= var4 - 1;
+ }
+
+ var8 /= var4;
+ var7 -= var8 * var4;
+ if(var7 < this.minBlockX) {
+ this.minBlockX = var7;
+ }
+
+ if(var7 > this.maxBlockX) {
+ this.maxBlockX = var7;
+ }
+
+ for(int var9 = 0; var9 < this.renderChunksDeep; ++var9) {
+ int var10 = var9 * 16;
+ int var11 = var10 + var5 - var3;
+ if(var11 < 0) {
+ var11 -= var4 - 1;
+ }
+
+ var11 /= var4;
+ var10 -= var11 * var4;
+ if(var10 < this.minBlockZ) {
+ this.minBlockZ = var10;
+ }
+
+ if(var10 > this.maxBlockZ) {
+ this.maxBlockZ = var10;
+ }
+
+ for(int var12 = 0; var12 < this.renderChunksTall; ++var12) {
+ int var13 = var12 * 16;
+ if(var13 < this.minBlockY) {
+ this.minBlockY = var13;
+ }
+
+ 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.worldRenderersToUpdate.add(var14);
+ }
+ }
+ }
+ }
+
+ }
+
+ public int sortAndRender(EntityPlayer var1, int var2, double var3) {
+ if(this.mc.gameSettings.renderDistance != this.renderDistance) {
+ this.loadRenderers();
+ }
+
+ if(var2 == 0) {
+ this.renderersLoaded = 0;
+ this.renderersBeingClipped = 0;
+ this.renderersBeingOccluded = 0;
+ this.renderersBeingRendered = 0;
+ this.renderersSkippingRenderPass = 0;
+ }
+
+ double var5 = 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));
+ }
+
+ byte var17 = 0;
+ int var33;
+ if(this.occlusionEnabled && !this.mc.gameSettings.anaglyph && var2 == 0) {
+ byte var18 = 0;
+ int var19 = 16;
+ this.checkOcclusionQueryResult(var18, var19);
+
+ for(int var20 = var18; var20 < var19; ++var20) {
+ this.sortedWorldRenderers[var20].isVisible = true;
+ }
+
+ var33 = var17 + this.renderSortedRenderers(var18, var19, var2, var3);
+
+ do {
+ int var34 = var19;
+ var19 *= 2;
+ if(var19 > this.sortedWorldRenderers.length) {
+ var19 = this.sortedWorldRenderers.length;
+ }
+
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glDisable(GL11.GL_FOG);
+ GL11.glColorMask(false, false, false, false);
+ GL11.glDepthMask(false);
+ this.checkOcclusionQueryResult(var34, var19);
+ GL11.glPushMatrix();
+ float var35 = 0.0F;
+ float var21 = 0.0F;
+ float var22 = 0.0F;
+
+ for(int var23 = var34; var23 < var19; ++var23) {
+ if(this.sortedWorldRenderers[var23].skipAllRenderPasses()) {
+ this.sortedWorldRenderers[var23].isInFrustum = false;
+ } else {
+ 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));
+ int var25 = (int)(1.0F + var24 / 128.0F);
+ if(this.cloudTickCounter % var25 == var23 % var25) {
+ WorldRenderer var26 = this.sortedWorldRenderers[var23];
+ float var27 = (float)((double)var26.posXMinus - var5);
+ float var28 = (float)((double)var26.posYMinus - var7);
+ float var29 = (float)((double)var26.posZMinus - var9);
+ float var30 = var27 - var35;
+ float var31 = var28 - var21;
+ float var32 = var29 - var22;
+ if(var30 != 0.0F || var31 != 0.0F || var32 != 0.0F) {
+ GL11.glTranslatef(var30, var31, var32);
+ var35 += var30;
+ var21 += var31;
+ var22 += var32;
+ }
+
+ ARBOcclusionQuery.glBeginQueryARB(GL15.GL_SAMPLES_PASSED, this.sortedWorldRenderers[var23].glOcclusionQuery);
+ this.sortedWorldRenderers[var23].callOcclusionQueryList();
+ ARBOcclusionQuery.glEndQueryARB(GL15.GL_SAMPLES_PASSED);
+ this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery = true;
+ }
+ }
+ }
+ }
+
+ GL11.glPopMatrix();
+ GL11.glColorMask(true, true, true, true);
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_FOG);
+ var33 += this.renderSortedRenderers(var34, var19, var2, var3);
+ } while(var19 < this.sortedWorldRenderers.length);
+ } else {
+ var33 = var17 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, var2, var3);
+ }
+
+ return var33;
+ }
+
+ private void checkOcclusionQueryResult(int var1, int var2) {
+ for(int var3 = var1; var3 < var2; ++var3) {
+ if(this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery) {
+ this.occlusionResult.clear();
+ ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, GL15.GL_QUERY_RESULT_AVAILABLE, this.occlusionResult);
+ if(this.occlusionResult.get(0) != 0) {
+ this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery = false;
+ this.occlusionResult.clear();
+ ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, GL15.GL_QUERY_RESULT, this.occlusionResult);
+ this.sortedWorldRenderers[var3].isVisible = this.occlusionResult.get(0) != 0;
+ }
+ }
+ }
+
+ }
+
+ private int renderSortedRenderers(int var1, int var2, int var3, double var4) {
+ this.glRenderLists.clear();
+ int var6 = 0;
+
+ for(int var7 = var1; var7 < var2; ++var7) {
+ if(var3 == 0) {
+ ++this.renderersLoaded;
+ if(this.sortedWorldRenderers[var7].skipRenderPass[var3]) {
+ ++this.renderersSkippingRenderPass;
+ } else if(!this.sortedWorldRenderers[var7].isInFrustum) {
+ ++this.renderersBeingClipped;
+ } else if(this.occlusionEnabled && !this.sortedWorldRenderers[var7].isVisible) {
+ ++this.renderersBeingOccluded;
+ } else {
+ ++this.renderersBeingRendered;
+ }
+ }
+
+ if(!this.sortedWorldRenderers[var7].skipRenderPass[var3] && this.sortedWorldRenderers[var7].isInFrustum && this.sortedWorldRenderers[var7].isVisible) {
+ int var8 = this.sortedWorldRenderers[var7].getGLCallListForPass(var3);
+ if(var8 >= 0) {
+ this.glRenderLists.add(this.sortedWorldRenderers[var7]);
+ ++var6;
+ }
+ }
+ }
+
+ EntityPlayerSP var19 = this.mc.thePlayer;
+ 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;
+ int var14 = 0;
+
+ int var15;
+ for(var15 = 0; var15 < this.allRenderLists.length; ++var15) {
+ this.allRenderLists[var15].reset();
+ }
+
+ 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].isRenderedAt(var16.posXMinus, var16.posYMinus, var16.posZMinus)) {
+ var17 = var18;
+ }
+ }
+
+ if(var17 < 0) {
+ var17 = var14++;
+ this.allRenderLists[var17].setLocation(var16.posXMinus, var16.posYMinus, var16.posZMinus, var20, var10, var12);
+ }
+
+ this.allRenderLists[var17].render(var16.getGLCallListForPass(var3));
+ }
+
+ this.renderAllRenderLists(var3, var4);
+ return var6;
+ }
+
+ public void renderAllRenderLists(int var1, double var2) {
+ for(int var4 = 0; var4 < this.allRenderLists.length; ++var4) {
+ this.allRenderLists[var4].render();
+ }
+
+ }
+
+ public void updateClouds() {
+ ++this.cloudTickCounter;
+ }
+
+ public void renderSky(float var1) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Vec3D var2 = this.theWorld.getSkyColor(var1);
+ float var3 = (float)var2.xCoord;
+ float var4 = (float)var2.yCoord;
+ float var5 = (float)var2.zCoord;
+ float var7;
+ float var8;
+ if(this.mc.gameSettings.anaglyph) {
+ float var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
+ var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
+ var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
+ var3 = var6;
+ var4 = var7;
+ var5 = var8;
+ }
+
+ GL11.glColor3f(var3, var4, var5);
+ Tessellator var12 = Tessellator.instance;
+ GL11.glDepthMask(false);
+ GL11.glEnable(GL11.GL_FOG);
+ GL11.glColor3f(var3, var4, var5);
+ GL11.glCallList(this.glSkyList);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_FOG);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
+ GL11.glPushMatrix();
+ var7 = 0.0F;
+ var8 = 0.0F;
+ float var9 = 0.0F;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glTranslatef(var7, var8, var9);
+ GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(this.theWorld.getCelestialAngle(var1) * 360.0F, 1.0F, 0.0F, 0.0F);
+ float var10 = 30.0F;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain/sun.png"));
+ var12.startDrawingQuads();
+ var12.addVertexWithUV((double)(-var10), 100.0D, (double)(-var10), 0.0D, 0.0D);
+ var12.addVertexWithUV((double)var10, 100.0D, (double)(-var10), 1.0D, 0.0D);
+ var12.addVertexWithUV((double)var10, 100.0D, (double)var10, 1.0D, 1.0D);
+ var12.addVertexWithUV((double)(-var10), 100.0D, (double)var10, 0.0D, 1.0D);
+ var12.draw();
+ var10 = 20.0F;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain/moon.png"));
+ var12.startDrawingQuads();
+ var12.addVertexWithUV((double)(-var10), -100.0D, (double)var10, 1.0D, 1.0D);
+ var12.addVertexWithUV((double)var10, -100.0D, (double)var10, 0.0D, 1.0D);
+ var12.addVertexWithUV((double)var10, -100.0D, (double)(-var10), 0.0D, 0.0D);
+ var12.addVertexWithUV((double)(-var10), -100.0D, (double)(-var10), 1.0D, 0.0D);
+ var12.draw();
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ float var11 = this.theWorld.getStarBrightness(var1);
+ if(var11 > 0.0F) {
+ GL11.glColor4f(var11, var11, var11, var11);
+ GL11.glCallList(this.starGLCallList);
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_FOG);
+ GL11.glPopMatrix();
+ GL11.glColor3f(var3 * 0.2F + 0.04F, var4 * 0.2F + 0.04F, var5 * 0.6F + 0.1F);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glCallList(this.glSkyList2);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDepthMask(true);
+ }
+
+ public void renderClouds(float var1) {
+ if(this.mc.gameSettings.fancyGraphics) {
+ this.renderCloudsFancy(var1);
+ } else {
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ float var2 = (float)(this.mc.thePlayer.lastTickPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.lastTickPosY) * (double)var1);
+ byte var3 = 32;
+ int var4 = 256 / var3;
+ Tessellator var5 = Tessellator.instance;
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/clouds.png"));
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Vec3D var6 = this.theWorld.getCloudColor(var1);
+ float var7 = (float)var6.xCoord;
+ float var8 = (float)var6.yCoord;
+ float var9 = (float)var6.zCoord;
+ float var10;
+ 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;
+ var7 = var10;
+ var8 = var11;
+ var9 = var12;
+ }
+
+ var10 = 0.5F / 1024.0F;
+ double var22 = this.theWorld.playerEntity.prevPosX + (this.theWorld.playerEntity.posX - this.theWorld.playerEntity.prevPosX) * (double)var1 + (double)(((float)this.cloudTickCounter + var1) * 0.03F);
+ double var13 = this.theWorld.playerEntity.prevPosZ + (this.theWorld.playerEntity.posZ - this.theWorld.playerEntity.prevPosZ) * (double)var1;
+ int var15 = MathHelper.floor_double(var22 / 2048.0D);
+ int var16 = MathHelper.floor_double(var13 / 2048.0D);
+ var22 -= (double)(var15 * 2048);
+ var13 -= (double)(var16 * 2048);
+ float var17 = 120.0F - var2 + 0.33F;
+ float var18 = (float)(var22 * (double)var10);
+ float var19 = (float)(var13 * (double)var10);
+ var5.startDrawingQuads();
+ var5.setColorRGBA_F(var7, var8, var9, 0.8F);
+
+ for(int var20 = -var3 * var4; var20 < var3 * var4; var20 += var3) {
+ for(int var21 = -var3 * var4; var21 < var3 * var4; var21 += var3) {
+ var5.addVertexWithUV((double)(var20 + 0), (double)var17, (double)(var21 + var3), (double)((float)(var20 + 0) * var10 + var18), (double)((float)(var21 + var3) * var10 + var19));
+ var5.addVertexWithUV((double)(var20 + var3), (double)var17, (double)(var21 + var3), (double)((float)(var20 + var3) * var10 + var18), (double)((float)(var21 + var3) * var10 + var19));
+ var5.addVertexWithUV((double)(var20 + var3), (double)var17, (double)(var21 + 0), (double)((float)(var20 + var3) * var10 + var18), (double)((float)(var21 + 0) * var10 + var19));
+ var5.addVertexWithUV((double)(var20 + 0), (double)var17, (double)(var21 + 0), (double)((float)(var20 + 0) * var10 + var18), (double)((float)(var21 + 0) * var10 + var19));
+ }
+ }
+
+ var5.draw();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ }
+ }
+
+ public void renderCloudsFancy(float var1) {
+ GL11.glDisable(GL11.GL_CULL_FACE);
+ float var2 = (float)(this.mc.thePlayer.lastTickPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.lastTickPosY) * (double)var1);
+ Tessellator var3 = Tessellator.instance;
+ float var4 = 12.0F;
+ float var5 = 4.0F;
+ double var6 = (this.theWorld.playerEntity.prevPosX + (this.theWorld.playerEntity.posX - this.theWorld.playerEntity.prevPosX) * (double)var1 + (double)(((float)this.cloudTickCounter + var1) * 0.03F)) / (double)var4;
+ double var8 = (this.theWorld.playerEntity.prevPosZ + (this.theWorld.playerEntity.posZ - this.theWorld.playerEntity.prevPosZ) * (double)var1) / (double)var4 + (double)0.33F;
+ float var10 = 108.0F - var2 + 0.33F;
+ int var11 = MathHelper.floor_double(var6 / 2048.0D);
+ int var12 = MathHelper.floor_double(var8 / 2048.0D);
+ var6 -= (double)(var11 * 2048);
+ var8 -= (double)(var12 * 2048);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/clouds.png"));
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Vec3D var13 = this.theWorld.getCloudColor(var1);
+ float var14 = (float)var13.xCoord;
+ float var15 = (float)var13.yCoord;
+ float var16 = (float)var13.zCoord;
+ float var17;
+ float var18;
+ float var19;
+ if(this.mc.gameSettings.anaglyph) {
+ var17 = (var14 * 30.0F + var15 * 59.0F + var16 * 11.0F) / 100.0F;
+ var18 = (var14 * 30.0F + var15 * 70.0F) / 100.0F;
+ var19 = (var14 * 30.0F + var16 * 70.0F) / 100.0F;
+ var14 = var17;
+ var15 = var18;
+ var16 = var19;
+ }
+
+ var17 = (float)(var6 * 0.0D);
+ var18 = (float)(var8 * 0.0D);
+ var19 = 0.00390625F;
+ var17 = (float)MathHelper.floor_double(var6) * var19;
+ var18 = (float)MathHelper.floor_double(var8) * var19;
+ float var20 = (float)(var6 - (double)MathHelper.floor_double(var6));
+ float var21 = (float)(var8 - (double)MathHelper.floor_double(var8));
+ byte var22 = 8;
+ byte var23 = 3;
+ float var24 = 1.0F / 1024.0F;
+ GL11.glScalef(var4, 1.0F, var4);
+
+ for(int var25 = 0; var25 < 2; ++var25) {
+ if(var25 == 0) {
+ GL11.glColorMask(false, false, false, false);
+ } else {
+ GL11.glColorMask(true, true, true, true);
+ }
+
+ for(int var26 = -var23 + 1; var26 <= var23; ++var26) {
+ for(int var27 = -var23 + 1; var27 <= var23; ++var27) {
+ var3.startDrawingQuads();
+ float var28 = (float)(var26 * var22);
+ float var29 = (float)(var27 * var22);
+ float var30 = var28 - var20;
+ float var31 = var29 - var21;
+ if(var10 > -var5 - 1.0F) {
+ var3.setColorRGBA_F(var14 * 0.7F, var15 * 0.7F, var16 * 0.7F, 0.8F);
+ var3.setNormal(0.0F, -1.0F, 0.0F);
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+
+ if(var10 <= var5 + 1.0F) {
+ var3.setColorRGBA_F(var14, var15, var16, 0.8F);
+ var3.setNormal(0.0F, 1.0F, 0.0F);
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5 - var24), (double)(var31 + (float)var22), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5 - var24), (double)(var31 + (float)var22), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5 - var24), (double)(var31 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5 - var24), (double)(var31 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+
+ var3.setColorRGBA_F(var14 * 0.9F, var15 * 0.9F, var16 * 0.9F, 0.8F);
+ int var32;
+ if(var26 > -1) {
+ var3.setNormal(-1.0F, 0.0F, 0.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + var5), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + var5), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+ }
+
+ if(var26 <= 1) {
+ var3.setNormal(1.0F, 0.0F, 0.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + 0.0F), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + var5), (double)(var31 + (float)var22), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + (float)var22) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + var5), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var32 + 1.0F - var24), (double)(var10 + 0.0F), (double)(var31 + 0.0F), (double)((var28 + (float)var32 + 0.5F) * var19 + var17), (double)((var29 + 0.0F) * var19 + var18));
+ }
+ }
+
+ var3.setColorRGBA_F(var14 * 0.8F, var15 * 0.8F, var16 * 0.8F, 0.8F);
+ if(var27 > -1) {
+ var3.setNormal(0.0F, 0.0F, -1.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 0.0F), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ }
+ }
+
+ if(var27 <= 1) {
+ var3.setNormal(0.0F, 0.0F, 1.0F);
+
+ for(var32 = 0; var32 < var22; ++var32) {
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + var5), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + var5), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + (float)var22), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + (float)var22) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ var3.addVertexWithUV((double)(var30 + 0.0F), (double)(var10 + 0.0F), (double)(var31 + (float)var32 + 1.0F - var24), (double)((var28 + 0.0F) * var19 + var17), (double)((var29 + (float)var32 + 0.5F) * var19 + var18));
+ }
+ }
+
+ var3.draw();
+ }
+ }
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ }
+
+ public boolean updateRenderers(EntityPlayer var1, boolean var2) {
+ Collections.sort(this.worldRenderersToUpdate, new RenderSorter(var1));
+ int var3 = this.worldRenderersToUpdate.size() - 1;
+ int var4 = this.worldRenderersToUpdate.size();
+
+ for(int var5 = 0; var5 < var4; ++var5) {
+ WorldRenderer var6 = (WorldRenderer)this.worldRenderersToUpdate.get(var3 - var5);
+ if(!var2) {
+ if(var6.distanceToEntitySquared(var1) > 1024.0F) {
+ if(var6.isInFrustum) {
+ if(var5 >= 3) {
+ return false;
+ }
+ } else if(var5 >= 1) {
+ return false;
+ }
+ }
+ } else if(!var6.isInFrustum) {
+ continue;
+ }
+
+ var6.updateRenderer();
+ this.worldRenderersToUpdate.remove(var6);
+ var6.needsUpdate = false;
+ }
+
+ return this.worldRenderersToUpdate.size() == 0;
+ }
+
+ public void drawBlockBreaking(EntityPlayer var1, MovingObjectPosition var2, int var3, ItemStack var4, float var5) {
+ Tessellator var6 = Tessellator.instance;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, (MathHelper.sin((float)System.currentTimeMillis() / 100.0F) * 0.2F + 0.4F) * 0.5F);
+ int var8;
+ if(var3 == 0) {
+ if(this.damagePartialTime > 0.0F) {
+ GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR);
+ int var7 = this.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var7);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
+ GL11.glPushMatrix();
+ var8 = this.theWorld.getBlockId(var2.blockX, var2.blockY, var2.blockZ);
+ Block var9 = var8 > 0 ? Block.blocksList[var8] : null;
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glPolygonOffset(-3.0F, -3.0F);
+ GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
+ var6.startDrawingQuads();
+ double var10 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var5;
+ double var12 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var5;
+ double var14 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var5;
+ var6.setTranslationD(-var10, -var12, -var14);
+ var6.disableColor();
+ if(var9 == null) {
+ var9 = Block.stone;
+ }
+
+ this.globalRenderBlocks.renderBlockUsingTexture(var9, var2.blockX, var2.blockY, var2.blockZ, 240 + (int)(this.damagePartialTime * 10.0F));
+ var6.draw();
+ var6.setTranslationD(0.0D, 0.0D, 0.0D);
+ GL11.glPolygonOffset(0.0F, 0.0F);
+ GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glDepthMask(true);
+ GL11.glPopMatrix();
+ }
+ } else if(var4 != null) {
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ float var16 = MathHelper.sin((float)System.currentTimeMillis() / 100.0F) * 0.2F + 0.8F;
+ GL11.glColor4f(var16, var16, var16, MathHelper.sin((float)System.currentTimeMillis() / 200.0F) * 0.2F + 0.5F);
+ var8 = this.renderEngine.getTexture("/terrain.png");
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, var8);
+ int var17 = var2.blockX;
+ int var18 = var2.blockY;
+ int var11 = var2.blockZ;
+ if(var2.sideHit == 0) {
+ --var18;
+ }
+
+ if(var2.sideHit == 1) {
+ ++var18;
+ }
+
+ if(var2.sideHit == 2) {
+ --var11;
+ }
+
+ if(var2.sideHit == 3) {
+ ++var11;
+ }
+
+ if(var2.sideHit == 4) {
+ --var17;
+ }
+
+ if(var2.sideHit == 5) {
+ ++var17;
+ }
+ }
+
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ }
+
+ public void drawSelectionBox(EntityPlayer var1, MovingObjectPosition var2, int var3, ItemStack var4, float var5) {
+ if(var3 == 0 && var2.typeOfHit == 0) {
+ 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);
+ GL11.glLineWidth(2.0F);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDepthMask(false);
+ float var6 = 0.002F;
+ int var7 = this.theWorld.getBlockId(var2.blockX, var2.blockY, var2.blockZ);
+ if(var7 > 0) {
+ double var8 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var5;
+ double var10 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var5;
+ double var12 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var5;
+ this.drawOutlinedBoundingBox(Block.blocksList[var7].getSelectedBoundingBoxFromPool(this.theWorld, var2.blockX, var2.blockY, var2.blockZ).expand((double)var6, (double)var6, (double)var6).getOffsetBoundingBox(-var8, -var10, -var12));
+ }
+
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ }
+
+ private void drawOutlinedBoundingBox(AxisAlignedBB var1) {
+ 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.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.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.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);
+
+ for(int var13 = var7; var13 <= var10; ++var13) {
+ int var14 = var13 % this.renderChunksWide;
+ if(var14 < 0) {
+ var14 += this.renderChunksWide;
+ }
+
+ for(int var15 = var8; var15 <= var11; ++var15) {
+ int var16 = var15 % this.renderChunksTall;
+ if(var16 < 0) {
+ var16 += this.renderChunksTall;
+ }
+
+ for(int var17 = var9; var17 <= var12; ++var17) {
+ int var18 = var17 % this.renderChunksDeep;
+ if(var18 < 0) {
+ var18 += this.renderChunksDeep;
+ }
+
+ int var19 = (var18 * this.renderChunksTall + var16) * this.renderChunksWide + var14;
+ WorldRenderer var20 = this.worldRenderers[var19];
+ if(!var20.needsUpdate) {
+ this.worldRenderersToUpdate.add(var20);
+ }
+
+ var20.markDirty();
+ }
+ }
+ }
+
+ }
+
+ public void markBlockAndNeighborsNeedsUpdate(int var1, int var2, int var3) {
+ this.markBlocksForUpdate(var1 - 1, var2 - 1, var3 - 1, var1 + 1, var2 + 1, var3 + 1);
+ }
+
+ public void markBlockRangeNeedsUpdate(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 clipRenderersByFrustrum(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].updateInFrustrum(var1);
+ }
+ }
+
+ ++this.frustumCheckOffset;
+ }
+
+ public void playSound(String var1, double var2, double var4, double var6, float var8, float var9) {
+ this.mc.sndManager.playSound(var1, (float)var2, (float)var4, (float)var6, var8, var9);
+ }
+
+ public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) {
+ double var14 = this.theWorld.playerEntity.posX - var2;
+ double var16 = this.theWorld.playerEntity.posY - var4;
+ double var18 = this.theWorld.playerEntity.posZ - var6;
+ if(var14 * var14 + var16 * var16 + var18 * var18 <= 256.0D) {
+ if(var1 == "bubble") {
+ this.mc.effectRenderer.addEffect(new EntityBubbleFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "smoke") {
+ this.mc.effectRenderer.addEffect(new EntitySmokeFX(this.theWorld, var2, var4, var6));
+ } else if(var1 == "explode") {
+ this.mc.effectRenderer.addEffect(new EntityExplodeFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "flame") {
+ this.mc.effectRenderer.addEffect(new EntityFlameFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "lava") {
+ this.mc.effectRenderer.addEffect(new EntityLavaFX(this.theWorld, var2, var4, var6));
+ } else if(var1 == "splash") {
+ this.mc.effectRenderer.addEffect(new EntitySplashFX(this.theWorld, var2, var4, var6, var8, var10, var12));
+ } else if(var1 == "largesmoke") {
+ this.mc.effectRenderer.addEffect(new EntitySmokeFX(this.theWorld, var2, var4, var6, 2.5F));
+ }
+
+ }
+ }
+
+ public void obtainEntitySkin(Entity var1) {
+ if(var1.skinUrl != null) {
+ this.renderEngine.obtainImageData(var1.skinUrl, new ImageBufferDownload());
+ }
+
+ }
+
+ public void releaseEntitySkin(Entity var1) {
+ if(var1.skinUrl != null) {
+ this.renderEngine.releaseImageData(var1.skinUrl);
+ }
+
+ }
+
+ public void updateAllRenderers() {
+ for(int var1 = 0; var1 < this.worldRenderers.length; ++var1) {
+ if(this.worldRenderers[var1].isChunkLit) {
+ if(!this.worldRenderers[var1].needsUpdate) {
+ this.worldRenderersToUpdate.add(this.worldRenderers[var1]);
+ }
+
+ this.worldRenderers[var1].markDirty();
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/RenderHelper.java b/src/net/minecraft/src/RenderHelper.java
new file mode 100644
index 0000000..daf49c3
--- /dev/null
+++ b/src/net/minecraft/src/RenderHelper.java
@@ -0,0 +1,49 @@
+package net.minecraft.src;
+
+import java.nio.FloatBuffer;
+import org.lwjgl.opengl.GL11;
+
+public class RenderHelper {
+ private static FloatBuffer colorBuffer = GLAllocation.createFloatBuffer(16);
+
+ public static void disableStandardItemLighting() {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_LIGHT0);
+ GL11.glDisable(GL11.GL_LIGHT1);
+ GL11.glDisable(GL11.GL_COLOR_MATERIAL);
+ }
+
+ public static void enableStandardItemLighting() {
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_LIGHT1);
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glColorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE);
+ float var0 = 0.4F;
+ float var1 = 0.6F;
+ float var2 = 0.0F;
+ Vec3D var3 = Vec3D.createVector((double)0.7F, 1.0D, (double)-0.2F).normalize();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, setColorBuffer(var3.xCoord, var3.yCoord, var3.zCoord, 0.0D));
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, setColorBuffer(var1, var1, var1, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F));
+ var3 = Vec3D.createVector((double)-0.7F, 1.0D, (double)0.2F).normalize();
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, setColorBuffer(var3.xCoord, var3.yCoord, var3.zCoord, 0.0D));
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, setColorBuffer(var1, var1, var1, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F));
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F));
+ GL11.glShadeModel(GL11.GL_FLAT);
+ 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) {
+ colorBuffer.clear();
+ colorBuffer.put(var0).put(var1).put(var2).put(var3);
+ colorBuffer.flip();
+ return colorBuffer;
+ }
+}
diff --git a/src/net/minecraft/src/RenderItem.java b/src/net/minecraft/src/RenderItem.java
new file mode 100644
index 0000000..bc50e5c
--- /dev/null
+++ b/src/net/minecraft/src/RenderItem.java
@@ -0,0 +1,193 @@
+package net.minecraft.src;
+
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderItem extends Render {
+ private RenderBlocks renderBlocks = new RenderBlocks();
+ private Random random = new Random();
+
+ public RenderItem() {
+ this.shadowSize = 0.15F;
+ this.shadowOpaque = 12.0F / 16.0F;
+ }
+
+ public void a(EntityItem var1, double var2, double var4, double var6, float var8, float var9) {
+ this.random.setSeed(187L);
+ ItemStack var10 = var1.item;
+ 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);
+ byte var13 = 1;
+ if(var1.item.stackSize > 1) {
+ var13 = 2;
+ }
+
+ if(var1.item.stackSize > 5) {
+ var13 = 3;
+ }
+
+ if(var1.item.stackSize > 20) {
+ var13 = 4;
+ }
+
+ GL11.glTranslatef((float)var2, (float)var4 + var11, (float)var6);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ float var16;
+ float var17;
+ float var18;
+ if(var10.itemID < 256 && Block.blocksList[var10.itemID].getRenderType() == 0) {
+ GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
+ this.loadTexture("/terrain.png");
+ float var27 = 0.25F;
+ if(!Block.blocksList[var10.itemID].renderAsNormalBlock() && var10.itemID != Block.stairSingle.blockID) {
+ var27 = 0.5F;
+ }
+
+ GL11.glScalef(var27, var27, var27);
+
+ for(int var28 = 0; var28 < var13; ++var28) {
+ GL11.glPushMatrix();
+ if(var28 > 0) {
+ var16 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var27;
+ var17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var27;
+ var18 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var27;
+ GL11.glTranslatef(var16, var17, var18);
+ }
+
+ this.renderBlocks.renderBlockOnInventory(Block.blocksList[var10.itemID]);
+ GL11.glPopMatrix();
+ }
+ } else {
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ int var14 = var10.getIconIndex();
+ if(var10.itemID < 256) {
+ this.loadTexture("/terrain.png");
+ } else {
+ this.loadTexture("/gui/items.png");
+ }
+
+ Tessellator var15 = Tessellator.instance;
+ var16 = (float)(var14 % 16 * 16 + 0) / 256.0F;
+ var17 = (float)(var14 % 16 * 16 + 16) / 256.0F;
+ var18 = (float)(var14 / 16 * 16 + 0) / 256.0F;
+ float var19 = (float)(var14 / 16 * 16 + 16) / 256.0F;
+ float var20 = 1.0F;
+ float var21 = 0.5F;
+ float var22 = 0.25F;
+
+ for(int var23 = 0; var23 < var13; ++var23) {
+ GL11.glPushMatrix();
+ if(var23 > 0) {
+ float var24 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
+ float var25 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
+ float var26 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
+ GL11.glTranslatef(var24, var25, var26);
+ }
+
+ GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
+ var15.startDrawingQuads();
+ var15.setNormal(0.0F, 1.0F, 0.0F);
+ var15.addVertexWithUV((double)(0.0F - var21), (double)(0.0F - var22), 0.0D, (double)var16, (double)var19);
+ var15.addVertexWithUV((double)(var20 - var21), (double)(0.0F - var22), 0.0D, (double)var17, (double)var19);
+ var15.addVertexWithUV((double)(var20 - var21), (double)(1.0F - var22), 0.0D, (double)var17, (double)var18);
+ var15.addVertexWithUV((double)(0.0F - var21), (double)(1.0F - var22), 0.0D, (double)var16, (double)var18);
+ var15.draw();
+ GL11.glPopMatrix();
+ }
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ public void drawItemIntoGui(FontRenderer var1, RenderEngine var2, ItemStack var3, int var4, int var5) {
+ if(var3 != null) {
+ if(var3.itemID < 256 && Block.blocksList[var3.itemID].getRenderType() == 0) {
+ int var6 = var3.itemID;
+ var2.bindTexture(var2.getTexture("/terrain.png"));
+ Block var7 = Block.blocksList[var6];
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(var4 - 2), (float)(var5 + 3), 0.0F);
+ GL11.glScalef(10.0F, 10.0F, 10.0F);
+ GL11.glTranslatef(1.0F, 0.5F, 8.0F);
+ GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.renderBlocks.renderBlockOnInventory(var7);
+ GL11.glPopMatrix();
+ } else if(var3.getIconIndex() >= 0) {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if(var3.itemID < 256) {
+ var2.bindTexture(var2.getTexture("/terrain.png"));
+ } else {
+ var2.bindTexture(var2.getTexture("/gui/items.png"));
+ }
+
+ this.renderTexturedQuad(var4, var5, var3.getIconIndex() % 16 * 16, var3.getIconIndex() / 16 * 16, 16, 16);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ }
+
+ }
+ }
+
+ public void renderItemOverlayIntoGUI(FontRenderer var1, RenderEngine var2, ItemStack var3, int var4, int var5) {
+ if(var3 != null) {
+ if(var3.stackSize > 1) {
+ String var6 = "" + var3.stackSize;
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ var1.drawStringWithShadow(var6, var4 + 19 - 2 - var1.getStringWidth(var6), var5 + 6 + 3, 16777215);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ }
+
+ if(var3.itemDmg > 0) {
+ int var11 = 13 - var3.itemDmg * 13 / var3.getMaxDamage();
+ int var7 = 255 - var3.itemDmg * 255 / var3.getMaxDamage();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ Tessellator var8 = Tessellator.instance;
+ int var9 = 255 - var7 << 16 | var7 << 8;
+ int var10 = (255 - var7) / 4 << 16 | 16128;
+ this.renderQuad(var8, var4 + 2, var5 + 13, 13, 2, 0);
+ this.renderQuad(var8, var4 + 2, var5 + 13, 12, 1, var10);
+ this.renderQuad(var8, var4 + 2, var5 + 13, var11, 1, var9);
+ 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();
+ }
+
+ public void renderTexturedQuad(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((double)(var1 + 0), (double)(var2 + var6), (double)var7, (double)((float)(var3 + 0) * var8), (double)((float)(var4 + var6) * var9));
+ var10.addVertexWithUV((double)(var1 + var5), (double)(var2 + var6), (double)var7, (double)((float)(var3 + var5) * var8), (double)((float)(var4 + var6) * var9));
+ var10.addVertexWithUV((double)(var1 + var5), (double)(var2 + 0), (double)var7, (double)((float)(var3 + var5) * var8), (double)((float)(var4 + 0) * var9));
+ var10.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)var7, (double)((float)(var3 + 0) * var8), (double)((float)(var4 + 0) * var9));
+ var10.draw();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityItem)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderList.java b/src/net/minecraft/src/RenderList.java
new file mode 100644
index 0000000..4688443
--- /dev/null
+++ b/src/net/minecraft/src/RenderList.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import java.nio.IntBuffer;
+import org.lwjgl.opengl.GL11;
+
+public class RenderList {
+ private int posX;
+ private int posY;
+ private int posZ;
+ private float playerPosX;
+ private float playerPosY;
+ private float playerPosZ;
+ private IntBuffer buffer = GLAllocation.createIntBuffer(65536);
+ private boolean render = false;
+ private boolean isCached = false;
+
+ public void setLocation(int var1, int var2, int var3, double var4, double var6, double var8) {
+ this.render = true;
+ this.buffer.clear();
+ this.posX = var1;
+ this.posY = var2;
+ this.posZ = var3;
+ this.playerPosX = (float)var4;
+ this.playerPosY = (float)var6;
+ this.playerPosZ = (float)var8;
+ }
+
+ public boolean isRenderedAt(int var1, int var2, int var3) {
+ return !this.render ? false : var1 == this.posX && var2 == this.posY && var3 == this.posZ;
+ }
+
+ public void render(int var1) {
+ this.buffer.put(var1);
+ if(this.buffer.remaining() == 0) {
+ this.render();
+ }
+
+ }
+
+ public void render() {
+ if(this.render) {
+ if(!this.isCached) {
+ this.buffer.flip();
+ this.isCached = true;
+ }
+
+ if(this.buffer.remaining() > 0) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)this.posX - this.playerPosX, (float)this.posY - this.playerPosY, (float)this.posZ - this.playerPosZ);
+ GL11.glCallLists(this.buffer);
+ GL11.glPopMatrix();
+ }
+
+ }
+ }
+
+ public void reset() {
+ this.render = false;
+ this.isCached = false;
+ }
+}
diff --git a/src/net/minecraft/src/RenderLiving.java b/src/net/minecraft/src/RenderLiving.java
new file mode 100644
index 0000000..564dd4c
--- /dev/null
+++ b/src/net/minecraft/src/RenderLiving.java
@@ -0,0 +1,133 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderLiving extends Render {
+ protected ModelBase mainModel;
+ protected ModelBase renderPassModel;
+
+ public RenderLiving(ModelBase var1, float var2) {
+ this.mainModel = var1;
+ this.shadowSize = var2;
+ }
+
+ public void setRenderPassModel(ModelBase var1) {
+ this.renderPassModel = var1;
+ }
+
+ public void a(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_CULL_FACE);
+
+ try {
+ float var10 = var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var9;
+ float var11 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9;
+ float var12 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9;
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ float var13 = (float)var1.ticksExisted + var9;
+ GL11.glRotatef(180.0F - var10, 0.0F, 1.0F, 0.0F);
+ float var14;
+ if(var1.deathTime > 0) {
+ var14 = ((float)var1.deathTime + var9 - 1.0F) / 20.0F * 1.6F;
+ var14 = MathHelper.sqrt_float(var14);
+ if(var14 > 1.0F) {
+ var14 = 1.0F;
+ }
+
+ GL11.glRotatef(var14 * this.getMaxDeathRotation(var1), 0.0F, 0.0F, 1.0F);
+ }
+
+ var14 = 1.0F / 16.0F;
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glScalef(-1.0F, -1.0F, 1.0F);
+ this.preRenderCallback(var1, var9);
+ GL11.glTranslatef(0.0F, -24.0F * var14 - 0.0078125F, 0.0F);
+ float var15 = var1.prevLimbYaw + (var1.limbYaw - var1.prevLimbYaw) * var9;
+ float var16 = var1.limbSwing - var1.limbYaw * (1.0F - var9);
+ if(var15 > 1.0F) {
+ var15 = 1.0F;
+ }
+
+ this.loadDownloadableImageTexture(var1.skinUrl, var1.getTexture());
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ this.mainModel.render(var16, var15, var13, var11 - var10, var12, var14);
+
+ for(int var17 = 0; var17 < 4; ++var17) {
+ if(this.shouldRenderPass(var1, var17)) {
+ this.renderPassModel.render(var16, var15, var13, var11 - var10, var12, var14);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ }
+ }
+
+ float var25 = var1.getEntityBrightness(var9);
+ int var18 = this.getColorMultiplier(var1, var25, var9);
+ if((var18 >> 24 & 255) > 0 || var1.hurtTime > 0 || var1.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) {
+ GL11.glColor4f(var25, 0.0F, 0.0F, 0.4F);
+ this.mainModel.render(var16, var15, var13, var11 - var10, var12, var14);
+
+ for(int var19 = 0; var19 < 4; ++var19) {
+ if(this.shouldRenderPass(var1, var19)) {
+ GL11.glColor4f(var25, 0.0F, 0.0F, 0.4F);
+ this.renderPassModel.render(var16, var15, var13, var11 - var10, var12, var14);
+ }
+ }
+ }
+
+ if((var18 >> 24 & 255) > 0) {
+ float var26 = (float)(var18 >> 16 & 255) / 255.0F;
+ float var20 = (float)(var18 >> 8 & 255) / 255.0F;
+ float var21 = (float)(var18 & 255) / 255.0F;
+ float var22 = (float)(var18 >> 24 & 255) / 255.0F;
+ GL11.glColor4f(var26, var20, var21, var22);
+ this.mainModel.render(var16, var15, var13, var11 - var10, var12, var14);
+
+ for(int var23 = 0; var23 < 4; ++var23) {
+ if(this.shouldRenderPass(var1, var23)) {
+ GL11.glColor4f(var26, var20, var21, var22);
+ this.renderPassModel.render(var16, var15, var13, var11 - var10, var12, var14);
+ }
+ }
+ }
+
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ } catch (Exception var24) {
+ var24.printStackTrace();
+ }
+
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glPopMatrix();
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return false;
+ }
+
+ protected float getMaxDeathRotation(EntityLiving var1) {
+ return 90.0F;
+ }
+
+ protected int getColorMultiplier(EntityLiving var1, float var2, float var3) {
+ return 0;
+ }
+
+ protected void preRenderCallback(EntityLiving var1, float var2) {
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityLiving)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderManager.java b/src/net/minecraft/src/RenderManager.java
new file mode 100644
index 0000000..8d427a4
--- /dev/null
+++ b/src/net/minecraft/src/RenderManager.java
@@ -0,0 +1,107 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.lwjgl.opengl.GL11;
+
+public class RenderManager {
+ private Map entityRenderMap = new HashMap();
+ public static RenderManager instance = new RenderManager();
+ private FontRenderer fontRenderer;
+ public static double renderPosX;
+ public static double renderPosY;
+ public static double renderPosZ;
+ public RenderEngine renderEngine;
+ public World worldObj;
+ public EntityPlayer player;
+ public float playerViewY;
+ public float playerViewX;
+ public GameSettings options;
+ public double viewerPosX;
+ public double viewerPosY;
+ public double viewerPosZ;
+
+ private RenderManager() {
+ 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 ModelSheep(), new ModelSheepFur(), 0.7F));
+ this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper());
+ this.entityRenderMap.put(EntitySkeleton.class, new RenderLiving(new ModelSkeleton(), 0.5F));
+ this.entityRenderMap.put(EntityZombie.class, new RenderLiving(new ModelZombie(), 0.5F));
+ this.entityRenderMap.put(EntityPlayer.class, new RenderPlayer());
+ this.entityRenderMap.put(EntityGiant.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F));
+ this.entityRenderMap.put(EntityLiving.class, new RenderLiving(new ModelBiped(), 0.5F));
+ this.entityRenderMap.put(Entity.class, new RenderEntity());
+ this.entityRenderMap.put(EntityPainting.class, new RenderPainting());
+ this.entityRenderMap.put(EntityArrow.class, new RenderArrow());
+ this.entityRenderMap.put(EntityItem.class, new RenderItem());
+ this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed());
+ this.entityRenderMap.put(EntityFallingSand.class, new RenderFallingSand());
+ this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart());
+ Iterator var1 = this.entityRenderMap.values().iterator();
+
+ while(var1.hasNext()) {
+ Render var2 = (Render)var1.next();
+ var2.setRenderManager(this);
+ }
+
+ }
+
+ public Render getEntityClassRenderObject(Class var1) {
+ Render var2 = (Render)this.entityRenderMap.get(var1);
+ if(var2 == null && var1 != Entity.class) {
+ var2 = this.getEntityClassRenderObject(var1.getSuperclass());
+ this.entityRenderMap.put(var1, var2);
+ }
+
+ return var2;
+ }
+
+ public Render getEntityRenderObject(Entity var1) {
+ return this.getEntityClassRenderObject(var1.getClass());
+ }
+
+ public void cacheActiveRenderInfo(World var1, RenderEngine var2, FontRenderer var3, EntityPlayer var4, GameSettings var5, float var6) {
+ this.worldObj = var1;
+ this.renderEngine = var2;
+ this.options = var5;
+ this.player = var4;
+ this.fontRenderer = var3;
+ this.playerViewY = var4.prevRotationYaw + (var4.rotationYaw - var4.prevRotationYaw) * var6;
+ this.playerViewX = var4.prevRotationPitch + (var4.rotationPitch - var4.prevRotationPitch) * var6;
+ this.viewerPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var6;
+ this.viewerPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var6;
+ this.viewerPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var6;
+ }
+
+ public void renderEntity(Entity var1, float var2) {
+ 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;
+ float var10 = var1.getEntityBrightness(var2);
+ GL11.glColor3f(var10, var10, var10);
+ this.renderEntityWithPosYaw(var1, var3 - renderPosX, var5 - renderPosY, var7 - renderPosZ, var9, var2);
+ }
+
+ public void renderEntityWithPosYaw(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ Render var10 = this.getEntityRenderObject(var1);
+ if(var10 != null) {
+ var10.doRender(var1, var2, var4, var6, var8, var9);
+ var10.doRenderShadowAndFire(var1, var2, var4, var6, var8, var9);
+ }
+
+ }
+
+ public void set(World var1) {
+ this.worldObj = var1;
+ }
+
+ public double getDistanceToCamera(double var1, double var3, double var5) {
+ double var7 = var1 - this.viewerPosX;
+ double var9 = var3 - this.viewerPosY;
+ double var11 = var5 - this.viewerPosZ;
+ return var7 * var7 + var9 * var9 + var11 * var11;
+ }
+}
diff --git a/src/net/minecraft/src/RenderMinecart.java b/src/net/minecraft/src/RenderMinecart.java
new file mode 100644
index 0000000..a87bf34
--- /dev/null
+++ b/src/net/minecraft/src/RenderMinecart.java
@@ -0,0 +1,70 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderMinecart extends Render {
+ protected ModelBase modelMinecart;
+
+ public RenderMinecart() {
+ this.shadowSize = 0.5F;
+ this.modelMinecart = new ModelMinecart();
+ }
+
+ public void a(EntityMinecart var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ double var10 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9;
+ double var12 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9;
+ double var14 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9;
+ double var16 = (double)0.3F;
+ Vec3D var18 = var1.getPos(var10, var12, var14);
+ float var19 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9;
+ if(var18 != null) {
+ Vec3D var20 = var1.getPosOffset(var10, var12, var14, var16);
+ Vec3D var21 = var1.getPosOffset(var10, var12, var14, -var16);
+ if(var20 == null) {
+ var20 = var18;
+ }
+
+ if(var21 == null) {
+ var21 = var18;
+ }
+
+ var2 += var18.xCoord - var10;
+ var4 += (var20.yCoord + var21.yCoord) / 2.0D - var12;
+ var6 += var18.zCoord - var14;
+ Vec3D var22 = var21.addVector(-var20.xCoord, -var20.yCoord, -var20.zCoord);
+ if(var22.lengthVector() != 0.0D) {
+ var22 = var22.normalize();
+ var8 = (float)(Math.atan2(var22.zCoord, var22.xCoord) * 180.0D / Math.PI);
+ var19 = (float)(Math.atan(var22.yCoord) * 73.0D);
+ }
+ }
+
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-var19, 0.0F, 0.0F, 1.0F);
+ float var23 = (float)var1.timeSinceHit - var9;
+ float var24 = (float)var1.damageTaken - var9;
+ if(var24 < 0.0F) {
+ var24 = 0.0F;
+ }
+
+ if(var23 > 0.0F) {
+ GL11.glRotatef(MathHelper.sin(var23) * var23 * var24 / 10.0F * (float)var1.forwardDirection, 1.0F, 0.0F, 0.0F);
+ }
+
+ this.loadTexture("/terrain.png");
+ float var25 = 12.0F / 16.0F;
+ GL11.glScalef(var25, var25, var25);
+ (new RenderBlocks()).renderBlockOnInventory(Block.chest);
+ GL11.glScalef(1.0F / var25, 1.0F / var25, 1.0F / var25);
+ this.loadTexture("/item/cart.png");
+ GL11.glScalef(-1.0F, -1.0F, 1.0F);
+ this.modelMinecart.render(0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F);
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityMinecart)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderPainting.java b/src/net/minecraft/src/RenderPainting.java
new file mode 100644
index 0000000..4545f64
--- /dev/null
+++ b/src/net/minecraft/src/RenderPainting.java
@@ -0,0 +1,119 @@
+package net.minecraft.src;
+
+import java.util.Random;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class RenderPainting extends Render {
+ private Random rand = new Random();
+
+ public void a(EntityPainting var1, double var2, double var4, double var6, float var8, float var9) {
+ this.rand.setSeed(187L);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ GL11.glRotatef(var8, 0.0F, 1.0F, 0.0F);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ this.loadTexture("/art/kz.png");
+ EnumArt var10 = var1.art;
+ float var11 = 1.0F / 16.0F;
+ GL11.glScalef(var11, var11, var11);
+ this.setSizes(var1, var10.sizeX, var10.sizeY, var10.offsetX, var10.offsetY);
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ private void setSizes(EntityPainting var1, int var2, int var3, int var4, int var5) {
+ float var6 = (float)(-var2) / 2.0F;
+ float var7 = (float)(-var3) / 2.0F;
+ float var8 = -0.5F;
+ float var9 = 0.5F;
+
+ for(int var10 = 0; var10 < var2 / 16; ++var10) {
+ for(int var11 = 0; var11 < var3 / 16; ++var11) {
+ float var12 = var6 + (float)((var10 + 1) * 16);
+ float var13 = var6 + (float)(var10 * 16);
+ float var14 = var7 + (float)((var11 + 1) * 16);
+ float var15 = var7 + (float)(var11 * 16);
+ this.getOffset(var1, (var12 + var13) / 2.0F, (var14 + var15) / 2.0F);
+ float var16 = (float)(var4 + var2 - var10 * 16) / 256.0F;
+ float var17 = (float)(var4 + var2 - (var10 + 1) * 16) / 256.0F;
+ float var18 = (float)(var5 + var3 - var11 * 16) / 256.0F;
+ float var19 = (float)(var5 + var3 - (var11 + 1) * 16) / 256.0F;
+ float var20 = 12.0F / 16.0F;
+ float var21 = 13.0F / 16.0F;
+ float var22 = 0.0F;
+ float var23 = 1.0F / 16.0F;
+ float var24 = 12.0F / 16.0F;
+ float var25 = 13.0F / 16.0F;
+ float var26 = 0.001953125F;
+ float var27 = 0.001953125F;
+ float var28 = 385.0F / 512.0F;
+ float var29 = 385.0F / 512.0F;
+ float var30 = 0.0F;
+ float var31 = 1.0F / 16.0F;
+ Tessellator var32 = Tessellator.instance;
+ var32.startDrawingQuads();
+ var32.setNormal(0.0F, 0.0F, -1.0F);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var8, (double)var17, (double)var18);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var8, (double)var16, (double)var18);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var8, (double)var16, (double)var19);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var8, (double)var17, (double)var19);
+ var32.setNormal(0.0F, 0.0F, 1.0F);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var9, (double)var20, (double)var22);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var9, (double)var21, (double)var22);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var9, (double)var21, (double)var23);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var9, (double)var20, (double)var23);
+ var32.setNormal(0.0F, -1.0F, 0.0F);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var8, (double)var24, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var8, (double)var25, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var9, (double)var25, (double)var27);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var9, (double)var24, (double)var27);
+ var32.setNormal(0.0F, 1.0F, 0.0F);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var9, (double)var24, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var9, (double)var25, (double)var26);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var8, (double)var25, (double)var27);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var8, (double)var24, (double)var27);
+ var32.setNormal(-1.0F, 0.0F, 0.0F);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var9, (double)var29, (double)var30);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var9, (double)var29, (double)var31);
+ var32.addVertexWithUV((double)var12, (double)var15, (double)var8, (double)var28, (double)var31);
+ var32.addVertexWithUV((double)var12, (double)var14, (double)var8, (double)var28, (double)var30);
+ var32.setNormal(1.0F, 0.0F, 0.0F);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var8, (double)var29, (double)var30);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var8, (double)var29, (double)var31);
+ var32.addVertexWithUV((double)var13, (double)var15, (double)var9, (double)var28, (double)var31);
+ var32.addVertexWithUV((double)var13, (double)var14, (double)var9, (double)var28, (double)var30);
+ var32.draw();
+ }
+ }
+
+ }
+
+ private void getOffset(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.direction == 0) {
+ var4 = MathHelper.floor_double(var1.posX + (double)(var2 / 16.0F));
+ }
+
+ if(var1.direction == 1) {
+ var6 = MathHelper.floor_double(var1.posZ - (double)(var2 / 16.0F));
+ }
+
+ if(var1.direction == 2) {
+ var4 = MathHelper.floor_double(var1.posX - (double)(var2 / 16.0F));
+ }
+
+ if(var1.direction == 3) {
+ var6 = MathHelper.floor_double(var1.posZ + (double)(var2 / 16.0F));
+ }
+
+ float var7 = this.renderManager.worldObj.getBrightness(var4, var5, var6);
+ GL11.glColor3f(var7, var7, var7);
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityPainting)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderPig.java b/src/net/minecraft/src/RenderPig.java
new file mode 100644
index 0000000..66a193e
--- /dev/null
+++ b/src/net/minecraft/src/RenderPig.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class RenderPig extends RenderLiving {
+ public RenderPig(ModelBase var1, ModelBase var2, float var3) {
+ super(var1, var3);
+ this.setRenderPassModel(var2);
+ }
+
+ protected boolean a(EntityPig var1, int var2) {
+ this.loadTexture("/mob/saddle.png");
+ return var2 == 0 && var1.saddled;
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntityPig)var1, var2);
+ }
+}
diff --git a/src/net/minecraft/src/RenderPlayer.java b/src/net/minecraft/src/RenderPlayer.java
new file mode 100644
index 0000000..af1ce50
--- /dev/null
+++ b/src/net/minecraft/src/RenderPlayer.java
@@ -0,0 +1,55 @@
+package net.minecraft.src;
+
+public class RenderPlayer extends RenderLiving {
+ private ModelBiped modelBipedMain = (ModelBiped)this.mainModel;
+ private ModelBiped modelArmorChestplate = new ModelBiped(1.0F);
+ private ModelBiped modelArmor = new ModelBiped(0.5F);
+ private static final String[] armorFilenamePrefix = new String[]{"cloth", "chain", "iron", "diamond", "gold"};
+
+ public RenderPlayer() {
+ super(new ModelBiped(0.0F), 0.5F);
+ }
+
+ protected boolean a(EntityPlayer var1, int var2) {
+ ItemStack var3 = var1.inventory.armorItemInSlot(3 - var2);
+ if(var3 != null) {
+ Item var4 = var3.getItem();
+ if(var4 instanceof ItemArmor) {
+ ItemArmor var5 = (ItemArmor)var4;
+ this.loadTexture("/armor/" + armorFilenamePrefix[var5.renderIndex] + "_" + (var2 == 2 ? 2 : 1) + ".png");
+ ModelBiped var6 = var2 == 2 ? this.modelArmor : this.modelArmorChestplate;
+ var6.bipedHead.showModel = var2 == 0;
+ var6.bipedHeadwear.showModel = var2 == 0;
+ var6.bipedBody.showModel = var2 == 1 || var2 == 2;
+ var6.bipedRightArm.showModel = var2 == 1;
+ var6.bipedLeftArm.showModel = var2 == 1;
+ var6.bipedRightLeg.showModel = var2 == 2 || var2 == 3;
+ var6.bipedLeftLeg.showModel = var2 == 2 || var2 == 3;
+ this.setRenderPassModel(var6);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public void a(EntityPlayer var1, double var2, double var4, double var6, float var8, float var9) {
+ super.a(var1, var2, var4 - (double)var1.yOffset, var6, var8, var9);
+ }
+
+ public void drawFirstPersonHand() {
+ this.modelBipedMain.bipedRightArm.render(1.0F / 16.0F);
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntityPlayer)var1, var2);
+ }
+
+ public void a(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityPlayer)var1, var2, var4, var6, var8, var9);
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityPlayer)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/RenderSheep.java b/src/net/minecraft/src/RenderSheep.java
new file mode 100644
index 0000000..e7e8d6f
--- /dev/null
+++ b/src/net/minecraft/src/RenderSheep.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class RenderSheep extends RenderLiving {
+ public RenderSheep(ModelBase var1, ModelBase var2, float var3) {
+ super(var1, var3);
+ this.setRenderPassModel(var2);
+ }
+
+ protected boolean a(EntitySheep var1, int var2) {
+ this.loadTexture("/mob/sheep_fur.png");
+ return var2 == 0 && !var1.sheared;
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntitySheep)var1, var2);
+ }
+}
diff --git a/src/net/minecraft/src/RenderSorter.java b/src/net/minecraft/src/RenderSorter.java
new file mode 100644
index 0000000..04a4d3a
--- /dev/null
+++ b/src/net/minecraft/src/RenderSorter.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+import java.util.Comparator;
+
+public class RenderSorter implements Comparator {
+ private EntityPlayer entity;
+
+ public RenderSorter(EntityPlayer var1) {
+ this.entity = var1;
+ }
+
+ public int a(WorldRenderer var1, WorldRenderer var2) {
+ boolean var3 = var1.isInFrustum;
+ boolean var4 = var2.isInFrustum;
+ return var3 && !var4 ? 1 : (var4 && !var3 ? -1 : (var1.distanceToEntitySquared(this.entity) < var2.distanceToEntitySquared(this.entity) ? 1 : -1));
+ }
+
+ public int compare(Object var1, Object var2) {
+ return this.a((WorldRenderer)var1, (WorldRenderer)var2);
+ }
+}
diff --git a/src/net/minecraft/src/RenderSpider.java b/src/net/minecraft/src/RenderSpider.java
new file mode 100644
index 0000000..18972d7
--- /dev/null
+++ b/src/net/minecraft/src/RenderSpider.java
@@ -0,0 +1,38 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderSpider extends RenderLiving {
+ public RenderSpider() {
+ super(new ModelSpider(), 1.0F);
+ this.setRenderPassModel(new ModelSpider());
+ }
+
+ protected float a(EntitySpider var1) {
+ return 180.0F;
+ }
+
+ protected boolean a(EntitySpider var1, int var2) {
+ if(var2 != 0) {
+ return false;
+ } else if(var2 != 0) {
+ return false;
+ } else {
+ this.loadTexture("/mob/spider_eyes.png");
+ float var3 = (1.0F - var1.getEntityBrightness(1.0F)) * 0.5F;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, var3);
+ return true;
+ }
+ }
+
+ protected float getMaxDeathRotation(EntityLiving var1) {
+ return this.a((EntitySpider)var1);
+ }
+
+ protected boolean shouldRenderPass(EntityLiving var1, int var2) {
+ return this.a((EntitySpider)var1, var2);
+ }
+}
diff --git a/src/net/minecraft/src/RenderTNTPrimed.java b/src/net/minecraft/src/RenderTNTPrimed.java
new file mode 100644
index 0000000..b93ef70
--- /dev/null
+++ b/src/net/minecraft/src/RenderTNTPrimed.java
@@ -0,0 +1,54 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderTNTPrimed extends Render {
+ private RenderBlocks blockRenderer = new RenderBlocks();
+
+ public RenderTNTPrimed() {
+ this.shadowSize = 0.5F;
+ }
+
+ public void a(EntityTNTPrimed var1, double var2, double var4, double var6, float var8, float var9) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2, (float)var4, (float)var6);
+ 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) {
+ var10 = 0.0F;
+ }
+
+ if(var10 > 1.0F) {
+ var10 = 1.0F;
+ }
+
+ var10 *= var10;
+ var10 *= var10;
+ float var11 = 1.0F + var10 * 0.3F;
+ GL11.glScalef(var11, var11, var11);
+ }
+
+ var10 = (1.0F - ((float)var1.fuse - var9 + 1.0F) / 100.0F) * 0.8F;
+ this.loadTexture("/terrain.png");
+ this.blockRenderer.renderBlockOnInventory(Block.tnt);
+ if(var1.fuse / 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, var10);
+ this.blockRenderer.renderBlockOnInventory(Block.tnt);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ GL11.glPopMatrix();
+ }
+
+ public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
+ this.a((EntityTNTPrimed)var1, var2, var4, var6, var8, var9);
+ }
+}
diff --git a/src/net/minecraft/src/ScaledResolution.java b/src/net/minecraft/src/ScaledResolution.java
new file mode 100644
index 0000000..7d6ed74
--- /dev/null
+++ b/src/net/minecraft/src/ScaledResolution.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class ScaledResolution {
+ private int scaledWidth;
+ private int scaledHeight;
+
+ public ScaledResolution(int var1, int var2) {
+ this.scaledWidth = var1;
+ this.scaledHeight = var2;
+
+ int var3;
+ for(var3 = 1; this.scaledWidth / (var3 + 1) >= 320 && this.scaledHeight / (var3 + 1) >= 240; ++var3) {
+ }
+
+ this.scaledWidth /= var3;
+ this.scaledHeight /= var3;
+ }
+
+ public int getScaledWidth() {
+ return this.scaledWidth;
+ }
+
+ public int getScaledHeight() {
+ return this.scaledHeight;
+ }
+}
diff --git a/src/net/minecraft/src/Session.java b/src/net/minecraft/src/Session.java
new file mode 100644
index 0000000..853aa65
--- /dev/null
+++ b/src/net/minecraft/src/Session.java
@@ -0,0 +1,48 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Session {
+ public static List registeredBlocksList = new ArrayList();
+ public String username;
+ public String sessionId;
+ public String mpPassParameter;
+
+ public Session(String var1, String var2) {
+ this.username = var1;
+ this.sessionId = var2;
+ }
+
+ static {
+ registeredBlocksList.add(Block.stone);
+ registeredBlocksList.add(Block.cobblestone);
+ registeredBlocksList.add(Block.brick);
+ registeredBlocksList.add(Block.dirt);
+ registeredBlocksList.add(Block.planks);
+ registeredBlocksList.add(Block.wood);
+ registeredBlocksList.add(Block.leaves);
+ registeredBlocksList.add(Block.torch);
+ registeredBlocksList.add(Block.stairSingle);
+ registeredBlocksList.add(Block.glass);
+ registeredBlocksList.add(Block.cobblestoneMossy);
+ registeredBlocksList.add(Block.sapling);
+ registeredBlocksList.add(Block.plantYellow);
+ registeredBlocksList.add(Block.plantRed);
+ registeredBlocksList.add(Block.mushroomBrown);
+ registeredBlocksList.add(Block.mushroomRed);
+ registeredBlocksList.add(Block.sand);
+ registeredBlocksList.add(Block.gravel);
+ registeredBlocksList.add(Block.sponge);
+ registeredBlocksList.add(Block.cloth);
+ registeredBlocksList.add(Block.oreCoal);
+ registeredBlocksList.add(Block.oreIron);
+ registeredBlocksList.add(Block.oreGold);
+ registeredBlocksList.add(Block.blockSteel);
+ registeredBlocksList.add(Block.blockGold);
+ registeredBlocksList.add(Block.bookshelf);
+ registeredBlocksList.add(Block.tnt);
+ registeredBlocksList.add(Block.obsidian);
+ System.out.println(registeredBlocksList.size());
+ }
+}
diff --git a/src/net/minecraft/src/SignModel.java b/src/net/minecraft/src/SignModel.java
new file mode 100644
index 0000000..9325b7b
--- /dev/null
+++ b/src/net/minecraft/src/SignModel.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+public class SignModel {
+ public ModelRenderer signBoard = new ModelRenderer(0, 0);
+ public ModelRenderer signStick;
+
+ public SignModel() {
+ this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F);
+ this.signStick = new ModelRenderer(0, 14);
+ this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F);
+ }
+
+ public void renderSign() {
+ this.signBoard.render(1.0F / 16.0F);
+ this.signStick.render(1.0F / 16.0F);
+ }
+}
diff --git a/src/net/minecraft/src/Slot.java b/src/net/minecraft/src/Slot.java
new file mode 100644
index 0000000..543f4ca
--- /dev/null
+++ b/src/net/minecraft/src/Slot.java
@@ -0,0 +1,50 @@
+package net.minecraft.src;
+
+public class Slot {
+ public final int slotIndex;
+ public final int xDisplayPosition;
+ public final int yDisplayPosition;
+ public final IInventory inventory;
+ private final GuiContainer inventoryGui;
+
+ public Slot(GuiContainer var1, IInventory var2, int var3, int var4, int var5) {
+ this.inventoryGui = var1;
+ this.inventory = var2;
+ this.slotIndex = var3;
+ this.xDisplayPosition = var4;
+ this.yDisplayPosition = var5;
+ }
+
+ public boolean getIsMouseOverSlot(int var1, int var2) {
+ int var3 = (this.inventoryGui.width - this.inventoryGui.xSize) / 2;
+ int var4 = (this.inventoryGui.height - this.inventoryGui.ySize) / 2;
+ var1 -= var3;
+ var2 -= var4;
+ return var1 >= this.xDisplayPosition - 1 && var1 < this.xDisplayPosition + 16 + 1 && var2 >= this.yDisplayPosition - 1 && var2 < this.yDisplayPosition + 16 + 1;
+ }
+
+ public void onPickupFromSlot() {
+ this.onSlotChanged();
+ }
+
+ public boolean isItemValid(ItemStack var1) {
+ return true;
+ }
+
+ public ItemStack getStack() {
+ return this.inventory.getStackInSlot(this.slotIndex);
+ }
+
+ public void putStack(ItemStack var1) {
+ this.inventory.setInventorySlotContents(this.slotIndex, var1);
+ this.onSlotChanged();
+ }
+
+ public int getBackgroundIconIndex() {
+ return -1;
+ }
+
+ public void onSlotChanged() {
+ this.inventory.onInventoryChanged();
+ }
+}
diff --git a/src/net/minecraft/src/SlotArmor.java b/src/net/minecraft/src/SlotArmor.java
new file mode 100644
index 0000000..cf2689f
--- /dev/null
+++ b/src/net/minecraft/src/SlotArmor.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+class SlotArmor extends Slot {
+ final int armorType;
+ final GuiInventory guiInventory;
+
+ SlotArmor(GuiInventory var1, GuiContainer var2, IInventory var3, int var4, int var5, int var6, int var7) {
+ super(var2, var3, var4, var5, var6);
+ this.guiInventory = var1;
+ this.armorType = var7;
+ }
+
+ public boolean isItemValid(ItemStack var1) {
+ return var1.getItem() instanceof ItemArmor ? ((ItemArmor)var1.getItem()).armorType == this.armorType : false;
+ }
+
+ public int getBackgroundIconIndex() {
+ return 15 + this.armorType * 16;
+ }
+}
diff --git a/src/net/minecraft/src/SlotCrafting.java b/src/net/minecraft/src/SlotCrafting.java
new file mode 100644
index 0000000..4a49dc1
--- /dev/null
+++ b/src/net/minecraft/src/SlotCrafting.java
@@ -0,0 +1,23 @@
+package net.minecraft.src;
+
+class SlotCrafting extends Slot {
+ private final IInventory craftMatrix;
+
+ public SlotCrafting(GuiContainer var1, IInventory var2, IInventory var3, int var4, int var5, int var6) {
+ super(var1, var3, var4, var5, var6);
+ this.craftMatrix = var2;
+ }
+
+ public boolean isItemValid(ItemStack var1) {
+ return false;
+ }
+
+ public void onPickupFromSlot() {
+ for(int var1 = 0; var1 < this.craftMatrix.getSizeInventory(); ++var1) {
+ if(this.craftMatrix.getStackInSlot(var1) != null) {
+ this.craftMatrix.decrStackSize(var1, 1);
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/SoundManager.java b/src/net/minecraft/src/SoundManager.java
new file mode 100644
index 0000000..17d5492
--- /dev/null
+++ b/src/net/minecraft/src/SoundManager.java
@@ -0,0 +1,138 @@
+package net.minecraft.src;
+
+import java.io.File;
+import paulscode.sound.SoundSystem;
+import paulscode.sound.SoundSystemConfig;
+import paulscode.sound.codecs.CodecJOrbis;
+import paulscode.sound.codecs.CodecWav;
+import paulscode.sound.libraries.LibraryLWJGLOpenAL;
+
+public class SoundManager {
+ private SoundSystem sndSystem;
+ private SoundPool soundPoolSounds = new SoundPool();
+ private SoundPool soundPoolMusic = new SoundPool();
+ private int latestSoundID = 0;
+ private GameSettings options;
+ private boolean loaded = false;
+
+ public void loadSoundSettings(GameSettings var1) {
+ this.options = var1;
+ if(!this.loaded && (var1.sound || var1.music)) {
+ this.tryToSetLibraryAndCodecs();
+ }
+
+ }
+
+ private void tryToSetLibraryAndCodecs() {
+ try {
+ boolean var1 = this.options.sound;
+ boolean var2 = this.options.music;
+ this.options.sound = false;
+ this.options.music = false;
+ this.options.saveOptions();
+ SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
+ SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
+ SoundSystemConfig.setCodec("wav", CodecWav.class);
+ this.sndSystem = new SoundSystem();
+ this.options.sound = var1;
+ this.options.music = var2;
+ this.options.saveOptions();
+ } catch (Throwable var3) {
+ System.err.println("error linking with the LibraryJavaSound plug-in");
+ }
+
+ this.loaded = true;
+ }
+
+ public void onSoundOptionsChanged() {
+ if(!this.loaded && (this.options.sound || this.options.music)) {
+ this.tryToSetLibraryAndCodecs();
+ }
+
+ if(!this.options.music) {
+ this.sndSystem.stop("BgMusic");
+ }
+
+ }
+
+ public void closeMinecraft() {
+ if(this.loaded) {
+ this.sndSystem.cleanup();
+ }
+
+ }
+
+ public void addSound(String var1, File var2) {
+ this.soundPoolSounds.addSound(var1, var2);
+ }
+
+ public void addMusic(String var1, File var2) {
+ this.soundPoolMusic.addSound(var1, var2);
+ }
+
+ public void setListener(EntityLiving var1, float var2) {
+ if(this.loaded && this.options.sound) {
+ if(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);
+ float var13 = MathHelper.cos(-var3 * ((float)Math.PI / 180.0F));
+ float var14 = MathHelper.sin(-var3 * ((float)Math.PI / 180.0F));
+ float var15 = -var12 * var13;
+ float var17 = -var11 * var13;
+ float var18 = -var12 * var14;
+ float var20 = -var11 * var14;
+ this.sndSystem.setListenerPosition((float)var5, (float)var7, (float)var9);
+ this.sndSystem.setListenerOrientation(var15, var14, var17, var18, var13, var20);
+ }
+ }
+ }
+
+ public void playSound(String var1, float var2, float var3, float var4, float var5, float var6) {
+ if(this.loaded && this.options.sound) {
+ 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.sndSystem.newSource(var5 > 1.0F, var8, var7.soundUrl, var7.soundName, false, var2, var3, var4, 2, var9);
+ this.sndSystem.setPitch(var8, var6);
+ if(var5 > 1.0F) {
+ var5 = 1.0F;
+ }
+
+ this.sndSystem.setVolume(var8, var5);
+ this.sndSystem.play(var8);
+ }
+
+ }
+ }
+
+ public void playSoundFX(String var1, float var2, float var3) {
+ if(this.loaded && this.options.sound) {
+ SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(var1);
+ if(var4 != null) {
+ this.latestSoundID = (this.latestSoundID + 1) % 256;
+ String var5 = "sound_" + this.latestSoundID;
+ this.sndSystem.newSource(false, var5, var4.soundUrl, var4.soundName, false, 0.0F, 0.0F, 0.0F, 0, 0.0F);
+ if(var2 > 1.0F) {
+ var2 = 1.0F;
+ }
+
+ var2 *= 0.25F;
+ this.sndSystem.setPitch(var5, var3);
+ this.sndSystem.setVolume(var5, var2);
+ this.sndSystem.play(var5);
+ }
+
+ }
+ }
+}
diff --git a/src/net/minecraft/src/SoundPool.java b/src/net/minecraft/src/SoundPool.java
new file mode 100644
index 0000000..ab70ae6
--- /dev/null
+++ b/src/net/minecraft/src/SoundPool.java
@@ -0,0 +1,42 @@
+package net.minecraft.src;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+public class SoundPool {
+ private Random rand = new Random();
+ private Map nameToSoundPoolEntriesMapping = new HashMap();
+ public int numberOfSoundPoolEntries = 0;
+
+ public SoundPoolEntry addSound(String var1, File var2) {
+ try {
+ String var3 = var1;
+
+ for(var1 = var1.substring(0, var1.indexOf(".")); Character.isDigit(var1.charAt(var1.length() - 1)); var1 = var1.substring(0, var1.length() - 1)) {
+ }
+
+ var1 = var1.replaceAll("/", ".");
+ if(!this.nameToSoundPoolEntriesMapping.containsKey(var1)) {
+ this.nameToSoundPoolEntriesMapping.put(var1, new ArrayList());
+ }
+
+ SoundPoolEntry var4 = new SoundPoolEntry(var3, var2.toURI().toURL());
+ ((List)this.nameToSoundPoolEntriesMapping.get(var1)).add(var4);
+ ++this.numberOfSoundPoolEntries;
+ return var4;
+ } catch (MalformedURLException var5) {
+ var5.printStackTrace();
+ throw new RuntimeException(var5);
+ }
+ }
+
+ public SoundPoolEntry getRandomSoundFromSoundPool(String var1) {
+ List var2 = (List)this.nameToSoundPoolEntriesMapping.get(var1);
+ return var2 == null ? null : (SoundPoolEntry)var2.get(this.rand.nextInt(var2.size()));
+ }
+}
diff --git a/src/net/minecraft/src/SoundPoolEntry.java b/src/net/minecraft/src/SoundPoolEntry.java
new file mode 100644
index 0000000..341e9ba
--- /dev/null
+++ b/src/net/minecraft/src/SoundPoolEntry.java
@@ -0,0 +1,13 @@
+package net.minecraft.src;
+
+import java.net.URL;
+
+public class SoundPoolEntry {
+ public String soundName;
+ public URL soundUrl;
+
+ public SoundPoolEntry(String var1, URL var2) {
+ this.soundName = var1;
+ this.soundUrl = var2;
+ }
+}
diff --git a/src/net/minecraft/src/SpawnerAnimals.java b/src/net/minecraft/src/SpawnerAnimals.java
new file mode 100644
index 0000000..8acc13f
--- /dev/null
+++ b/src/net/minecraft/src/SpawnerAnimals.java
@@ -0,0 +1,97 @@
+package net.minecraft.src;
+
+public class SpawnerAnimals {
+ private int maxSpawns;
+ private Class entityType;
+ private Class[] entities;
+
+ public SpawnerAnimals(int var1, Class var2, Class[] var3) {
+ this.maxSpawns = var1;
+ this.entityType = var2;
+ this.entities = var3;
+ }
+
+ public void onUpdate(World var1) {
+ int var2 = var1.countEntities(this.entityType);
+ if(var2 < this.maxSpawns) {
+ for(int var3 = 0; var3 < 10; ++var3) {
+ this.performSpawning(var1, 1, var1.playerEntity, (IProgressUpdate)null);
+ }
+ }
+
+ }
+
+ protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
+ int var4 = var2 + var1.rand.nextInt(256) - 128;
+ int var5 = var1.rand.nextInt(128);
+ int var6 = var3 + var1.rand.nextInt(256) - 128;
+ return new ChunkPosition(var4, var5, var6);
+ }
+
+ private int performSpawning(World var1, int var2, Entity var3, IProgressUpdate var4) {
+ int var5 = 0;
+ int var6 = MathHelper.floor_double(var3.posX);
+ int var7 = MathHelper.floor_double(var3.posZ);
+ int var8 = var1.rand.nextInt(this.entities.length);
+ ChunkPosition var9 = this.getRandomSpawningPointInChunk(var1, var6, var7);
+ int var10 = var9.x;
+ int var11 = var9.y;
+ int var12 = var9.z;
+ if(var1.isBlockNormalCube(var10, var11, var12)) {
+ return 0;
+ } else if(var1.getBlockMaterial(var10, var11, var12) != Material.air) {
+ return 0;
+ } else {
+ for(int var13 = 0; var13 < 3; ++var13) {
+ int var14 = var10;
+ int var15 = var11;
+ int var16 = var12;
+ byte var17 = 6;
+
+ for(int var18 = 0; var18 < 3; ++var18) {
+ var14 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17);
+ var15 += var1.rand.nextInt(1) - var1.rand.nextInt(1);
+ var16 += var1.rand.nextInt(var17) - var1.rand.nextInt(var17);
+ if(var1.isBlockNormalCube(var14, var15 - 1, var16) && !var1.isBlockNormalCube(var14, var15, var16) && !var1.getBlockMaterial(var14, var15, var16).getIsLiquid() && !var1.isBlockNormalCube(var14, var15 + 1, var16)) {
+ float var19 = (float)var14 + 0.5F;
+ float var20 = (float)var15 + 1.0F;
+ float var21 = (float)var16 + 0.5F;
+ if(var3 != null) {
+ double var22 = (double)var19 - var3.posX;
+ double var24 = (double)var20 - var3.posY;
+ double var26 = (double)var21 - var3.posZ;
+ double var28 = var22 * var22 + var24 * var24 + var26 * var26;
+ if(var28 < 1024.0D) {
+ continue;
+ }
+ } else {
+ float var31 = var19 - (float)var1.spawnX;
+ float var23 = var20 - (float)var1.spawnY;
+ float var33 = var21 - (float)var1.spawnZ;
+ float var25 = var31 * var31 + var23 * var23 + var33 * var33;
+ if(var25 < 1024.0F) {
+ continue;
+ }
+ }
+
+ EntityLiving var32;
+ try {
+ var32 = (EntityLiving)this.entities[var8].getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
+ } catch (Exception var30) {
+ var30.printStackTrace();
+ return var5;
+ }
+
+ var32.setPositionAndRotation((double)var19, (double)var20, (double)var21, var1.rand.nextFloat() * 360.0F, 0.0F);
+ if(var32.getCanSpawnHere((double)var19, (double)var20, (double)var21)) {
+ ++var5;
+ var1.spawnEntityInWorld(var32);
+ }
+ }
+ }
+ }
+
+ return var5;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/SpawnerMonsters.java b/src/net/minecraft/src/SpawnerMonsters.java
new file mode 100644
index 0000000..d253214
--- /dev/null
+++ b/src/net/minecraft/src/SpawnerMonsters.java
@@ -0,0 +1,17 @@
+package net.minecraft.src;
+
+class SpawnerMonsters extends SpawnerAnimals {
+ final PlayerControllerSP playerController;
+
+ SpawnerMonsters(PlayerControllerSP var1, int var2, Class var3, Class[] var4) {
+ super(var2, var3, var4);
+ this.playerController = var1;
+ }
+
+ protected ChunkPosition getRandomSpawningPointInChunk(World var1, int var2, int var3) {
+ int var4 = var2 + var1.rand.nextInt(256) - 128;
+ int var5 = var1.rand.nextInt(var1.rand.nextInt(var1.rand.nextInt(112) + 8) + 8);
+ int var6 = var3 + var1.rand.nextInt(256) - 128;
+ return new ChunkPosition(var4, var5, var6);
+ }
+}
diff --git a/src/net/minecraft/src/StepSound.java b/src/net/minecraft/src/StepSound.java
new file mode 100644
index 0000000..ad50bb0
--- /dev/null
+++ b/src/net/minecraft/src/StepSound.java
@@ -0,0 +1,29 @@
+package net.minecraft.src;
+
+public class StepSound {
+ public final String stepSoundName;
+ public final float stepSoundVolume;
+ public final float stepSoundPitch;
+
+ public StepSound(String var1, float var2, float var3) {
+ this.stepSoundName = var1;
+ this.stepSoundVolume = var2;
+ this.stepSoundPitch = var3;
+ }
+
+ public float getVolume() {
+ return this.stepSoundVolume;
+ }
+
+ public float getPitch() {
+ return this.stepSoundPitch;
+ }
+
+ public String getBreakSound() {
+ return "step." + this.stepSoundName;
+ }
+
+ public String getStepSound() {
+ return "step." + this.stepSoundName;
+ }
+}
diff --git a/src/net/minecraft/src/StepSoundGlass.java b/src/net/minecraft/src/StepSoundGlass.java
new file mode 100644
index 0000000..a7f7d81
--- /dev/null
+++ b/src/net/minecraft/src/StepSoundGlass.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+final class StepSoundGlass extends StepSound {
+ StepSoundGlass(String var1, float var2, float var3) {
+ super(var1, var2, var3);
+ }
+
+ public String getBreakSound() {
+ return "random.glass";
+ }
+}
diff --git a/src/net/minecraft/src/StepSoundSand.java b/src/net/minecraft/src/StepSoundSand.java
new file mode 100644
index 0000000..f1e2705
--- /dev/null
+++ b/src/net/minecraft/src/StepSoundSand.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+final class StepSoundSand extends StepSound {
+ StepSoundSand(String var1, float var2, float var3) {
+ super(var1, var2, var3);
+ }
+
+ public String getBreakSound() {
+ return "step.gravel";
+ }
+}
diff --git a/src/net/minecraft/src/TerrainTextureManager.java b/src/net/minecraft/src/TerrainTextureManager.java
new file mode 100644
index 0000000..e6acf43
--- /dev/null
+++ b/src/net/minecraft/src/TerrainTextureManager.java
@@ -0,0 +1,214 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.Arrays;
+import javax.imageio.ImageIO;
+
+public class TerrainTextureManager {
+ private float[] texCols = new float[768];
+ private int[] pixels = new int[5120];
+ private int[] zBuf = new int[5120];
+ private int[] waterBuf = new int[5120];
+ private int[] waterBr = new int[5120];
+ private int[] yBuf = new int[34];
+ private int[] textures = new int[768];
+
+ public TerrainTextureManager() {
+ try {
+ BufferedImage var1 = ImageIO.read(TerrainTextureManager.class.getResource("/terrain.png"));
+ int[] var2 = new int[65536];
+ var1.getRGB(0, 0, 256, 256, var2, 0, 256);
+
+ for(int var3 = 0; var3 < 256; ++var3) {
+ int var4 = 0;
+ int var5 = 0;
+ int var6 = 0;
+ int var7 = var3 % 16 * 16;
+ int var8 = var3 / 16 * 16;
+ int var9 = 0;
+
+ for(int var10 = 0; var10 < 16; ++var10) {
+ for(int var11 = 0; var11 < 16; ++var11) {
+ int var12 = var2[var11 + var7 + (var10 + var8) * 256];
+ int var13 = var12 >> 24 & 255;
+ if(var13 > 128) {
+ var4 += var12 >> 16 & 255;
+ var5 += var12 >> 8 & 255;
+ var6 += var12 & 255;
+ ++var9;
+ }
+ }
+
+ if(var9 == 0) {
+ ++var9;
+ }
+
+ this.texCols[var3 * 3 + 0] = (float)(var4 / var9);
+ this.texCols[var3 * 3 + 1] = (float)(var5 / var9);
+ this.texCols[var3 * 3 + 2] = (float)(var6 / var9);
+ }
+ }
+ } catch (IOException var14) {
+ var14.printStackTrace();
+ }
+
+ for(int var15 = 0; var15 < 256; ++var15) {
+ if(Block.blocksList[var15] != null) {
+ this.textures[var15 * 3 + 0] = Block.blocksList[var15].getBlockTextureFromSide(1);
+ this.textures[var15 * 3 + 1] = Block.blocksList[var15].getBlockTextureFromSide(2);
+ this.textures[var15 * 3 + 2] = Block.blocksList[var15].getBlockTextureFromSide(3);
+ }
+ }
+
+ }
+
+ public void render(IsoImageBuffer var1) {
+ World var2 = var1.level;
+ if(var2 == null) {
+ var1.noContent = true;
+ var1.rendered = true;
+ } else {
+ int var3 = var1.chunkX * 16;
+ int var4 = var1.chunkZ * 16;
+ int var5 = var3 + 16;
+ int var6 = var4 + 16;
+ Chunk var7 = var2.getChunkFromChunkCoords(var1.chunkX, var1.chunkZ);
+ if(var7.isChunkRendered) {
+ var1.noContent = true;
+ var1.rendered = true;
+ } else {
+ var1.noContent = false;
+ Arrays.fill(this.zBuf, 0);
+ Arrays.fill(this.waterBuf, 0);
+ Arrays.fill(this.yBuf, 160);
+
+ for(int var8 = var6 - 1; var8 >= var4; --var8) {
+ for(int var9 = var5 - 1; var9 >= var3; --var9) {
+ int var10 = var9 - var3;
+ int var11 = var8 - var4;
+ int var12 = var10 + var11;
+ boolean var13 = true;
+
+ for(int var14 = 0; var14 < 128; ++var14) {
+ int var15 = var11 - var10 - var14 + 160 - 16;
+ if(var15 < this.yBuf[var12] || var15 < this.yBuf[var12 + 1]) {
+ Block var16 = Block.blocksList[var2.getBlockId(var9, var14, var8)];
+ if(var16 == null) {
+ var13 = false;
+ } else if(var16.blockMaterial == Material.water) {
+ int var24 = var2.getBlockId(var9, var14 + 1, var8);
+ if(var24 == 0 || Block.blocksList[var24].blockMaterial != Material.water) {
+ float var25 = (float)var14 / 127.0F * 0.6F + 0.4F;
+ float var26 = var2.getBrightness(var9, var14 + 1, var8) * var25;
+ if(var15 >= 0 && var15 < 160) {
+ int var27 = var12 + var15 * 32;
+ if(var12 >= 0 && var12 <= 32 && this.waterBuf[var27] <= var14) {
+ this.waterBuf[var27] = var14;
+ this.waterBr[var27] = (int)(var26 * 127.0F);
+ }
+
+ if(var12 >= -1 && var12 <= 31 && this.waterBuf[var27 + 1] <= var14) {
+ this.waterBuf[var27 + 1] = var14;
+ this.waterBr[var27 + 1] = (int)(var26 * 127.0F);
+ }
+
+ var13 = false;
+ }
+ }
+ } else {
+ if(var13) {
+ if(var15 < this.yBuf[var12]) {
+ this.yBuf[var12] = var15;
+ }
+
+ if(var15 < this.yBuf[var12 + 1]) {
+ this.yBuf[var12 + 1] = var15;
+ }
+ }
+
+ float var17 = (float)var14 / 127.0F * 0.6F + 0.4F;
+ int var18;
+ int var19;
+ float var20;
+ float var22;
+ if(var15 >= 0 && var15 < 160) {
+ var18 = var12 + var15 * 32;
+ var19 = this.textures[var16.blockID * 3 + 0];
+ var20 = (var2.getBrightness(var9, var14 + 1, var8) * 0.8F + 0.2F) * var17;
+ if(var12 >= 0 && this.zBuf[var18] <= var14) {
+ this.zBuf[var18] = var14;
+ this.pixels[var18] = -16777216 | (int)(this.texCols[var19 * 3 + 0] * var20) << 16 | (int)(this.texCols[var19 * 3 + 1] * var20) << 8 | (int)(this.texCols[var19 * 3 + 2] * var20);
+ }
+
+ if(var12 < 31) {
+ var22 = var20 * 0.9F;
+ if(this.zBuf[var18 + 1] <= var14) {
+ this.zBuf[var18 + 1] = var14;
+ this.pixels[var18 + 1] = -16777216 | (int)(this.texCols[var19 * 3 + 0] * var22) << 16 | (int)(this.texCols[var19 * 3 + 1] * var22) << 8 | (int)(this.texCols[var19 * 3 + 2] * var22);
+ }
+ }
+ }
+
+ if(var15 >= -1 && var15 < 159) {
+ var18 = var12 + (var15 + 1) * 32;
+ var19 = this.textures[var16.blockID * 3 + 1];
+ var20 = var2.getBrightness(var9 - 1, var14, var8) * 0.8F + 0.2F;
+ int var21 = this.textures[var16.blockID * 3 + 2];
+ var22 = var2.getBrightness(var9, var14, var8 + 1) * 0.8F + 0.2F;
+ float var23;
+ if(var12 >= 0) {
+ var23 = var20 * var17 * 0.6F;
+ if(this.zBuf[var18] <= var14 - 1) {
+ this.zBuf[var18] = var14 - 1;
+ this.pixels[var18] = -16777216 | (int)(this.texCols[var19 * 3 + 0] * var23) << 16 | (int)(this.texCols[var19 * 3 + 1] * var23) << 8 | (int)(this.texCols[var19 * 3 + 2] * var23);
+ }
+ }
+
+ if(var12 < 31) {
+ var23 = var22 * 0.9F * var17 * 0.4F;
+ if(this.zBuf[var18 + 1] <= var14 - 1) {
+ this.zBuf[var18 + 1] = var14 - 1;
+ this.pixels[var18 + 1] = -16777216 | (int)(this.texCols[var21 * 3 + 0] * var23) << 16 | (int)(this.texCols[var21 * 3 + 1] * var23) << 8 | (int)(this.texCols[var21 * 3 + 2] * var23);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ this.postProcess();
+ if(var1.image == null) {
+ var1.image = new BufferedImage(32, 160, 2);
+ }
+
+ var1.image.setRGB(0, 0, 32, 160, this.pixels, 0, 32);
+ var1.rendered = true;
+ }
+ }
+ }
+
+ private void postProcess() {
+ for(int var1 = 0; var1 < 32; ++var1) {
+ for(int var2 = 0; var2 < 160; ++var2) {
+ int var3 = var1 + var2 * 32;
+ if(this.zBuf[var3] == 0) {
+ this.pixels[var3] = 0;
+ }
+
+ if(this.waterBuf[var3] > this.zBuf[var3]) {
+ int var4 = this.pixels[var3] >> 24 & 255;
+ this.pixels[var3] = ((this.pixels[var3] & 16711422) >> 1) + this.waterBr[var3];
+ if(var4 < 128) {
+ this.pixels[var3] = Integer.MIN_VALUE + this.waterBr[var3] * 2;
+ } else {
+ this.pixels[var3] |= -16777216;
+ }
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/Tessellator.java b/src/net/minecraft/src/Tessellator.java
new file mode 100644
index 0000000..0ca7e03
--- /dev/null
+++ b/src/net/minecraft/src/Tessellator.java
@@ -0,0 +1,298 @@
+package net.minecraft.src;
+
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import org.lwjgl.opengl.ARBVertexBufferObject;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL15;
+import org.lwjgl.opengl.GLContext;
+
+public class Tessellator {
+ private static boolean convertQuadsToTriangles = true;
+ private static boolean tryVBO = false;
+ private ByteBuffer byteBuffer;
+ private IntBuffer intBuffer;
+ private FloatBuffer floatBuffer;
+ private int[] rawBuffer;
+ private int vertexCount = 0;
+ private double textureU;
+ private double textureV;
+ private int color;
+ private boolean hasColor = false;
+ private boolean hasTexture = false;
+ private boolean hasNormals = false;
+ private int rawBufferIndex = 0;
+ private int addedVertices = 0;
+ private boolean isColorDisabled = false;
+ private int drawMode;
+ private double xOffset;
+ private double yOffset;
+ private double zOffset;
+ private int normal;
+ public static final Tessellator instance = new Tessellator(2097152);
+ private boolean isDrawing = false;
+ private boolean useVBO = false;
+ private IntBuffer vertexBuffers;
+ private int vboIndex = 0;
+ private int vboCount = 10;
+ private int bufferSize;
+
+ private Tessellator(int var1) {
+ this.bufferSize = var1;
+ this.byteBuffer = GLAllocation.createDirectByteBuffer(var1 * 4);
+ this.intBuffer = this.byteBuffer.asIntBuffer();
+ this.floatBuffer = this.byteBuffer.asFloatBuffer();
+ this.rawBuffer = new int[var1];
+ this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
+ if(this.useVBO) {
+ this.vertexBuffers = GLAllocation.createIntBuffer(this.vboCount);
+ ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers);
+ }
+
+ }
+
+ public void draw() {
+ if(!this.isDrawing) {
+ throw new IllegalStateException("Not tesselating!");
+ } else {
+ this.isDrawing = false;
+ if(this.vertexCount > 0) {
+ 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.vertexBuffers.get(this.vboIndex));
+ ARBVertexBufferObject.glBufferDataARB(GL15.GL_ARRAY_BUFFER, this.byteBuffer, GL15.GL_STREAM_DRAW);
+ }
+
+ if(this.hasTexture) {
+ if(this.useVBO) {
+ GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 32, 12L);
+ } else {
+ this.floatBuffer.position(3);
+ GL11.glTexCoordPointer(2, 32, (FloatBuffer)this.floatBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
+ }
+
+ if(this.hasColor) {
+ if(this.useVBO) {
+ GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 32, 20L);
+ } else {
+ this.byteBuffer.position(20);
+ GL11.glColorPointer(4, true, 32, this.byteBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
+ }
+
+ if(this.hasNormals) {
+ if(this.useVBO) {
+ GL11.glNormalPointer(GL11.GL_BYTE, 32, 24L);
+ } else {
+ this.byteBuffer.position(24);
+ GL11.glNormalPointer(32, (ByteBuffer)this.byteBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
+ }
+
+ if(this.useVBO) {
+ GL11.glVertexPointer(3, GL11.GL_FLOAT, 32, 0L);
+ } else {
+ this.floatBuffer.position(0);
+ GL11.glVertexPointer(3, 32, (FloatBuffer)this.floatBuffer);
+ }
+
+ GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
+ if(this.drawMode == 7 && convertQuadsToTriangles) {
+ GL11.glDrawArrays(GL11.GL_TRIANGLES, GL11.GL_POINTS, this.vertexCount);
+ } else {
+ GL11.glDrawArrays(this.drawMode, GL11.GL_POINTS, this.vertexCount);
+ }
+
+ GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
+ if(this.hasTexture) {
+ GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
+ }
+
+ if(this.hasColor) {
+ GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
+ }
+
+ if(this.hasNormals) {
+ GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
+ }
+ }
+
+ this.reset();
+ }
+ }
+
+ private void reset() {
+ this.vertexCount = 0;
+ this.byteBuffer.clear();
+ this.rawBufferIndex = 0;
+ this.addedVertices = 0;
+ }
+
+ public void startDrawingQuads() {
+ this.startDrawing(7);
+ }
+
+ public void startDrawing(int var1) {
+ if(this.isDrawing) {
+ throw new IllegalStateException("Already tesselating!");
+ } else {
+ this.isDrawing = true;
+ this.reset();
+ this.drawMode = var1;
+ this.hasNormals = false;
+ this.hasColor = false;
+ this.hasTexture = false;
+ this.isColorDisabled = false;
+ }
+ }
+
+ public void setTextureUV(double var1, double var3) {
+ this.hasTexture = true;
+ this.textureU = var1;
+ this.textureV = var3;
+ }
+
+ 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.hasColor = true;
+ this.color = var4 << 24 | var3 << 16 | var2 << 8 | var1;
+ }
+ }
+
+ public void addVertexWithUV(double var1, double var3, double var5, double var7, double var9) {
+ this.setTextureUV(var7, var9);
+ this.addVertex(var1, var3, var5);
+ }
+
+ public void addVertex(double var1, double var3, double var5) {
+ ++this.addedVertices;
+ if(this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0) {
+ for(int var7 = 0; var7 < 2; ++var7) {
+ int var8 = 8 * (3 - var7);
+ 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.hasColor) {
+ this.rawBuffer[this.rawBufferIndex + 5] = this.rawBuffer[this.rawBufferIndex - var8 + 5];
+ }
+
+ this.rawBuffer[this.rawBufferIndex + 0] = this.rawBuffer[this.rawBufferIndex - var8 + 0];
+ this.rawBuffer[this.rawBufferIndex + 1] = this.rawBuffer[this.rawBufferIndex - var8 + 1];
+ this.rawBuffer[this.rawBufferIndex + 2] = this.rawBuffer[this.rawBufferIndex - var8 + 2];
+ ++this.vertexCount;
+ this.rawBufferIndex += 8;
+ }
+ }
+
+ 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.hasColor) {
+ this.rawBuffer[this.rawBufferIndex + 5] = this.color;
+ }
+
+ 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.rawBufferIndex += 8;
+ ++this.vertexCount;
+ 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;
+ this.setColorOpaque(var2, var3, var4);
+ }
+
+ public void disableColor() {
+ this.isColorDisabled = true;
+ }
+
+ public void setNormal(float var1, float var2, float var3) {
+ if(!this.isDrawing) {
+ System.out.println("But..");
+ }
+
+ this.hasNormals = true;
+ byte var4 = (byte)((int)(var1 * 128.0F));
+ byte var5 = (byte)((int)(var2 * 127.0F));
+ byte var6 = (byte)((int)(var3 * 127.0F));
+ this.normal = var4 | var5 << 8 | var6 << 16;
+ }
+
+ public void setTranslationD(double var1, double var3, double var5) {
+ this.xOffset = var1;
+ this.yOffset = var3;
+ this.zOffset = var5;
+ }
+}
diff --git a/src/net/minecraft/src/TextureFX.java b/src/net/minecraft/src/TextureFX.java
new file mode 100644
index 0000000..0396745
--- /dev/null
+++ b/src/net/minecraft/src/TextureFX.java
@@ -0,0 +1,16 @@
+package net.minecraft.src;
+
+public class TextureFX {
+ public byte[] imageData = new byte[1024];
+ public int iconIndex;
+ public boolean anaglyphEnabled = false;
+ public int textureId = 0;
+ public int tileSize = 1;
+
+ public TextureFX(int var1) {
+ this.iconIndex = var1;
+ }
+
+ public void onTick() {
+ }
+}
diff --git a/src/net/minecraft/src/TextureFlamesFX.java b/src/net/minecraft/src/TextureFlamesFX.java
new file mode 100644
index 0000000..9ddc148
--- /dev/null
+++ b/src/net/minecraft/src/TextureFlamesFX.java
@@ -0,0 +1,77 @@
+package net.minecraft.src;
+
+public class TextureFlamesFX extends TextureFX {
+ protected float[] currentFireFrame = new float[320];
+ protected float[] lastFireFrame = new float[320];
+
+ public TextureFlamesFX(int var1) {
+ super(Block.fire.blockIndexInTexture + var1 * 16);
+ }
+
+ public void onTick() {
+ int var2;
+ float var4;
+ int var5;
+ int var6;
+ for(int var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 20; ++var2) {
+ int var3 = 18;
+ var4 = this.currentFireFrame[var1 + (var2 + 1) % 20 * 16] * (float)var3;
+
+ for(var5 = var1 - 1; var5 <= var1 + 1; ++var5) {
+ for(var6 = var2; var6 <= var2 + 1; ++var6) {
+ if(var5 >= 0 && var6 >= 0 && var5 < 16 && var6 < 20) {
+ var4 += this.currentFireFrame[var5 + var6 * 16];
+ }
+
+ ++var3;
+ }
+ }
+
+ this.lastFireFrame[var1 + var2 * 16] = var4 / ((float)var3 * 1.06F);
+ if(var2 >= 19) {
+ this.lastFireFrame[var1 + var2 * 16] = (float)(Math.random() * Math.random() * Math.random() * 4.0D + Math.random() * (double)0.1F + (double)0.2F);
+ }
+ }
+ }
+
+ float[] var12 = this.lastFireFrame;
+ this.lastFireFrame = this.currentFireFrame;
+ this.currentFireFrame = var12;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ float var13 = this.currentFireFrame[var2] * 1.8F;
+ if(var13 > 1.0F) {
+ var13 = 1.0F;
+ }
+
+ if(var13 < 0.0F) {
+ var13 = 0.0F;
+ }
+
+ var5 = (int)(var13 * 155.0F + 100.0F);
+ var6 = (int)(var13 * var13 * 255.0F);
+ int var7 = (int)(var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * 255.0F);
+ short var8 = 255;
+ if(var13 < 0.5F) {
+ var8 = 0;
+ }
+
+ var4 = (var13 - 0.5F) * 2.0F;
+ if(this.anaglyphEnabled) {
+ int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ int var10 = (var5 * 30 + var6 * 70) / 100;
+ int var11 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var9;
+ var6 = var10;
+ var7 = var11;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = (byte)var8;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TextureGearsFX.java b/src/net/minecraft/src/TextureGearsFX.java
new file mode 100644
index 0000000..17138a5
--- /dev/null
+++ b/src/net/minecraft/src/TextureGearsFX.java
@@ -0,0 +1,65 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+public class TextureGearsFX extends TextureFX {
+ private int gearRotation = 0;
+ private int[] gearColor = new int[1024];
+ private int[] gearMiddleColor = new int[1024];
+ private int gearRotationDir;
+
+ public TextureGearsFX(int var1) {
+ super(Block.cog.blockIndexInTexture + var1);
+ this.gearRotationDir = var1 * 2 - 1;
+ this.gearRotation = 2;
+
+ try {
+ BufferedImage var2 = ImageIO.read(TextureGearsFX.class.getResource("/misc/gear.png"));
+ var2.getRGB(0, 0, 32, 32, this.gearColor, 0, 32);
+ var2 = ImageIO.read(TextureGearsFX.class.getResource("/misc/gearmiddle.png"));
+ var2.getRGB(0, 0, 16, 16, this.gearMiddleColor, 0, 16);
+ } catch (IOException var3) {
+ var3.printStackTrace();
+ }
+
+ }
+
+ public void onTick() {
+ this.gearRotation = this.gearRotation + this.gearRotationDir & 63;
+ float var1 = MathHelper.sin((float)this.gearRotation / 64.0F * (float)Math.PI * 2.0F);
+ float var2 = MathHelper.cos((float)this.gearRotation / 64.0F * (float)Math.PI * 2.0F);
+
+ for(int var3 = 0; var3 < 16; ++var3) {
+ for(int var4 = 0; var4 < 16; ++var4) {
+ float var5 = ((float)var3 / 15.0F - 0.5F) * 31.0F;
+ float var6 = ((float)var4 / 15.0F - 0.5F) * 31.0F;
+ float var7 = var2 * var5 - var1 * var6;
+ float var8 = var2 * var6 + var1 * var5;
+ int var9 = (int)(var7 + 16.0F);
+ int var10 = (int)(var8 + 16.0F);
+ int var11 = 0;
+ int var12;
+ if(var9 >= 0 && var10 >= 0 && var9 < 32 && var10 < 32) {
+ var11 = this.gearColor[var9 + var10 * 32];
+ var12 = this.gearMiddleColor[var3 + var4 * 16];
+ if((var12 >> 24 & 255) > 128) {
+ var11 = var12;
+ }
+ }
+
+ var12 = var11 >> 16 & 255;
+ int var13 = var11 >> 8 & 255;
+ int var14 = var11 & 255;
+ int var15 = (var11 >> 24 & 255) > 128 ? 255 : 0;
+ int var16 = var3 + var4 * 16;
+ this.imageData[var16 * 4 + 0] = (byte)var12;
+ this.imageData[var16 * 4 + 1] = (byte)var13;
+ this.imageData[var16 * 4 + 2] = (byte)var14;
+ this.imageData[var16 * 4 + 3] = (byte)var15;
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TextureLavaFX.java b/src/net/minecraft/src/TextureLavaFX.java
new file mode 100644
index 0000000..c4d9c4c
--- /dev/null
+++ b/src/net/minecraft/src/TextureLavaFX.java
@@ -0,0 +1,81 @@
+package net.minecraft.src;
+
+public class TextureLavaFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+
+ public TextureLavaFX() {
+ super(Block.lavaMoving.blockIndexInTexture);
+ }
+
+ public void onTick() {
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ int var7;
+ int var8;
+ int var9;
+ for(int var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+ int var4 = (int)(MathHelper.sin((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+ var5 = (int)(MathHelper.sin((float)var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+
+ for(var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
+ for(var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
+ var8 = var6 + var4 & 15;
+ var9 = var7 + var5 & 15;
+ var3 += this.red[var8 + var9 * 16];
+ }
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 10.0F + (this.blue[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.blue[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.01F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.06F;
+ if(Math.random() < 0.005D) {
+ this.alpha[var1 + var2 * 16] = 1.5F;
+ }
+ }
+ }
+
+ float[] var11 = this.green;
+ this.green = this.red;
+ this.red = var11;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2] * 2.0F;
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ var5 = (int)(var3 * 100.0F + 155.0F);
+ var6 = (int)(var3 * var3 * 255.0F);
+ var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
+ if(this.anaglyphEnabled) {
+ var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ var9 = (var5 * 30 + var6 * 70) / 100;
+ int var10 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var8;
+ var6 = var9;
+ var7 = var10;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = -1;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TextureLavaFlowFX.java b/src/net/minecraft/src/TextureLavaFlowFX.java
new file mode 100644
index 0000000..8d91375
--- /dev/null
+++ b/src/net/minecraft/src/TextureLavaFlowFX.java
@@ -0,0 +1,85 @@
+package net.minecraft.src;
+
+public class TextureLavaFlowFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+ int tickCounter = 0;
+
+ public TextureLavaFlowFX() {
+ super(Block.lavaMoving.blockIndexInTexture + 1);
+ this.tileSize = 2;
+ }
+
+ public void onTick() {
+ ++this.tickCounter;
+
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ int var7;
+ int var8;
+ int var9;
+ for(int var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+ int var4 = (int)(MathHelper.sin((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+ var5 = (int)(MathHelper.sin((float)var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
+
+ for(var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
+ for(var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
+ var8 = var6 + var4 & 15;
+ var9 = var7 + var5 & 15;
+ var3 += this.red[var8 + var9 * 16];
+ }
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 10.0F + (this.blue[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.blue[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.blue[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.01F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.06F;
+ if(Math.random() < 0.005D) {
+ this.alpha[var1 + var2 * 16] = 1.5F;
+ }
+ }
+ }
+
+ float[] var11 = this.green;
+ this.green = this.red;
+ this.red = var11;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2 - this.tickCounter / 3 * 16 & 255] * 2.0F;
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ var5 = (int)(var3 * 100.0F + 155.0F);
+ var6 = (int)(var3 * var3 * 255.0F);
+ var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
+ if(this.anaglyphEnabled) {
+ var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ var9 = (var5 * 30 + var6 * 70) / 100;
+ int var10 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var8;
+ var6 = var9;
+ var7 = var10;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = -1;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TextureWaterFX.java b/src/net/minecraft/src/TextureWaterFX.java
new file mode 100644
index 0000000..67a5040
--- /dev/null
+++ b/src/net/minecraft/src/TextureWaterFX.java
@@ -0,0 +1,85 @@
+package net.minecraft.src;
+
+public class TextureWaterFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+ private int tickCounter = 0;
+
+ public TextureWaterFX() {
+ super(Block.waterMoving.blockIndexInTexture);
+ }
+
+ public void onTick() {
+ ++this.tickCounter;
+
+ int var1;
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+
+ for(int var4 = var1 - 1; var4 <= var1 + 1; ++var4) {
+ var5 = var4 & 15;
+ var6 = var2 & 15;
+ var3 += this.red[var5 + var6 * 16];
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 3.3F + this.blue[var1 + var2 * 16] * 0.8F;
+ }
+ }
+
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.05F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.1F;
+ if(Math.random() < 0.05D) {
+ this.alpha[var1 + var2 * 16] = 0.5F;
+ }
+ }
+ }
+
+ float[] var12 = this.green;
+ this.green = this.red;
+ this.red = var12;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2];
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ float var13 = var3 * var3;
+ var5 = (int)(32.0F + var13 * 32.0F);
+ var6 = (int)(50.0F + var13 * 64.0F);
+ int var7 = 255;
+ int var8 = (int)(146.0F + var13 * 50.0F);
+ if(this.anaglyphEnabled) {
+ int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ int var10 = (var5 * 30 + var6 * 70) / 100;
+ int var11 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var9;
+ var6 = var10;
+ var7 = var11;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = (byte)var8;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TextureWaterFlowFX.java b/src/net/minecraft/src/TextureWaterFlowFX.java
new file mode 100644
index 0000000..668c17f
--- /dev/null
+++ b/src/net/minecraft/src/TextureWaterFlowFX.java
@@ -0,0 +1,86 @@
+package net.minecraft.src;
+
+public class TextureWaterFlowFX extends TextureFX {
+ protected float[] red = new float[256];
+ protected float[] green = new float[256];
+ protected float[] blue = new float[256];
+ protected float[] alpha = new float[256];
+ private int tickCounter = 0;
+
+ public TextureWaterFlowFX() {
+ super(Block.waterMoving.blockIndexInTexture + 1);
+ this.tileSize = 2;
+ }
+
+ public void onTick() {
+ ++this.tickCounter;
+
+ int var1;
+ int var2;
+ float var3;
+ int var5;
+ int var6;
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ var3 = 0.0F;
+
+ for(int var4 = var2 - 2; var4 <= var2; ++var4) {
+ var5 = var1 & 15;
+ var6 = var4 & 15;
+ var3 += this.red[var5 + var6 * 16];
+ }
+
+ this.green[var1 + var2 * 16] = var3 / 3.2F + this.blue[var1 + var2 * 16] * 0.8F;
+ }
+ }
+
+ for(var1 = 0; var1 < 16; ++var1) {
+ for(var2 = 0; var2 < 16; ++var2) {
+ this.blue[var1 + var2 * 16] += this.alpha[var1 + var2 * 16] * 0.05F;
+ if(this.blue[var1 + var2 * 16] < 0.0F) {
+ this.blue[var1 + var2 * 16] = 0.0F;
+ }
+
+ this.alpha[var1 + var2 * 16] -= 0.3F;
+ if(Math.random() < 0.2D) {
+ this.alpha[var1 + var2 * 16] = 0.5F;
+ }
+ }
+ }
+
+ float[] var12 = this.green;
+ this.green = this.red;
+ this.red = var12;
+
+ for(var2 = 0; var2 < 256; ++var2) {
+ var3 = this.red[var2 - this.tickCounter * 16 & 255];
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ float var13 = var3 * var3;
+ var5 = (int)(32.0F + var13 * 32.0F);
+ var6 = (int)(50.0F + var13 * 64.0F);
+ int var7 = 255;
+ int var8 = (int)(146.0F + var13 * 50.0F);
+ if(this.anaglyphEnabled) {
+ int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
+ int var10 = (var5 * 30 + var6 * 70) / 100;
+ int var11 = (var5 * 30 + var7 * 70) / 100;
+ var5 = var9;
+ var6 = var10;
+ var7 = var11;
+ }
+
+ this.imageData[var2 * 4 + 0] = (byte)var5;
+ this.imageData[var2 * 4 + 1] = (byte)var6;
+ this.imageData[var2 * 4 + 2] = (byte)var7;
+ this.imageData[var2 * 4 + 3] = (byte)var8;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TexturedQuad.java b/src/net/minecraft/src/TexturedQuad.java
new file mode 100644
index 0000000..60719d0
--- /dev/null
+++ b/src/net/minecraft/src/TexturedQuad.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+public class TexturedQuad {
+ public PositionTextureVertex[] vertexPositions;
+ public int nVertices;
+
+ public TexturedQuad(PositionTextureVertex[] var1) {
+ this.nVertices = 0;
+ this.vertexPositions = var1;
+ this.nVertices = var1.length;
+ }
+
+ public TexturedQuad(PositionTextureVertex[] var1, int var2, int var3, int var4, int var5) {
+ this(var1);
+ float var6 = 0.0015625F;
+ float var7 = 0.003125F;
+ var1[0] = var1[0].setTexturePosition((float)var4 / 64.0F - var6, (float)var3 / 32.0F + var7);
+ var1[1] = var1[1].setTexturePosition((float)var2 / 64.0F + var6, (float)var3 / 32.0F + var7);
+ var1[2] = var1[2].setTexturePosition((float)var2 / 64.0F + var6, (float)var5 / 32.0F - var7);
+ var1[3] = var1[3].setTexturePosition((float)var4 / 64.0F - var6, (float)var5 / 32.0F - var7);
+ }
+
+ public void flipFace() {
+ PositionTextureVertex[] var1 = new PositionTextureVertex[this.vertexPositions.length];
+
+ 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) {
+ Vec3D var3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D);
+ Vec3D var4 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D);
+ Vec3D var5 = var4.crossProduct(var3).normalize();
+ var1.startDrawingQuads();
+ var1.setNormal((float)var5.xCoord, (float)var5.yCoord, (float)var5.zCoord);
+
+ 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);
+ }
+
+ var1.draw();
+ }
+}
diff --git a/src/net/minecraft/src/ThreadDownloadImage.java b/src/net/minecraft/src/ThreadDownloadImage.java
new file mode 100644
index 0000000..3912dc6
--- /dev/null
+++ b/src/net/minecraft/src/ThreadDownloadImage.java
@@ -0,0 +1,44 @@
+package net.minecraft.src;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import javax.imageio.ImageIO;
+
+class ThreadDownloadImage extends Thread {
+ final String location;
+ final ImageBuffer buffer;
+ final ThreadDownloadImageData imageData;
+
+ ThreadDownloadImage(ThreadDownloadImageData var1, String var2, ImageBuffer var3) {
+ this.imageData = var1;
+ this.location = var2;
+ this.buffer = var3;
+ }
+
+ public void run() {
+ HttpURLConnection var1 = null;
+
+ try {
+ URL var2 = new URL(this.location);
+ var1 = (HttpURLConnection)var2.openConnection();
+ var1.setDoInput(true);
+ var1.setDoOutput(false);
+ var1.connect();
+ if(var1.getResponseCode() != 404) {
+ if(this.buffer == null) {
+ this.imageData.image = ImageIO.read(var1.getInputStream());
+ } else {
+ this.imageData.image = this.buffer.parseUserSkin(ImageIO.read(var1.getInputStream()));
+ }
+
+ return;
+ }
+ } catch (Exception var6) {
+ var6.printStackTrace();
+ return;
+ } finally {
+ var1.disconnect();
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/ThreadDownloadImageData.java b/src/net/minecraft/src/ThreadDownloadImageData.java
new file mode 100644
index 0000000..13ac4e6
--- /dev/null
+++ b/src/net/minecraft/src/ThreadDownloadImageData.java
@@ -0,0 +1,14 @@
+package net.minecraft.src;
+
+import java.awt.image.BufferedImage;
+
+public class ThreadDownloadImageData {
+ public BufferedImage image;
+ public int referenceCount = 1;
+ public int textureName = -1;
+ public boolean textureSetupComplete = false;
+
+ public ThreadDownloadImageData(String var1, ImageBuffer var2) {
+ (new ThreadDownloadImage(this, var1, var2)).start();
+ }
+}
diff --git a/src/net/minecraft/src/ThreadDownloadResources.java b/src/net/minecraft/src/ThreadDownloadResources.java
new file mode 100644
index 0000000..6bcdb12
--- /dev/null
+++ b/src/net/minecraft/src/ThreadDownloadResources.java
@@ -0,0 +1,117 @@
+package net.minecraft.src;
+
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+
+public class ThreadDownloadResources extends Thread {
+ public File resourcesFolder;
+ private Minecraft mc;
+ private boolean closing = false;
+
+ public ThreadDownloadResources(File var1, Minecraft var2) {
+ this.mc = var2;
+ this.setName("Resource download thread");
+ this.setDaemon(true);
+ this.resourcesFolder = new File(var1, "resources/");
+ if(!this.resourcesFolder.exists() && !this.resourcesFolder.mkdirs()) {
+ throw new RuntimeException("The working directory could not be created: " + this.resourcesFolder);
+ }
+ }
+
+ public void run() {
+ try {
+ ArrayList var1 = new ArrayList();
+ URL var2 = new URL("http://www.minecraft.net/resources/");
+ BufferedReader var3 = new BufferedReader(new InputStreamReader(var2.openStream()));
+ String var4 = "";
+
+ while(true) {
+ var4 = var3.readLine();
+ if(var4 == null) {
+ var3.close();
+
+ for(int var5 = 0; var5 < var1.size(); ++var5) {
+ this.downloadAndInstallResource(var2, (String)var1.get(var5));
+ if(this.closing) {
+ return;
+ }
+ }
+ break;
+ }
+
+ var1.add(var4);
+ }
+ } catch (IOException var6) {
+ this.loadResource(this.resourcesFolder, "");
+ var6.printStackTrace();
+ }
+
+ }
+
+ private void loadResource(File var1, String var2) {
+ File[] var3 = var1.listFiles();
+
+ for(int var4 = 0; var4 < var3.length; ++var4) {
+ if(var3[var4].isDirectory()) {
+ this.loadResource(var3[var4], var2 + var3[var4].getName() + "/");
+ } else {
+ this.mc.installResource(var2 + var3[var4].getName(), var3[var4]);
+ }
+ }
+
+ }
+
+ private void downloadAndInstallResource(URL var1, String var2) {
+ try {
+ String[] var3 = var2.split(",");
+ String var4 = var3[0];
+ int var5 = Integer.parseInt(var3[1]);
+ long var6 = Long.parseLong(var3[2]);
+ var6 /= 2L;
+ File var8 = new File(this.resourcesFolder, var4);
+ if(!var8.exists() || var8.length() != (long)var5) {
+ var8.getParentFile().mkdirs();
+ String var9 = var4.replaceAll(" ", "%20");
+ this.downloadResource(new URL(var1, var9), var8, var5);
+ if(this.closing) {
+ return;
+ }
+ }
+
+ this.mc.installResource(var4, var8);
+ } catch (Exception var10) {
+ var10.printStackTrace();
+ }
+
+ }
+
+ private void downloadResource(URL var1, File var2, int var3) throws IOException {
+ byte[] var4 = new byte[4096];
+ DataInputStream var5 = new DataInputStream(var1.openStream());
+ DataOutputStream var6 = new DataOutputStream(new FileOutputStream(var2));
+ boolean var7 = false;
+
+ do {
+ int var8 = var5.read(var4);
+ if(var8 < 0) {
+ var5.close();
+ var6.close();
+ return;
+ }
+
+ var6.write(var4, 0, var8);
+ } while(!this.closing);
+
+ }
+
+ public void closeMinecraft() {
+ this.closing = true;
+ }
+}
diff --git a/src/net/minecraft/src/ThreadRunIsoClient.java b/src/net/minecraft/src/ThreadRunIsoClient.java
new file mode 100644
index 0000000..aed30bb
--- /dev/null
+++ b/src/net/minecraft/src/ThreadRunIsoClient.java
@@ -0,0 +1,21 @@
+package net.minecraft.src;
+
+class ThreadRunIsoClient extends Thread {
+ final CanvasIsomPreview isoCanvas;
+
+ ThreadRunIsoClient(CanvasIsomPreview var1) {
+ this.isoCanvas = var1;
+ }
+
+ public void run() {
+ while(CanvasIsomPreview.a(this.isoCanvas)) {
+ this.isoCanvas.render();
+
+ try {
+ Thread.sleep(1L);
+ } catch (Exception var2) {
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/ThreadSleepForever.java b/src/net/minecraft/src/ThreadSleepForever.java
new file mode 100644
index 0000000..09cb8b7
--- /dev/null
+++ b/src/net/minecraft/src/ThreadSleepForever.java
@@ -0,0 +1,22 @@
+package net.minecraft.src;
+
+class ThreadSleepForever extends Thread {
+ final Minecraft mc;
+
+ ThreadSleepForever(Minecraft var1, String var2) {
+ super(var2);
+ this.mc = var1;
+ this.setDaemon(true);
+ this.start();
+ }
+
+ public void run() {
+ while(this.mc.running) {
+ try {
+ Thread.sleep(2147483647L);
+ } catch (InterruptedException var2) {
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TileEntity.java b/src/net/minecraft/src/TileEntity.java
new file mode 100644
index 0000000..78965d1
--- /dev/null
+++ b/src/net/minecraft/src/TileEntity.java
@@ -0,0 +1,86 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class TileEntity {
+ private static Map nameToClassMap = new HashMap();
+ private static Map classToNameMap = new HashMap();
+ public World worldObj;
+ public int xCoord;
+ public int yCoord;
+ public int zCoord;
+
+ private static void addMapping(Class var0, String var1) {
+ if(classToNameMap.containsKey(var1)) {
+ throw new IllegalArgumentException("Duplicate id: " + var1);
+ } else {
+ nameToClassMap.put(var1, var0);
+ classToNameMap.put(var0, var1);
+ }
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ this.xCoord = var1.getInteger("x");
+ this.yCoord = var1.getInteger("y");
+ this.zCoord = var1.getInteger("z");
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ 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);
+ }
+ }
+
+ public void updateEntity() {
+ }
+
+ public static TileEntity createAndLoadEntity(NBTTagCompound var0) {
+ TileEntity var1 = null;
+
+ try {
+ Class var2 = (Class)nameToClassMap.get(var0.getString("id"));
+ if(var2 != null) {
+ var1 = (TileEntity)var2.newInstance();
+ }
+ } catch (Exception var3) {
+ var3.printStackTrace();
+ }
+
+ if(var1 != null) {
+ var1.readFromNBT(var0);
+ } else {
+ System.out.println("Skipping TileEntity with id " + var0.getString("id"));
+ }
+
+ return var1;
+ }
+
+ public int getBlockMetadata() {
+ return this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ public void onInventoryChanged() {
+ this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ 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;
+ return var7 * var7 + var9 * var9 + var11 * var11;
+ }
+
+ static {
+ addMapping(TileEntityFurnace.class, "Furnace");
+ addMapping(TileEntityChest.class, "Chest");
+ addMapping(TileEntitySign.class, "Sign");
+ addMapping(TileEntityMobSpawner.class, "MobSpawner");
+ }
+}
diff --git a/src/net/minecraft/src/TileEntityChest.java b/src/net/minecraft/src/TileEntityChest.java
new file mode 100644
index 0000000..e29f7d0
--- /dev/null
+++ b/src/net/minecraft/src/TileEntityChest.java
@@ -0,0 +1,80 @@
+package net.minecraft.src;
+
+public class TileEntityChest extends TileEntity implements IInventory {
+ private ItemStack[] chestContents = new ItemStack[36];
+
+ public int getSizeInventory() {
+ return 27;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.chestContents[var1];
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.chestContents[var1] != null) {
+ ItemStack var3;
+ if(this.chestContents[var1].stackSize <= var2) {
+ var3 = this.chestContents[var1];
+ this.chestContents[var1] = null;
+ return var3;
+ } else {
+ var3 = this.chestContents[var1].splitStack(var2);
+ if(this.chestContents[var1].stackSize == 0) {
+ this.chestContents[var1] = null;
+ }
+
+ return var3;
+ }
+ } 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();
+ }
+
+ }
+
+ public String getInvName() {
+ return "Chest";
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+ NBTTagList var2 = var1.getTagList("Items");
+ this.chestContents = new ItemStack[this.getSizeInventory()];
+
+ 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) {
+ this.chestContents[var5] = new ItemStack(var4);
+ }
+ }
+
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ NBTTagList var2 = new NBTTagList();
+
+ 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);
+ var2.setTag(var4);
+ }
+ }
+
+ var1.setTag("Items", var2);
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+}
diff --git a/src/net/minecraft/src/TileEntityFurnace.java b/src/net/minecraft/src/TileEntityFurnace.java
new file mode 100644
index 0000000..fe6c7d7
--- /dev/null
+++ b/src/net/minecraft/src/TileEntityFurnace.java
@@ -0,0 +1,190 @@
+package net.minecraft.src;
+
+public class TileEntityFurnace extends TileEntity implements IInventory {
+ private ItemStack[] furnaceItemStacks = new ItemStack[3];
+ private int furnaceBurnTime = 0;
+ private int currentItemBurnTime = 0;
+ private int furnaceCookTime = 0;
+
+ public int getSizeInventory() {
+ return this.furnaceItemStacks.length;
+ }
+
+ public ItemStack getStackInSlot(int var1) {
+ return this.furnaceItemStacks[var1];
+ }
+
+ public ItemStack decrStackSize(int var1, int var2) {
+ if(this.furnaceItemStacks[var1] != null) {
+ ItemStack var3;
+ if(this.furnaceItemStacks[var1].stackSize <= var2) {
+ var3 = this.furnaceItemStacks[var1];
+ this.furnaceItemStacks[var1] = null;
+ return var3;
+ } else {
+ var3 = this.furnaceItemStacks[var1].splitStack(var2);
+ if(this.furnaceItemStacks[var1].stackSize == 0) {
+ this.furnaceItemStacks[var1] = null;
+ }
+
+ return var3;
+ }
+ } 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();
+ }
+
+ }
+
+ public String getInvName() {
+ return "Chest";
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+ NBTTagList var2 = var1.getTagList("Items");
+ this.furnaceItemStacks = new ItemStack[this.getSizeInventory()];
+
+ 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) {
+ this.furnaceItemStacks[var5] = new ItemStack(var4);
+ }
+ }
+
+ this.furnaceBurnTime = var1.getShort("BurnTime");
+ this.furnaceCookTime = var1.getShort("CookTime");
+ this.currentItemBurnTime = this.getItemBurnTime(this.furnaceItemStacks[1]);
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ var1.setShort("BurnTime", (short)this.furnaceBurnTime);
+ var1.setShort("CookTime", (short)this.furnaceCookTime);
+ NBTTagList var2 = new NBTTagList();
+
+ 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);
+ var2.setTag(var4);
+ }
+ }
+
+ var1.setTag("Items", var2);
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public int getCookProgressScaled(int var1) {
+ return this.furnaceCookTime * var1 / 200;
+ }
+
+ public int getBurnTimeRemainingScaled(int var1) {
+ if(this.currentItemBurnTime == 0) {
+ this.currentItemBurnTime = 200;
+ }
+
+ return this.furnaceBurnTime * var1 / this.currentItemBurnTime;
+ }
+
+ public boolean isBurning() {
+ return this.furnaceBurnTime > 0;
+ }
+
+ public void updateEntity() {
+ boolean var1 = this.furnaceBurnTime > 0;
+ boolean var2 = false;
+ if(this.furnaceBurnTime > 0) {
+ --this.furnaceBurnTime;
+ var2 = true;
+ }
+
+ if(this.furnaceBurnTime == 0 && this.canSmelt()) {
+ this.currentItemBurnTime = this.furnaceBurnTime = this.getItemBurnTime(this.furnaceItemStacks[1]);
+ if(this.furnaceBurnTime > 0) {
+ var2 = true;
+ if(this.furnaceItemStacks[1] != null) {
+ --this.furnaceItemStacks[1].stackSize;
+ if(this.furnaceItemStacks[1].stackSize == 0) {
+ this.furnaceItemStacks[1] = null;
+ }
+ }
+ }
+ }
+
+ if(this.isBurning() && this.canSmelt()) {
+ ++this.furnaceCookTime;
+ if(this.furnaceCookTime == 200) {
+ this.furnaceCookTime = 0;
+ this.smeltItem();
+ var2 = true;
+ }
+ } else {
+ this.furnaceCookTime = 0;
+ }
+
+ if(var1 != this.furnaceBurnTime > 0) {
+ var2 = true;
+ BlockFurnace.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ if(var2) {
+ this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ }
+
+ private boolean canSmelt() {
+ if(this.furnaceItemStacks[0] == null) {
+ return false;
+ } else {
+ int var1 = this.getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex);
+ return var1 < 0 ? false : (this.furnaceItemStacks[2] == null ? true : (this.furnaceItemStacks[2].itemID != var1 ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < Item.itemsList[var1].getItemStackLimit())));
+ }
+ }
+
+ public void smeltItem() {
+ if(this.canSmelt()) {
+ int var1 = this.getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex);
+ if(this.furnaceItemStacks[2] == null) {
+ this.furnaceItemStacks[2] = new ItemStack(var1, 1);
+ } else if(this.furnaceItemStacks[2].itemID == var1) {
+ ++this.furnaceItemStacks[2].stackSize;
+ }
+
+ --this.furnaceItemStacks[0].stackSize;
+ if(this.furnaceItemStacks[0].stackSize <= 0) {
+ this.furnaceItemStacks[0] = null;
+ }
+
+ }
+ }
+
+ private int getSmeltingResult(int var1) {
+ return var1 == Block.oreIron.blockID ? Item.ingotIron.shiftedIndex : (var1 == Block.oreGold.blockID ? Item.ingotGold.shiftedIndex : (var1 == Block.oreDiamond.blockID ? Item.diamond.shiftedIndex : (var1 == Block.sand.blockID ? Block.glass.blockID : (var1 == Item.porkRaw.shiftedIndex ? Item.porkCooked.shiftedIndex : (var1 == Block.cobblestone.blockID ? Block.stone.blockID : -1)))));
+ }
+
+ private int getItemBurnTime(ItemStack var1) {
+ if(var1 == null) {
+ return 0;
+ } else {
+ int var2 = var1.getItem().shiftedIndex;
+ return var2 < 256 && Block.blocksList[var2].blockMaterial == Material.wood ? 300 : (var2 == Item.stick.shiftedIndex ? 100 : (var2 == Item.coal.shiftedIndex ? 1600 : 0));
+ }
+ }
+
+ public void onInventoryChanged() {
+ this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord);
+ }
+}
diff --git a/src/net/minecraft/src/TileEntityMobSpawner.java b/src/net/minecraft/src/TileEntityMobSpawner.java
new file mode 100644
index 0000000..a03cbb6
--- /dev/null
+++ b/src/net/minecraft/src/TileEntityMobSpawner.java
@@ -0,0 +1,94 @@
+package net.minecraft.src;
+
+public class TileEntityMobSpawner extends TileEntity {
+ public int delay = -1;
+ public String mobID = "Pig";
+ public double yaw;
+ public double prevYaw = 0.0D;
+
+ public TileEntityMobSpawner() {
+ this.delay = 20;
+ }
+
+ public boolean anyPlayerInRange() {
+ double var1 = this.worldObj.playerEntity.getDistanceSq((double)this.xCoord, (double)this.yCoord, (double)this.zCoord);
+ return var1 <= 256.0D;
+ }
+
+ public void updateEntity() {
+ this.prevYaw = this.yaw;
+ if(this.anyPlayerInRange()) {
+ double var1 = (double)((float)this.xCoord + this.worldObj.rand.nextFloat());
+ double var3 = (double)((float)this.yCoord + this.worldObj.rand.nextFloat());
+ double var5 = (double)((float)this.zCoord + this.worldObj.rand.nextFloat());
+ this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+
+ for(this.yaw += (double)(1000.0F / ((float)this.delay + 200.0F)); this.yaw > 360.0D; this.prevYaw -= 360.0D) {
+ this.yaw -= 360.0D;
+ }
+
+ if(this.delay == -1) {
+ this.updateDelay();
+ }
+
+ if(this.delay > 0) {
+ --this.delay;
+ } else {
+ byte var7 = 4;
+
+ for(int var8 = 0; var8 < var7; ++var8) {
+ EntityLiving var9 = (EntityLiving)((EntityLiving)EntityList.createEntityInWorld(this.mobID, this.worldObj));
+ if(var9 == null) {
+ return;
+ }
+
+ int var10 = this.worldObj.getEntitiesWithinAABB(var9.getClass(), AxisAlignedBB.getBoundingBoxFromPool((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)(this.xCoord + 1), (double)(this.yCoord + 1), (double)(this.zCoord + 1)).expand(8.0D, 4.0D, 8.0D)).size();
+ if(var10 >= 6) {
+ this.updateDelay();
+ return;
+ }
+
+ if(var9 != null) {
+ double var11 = (double)this.xCoord + (this.worldObj.rand.nextDouble() - this.worldObj.rand.nextDouble()) * 4.0D;
+ double var13 = (double)(this.yCoord + this.worldObj.rand.nextInt(3) - 1);
+ double var15 = (double)this.zCoord + (this.worldObj.rand.nextDouble() - this.worldObj.rand.nextDouble()) * 4.0D;
+ var9.setPositionAndRotation(var11, var13, var15, this.worldObj.rand.nextFloat() * 360.0F, 0.0F);
+ if(var9.getCanSpawnHere(var11, var13, var15)) {
+ this.worldObj.spawnEntityInWorld(var9);
+
+ for(int var17 = 0; var17 < 20; ++var17) {
+ var1 = (double)this.xCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
+ var3 = (double)this.yCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
+ var5 = (double)this.zCoord + 0.5D + ((double)this.worldObj.rand.nextFloat() - 0.5D) * 2.0D;
+ this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ }
+
+ var9.spawnExplosionParticle();
+ this.updateDelay();
+ }
+ }
+ }
+
+ super.updateEntity();
+ }
+ }
+ }
+
+ private void updateDelay() {
+ this.delay = 200 + this.worldObj.rand.nextInt(600);
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+ this.mobID = var1.getString("EntityId");
+ this.delay = var1.getShort("Delay");
+ }
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ var1.setString("EntityId", this.mobID);
+ var1.setShort("Delay", (short)this.delay);
+ }
+}
diff --git a/src/net/minecraft/src/TileEntityMobSpawnerRenderer.java b/src/net/minecraft/src/TileEntityMobSpawnerRenderer.java
new file mode 100644
index 0000000..6487d2e
--- /dev/null
+++ b/src/net/minecraft/src/TileEntityMobSpawnerRenderer.java
@@ -0,0 +1,36 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.lwjgl.opengl.GL11;
+
+public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer {
+ private Map entityHashMap = new HashMap();
+
+ public void a(TileEntityMobSpawner var1, double var2, double var4, double var6, float var8) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2 + 0.5F, (float)var4, (float)var6 + 0.5F);
+ Entity var9 = (Entity)this.entityHashMap.get(var1.mobID);
+ if(var9 == null) {
+ var9 = EntityList.createEntityInWorld(var1.mobID, (World)null);
+ this.entityHashMap.put(var1.mobID, var9);
+ }
+
+ if(var9 != null) {
+ var9.setWorld(var1.worldObj);
+ float var10 = 7.0F / 16.0F;
+ GL11.glTranslatef(0.0F, 0.4F, 0.0F);
+ GL11.glRotatef((float)(var1.prevYaw + (var1.yaw - var1.prevYaw) * (double)var8) * 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(var10, var10, var10);
+ RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, var8);
+ }
+
+ GL11.glPopMatrix();
+ }
+
+ public void renderTileEntityMobSpawner(TileEntity var1, double var2, double var4, double var6, float var8) {
+ this.a((TileEntityMobSpawner)var1, var2, var4, var6, var8);
+ }
+}
diff --git a/src/net/minecraft/src/TileEntityRenderer.java b/src/net/minecraft/src/TileEntityRenderer.java
new file mode 100644
index 0000000..c11fa4e
--- /dev/null
+++ b/src/net/minecraft/src/TileEntityRenderer.java
@@ -0,0 +1,86 @@
+package net.minecraft.src;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.lwjgl.opengl.GL11;
+
+public class TileEntityRenderer {
+ private Map specialRendererMap = new HashMap();
+ public static TileEntityRenderer instance = new TileEntityRenderer();
+ private FontRenderer fontRenderer;
+ public static double staticPlayerX;
+ public static double staticPlayerY;
+ public static double staticPlayerZ;
+ public RenderEngine renderEngine;
+ public World worldObj;
+ public EntityPlayer entityPlayer;
+ public float playerYaw;
+ public float playerPitch;
+ public double playerX;
+ public double playerY;
+ public double playerZ;
+
+ private TileEntityRenderer() {
+ this.specialRendererMap.put(TileEntitySign.class, new TileEntitySignRenderer());
+ this.specialRendererMap.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
+ Iterator var1 = this.specialRendererMap.values().iterator();
+
+ while(var1.hasNext()) {
+ TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next();
+ var2.setTileEntityRenderer(this);
+ }
+
+ }
+
+ public TileEntitySpecialRenderer getSpecialRendererForClass(Class var1) {
+ TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)this.specialRendererMap.get(var1);
+ if(var2 == null && var1 != TileEntity.class) {
+ var2 = this.getSpecialRendererForClass(var1.getSuperclass());
+ this.specialRendererMap.put(var1, var2);
+ }
+
+ return var2;
+ }
+
+ public boolean hasSpecialRenderer(TileEntity var1) {
+ return this.getSpecialRendererForEntity(var1) != null;
+ }
+
+ public TileEntitySpecialRenderer getSpecialRendererForEntity(TileEntity var1) {
+ return this.getSpecialRendererForClass(var1.getClass());
+ }
+
+ public void cacheActiveRenderInfo(World var1, RenderEngine var2, FontRenderer var3, EntityPlayer var4, float var5) {
+ this.worldObj = var1;
+ this.renderEngine = var2;
+ this.entityPlayer = 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;
+ }
+
+ public void renderTileEntity(TileEntity var1, float var2) {
+ if(var1.getDistanceFrom(this.playerX, this.playerY, this.playerZ) < 4096.0D) {
+ float var3 = this.worldObj.getBrightness(var1.xCoord, var1.yCoord, var1.zCoord);
+ GL11.glColor3f(var3, var3, var3);
+ this.renderTileEntityAt(var1, (double)var1.xCoord - staticPlayerX, (double)var1.yCoord - staticPlayerY, (double)var1.zCoord - staticPlayerZ, var2);
+ }
+
+ }
+
+ public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {
+ TileEntitySpecialRenderer var9 = this.getSpecialRendererForEntity(var1);
+ if(var9 != null) {
+ var9.renderTileEntityMobSpawner(var1, var2, var4, var6, var8);
+ }
+
+ }
+
+ public FontRenderer getFontRenderer() {
+ return this.fontRenderer;
+ }
+}
diff --git a/src/net/minecraft/src/TileEntitySign.java b/src/net/minecraft/src/TileEntitySign.java
new file mode 100644
index 0000000..69f2787
--- /dev/null
+++ b/src/net/minecraft/src/TileEntitySign.java
@@ -0,0 +1,26 @@
+package net.minecraft.src;
+
+public class TileEntitySign extends TileEntity {
+ public String[] signText = new String[]{"", "", "", ""};
+ public int lineBeingEdited = -1;
+
+ public void writeToNBT(NBTTagCompound var1) {
+ super.writeToNBT(var1);
+ var1.setString("Text1", this.signText[0]);
+ var1.setString("Text2", this.signText[1]);
+ var1.setString("Text3", this.signText[2]);
+ var1.setString("Text4", this.signText[3]);
+ }
+
+ public void readFromNBT(NBTTagCompound var1) {
+ super.readFromNBT(var1);
+
+ for(int var2 = 0; var2 < 4; ++var2) {
+ this.signText[var2] = var1.getString("Text" + (var2 + 1));
+ if(this.signText[var2].length() > 15) {
+ this.signText[var2] = this.signText[var2].substring(0, 15);
+ }
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/TileEntitySignRenderer.java b/src/net/minecraft/src/TileEntitySignRenderer.java
new file mode 100644
index 0000000..b12ca76
--- /dev/null
+++ b/src/net/minecraft/src/TileEntitySignRenderer.java
@@ -0,0 +1,41 @@
+package net.minecraft.src;
+
+import org.lwjgl.opengl.GL11;
+
+public class TileEntitySignRenderer extends TileEntitySpecialRenderer {
+ private SignModel modelSign = new SignModel();
+
+ public void a(TileEntitySign var1, double var2, double var4, double var6, float var8) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F, (float)var6 + 0.5F);
+ float var9 = (float)(var1.getBlockMetadata() * 360) / 16.0F;
+ GL11.glRotatef(-var9, 0.0F, 1.0F, 0.0F);
+ this.bindTextureByName("/item/sign.png");
+ GL11.glPushMatrix();
+ GL11.glScalef(1.0F, -1.0F, -1.0F);
+ this.modelSign.renderSign();
+ GL11.glPopMatrix();
+ float var10 = (float)(1.0D / 60.0D);
+ GL11.glTranslatef(0.0F, 0.5F, 0.09F);
+ GL11.glScalef(var10, -var10, var10);
+ GL11.glNormal3f(0.0F, 0.0F, -1.0F * var10);
+ FontRenderer var11 = this.getFontRenderer();
+
+ for(int var12 = 0; var12 < var1.signText.length; ++var12) {
+ String var13 = var1.signText[var12];
+ if(var12 == var1.lineBeingEdited) {
+ var13 = "> " + var13 + " <";
+ var11.drawString(var13, -var11.getStringWidth(var13) / 2, var12 * 10 - var1.signText.length * 5, 0);
+ } else {
+ var11.drawString(var13, -var11.getStringWidth(var13) / 2, var12 * 10 - var1.signText.length * 5, 0);
+ }
+ }
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glPopMatrix();
+ }
+
+ public void renderTileEntityMobSpawner(TileEntity var1, double var2, double var4, double var6, float var8) {
+ this.a((TileEntitySign)var1, var2, var4, var6, var8);
+ }
+}
diff --git a/src/net/minecraft/src/TileEntitySpecialRenderer.java b/src/net/minecraft/src/TileEntitySpecialRenderer.java
new file mode 100644
index 0000000..d0ae86c
--- /dev/null
+++ b/src/net/minecraft/src/TileEntitySpecialRenderer.java
@@ -0,0 +1,20 @@
+package net.minecraft.src;
+
+public abstract class TileEntitySpecialRenderer {
+ protected TileEntityRenderer tileEntityRenderer;
+
+ public abstract void renderTileEntityMobSpawner(TileEntity var1, double var2, double var4, double var6, float var8);
+
+ protected void bindTextureByName(String var1) {
+ RenderEngine var2 = this.tileEntityRenderer.renderEngine;
+ var2.bindTexture(var2.getTexture(var1));
+ }
+
+ public void setTileEntityRenderer(TileEntityRenderer var1) {
+ this.tileEntityRenderer = var1;
+ }
+
+ public FontRenderer getFontRenderer() {
+ return this.tileEntityRenderer.getFontRenderer();
+ }
+}
diff --git a/src/net/minecraft/src/Timer.java b/src/net/minecraft/src/Timer.java
new file mode 100644
index 0000000..55f1390
--- /dev/null
+++ b/src/net/minecraft/src/Timer.java
@@ -0,0 +1,58 @@
+package net.minecraft.src;
+
+public class Timer {
+ float ticksPerSecond;
+ private double lastHRTime;
+ public int elapsedTicks;
+ public float renderPartialTicks;
+ public float timerSpeed = 1.0F;
+ public float elapsedPartialTicks = 0.0F;
+ private long lastSyncSysClock;
+ private long lastSyncHRClock;
+ private double timeSyncAdjustment = 1.0D;
+
+ public Timer(float var1) {
+ this.ticksPerSecond = var1;
+ this.lastSyncSysClock = System.currentTimeMillis();
+ this.lastSyncHRClock = System.nanoTime() / 1000000L;
+ }
+
+ public void updateTimer() {
+ long var1 = System.currentTimeMillis();
+ long var3 = var1 - this.lastSyncSysClock;
+ long var5 = System.nanoTime() / 1000000L;
+ double var9;
+ if(var3 > 1000L) {
+ long var7 = var5 - this.lastSyncHRClock;
+ var9 = (double)var3 / (double)var7;
+ this.timeSyncAdjustment += (var9 - this.timeSyncAdjustment) * (double)0.2F;
+ this.lastSyncSysClock = var1;
+ this.lastSyncHRClock = var5;
+ }
+
+ if(var3 < 0L) {
+ this.lastSyncSysClock = var1;
+ this.lastSyncHRClock = var5;
+ }
+
+ double var11 = (double)var5 / 1000.0D;
+ var9 = (var11 - this.lastHRTime) * this.timeSyncAdjustment;
+ this.lastHRTime = var11;
+ if(var9 < 0.0D) {
+ var9 = 0.0D;
+ }
+
+ if(var9 > 1.0D) {
+ var9 = 1.0D;
+ }
+
+ this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + var9 * (double)this.timerSpeed * (double)this.ticksPerSecond);
+ this.elapsedTicks = (int)this.elapsedPartialTicks;
+ this.elapsedPartialTicks -= (float)this.elapsedTicks;
+ if(this.elapsedTicks > 10) {
+ this.elapsedTicks = 10;
+ }
+
+ this.renderPartialTicks = this.elapsedPartialTicks;
+ }
+}
diff --git a/src/net/minecraft/src/UnexpectedThrowable.java b/src/net/minecraft/src/UnexpectedThrowable.java
new file mode 100644
index 0000000..b05f1b4
--- /dev/null
+++ b/src/net/minecraft/src/UnexpectedThrowable.java
@@ -0,0 +1,11 @@
+package net.minecraft.src;
+
+public class UnexpectedThrowable {
+ public final String description;
+ public final Exception exception;
+
+ public UnexpectedThrowable(String var1, Exception var2) {
+ this.description = var1;
+ this.exception = var2;
+ }
+}
diff --git a/src/net/minecraft/src/Vec3D.java b/src/net/minecraft/src/Vec3D.java
new file mode 100644
index 0000000..c0b23a5
--- /dev/null
+++ b/src/net/minecraft/src/Vec3D.java
@@ -0,0 +1,135 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Vec3D {
+ private static List vectorList = new ArrayList();
+ private static int nextVector = 0;
+ public double xCoord;
+ public double yCoord;
+ public double zCoord;
+
+ public static Vec3D createVectorHelper(double var0, double var2, double var4) {
+ return new Vec3D(var0, var2, var4);
+ }
+
+ public static void initialize() {
+ nextVector = 0;
+ }
+
+ public static Vec3D createVector(double var0, double var2, double var4) {
+ if(nextVector >= vectorList.size()) {
+ vectorList.add(createVectorHelper(0.0D, 0.0D, 0.0D));
+ }
+
+ return ((Vec3D)vectorList.get(nextVector++)).setComponents(var0, var2, var4);
+ }
+
+ private Vec3D(double var1, double var3, double var5) {
+ if(var1 == -0.0D) {
+ var1 = 0.0D;
+ }
+
+ if(var3 == -0.0D) {
+ var3 = 0.0D;
+ }
+
+ if(var5 == -0.0D) {
+ var5 = 0.0D;
+ }
+
+ this.xCoord = var1;
+ this.yCoord = var3;
+ this.zCoord = var5;
+ }
+
+ private Vec3D setComponents(double var1, double var3, double var5) {
+ this.xCoord = var1;
+ this.yCoord = var3;
+ this.zCoord = var5;
+ return this;
+ }
+
+ public Vec3D subtract(Vec3D var1) {
+ return createVector(var1.xCoord - this.xCoord, var1.yCoord - this.yCoord, var1.zCoord - this.zCoord);
+ }
+
+ public Vec3D normalize() {
+ double var1 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
+ return var1 < 1.0E-4D ? createVector(0.0D, 0.0D, 0.0D) : createVector(this.xCoord / var1, this.yCoord / var1, this.zCoord / var1);
+ }
+
+ public Vec3D crossProduct(Vec3D var1) {
+ return createVector(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 Vec3D addVector(double var1, double var3, double var5) {
+ return createVector(this.xCoord + var1, this.yCoord + var3, this.zCoord + var5);
+ }
+
+ public double distanceTo(Vec3D var1) {
+ double var2 = var1.xCoord - this.xCoord;
+ double var4 = var1.yCoord - this.yCoord;
+ double var6 = var1.zCoord - this.zCoord;
+ return (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6);
+ }
+
+ public double squareDistanceTo(Vec3D var1) {
+ double var2 = var1.xCoord - this.xCoord;
+ double var4 = var1.yCoord - this.yCoord;
+ double var6 = var1.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;
+ return var7 * var7 + var9 * var9 + var11 * var11;
+ }
+
+ public double lengthVector() {
+ return (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
+ }
+
+ public Vec3D getIntermediateWithXValue(Vec3D 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 ? createVector(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
+ }
+ }
+
+ public Vec3D getIntermediateWithYValue(Vec3D 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 ? createVector(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
+ }
+ }
+
+ public Vec3D getIntermediateWithZValue(Vec3D 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;
+ return var10 >= 0.0D && var10 <= 1.0D ? createVector(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
+ }
+ }
+
+ public String toString() {
+ return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")";
+ }
+}
diff --git a/src/net/minecraft/src/World.java b/src/net/minecraft/src/World.java
new file mode 100644
index 0000000..ce6119a
--- /dev/null
+++ b/src/net/minecraft/src/World.java
@@ -0,0 +1,1599 @@
+package net.minecraft.src;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeSet;
+
+public class World implements IBlockAccess {
+ private List lightingToUpdate;
+ private List loadedEntityList;
+ private List unloadedEntityList;
+ private TreeSet scheduledTickTreeSet;
+ private Set scheduledTickSet;
+ public List loadedTileEntityList;
+ public long worldTime;
+ private long skyColor;
+ private long fogColor;
+ private long cloudColor;
+ public int skylightSubtracted;
+ private int updateLCG;
+ private int DIST_HASH_MAGIC;
+ public boolean editingBlocks;
+ public static float[] lightBrightnessTable = new float[16];
+ public Entity playerEntity;
+ public int difficultySetting;
+ public Object fontRenderer;
+ public Random rand;
+ public int spawnX;
+ public int spawnY;
+ public int spawnZ;
+ public boolean isNewWorld;
+ private List worldAccesses;
+ private IChunkProvider chunkProvider;
+ private File saveDirectory;
+ public long randomSeed;
+ private NBTTagCompound nbtCompoundPlayer;
+ public long setSizeOnDisk;
+ public final String levelName;
+ private ArrayList collidingBoundingBoxes;
+ private List entitiesWithinAABBExcludingEntity;
+
+ public static NBTTagCompound getLevelData(File var0, String var1) {
+ File var2 = new File(var0, "saves");
+ File var3 = new File(var2, var1);
+ if(!var3.exists()) {
+ return null;
+ } else {
+ File var4 = new File(var3, "level.dat");
+ if(var4.exists()) {
+ try {
+ NBTTagCompound var5 = CompressedStreamTools.readCompressed(new FileInputStream(var4));
+ NBTTagCompound var6 = var5.getCompoundTag("Data");
+ return var6;
+ } catch (Exception var7) {
+ var7.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+ }
+
+ public static void deleteWorld(File var0, String var1) {
+ File var2 = new File(var0, "saves");
+ File var3 = new File(var2, var1);
+ if(var3.exists()) {
+ deleteWorldFiles(var3.listFiles());
+ var3.delete();
+ }
+ }
+
+ private static void deleteWorldFiles(File[] var0) {
+ for(int var1 = 0; var1 < var0.length; ++var1) {
+ if(var0[var1].isDirectory()) {
+ deleteWorldFiles(var0[var1].listFiles());
+ }
+
+ var0[var1].delete();
+ }
+
+ }
+
+ public World(File var1, String var2) {
+ this(var1, var2, (new Random()).nextLong());
+ }
+
+ public World(File var1, String var2, long var3) {
+ this.lightingToUpdate = new ArrayList();
+ this.loadedEntityList = new ArrayList();
+ this.unloadedEntityList = new ArrayList();
+ this.scheduledTickTreeSet = new TreeSet();
+ this.scheduledTickSet = new HashSet();
+ this.loadedTileEntityList = new ArrayList();
+ this.worldTime = 0L;
+ this.skyColor = 8961023L;
+ this.fogColor = 12638463L;
+ this.cloudColor = 16777215L;
+ this.skylightSubtracted = 0;
+ this.updateLCG = (new Random()).nextInt();
+ this.DIST_HASH_MAGIC = 1013904223;
+ this.editingBlocks = false;
+ this.rand = new Random();
+ this.isNewWorld = false;
+ this.worldAccesses = new ArrayList();
+ this.randomSeed = 0L;
+ this.setSizeOnDisk = 0L;
+ this.collidingBoundingBoxes = new ArrayList();
+ this.entitiesWithinAABBExcludingEntity = new ArrayList();
+ this.levelName = var2;
+ var1.mkdirs();
+ this.saveDirectory = new File(var1, var2);
+ this.saveDirectory.mkdirs();
+ File var5 = new File(this.saveDirectory, "level.dat");
+ this.isNewWorld = !var5.exists();
+ if(var5.exists()) {
+ try {
+ NBTTagCompound var6 = CompressedStreamTools.readCompressed(new FileInputStream(var5));
+ NBTTagCompound var7 = var6.getCompoundTag("Data");
+ this.randomSeed = var7.getLong("RandomSeed");
+ this.spawnX = var7.getInteger("SpawnX");
+ this.spawnY = var7.getInteger("SpawnY");
+ this.spawnZ = var7.getInteger("SpawnZ");
+ this.worldTime = var7.getLong("Time");
+ this.setSizeOnDisk = var7.getLong("SizeOnDisk");
+ this.nbtCompoundPlayer = var7.getCompoundTag("Player");
+ } catch (Exception var8) {
+ var8.printStackTrace();
+ }
+ }
+
+ boolean var9 = false;
+ if(this.randomSeed == 0L) {
+ this.randomSeed = var3;
+ var9 = true;
+ }
+
+ this.chunkProvider = this.getChunkProvider(this.saveDirectory);
+ if(var9) {
+ this.spawnX = 0;
+ this.spawnY = 64;
+
+ for(this.spawnZ = 0; !this.findSpawn(this.spawnX, this.spawnZ); this.spawnZ += this.rand.nextInt(64) - this.rand.nextInt(64)) {
+ this.spawnX += this.rand.nextInt(64) - this.rand.nextInt(64);
+ }
+ }
+
+ this.calculateInitialSkylight();
+ }
+
+ protected IChunkProvider getChunkProvider(File var1) {
+ return new ChunkProviderLoadOrGenerate(this, new ChunkLoader(var1, true), new ChunkProviderGenerate(this, this.randomSeed));
+ }
+
+ public void setSpawnLocation() {
+ while(this.getFirstUncoveredBlock(this.spawnX, this.spawnZ) == 0) {
+ this.spawnX += this.rand.nextInt(8) - this.rand.nextInt(8);
+ this.spawnZ += this.rand.nextInt(8) - this.rand.nextInt(8);
+ }
+
+ }
+
+ private boolean findSpawn(int var1, int var2) {
+ return this.getFirstUncoveredBlock(var1, var2) == Block.sand.blockID;
+ }
+
+ private int getFirstUncoveredBlock(int var1, int var2) {
+ int var3;
+ for(var3 = 63; this.getBlockId(var1, var3 + 1, var2) != 0; ++var3) {
+ }
+
+ return this.getBlockId(var1, var3, var2);
+ }
+
+ public void spawnPlayerWithLoadedChunks() {
+ try {
+ if(this.nbtCompoundPlayer != null) {
+ this.playerEntity.readFromNBT(this.nbtCompoundPlayer);
+ this.nbtCompoundPlayer = null;
+ }
+
+ this.spawnEntityInWorld(this.playerEntity);
+ } catch (Exception var2) {
+ var2.printStackTrace();
+ }
+
+ }
+
+ public void saveWorld(boolean var1, IProgressUpdate var2) {
+ if(this.chunkProvider.canSave()) {
+ if(var2 != null) {
+ var2.displayProgressMessage("Saving level");
+ }
+
+ this.saveLevel();
+ if(var2 != null) {
+ var2.displayLoadingString("Saving chunks");
+ }
+
+ this.chunkProvider.saveChunks(var1, var2);
+ }
+ }
+
+ private void saveLevel() {
+ NBTTagCompound var1 = new NBTTagCompound();
+ var1.setLong("RandomSeed", this.randomSeed);
+ var1.setInteger("SpawnX", this.spawnX);
+ var1.setInteger("SpawnY", this.spawnY);
+ var1.setInteger("SpawnZ", this.spawnZ);
+ var1.setLong("Time", this.worldTime);
+ var1.setLong("SizeOnDisk", this.setSizeOnDisk);
+ var1.setLong("LastPlayed", System.currentTimeMillis());
+ NBTTagCompound var2;
+ if(this.playerEntity != null) {
+ var2 = new NBTTagCompound();
+ this.playerEntity.writeToNBT(var2);
+ var1.setCompoundTag("Player", var2);
+ }
+
+ var2 = new NBTTagCompound();
+ var2.setTag("Data", var1);
+
+ try {
+ File var3 = new File(this.saveDirectory, "level.dat_new");
+ File var4 = new File(this.saveDirectory, "level.dat_old");
+ File var5 = new File(this.saveDirectory, "level.dat");
+ CompressedStreamTools.writeCompressed(var2, new FileOutputStream(var3));
+ if(var4.exists()) {
+ var4.delete();
+ }
+
+ var5.renameTo(var4);
+ if(var5.exists()) {
+ var5.delete();
+ }
+
+ var3.renameTo(var5);
+ if(var3.exists()) {
+ var3.delete();
+ }
+ } catch (Exception var6) {
+ var6.printStackTrace();
+ }
+
+ }
+
+ public boolean saveWorld(int var1) {
+ if(!this.chunkProvider.canSave()) {
+ return true;
+ } else {
+ if(var1 == 0) {
+ this.saveLevel();
+ }
+
+ return this.chunkProvider.saveChunks(false, (IProgressUpdate)null);
+ }
+ }
+
+ public int getBlockId(int var1, int var2, int var3) {
+ return var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000 ? (var2 < 0 ? 0 : (var2 >= 128 ? 0 : this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4).getBlockID(var1 & 15, var2, var3 & 15))) : 0;
+ }
+
+ public boolean blockExists(int var1, int var2, int var3) {
+ return var2 >= 0 && var2 < 128 ? this.chunkExists(var1 >> 4, var3 >> 4) : false;
+ }
+
+ public boolean checkChunksExist(int var1, int var2, int var3, int var4, int var5, int var6) {
+ if(var5 >= 0 && var2 < 128) {
+ var1 >>= 4;
+ var2 >>= 4;
+ var3 >>= 4;
+ var4 >>= 4;
+ var5 >>= 4;
+ var6 >>= 4;
+
+ for(int var7 = var1; var7 <= var4; ++var7) {
+ for(int var8 = var3; var8 <= var6; ++var8) {
+ if(!this.chunkExists(var7, var8)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private 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 setBlockAndMetadata(int var1, int var2, int var3, int var4, int var5) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return false;
+ } else {
+ Chunk var6 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ return var6.setBlockIDWithMetadata(var1 & 15, var2, var3 & 15, var4, var5);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setBlock(int var1, int var2, int var3, int var4) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return false;
+ } else {
+ Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ return var5.setBlockID(var1 & 15, var2, var3 & 15, var4);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public Material getBlockMaterial(int var1, int var2, int var3) {
+ int var4 = this.getBlockId(var1, var2, var3);
+ return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial;
+ }
+
+ public int getBlockMetadata(int var1, int var2, int var3) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ return 0;
+ } else {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ return var4.getBlockMetadata(var1, var2, var3);
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ public void setBlockMetadataWithNotify(int var1, int var2, int var3, int var4) {
+ this.setBlockMetadata(var1, var2, var3, var4);
+ }
+
+ public boolean setBlockMetadata(int var1, int var2, int var3, int var4) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return false;
+ } else {
+ Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ var5.setBlockMetadata(var1, var2, var3, var4);
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setBlockWithNotify(int var1, int var2, int var3, int var4) {
+ if(this.setBlock(var1, var2, var3, var4)) {
+ this.markBlockNeedsUpdate(var1, var2, var3, var4);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setBlockAndMetadataWithNotify(int var1, int var2, int var3, int var4, int var5) {
+ if(this.setBlockAndMetadata(var1, var2, var3, var4, var5)) {
+ this.markBlockNeedsUpdate(var1, var2, var3, var4);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private void markBlockNeedsUpdate(int var1, int var2, int var3, int var4) {
+ for(int var5 = 0; var5 < this.worldAccesses.size(); ++var5) {
+ ((IWorldAccess)this.worldAccesses.get(var5)).markBlockAndNeighborsNeedsUpdate(var1, var2, var3);
+ }
+
+ this.notifyBlocksOfNeighborChange(var1, var2, var3, var4);
+ }
+
+ public void markBlockAsNeedsUpdate(int var1, int var2, int var3, int var4) {
+ if(var3 > var4) {
+ int var5 = var4;
+ var4 = var3;
+ var3 = var5;
+ }
+
+ this.markBlocksDirty(var1, var3, var2, var1, var4, var2);
+ }
+
+ public void markBlocksDirty(int var1, int var2, int var3, int var4, int var5, int var6) {
+ for(int var7 = 0; var7 < this.worldAccesses.size(); ++var7) {
+ ((IWorldAccess)this.worldAccesses.get(var7)).markBlockRangeNeedsUpdate(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);
+ }
+
+ private void notifyBlockOfNeighborChange(int var1, int var2, int var3, int var4) {
+ if(!this.editingBlocks) {
+ Block var5 = Block.blocksList[this.getBlockId(var1, var2, var3)];
+ if(var5 != null) {
+ var5.onNeighborBlockChange(this, var1, var2, var3, var4);
+ }
+
+ }
+ }
+
+ public boolean canBlockSeeTheSky(int var1, int var2, int var3) {
+ return this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4).canBlockSeeTheSky(var1 & 15, var2, var3 & 15);
+ }
+
+ public int getBlockLightValue(int var1, int var2, int var3) {
+ return this.getBlockLightValue_do(var1, var2, var3, true);
+ }
+
+ public int getBlockLightValue_do(int var1, int var2, int var3, boolean var4) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ int var5;
+ if(var4) {
+ var5 = this.getBlockId(var1, var2, var3);
+ if(var5 == Block.stairSingle.blockID || var5 == Block.tilledField.blockID) {
+ 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) {
+ var6 = var7;
+ }
+
+ if(var8 > var6) {
+ var6 = var8;
+ }
+
+ if(var9 > var6) {
+ var6 = var9;
+ }
+
+ if(var10 > var6) {
+ var6 = var10;
+ }
+
+ return var6;
+ }
+ }
+
+ if(var2 < 0) {
+ return 0;
+ } else if(var2 >= 128) {
+ var5 = 15 - this.skylightSubtracted;
+ if(var5 < 0) {
+ var5 = 0;
+ }
+
+ return var5;
+ } else {
+ Chunk var11 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ return var11.getBlockLightValue(var1, var2, var3, this.skylightSubtracted);
+ }
+ } else {
+ return 15;
+ }
+ }
+
+ public boolean canExistingBlockSeeTheSky(int var1, int var2, int var3) {
+ if(var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
+ if(var2 < 0) {
+ return false;
+ } else if(var2 >= 128) {
+ return true;
+ } else if(!this.chunkExists(var1 >> 4, var3 >> 4)) {
+ return false;
+ } else {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ var1 &= 15;
+ var3 &= 15;
+ return var4.canBlockSeeTheSky(var1, var2, var3);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public int getHeightValue(int var1, int var2) {
+ if(var1 >= -32000000 && var2 >= -32000000 && var1 < 32000000 && var2 <= 32000000) {
+ if(!this.chunkExists(var1 >> 4, var2 >> 4)) {
+ return 0;
+ } else {
+ Chunk var3 = this.getChunkFromChunkCoords(var1 >> 4, var2 >> 4);
+ return var3.getHeightValue(var1 & 15, var2 & 15);
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ public void neighborLightPropagationChanged(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
+ if(this.blockExists(var2, var3, var4)) {
+ if(var1 == EnumSkyBlock.Sky) {
+ if(this.canExistingBlockSeeTheSky(var2, var3, var4)) {
+ var5 = 15;
+ }
+ } else if(var1 == EnumSkyBlock.Block) {
+ int var6 = this.getBlockId(var2, var3, var4);
+ if(Block.lightValue[var6] > var5) {
+ var5 = Block.lightValue[var6];
+ }
+ }
+
+ if(this.getSavedLightValue(var1, var2, var3, var4) != var5) {
+ this.scheduleLightingUpdate(var1, var2, var3, var4, var2, var3, var4);
+ }
+
+ }
+ }
+
+ public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) {
+ if(var3 >= 0 && var3 < 128 && var2 >= -32000000 && var4 >= -32000000 && var2 < 32000000 && var4 <= 32000000) {
+ int var5 = var2 >> 4;
+ int var6 = var4 >> 4;
+ if(!this.chunkExists(var5, var6)) {
+ return 0;
+ } 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 >= -32000000 && var4 >= -32000000 && var2 < 32000000 && var4 <= 32000000) {
+ if(var3 >= 0) {
+ if(var3 < 128) {
+ 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.worldAccesses.size(); ++var7) {
+ ((IWorldAccess)this.worldAccesses.get(var7)).markBlockAndNeighborsNeedsUpdate(var2, var3, var4);
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+ public float getBrightness(int var1, int var2, int var3) {
+ return lightBrightnessTable[this.getBlockLightValue(var1, var2, var3)];
+ }
+
+ public boolean isDaytime() {
+ return this.skylightSubtracted < 4;
+ }
+
+ public MovingObjectPosition rayTraceBlocks(Vec3D var1, Vec3D var2) {
+ return this.rayTraceBlocks_do(var1, var2, false);
+ }
+
+ public MovingObjectPosition rayTraceBlocks_do(Vec3D var1, Vec3D var2, boolean var3) {
+ 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 var4 = MathHelper.floor_double(var2.xCoord);
+ int var5 = MathHelper.floor_double(var2.yCoord);
+ int var6 = MathHelper.floor_double(var2.zCoord);
+ int var7 = MathHelper.floor_double(var1.xCoord);
+ int var8 = MathHelper.floor_double(var1.yCoord);
+ int var9 = MathHelper.floor_double(var1.zCoord);
+ int var10 = 20;
+
+ while(var10-- >= 0) {
+ if(Double.isNaN(var1.xCoord) || Double.isNaN(var1.yCoord) || Double.isNaN(var1.zCoord)) {
+ return null;
+ }
+
+ if(var7 == var4 && var8 == var5 && var9 == var6) {
+ return null;
+ }
+
+ double var11 = 999.0D;
+ double var13 = 999.0D;
+ double var15 = 999.0D;
+ if(var4 > var7) {
+ var11 = (double)var7 + 1.0D;
+ }
+
+ if(var4 < var7) {
+ var11 = (double)var7 + 0.0D;
+ }
+
+ if(var5 > var8) {
+ var13 = (double)var8 + 1.0D;
+ }
+
+ if(var5 < var8) {
+ var13 = (double)var8 + 0.0D;
+ }
+
+ if(var6 > var9) {
+ var15 = (double)var9 + 1.0D;
+ }
+
+ if(var6 < var9) {
+ var15 = (double)var9 + 0.0D;
+ }
+
+ double var17 = 999.0D;
+ double var19 = 999.0D;
+ double var21 = 999.0D;
+ double var23 = var2.xCoord - var1.xCoord;
+ double var25 = var2.yCoord - var1.yCoord;
+ double var27 = var2.zCoord - var1.zCoord;
+ if(var11 != 999.0D) {
+ var17 = (var11 - var1.xCoord) / var23;
+ }
+
+ if(var13 != 999.0D) {
+ var19 = (var13 - var1.yCoord) / var25;
+ }
+
+ if(var15 != 999.0D) {
+ var21 = (var15 - var1.zCoord) / var27;
+ }
+
+ boolean var29 = false;
+ byte var35;
+ if(var17 < var19 && var17 < var21) {
+ if(var4 > var7) {
+ var35 = 4;
+ } else {
+ var35 = 5;
+ }
+
+ var1.xCoord = var11;
+ var1.yCoord += var25 * var17;
+ var1.zCoord += var27 * var17;
+ } else if(var19 < var21) {
+ if(var5 > var8) {
+ var35 = 0;
+ } else {
+ var35 = 1;
+ }
+
+ var1.xCoord += var23 * var19;
+ var1.yCoord = var13;
+ var1.zCoord += var27 * var19;
+ } else {
+ if(var6 > var9) {
+ var35 = 2;
+ } else {
+ var35 = 3;
+ }
+
+ var1.xCoord += var23 * var21;
+ var1.yCoord += var25 * var21;
+ var1.zCoord = var15;
+ }
+
+ Vec3D var30 = Vec3D.createVector(var1.xCoord, var1.yCoord, var1.zCoord);
+ var7 = (int)(var30.xCoord = (double)MathHelper.floor_double(var1.xCoord));
+ if(var35 == 5) {
+ --var7;
+ ++var30.xCoord;
+ }
+
+ var8 = (int)(var30.yCoord = (double)MathHelper.floor_double(var1.yCoord));
+ if(var35 == 1) {
+ --var8;
+ ++var30.yCoord;
+ }
+
+ var9 = (int)(var30.zCoord = (double)MathHelper.floor_double(var1.zCoord));
+ if(var35 == 3) {
+ --var9;
+ ++var30.zCoord;
+ }
+
+ int var31 = this.getBlockId(var7, var8, var9);
+ int var32 = this.getBlockMetadata(var7, var8, var9);
+ Block var33 = Block.blocksList[var31];
+ MovingObjectPosition var34;
+ if(var31 > 0 && var33.canCollideCheck(var32, var3)) {
+ var34 = var33.collisionRayTrace(this, var7, var8, var9, var1, var2);
+ if(var34 != null) {
+ return var34;
+ }
+ }
+
+ var31 = this.getBlockId(var7, var8 - 1, var9);
+ var32 = this.getBlockMetadata(var7, var8 - 1, var9);
+ var33 = Block.blocksList[var31];
+ if(var31 > 0 && var33.canCollideCheck(var32, var3)) {
+ var34 = var33.collisionRayTrace(this, var7, var8 - 1, var9, var1, var2);
+ if(var34 != null) {
+ return var34;
+ }
+ }
+ }
+
+ return null;
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public void playSoundAtEntity(Entity var1, String var2, float var3, float var4) {
+ for(int var5 = 0; var5 < this.worldAccesses.size(); ++var5) {
+ float var6 = 16.0F;
+ if(var3 > 1.0F) {
+ var6 *= var3;
+ }
+
+ if(this.playerEntity.getDistanceSqToEntity(var1) < (double)(var6 * var6)) {
+ ((IWorldAccess)this.worldAccesses.get(var5)).playSound(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) {
+ try {
+ for(int var10 = 0; var10 < this.worldAccesses.size(); ++var10) {
+ float var11 = 16.0F;
+ if(var8 > 1.0F) {
+ var11 *= var8;
+ }
+
+ double var12 = var1 - this.playerEntity.posX;
+ double var14 = var3 - this.playerEntity.posY;
+ double var16 = var5 - this.playerEntity.posZ;
+ if(var12 * var12 + var14 * var14 + var16 * var16 < (double)(var11 * var11)) {
+ ((IWorldAccess)this.worldAccesses.get(var10)).playSound(var7, var1, var3, var5, var8, var9);
+ }
+ }
+ } catch (Exception var18) {
+ var18.printStackTrace();
+ }
+
+ }
+
+ public void playMusic(double var1, double var3, double var5, String var7, float var8) {
+ }
+
+ public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) {
+ for(int var14 = 0; var14 < this.worldAccesses.size(); ++var14) {
+ ((IWorldAccess)this.worldAccesses.get(var14)).spawnParticle(var1, var2, var4, var6, var8, var10, var12);
+ }
+
+ }
+
+ public void spawnEntityInWorld(Entity var1) {
+ int var2 = MathHelper.floor_double(var1.posX / 16.0D);
+ int var3 = MathHelper.floor_double(var1.posZ / 16.0D);
+ if(this.chunkExists(var2, var3)) {
+ this.getChunkFromChunkCoords(var2, var3).addEntity(var1);
+ this.loadedEntityList.add(var1);
+
+ for(int var4 = 0; var4 < this.worldAccesses.size(); ++var4) {
+ ((IWorldAccess)this.worldAccesses.get(var4)).obtainEntitySkin(var1);
+ }
+ } else {
+ System.out.println("Failed to add entity " + var1);
+ }
+
+ }
+
+ public void setEntityDead(Entity var1) {
+ var1.setEntityDead();
+ }
+
+ public void addWorldAccess(IWorldAccess var1) {
+ this.worldAccesses.add(var1);
+ }
+
+ public void removeWorldAccess(IWorldAccess var1) {
+ this.worldAccesses.remove(var1);
+ }
+
+ public List getCollidingBoundingBoxes(Entity var1, AxisAlignedBB var2) {
+ this.collidingBoundingBoxes.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 = var5 - 1; var10 < var6; ++var10) {
+ for(int var11 = var7; var11 < var8; ++var11) {
+ Block var12 = Block.blocksList[this.getBlockId(var9, var10, var11)];
+ if(var12 != null) {
+ var12.getCollidingBoundingBoxes(this, var9, var10, var11, var2, this.collidingBoundingBoxes);
+ }
+ }
+ }
+ }
+
+ double var16 = 0.25D;
+ List var14 = this.getEntitiesWithinAABBExcludingEntity(var1, var2.expand(var16, var16, var16));
+
+ for(int var15 = 0; var15 < var14.size(); ++var15) {
+ AxisAlignedBB var13 = ((Entity)var14.get(var15)).getBoundingBox();
+ if(var13 != null) {
+ this.collidingBoundingBoxes.add(var13);
+ }
+
+ var13 = var1.getCollisionBox((Entity)var14.get(var15));
+ if(var13 != null) {
+ this.collidingBoundingBoxes.add(var13);
+ }
+ }
+
+ return this.collidingBoundingBoxes;
+ }
+
+ public int calculateSkylightSubtracted(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F);
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ return (int)(var3 * 11.0F);
+ }
+
+ public Vec3D getSkyColor(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ float var4 = (float)(this.skyColor >> 16 & 255L) / 255.0F;
+ float var5 = (float)(this.skyColor >> 8 & 255L) / 255.0F;
+ float var6 = (float)(this.skyColor & 255L) / 255.0F;
+ var4 *= var3;
+ var5 *= var3;
+ var6 *= var3;
+ return Vec3D.createVector((double)var4, (double)var5, (double)var6);
+ }
+
+ public float getCelestialAngle(float var1) {
+ int var2 = (int)(this.worldTime % 24000L);
+ float var3 = ((float)var2 + var1) / 24000.0F - 0.25F;
+ if(var3 < 0.0F) {
+ ++var3;
+ }
+
+ if(var3 > 1.0F) {
+ --var3;
+ }
+
+ float var4 = var3;
+ var3 = 1.0F - (float)((Math.cos((double)var3 * Math.PI) + 1.0D) / 2.0D);
+ var3 = var4 + (var3 - var4) / 3.0F;
+ return var3;
+ }
+
+ public Vec3D getCloudColor(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ float var4 = (float)(this.cloudColor >> 16 & 255L) / 255.0F;
+ float var5 = (float)(this.cloudColor >> 8 & 255L) / 255.0F;
+ float var6 = (float)(this.cloudColor & 255L) / 255.0F;
+ var4 *= var3 * 0.9F + 0.1F;
+ var5 *= var3 * 0.9F + 0.1F;
+ var6 *= var3 * 0.85F + 0.15F;
+ return Vec3D.createVector((double)var4, (double)var5, (double)var6);
+ }
+
+ public Vec3D getFogColor(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ float var4 = (float)(this.fogColor >> 16 & 255L) / 255.0F;
+ float var5 = (float)(this.fogColor >> 8 & 255L) / 255.0F;
+ float var6 = (float)(this.fogColor & 255L) / 255.0F;
+ var4 *= var3 * 0.94F + 0.06F;
+ var5 *= var3 * 0.94F + 0.06F;
+ var6 *= var3 * 0.91F + 0.09F;
+ return Vec3D.createVector((double)var4, (double)var5, (double)var6);
+ }
+
+ public int getTopSolidOrLiquidBlock(int var1, int var2) {
+ return 64;
+ }
+
+ public float getStarBrightness(float var1) {
+ float var2 = this.getCelestialAngle(var1);
+ float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 12.0F / 16.0F);
+ if(var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if(var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ return var3 * var3 * 0.5F;
+ }
+
+ public void scheduleBlockUpdate(int var1, int var2, int var3, int var4) {
+ NextTickListEntry var5 = new NextTickListEntry(var1, var2, var3, var4);
+ byte var6 = 8;
+ if(this.checkChunksExist(var1 - var6, var2 - var6, var3 - var6, var1 + var6, var2 + var6, var3 + var6)) {
+ if(var4 > 0) {
+ var5.setScheduledTime((long)Block.blocksList[var4].tickRate() + this.worldTime);
+ }
+
+ if(!this.scheduledTickSet.contains(var5)) {
+ this.scheduledTickSet.add(var5);
+ this.scheduledTickTreeSet.add(var5);
+ }
+ }
+
+ }
+
+ public void updateEntities() {
+ this.loadedEntityList.removeAll(this.unloadedEntityList);
+
+ int var1;
+ int var3;
+ for(var1 = 0; var1 < this.worldAccesses.size(); ++var1) {
+ IWorldAccess var2 = (IWorldAccess)this.worldAccesses.get(var1);
+
+ for(var3 = 0; var3 < this.unloadedEntityList.size(); ++var3) {
+ var2.releaseEntitySkin((Entity)this.unloadedEntityList.get(var3));
+ }
+ }
+
+ this.unloadedEntityList.clear();
+
+ for(var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
+ Entity var6 = (Entity)this.loadedEntityList.get(var1);
+ if(var6.ridingEntity != null) {
+ if(!var6.ridingEntity.isDead && var6.ridingEntity.riddenByEntity == var6) {
+ continue;
+ }
+
+ var6.ridingEntity.riddenByEntity = null;
+ var6.ridingEntity = null;
+ }
+
+ if(!var6.isDead) {
+ this.updateEntity(var6);
+ }
+
+ if(var6.isDead) {
+ var3 = MathHelper.floor_double(var6.posX / 16.0D);
+ int var4 = MathHelper.floor_double(var6.posZ / 16.0D);
+ if(this.chunkExists(var3, var4)) {
+ this.getChunkFromChunkCoords(var3, var4).removeEntity(var6);
+ }
+
+ this.loadedEntityList.remove(var1--);
+
+ for(int var5 = 0; var5 < this.worldAccesses.size(); ++var5) {
+ ((IWorldAccess)this.worldAccesses.get(var5)).releaseEntitySkin(var6);
+ }
+ }
+ }
+
+ for(var1 = 0; var1 < this.loadedTileEntityList.size(); ++var1) {
+ TileEntity var7 = (TileEntity)this.loadedTileEntityList.get(var1);
+ var7.updateEntity();
+ }
+
+ }
+
+ private void updateEntity(Entity var1) {
+ int var2 = MathHelper.floor_double(var1.posX);
+ int var3 = MathHelper.floor_double(var1.posY);
+ int var4 = MathHelper.floor_double(var1.posZ);
+ byte var5 = 16;
+ if(this.checkChunksExist(var2 - var5, 0, var4 - var5, var2 + var5, 128, var4 + var5)) {
+ var1.lastTickPosX = var1.posX;
+ var1.lastTickPosY = var1.posY;
+ var1.lastTickPosZ = var1.posZ;
+ var1.prevRotationYaw = var1.rotationYaw;
+ var1.prevRotationPitch = var1.rotationPitch;
+ 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.ridingEntity != null) {
+ var1.updateRidden();
+ } else {
+ var1.onUpdate();
+ }
+
+ int var9 = MathHelper.floor_double(var1.posX / 16.0D);
+ int var10 = MathHelper.floor_double(var1.posY / 16.0D);
+ int var11 = MathHelper.floor_double(var1.posZ / 16.0D);
+ if(var6 != var9 || var7 != var10 || var8 != var11) {
+ if(this.chunkExists(var6, var8)) {
+ this.getChunkFromChunkCoords(var6, var8).removeEntityAtIndex(var1, var7);
+ }
+
+ if(this.chunkExists(var9, var11)) {
+ this.getChunkFromChunkCoords(var9, var11).addEntity(var1);
+ } else {
+ var1.setEntityDead();
+ }
+ }
+
+ if(var1.riddenByEntity != null) {
+ if(!var1.riddenByEntity.isDead && var1.riddenByEntity.ridingEntity == var1) {
+ this.updateEntity(var1.riddenByEntity);
+ } else {
+ var1.riddenByEntity.ridingEntity = null;
+ var1.riddenByEntity = null;
+ }
+ }
+
+ 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;
+ }
+
+ }
+ }
+
+ public boolean checkIfAABBIsClear(AxisAlignedBB var1) {
+ List var2 = this.getEntitiesWithinAABBExcludingEntity((Entity)null, var1);
+
+ for(int var3 = 0; var3 < var2.size(); ++var3) {
+ Entity var4 = (Entity)var2.get(var3);
+ if(!var4.isDead && var4.preventEntitySpawning) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public boolean getIsAnyLiquid(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.getIsLiquid()) {
+ 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);
+
+ 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) {
+ return true;
+ }
+ }
+ }
+ }
+
+ 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);
+ boolean var10 = false;
+ Vec3D var11 = Vec3D.createVector(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) {
+ Block var15 = Block.blocksList[this.getBlockId(var12, var13, var14)];
+ if(var15 != null && var15.blockMaterial == var2) {
+ double var16 = (double)((float)(var13 + 1) - BlockFluid.getPercentAir(this.getBlockMetadata(var12, var13, var14)));
+ if((double)var7 >= var16) {
+ var10 = true;
+ var15.velocityToAddToEntity(this, var12, var13, var14, var3, var11);
+ }
+ }
+ }
+ }
+ }
+
+ if(var11.lengthVector() > 0.0D) {
+ var11 = var11.normalize();
+ double var18 = 0.004D;
+ var3.motionX += var11.xCoord * var18;
+ var3.motionY += var11.yCoord * var18;
+ var3.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);
+
+ 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) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public void createExplosion(Entity var1, double var2, double var4, double var6, float var8) {
+ (new Explosion()).doExplosion(this, var1, var2, var4, var6, var8);
+ }
+
+ public float getBlockDensity(Vec3D 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);
+ 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(Vec3D.createVector(var14, var16, var18), var1) == null) {
+ ++var9;
+ }
+
+ ++var10;
+ }
+ }
+ }
+
+ return (float)var9 / (float)var10;
+ }
+
+ public void extinguishFire(int var1, int var2, int var3, int var4) {
+ if(var4 == 0) {
+ --var2;
+ }
+
+ if(var4 == 1) {
+ ++var2;
+ }
+
+ if(var4 == 2) {
+ --var3;
+ }
+
+ if(var4 == 3) {
+ ++var3;
+ }
+
+ if(var4 == 4) {
+ --var1;
+ }
+
+ if(var4 == 5) {
+ ++var1;
+ }
+
+ if(this.getBlockId(var1, var2, var3) == Block.fire.blockID) {
+ this.playSoundEffect((double)((float)var1 + 0.5F), (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), "random.fizz", 0.5F, 2.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.8F);
+ this.setBlockWithNotify(var1, var2, var3, 0);
+ }
+
+ }
+
+ public Entity createDebugPlayer(Class var1) {
+ return null;
+ }
+
+ public String getDebugLoadedEntities() {
+ return "All: " + this.loadedEntityList.size();
+ }
+
+ public Entity getPlayerEntity() {
+ return this.playerEntity;
+ }
+
+ public TileEntity getBlockTileEntity(int var1, int var2, int var3) {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ return var4 != null ? var4.getChunkBlockTileEntity(var1 & 15, var2, var3 & 15) : null;
+ }
+
+ public void setBlockTileEntity(int var1, int var2, int var3, TileEntity var4) {
+ Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ if(var5 != null) {
+ var5.setChunkBlockTileEntity(var1 & 15, var2, var3 & 15, var4);
+ }
+
+ }
+
+ public void removeBlockTileEntity(int var1, int var2, int var3) {
+ Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4);
+ if(var4 != null) {
+ var4.removeChunkBlockTileEntity(var1 & 15, var2, var3 & 15);
+ }
+
+ }
+
+ public boolean isBlockNormalCube(int var1, int var2, int var3) {
+ Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)];
+ return var4 == null ? false : var4.isOpaqueCube();
+ }
+
+ public void saveWorldIndirectly(IProgressUpdate var1) {
+ this.saveWorld(true, var1);
+ }
+
+ public boolean updatingLighting() {
+ int var1 = 100000;
+
+ while(this.lightingToUpdate.size() > 0) {
+ --var1;
+ if(var1 <= 0) {
+ return true;
+ }
+
+ ((MetadataChunkBlock)this.lightingToUpdate.remove(this.lightingToUpdate.size() - 1)).updateLight(this);
+ }
+
+ return false;
+ }
+
+ public void scheduleLightingUpdate(EnumSkyBlock var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ int var8 = this.lightingToUpdate.size();
+ int var9 = 4;
+ if(var9 > var8) {
+ var9 = var8;
+ }
+
+ for(int var10 = 0; var10 < var9; ++var10) {
+ MetadataChunkBlock var11 = (MetadataChunkBlock)this.lightingToUpdate.get(this.lightingToUpdate.size() - var10 - 1);
+ if(var11.skyBlock == var1 && var11.getLightUpdated(var2, var3, var4, var5, var6, var7)) {
+ return;
+ }
+ }
+
+ this.lightingToUpdate.add(new MetadataChunkBlock(var1, var2, var3, var4, var5, var6, var7));
+ if(this.lightingToUpdate.size() > 100000) {
+ while(this.lightingToUpdate.size() > '\uc350') {
+ this.updatingLighting();
+ }
+ }
+
+ }
+
+ public void calculateInitialSkylight() {
+ int var1 = this.calculateSkylightSubtracted(1.0F);
+ if(var1 != this.skylightSubtracted) {
+ this.skylightSubtracted = var1;
+ }
+
+ }
+
+ public void tick() {
+ this.chunkProvider.unload100OldestChunks();
+ if(!this.loadedEntityList.contains(this.playerEntity) && this.playerEntity != null) {
+ System.out.println("DOHASDOSHIH!");
+ this.spawnEntityInWorld(this.playerEntity);
+ }
+
+ int var1 = this.calculateSkylightSubtracted(1.0F);
+ int var2;
+ if(var1 != this.skylightSubtracted) {
+ this.skylightSubtracted = var1;
+
+ for(var2 = 0; var2 < this.worldAccesses.size(); ++var2) {
+ ((IWorldAccess)this.worldAccesses.get(var2)).updateAllRenderers();
+ }
+ }
+
+ ++this.worldTime;
+ if(this.worldTime % 20L == 0L) {
+ this.saveWorld(false, (IProgressUpdate)null);
+ }
+
+ this.tickUpdates(false);
+ var2 = MathHelper.floor_double(this.playerEntity.posX);
+ int var3 = MathHelper.floor_double(this.playerEntity.posZ);
+ byte var4 = 64;
+ ChunkCache var5 = new ChunkCache(this, var2 - var4, 0, var3 - var4, var2 + var4, 128, var3 + var4);
+
+ for(int var6 = 0; var6 < 8000; ++var6) {
+ this.updateLCG = this.updateLCG * 3 + this.DIST_HASH_MAGIC;
+ int var7 = this.updateLCG >> 2;
+ int var8 = (var7 & 127) - 64 + var2;
+ int var9 = (var7 >> 8 & 127) - 64 + var3;
+ int var10 = var7 >> 16 & 127;
+ int var11 = var5.getBlockId(var8, var10, var9);
+ if(Block.tickOnLoad[var11]) {
+ Block.blocksList[var11].updateTick(this, var8, var10, var9, this.rand);
+ }
+ }
+
+ }
+
+ public boolean tickUpdates(boolean var1) {
+ int var2 = this.scheduledTickTreeSet.size();
+ if(var2 != this.scheduledTickSet.size()) {
+ throw new IllegalStateException("TickNextTick list out of synch");
+ } else {
+ if(var2 > 500) {
+ var2 = 500;
+ }
+
+ for(int var3 = 0; var3 < var2; ++var3) {
+ NextTickListEntry var4 = (NextTickListEntry)this.scheduledTickTreeSet.first();
+ if(!var1 && var4.scheduledTime > this.worldTime) {
+ break;
+ }
+
+ this.scheduledTickTreeSet.remove(var4);
+ this.scheduledTickSet.remove(var4);
+ byte var5 = 8;
+ 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 == var4.blockID && var6 > 0) {
+ Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.rand);
+ }
+ }
+ }
+
+ return this.scheduledTickTreeSet.size() != 0;
+ }
+ }
+
+ public void randomDisplayUpdates(int var1, int var2, int var3) {
+ byte var4 = 16;
+ Random var5 = new Random();
+
+ for(int var6 = 0; var6 < 1000; ++var6) {
+ int var7 = var1 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
+ int var8 = var2 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
+ int var9 = var3 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
+ int var10 = this.getBlockId(var7, var8, var9);
+ if(var10 > 0) {
+ Block.blocksList[var10].randomDisplayTick(this, var7, var8, var9, var5);
+ }
+ }
+
+ }
+
+ public List getEntitiesWithinAABBExcludingEntity(Entity var1, AxisAlignedBB var2) {
+ this.entitiesWithinAABBExcludingEntity.clear();
+ int var3 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D);
+ int var4 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.minZ - 2.0D) / 16.0D);
+ int var6 = MathHelper.floor_double((var2.maxZ + 2.0D) / 16.0D);
+
+ for(int var7 = var3; var7 <= var4; ++var7) {
+ for(int var8 = var5; var8 <= var6; ++var8) {
+ if(this.chunkExists(var7, var8)) {
+ this.getChunkFromChunkCoords(var7, var8).getEntitiesWithinAABBForEntity(var1, var2, this.entitiesWithinAABBExcludingEntity);
+ }
+ }
+ }
+
+ return this.entitiesWithinAABBExcludingEntity;
+ }
+
+ public List getEntitiesWithinAABB(Class var1, AxisAlignedBB var2) {
+ int var3 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D);
+ int var4 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((var2.minZ - 2.0D) / 16.0D);
+ int var6 = MathHelper.floor_double((var2.maxZ + 2.0D) / 16.0D);
+ ArrayList var7 = new ArrayList();
+
+ for(int var8 = var3; var8 <= var4; ++var8) {
+ for(int var9 = var5; var9 <= var6; ++var9) {
+ if(this.chunkExists(var8, var9)) {
+ this.getChunkFromChunkCoords(var8, var9).getEntitiesOfTypeWithinAAAB(var1, var2, var7);
+ }
+ }
+ }
+
+ return var7;
+ }
+
+ public List getLoadedEntityList() {
+ return this.loadedEntityList;
+ }
+
+ public void updateTileEntityChunkAndDoNothing(int var1, int var2, int var3) {
+ if(this.blockExists(var1, var2, var3)) {
+ this.getChunkFromBlockCoords(var1, var3).setChunkModified();
+ }
+
+ }
+
+ public int countEntities(Class var1) {
+ int var2 = 0;
+
+ for(int var3 = 0; var3 < this.loadedEntityList.size(); ++var3) {
+ Entity var4 = (Entity)this.loadedEntityList.get(var3);
+ if(var1.isAssignableFrom(var4.getClass())) {
+ ++var2;
+ }
+ }
+
+ return var2;
+ }
+
+ public void addLoadedEntities(List var1) {
+ this.loadedEntityList.addAll(var1);
+
+ for(int var2 = 0; var2 < this.worldAccesses.size(); ++var2) {
+ IWorldAccess var3 = (IWorldAccess)this.worldAccesses.get(var2);
+
+ for(int var4 = 0; var4 < var1.size(); ++var4) {
+ var3.obtainEntitySkin((Entity)var1.get(var4));
+ }
+ }
+
+ }
+
+ public void unloadEntities(List var1) {
+ this.unloadedEntityList.addAll(var1);
+ }
+
+ public void dropOldChunks() {
+ while(this.chunkProvider.unload100OldestChunks()) {
+ }
+
+ }
+
+ public boolean canBlockBePlacedAt(int var1, int var2, int var3, int var4, boolean var5) {
+ int var6 = this.getBlockId(var2, var3, var4);
+ Block var7 = Block.blocksList[var6];
+ Block var8 = Block.blocksList[var1];
+ AxisAlignedBB var9 = var8.getCollisionBoundingBoxFromPool(this, var2, var3, var4);
+ if(var5) {
+ var9 = null;
+ }
+
+ return (var1 > 0 && var7 == null || var7 == Block.waterMoving || var7 == Block.waterStill || var7 == Block.lavaMoving || var7 == Block.lavaStill || var7 == Block.fire) && (var9 == null || this.checkIfAABBIsClear(var9)) && var8.canPlaceBlockAt(this, var2, var3, var4);
+ }
+
+ public PathEntity getPathToEntity(Entity var1, Entity var2, float var3) {
+ int var4 = MathHelper.floor_double(var1.posX);
+ int var5 = MathHelper.floor_double(var1.posY);
+ int var6 = MathHelper.floor_double(var1.posZ);
+ int var7 = (int)(var3 + 32.0F);
+ int var8 = var4 - var7;
+ int var9 = var5 - var7;
+ int var10 = var6 - var7;
+ int var11 = var4 + var7;
+ int var12 = var5 + var7;
+ int var13 = var6 + var7;
+ ChunkCache var14 = new ChunkCache(this, var8, var9, var10, var11, var12, var13);
+ return (new Pathfinder(var14)).createEntityPathTo(var1, var2, var3);
+ }
+
+ public PathEntity getEntityPathToXYZ(Entity var1, int var2, int var3, int var4, float var5) {
+ int var6 = MathHelper.floor_double(var1.posX);
+ int var7 = MathHelper.floor_double(var1.posY);
+ int var8 = MathHelper.floor_double(var1.posZ);
+ int var9 = (int)(var5 + 32.0F);
+ int var10 = var6 - var9;
+ int var11 = var7 - var9;
+ int var12 = var8 - var9;
+ int var13 = var6 + var9;
+ int var14 = var7 + var9;
+ int var15 = var8 + var9;
+ ChunkCache var16 = new ChunkCache(this, var10, var11, var12, var13, var14, var15);
+ return (new Pathfinder(var16)).createEntityPathTo(var1, var2, var3, var4, var5);
+ }
+
+ static {
+ float var0 = 0.05F;
+
+ for(int var1 = 0; var1 <= 15; ++var1) {
+ float var2 = 1.0F - (float)var1 / 15.0F;
+ lightBrightnessTable[var1] = (1.0F - var2) / (var2 * 3.0F + 1.0F) * (1.0F - var0) + var0;
+ }
+
+ }
+}
diff --git a/src/net/minecraft/src/WorldGenDungeons.java b/src/net/minecraft/src/WorldGenDungeons.java
new file mode 100644
index 0000000..64d59f0
--- /dev/null
+++ b/src/net/minecraft/src/WorldGenDungeons.java
@@ -0,0 +1,116 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenDungeons extends WorldGenerator {
+ public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
+ byte var6 = 3;
+ int var7 = var2.nextInt(2) + 2;
+ int var8 = var2.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.getBlockId(var10, var11, var12) == 0 && var1.getBlockId(var10, var11 + 1, var12) == 0) {
+ ++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.setBlockWithNotify(var10, var11, var12, 0);
+ } else if(var11 >= 0 && !var1.getBlockMaterial(var10, var11 - 1, var12).isSolid()) {
+ var1.setBlockWithNotify(var10, var11, var12, 0);
+ } else if(var1.getBlockMaterial(var10, var11, var12).isSolid()) {
+ if(var11 == var4 - 1 && var2.nextInt(4) != 0) {
+ var1.setBlockWithNotify(var10, var11, var12, Block.cobblestoneMossy.blockID);
+ } else {
+ var1.setBlockWithNotify(var10, var11, var12, Block.cobblestone.blockID);
+ }
+ }
+ }
+ }
+ }
+
+ label110:
+ 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.getBlockId(var12, var4, var14) == 0) {
+ 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.setBlockWithNotify(var12, var4, var14, Block.chest.blockID);
+ TileEntityChest var16 = (TileEntityChest)var1.getBlockTileEntity(var12, var4, var14);
+ int var17 = 0;
+
+ while(true) {
+ if(var17 >= 8) {
+ continue label110;
+ }
+
+ ItemStack var18 = this.pickCheckLootItem(var2);
+ if(var18 != null) {
+ var16.setInventorySlotContents(var2.nextInt(var16.getSizeInventory()), var18);
+ }
+
+ ++var17;
+ }
+ }
+ }
+ }
+ }
+
+ var1.setBlockWithNotify(var3, var4, var5, Block.mobSpawner.blockID);
+ TileEntityMobSpawner var19 = (TileEntityMobSpawner)var1.getBlockTileEntity(var3, var4, var5);
+ var19.mobID = this.pickMobSpawner(var2);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private ItemStack pickCheckLootItem(Random var1) {
+ int var2 = var1.nextInt(10);
+ return var2 == 0 ? new ItemStack(Item.saddle) : (var2 == 1 ? new ItemStack(Item.ingotIron, var1.nextInt(4) + 1) : (var2 == 2 ? new ItemStack(Item.bread) : (var2 == 3 ? new ItemStack(Item.wheat, var1.nextInt(4) + 1) : (var2 == 4 ? new ItemStack(Item.gunpowder, var1.nextInt(4) + 1) : (var2 == 5 ? new ItemStack(Item.silk, var1.nextInt(4) + 1) : (var2 == 6 ? new ItemStack(Item.bucketEmpty) : (var2 == 7 && var1.nextInt(100) == 0 ? new ItemStack(Item.appleGold) : null)))))));
+ }
+
+ private String pickMobSpawner(Random var1) {
+ int var2 = var1.nextInt(4);
+ return var2 == 0 ? "Skeleton" : (var2 == 1 ? "Zombie" : (var2 == 2 ? "Zombie" : (var2 == 3 ? "Spider" : "")));
+ }
+}
diff --git a/src/net/minecraft/src/WorldGenFlowers.java b/src/net/minecraft/src/WorldGenFlowers.java
new file mode 100644
index 0000000..f01a0f1
--- /dev/null
+++ b/src/net/minecraft/src/WorldGenFlowers.java
@@ -0,0 +1,24 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenFlowers extends WorldGenerator {
+ private int plantBlockId;
+
+ public WorldGenFlowers(int var1) {
+ this.plantBlockId = var1;
+ }
+
+ 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.getBlockId(var7, var8, var9) == 0 && ((BlockFlower)Block.blocksList[this.plantBlockId]).canBlockStay(var1, var7, var8, var9)) {
+ var1.setBlock(var7, var8, var9, this.plantBlockId);
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/WorldGenLiquids.java b/src/net/minecraft/src/WorldGenLiquids.java
new file mode 100644
index 0000000..7fbf0cb
--- /dev/null
+++ b/src/net/minecraft/src/WorldGenLiquids.java
@@ -0,0 +1,61 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenLiquids extends WorldGenerator {
+ private int liquidBlockId;
+
+ public WorldGenLiquids(int var1) {
+ this.liquidBlockId = var1;
+ }
+
+ 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) {
+ 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) {
+ ++var6;
+ }
+
+ int var7 = 0;
+ if(var1.getBlockId(var3 - 1, var4, var5) == 0) {
+ ++var7;
+ }
+
+ if(var1.getBlockId(var3 + 1, var4, var5) == 0) {
+ ++var7;
+ }
+
+ if(var1.getBlockId(var3, var4, var5 - 1) == 0) {
+ ++var7;
+ }
+
+ if(var1.getBlockId(var3, var4, var5 + 1) == 0) {
+ ++var7;
+ }
+
+ if(var6 == 3 && var7 == 1) {
+ var1.setBlockWithNotify(var3, var4, var5, this.liquidBlockId);
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/WorldGenMinable.java b/src/net/minecraft/src/WorldGenMinable.java
new file mode 100644
index 0000000..652dd5a
--- /dev/null
+++ b/src/net/minecraft/src/WorldGenMinable.java
@@ -0,0 +1,47 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenMinable extends WorldGenerator {
+ private int minableBlockId;
+ private int numberOfBlocks;
+
+ public WorldGenMinable(int var1, int var2) {
+ this.minableBlockId = var1;
+ this.numberOfBlocks = var2;
+ }
+
+ 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) {
+ 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 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;
+
+ for(int var32 = (int)(var20 - var28 / 2.0D); var32 <= (int)(var20 + var28 / 2.0D); ++var32) {
+ for(int var33 = (int)(var22 - var30 / 2.0D); var33 <= (int)(var22 + var30 / 2.0D); ++var33) {
+ for(int var34 = (int)(var24 - var28 / 2.0D); var34 <= (int)(var24 + var28 / 2.0D); ++var34) {
+ double var35 = ((double)var32 + 0.5D - var20) / (var28 / 2.0D);
+ double var37 = ((double)var33 + 0.5D - var22) / (var30 / 2.0D);
+ double var39 = ((double)var34 + 0.5D - var24) / (var28 / 2.0D);
+ if(var35 * var35 + var37 * var37 + var39 * var39 < 1.0D && var1.getBlockId(var32, var33, var34) == Block.stone.blockID) {
+ var1.setBlock(var32, var33, var34, this.minableBlockId);
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/net/minecraft/src/WorldGenTrees.java b/src/net/minecraft/src/WorldGenTrees.java
new file mode 100644
index 0000000..631e379
--- /dev/null
+++ b/src/net/minecraft/src/WorldGenTrees.java
@@ -0,0 +1,78 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public class WorldGenTrees extends WorldGenerator {
+ public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
+ int var6 = var2.nextInt(3) + 4;
+ boolean var7 = true;
+ if(var4 >= 1 && var4 + var6 + 1 <= 128) {
+ int var8;
+ int var10;
+ int var11;
+ int var12;
+ for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) {
+ byte var9 = 1;
+ if(var8 == var4) {
+ var9 = 0;
+ }
+
+ if(var8 >= var4 + 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 < 128) {
+ var12 = var1.getBlockId(var10, var8, var11);
+ if(var12 != 0 && var12 != Block.leaves.blockID) {
+ var7 = false;
+ }
+ } else {
+ var7 = false;
+ }
+ }
+ }
+ }
+
+ 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) {
+ var1.setBlock(var3, var4 - 1, var5, Block.dirt.blockID);
+
+ int var16;
+ for(var16 = var4 - 3 + var6; var16 <= var4 + var6; ++var16) {
+ var10 = var16 - (var4 + 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) && !Block.opaqueCubeLookup[var1.getBlockId(var12, var16, var14)]) {
+ var1.setBlock(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) {
+ var1.setBlock(var3, var4 + var16, var5, Block.wood.blockID);
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/src/net/minecraft/src/WorldGenerator.java b/src/net/minecraft/src/WorldGenerator.java
new file mode 100644
index 0000000..61bcf66
--- /dev/null
+++ b/src/net/minecraft/src/WorldGenerator.java
@@ -0,0 +1,10 @@
+package net.minecraft.src;
+
+import java.util.Random;
+
+public abstract class WorldGenerator {
+ public abstract boolean generate(World var1, Random var2, int var3, int var4, int var5);
+
+ public void setScale(double var1, double var3, double var5) {
+ }
+}
diff --git a/src/net/minecraft/src/WorldIso.java b/src/net/minecraft/src/WorldIso.java
new file mode 100644
index 0000000..703718d
--- /dev/null
+++ b/src/net/minecraft/src/WorldIso.java
@@ -0,0 +1,16 @@
+package net.minecraft.src;
+
+import java.io.File;
+
+class WorldIso extends World {
+ final CanvasIsomPreview isomPreview;
+
+ WorldIso(CanvasIsomPreview var1, File var2, String var3) {
+ super(var2, var3);
+ this.isomPreview = var1;
+ }
+
+ protected IChunkProvider getChunkProvider(File var1) {
+ return new ChunkProviderIso(this, new ChunkLoader(var1, false));
+ }
+}
diff --git a/src/net/minecraft/src/WorldRenderer.java b/src/net/minecraft/src/WorldRenderer.java
new file mode 100644
index 0000000..d9ae1a0
--- /dev/null
+++ b/src/net/minecraft/src/WorldRenderer.java
@@ -0,0 +1,214 @@
+package net.minecraft.src;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import org.lwjgl.opengl.GL11;
+
+public class WorldRenderer {
+ public World worldObj;
+ private int glRenderList = -1;
+ private static Tessellator tessellator = Tessellator.instance;
+ public static int chunksUpdated = 0;
+ public int posX;
+ public int posY;
+ public int posZ;
+ public int sizeWidth;
+ public int sizeHeight;
+ public int sizeDepth;
+ public int posXMinus;
+ public int posYMinus;
+ public int posZMinus;
+ public int posXClip;
+ public int posYClip;
+ public int posZClip;
+ public boolean isInFrustum = false;
+ public boolean[] skipRenderPass = new boolean[2];
+ public int posXPlus;
+ public int posYPlus;
+ public int posZPlus;
+ public float rendererRadius;
+ public boolean needsUpdate;
+ public AxisAlignedBB rendererBoundingBox;
+ public int chunkIndex;
+ public boolean isVisible = true;
+ public boolean isWaitingOnOcclusionQuery;
+ public int glOcclusionQuery;
+ public boolean isChunkLit;
+ private boolean isInitialized = false;
+ public List tileEntityRenderers = new ArrayList();
+ private List tileEntities;
+
+ public WorldRenderer(World var1, List var2, int var3, int var4, int var5, int var6, int var7) {
+ this.worldObj = var1;
+ this.tileEntities = var2;
+ this.sizeWidth = this.sizeHeight = this.sizeDepth = var6;
+ this.rendererRadius = MathHelper.sqrt_float((float)(this.sizeWidth * this.sizeWidth + this.sizeHeight * this.sizeHeight + this.sizeDepth * this.sizeDepth)) / 2.0F;
+ this.glRenderList = var7;
+ this.posX = -999;
+ this.setPosition(var3, var4, var5);
+ this.needsUpdate = false;
+ }
+
+ public void setPosition(int var1, int var2, int var3) {
+ if(var1 != this.posX || var2 != this.posY || var3 != this.posZ) {
+ this.setDontDraw();
+ this.posX = var1;
+ this.posY = var2;
+ this.posZ = var3;
+ this.posXPlus = var1 + this.sizeWidth / 2;
+ this.posYPlus = var2 + this.sizeHeight / 2;
+ this.posZPlus = var3 + this.sizeDepth / 2;
+ 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;
+ float var4 = 2.0F;
+ this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)((float)var1 - var4), (double)((float)var2 - var4), (double)((float)var3 - var4), (double)((float)(var1 + this.sizeWidth) + var4), (double)((float)(var2 + this.sizeHeight) + var4), (double)((float)(var3 + this.sizeDepth) + var4));
+ GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE);
+ RenderItem.renderAABB(AxisAlignedBB.getBoundingBoxFromPool((double)((float)this.posXClip - var4), (double)((float)this.posYClip - var4), (double)((float)this.posZClip - var4), (double)((float)(this.posXClip + this.sizeWidth) + var4), (double)((float)(this.posYClip + this.sizeHeight) + var4), (double)((float)(this.posZClip + this.sizeDepth) + var4)));
+ GL11.glEndList();
+ this.markDirty();
+ }
+ }
+
+ private void setupGLTranslation() {
+ GL11.glTranslatef((float)this.posXClip, (float)this.posYClip, (float)this.posZClip);
+ }
+
+ public void updateRenderer() {
+ if(this.needsUpdate) {
+ ++chunksUpdated;
+ int var1 = this.posX;
+ int var2 = this.posY;
+ int var3 = this.posZ;
+ int var4 = this.posX + this.sizeWidth;
+ int var5 = this.posY + this.sizeHeight;
+ int var6 = this.posZ + this.sizeDepth;
+
+ for(int var7 = 0; var7 < 2; ++var7) {
+ this.skipRenderPass[var7] = true;
+ }
+
+ Chunk.isLit = false;
+ HashSet var21 = new HashSet();
+ var21.addAll(this.tileEntityRenderers);
+ this.tileEntityRenderers.clear();
+ byte var8 = 1;
+ ChunkCache var9 = new ChunkCache(this.worldObj, var1 - var8, var2 - var8, var3 - var8, var4 + var8, var5 + var8, var6 + var8);
+ RenderBlocks var10 = new RenderBlocks(var9);
+
+ 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((float)(-this.sizeDepth) / 2.0F, (float)(-this.sizeHeight) / 2.0F, (float)(-this.sizeDepth) / 2.0F);
+ GL11.glScalef(var19, var19, var19);
+ GL11.glTranslatef((float)this.sizeDepth / 2.0F, (float)this.sizeHeight / 2.0F, (float)this.sizeDepth / 2.0F);
+ tessellator.startDrawingQuads();
+ tessellator.setTranslationD((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
+ }
+
+ if(var11 == 0 && Block.blocksList[var18] instanceof BlockContainer) {
+ TileEntity var23 = var9.getBlockTileEntity(var17, var15, var16);
+ if(TileEntityRenderer.instance.hasSpecialRenderer(var23)) {
+ this.tileEntityRenderers.add(var23);
+ }
+ }
+
+ Block var24 = Block.blocksList[var18];
+ int var20 = var24.getRenderBlockPass();
+ if(var20 != var11) {
+ var12 = true;
+ } else if(var20 == var11) {
+ var13 |= var10.renderBlockByRenderType(var24, var17, var15, var16);
+ }
+ }
+ }
+ }
+ }
+
+ if(var14) {
+ tessellator.draw();
+ GL11.glPopMatrix();
+ GL11.glEndList();
+ tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
+ } else {
+ var13 = false;
+ }
+
+ if(var13) {
+ this.skipRenderPass[var11] = false;
+ }
+
+ if(!var12) {
+ break;
+ }
+ }
+
+ HashSet var22 = new HashSet();
+ var22.addAll(this.tileEntityRenderers);
+ var22.removeAll(var21);
+ this.tileEntities.addAll(var22);
+ var21.removeAll(this.tileEntityRenderers);
+ this.tileEntities.removeAll(var21);
+ this.isChunkLit = Chunk.isLit;
+ this.isInitialized = true;
+ }
+ }
+
+ 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);
+ return var2 * var2 + var3 * var3 + var4 * var4;
+ }
+
+ public void setDontDraw() {
+ for(int var1 = 0; var1 < 2; ++var1) {
+ this.skipRenderPass[var1] = true;
+ }
+
+ this.isInFrustum = false;
+ this.isInitialized = false;
+ }
+
+ public void stopRendering() {
+ this.setDontDraw();
+ this.worldObj = null;
+ }
+
+ public int getGLCallListForPass(int var1) {
+ return !this.isInFrustum ? -1 : (!this.skipRenderPass[var1] ? this.glRenderList + var1 : -1);
+ }
+
+ public void updateInFrustrum(ICamera var1) {
+ this.isInFrustum = var1.isBoundingBoxInFrustum(this.rendererBoundingBox);
+ }
+
+ public void callOcclusionQueryList() {
+ GL11.glCallList(this.glRenderList + 2);
+ }
+
+ public boolean skipAllRenderPasses() {
+ return !this.isInitialized ? false : this.skipRenderPass[0] && this.skipRenderPass[1];
+ }
+
+ public void markDirty() {
+ this.needsUpdate = true;
+ }
+}