From 8dcffe3d5c8681d306d40b86e3bbfc8fa39c1bc4 Mon Sep 17 00:00:00 2001 From: mDiyo Date: Sat, 13 Jul 2013 03:48:08 -0700 Subject: [PATCH] Initial fixes, still a long ways to go --- mods/tinker/tconstruct/TConstruct.java | 3 +- mods/tinker/tconstruct/blocks/DryingRack.java | 2 - .../tconstruct/blocks/GlassBlockStained.java | 2 - mods/tinker/tconstruct/blocks/GlassPane.java | 8 - .../tconstruct/blocks/GlassPaneStained.java | 8 - .../tconstruct/blocks/GolemHeadBlock.java | 4 +- mods/tinker/tconstruct/blocks/GravelOre.java | 1 - .../tconstruct/blocks/LavaTankBlock.java | 3 - .../tconstruct/blocks/LightCrystalBase.java | 1 - .../tconstruct/blocks/LiquidMetalBase.java | 1 - .../tconstruct/blocks/LiquidMetalFlowing.java | 9 +- .../tconstruct/blocks/LiquidMetalStill.java | 9 +- mods/tinker/tconstruct/blocks/MultiBrick.java | 1 - .../tconstruct/blocks/MultiBrickFancy.java | 1 - .../blocks/OreberryBushEssence.java | 22 - mods/tinker/tconstruct/blocks/PaneBase.java | 5 +- .../blocks/RedstoneBallRepeater.java | 3 - .../tconstruct/blocks/RedstoneMachine.java | 1 - .../tinker/tconstruct/blocks/SearedBlock.java | 1 - mods/tinker/tconstruct/blocks/SoilBlock.java | 1 - .../tconstruct/blocks/TConstructBlock.java | 5 +- .../tinker/tconstruct/blocks/TMetalBlock.java | 4 - .../tconstruct/blocks/ToolForgeBlock.java | 1 - .../blocks/logic/AggregatorLogic.java | 3 - .../blocks/logic/AqueductLogic.java | 9 +- .../blocks/logic/CastingBasinLogic.java | 4 - .../blocks/logic/CastingTableLogic.java | 4 - .../blocks/logic/DrawbridgeLogic.java | 5 - .../blocks/logic/DryingRackLogic.java | 7 +- .../tconstruct/blocks/logic/FaucetLogic.java | 3 - .../blocks/logic/GolemCoreLogic.java | 2 +- .../blocks/logic/GolemPedestalLogic.java | 6 +- .../blocks/logic/LavaTankLogic.java | 5 - .../blocks/logic/MultiServantLogic.java | 2 - .../tconstruct/blocks/logic/RedwireLogic.java | 1 - .../blocks/logic/SmelteryDrainLogic.java | 3 - .../blocks/logic/SmelteryLogic.java | 4 - .../blocks/logic/ToolForgeLogic.java | 1 - .../tconstruct/client/ChiselRotator.java | 106 - mods/tinker/tconstruct/client/CustomFont.java | 3 +- .../tconstruct/client/RenderItemCopy.java | 221 +- .../tconstruct/client/TClientEvents.java | 1 - .../tconstruct/client/TClientTickHandler.java | 1 - mods/tinker/tconstruct/client/TControls.java | 2 - .../tconstruct/client/TProxyClient.java | 123 +- .../tconstruct/client/armor/WingModel.java | 1 - .../client/block/BlockSkinRenderHelper.java | 1 - .../tconstruct/client/block/BreakingFX.java | 45 +- .../client/block/GolemCoreRender.java | 5 - .../client/block/OreberryRender.java | 4 - .../client/block/SmallFontRenderer.java | 293 +-- .../client/block/SmelteryRender.java | 6 - .../tconstruct/client/block/TankRender.java | 2 - .../tconstruct/client/entity/CartRender.java | 8 + .../client/entity/CrystalGuardianModel.java | 4 +- .../client/entity/CrystalGuardianRender.java | 17 +- .../client/entity/CrystalRender.java | 10 +- .../client/entity/FancyItemRender.java | 242 ++- .../tconstruct/client/entity/GolemRender.java | 419 ---- .../client/entity/MiniGardyRender.java | 24 +- .../tconstruct/client/entity/SkylaRender.java | 9 + .../tconstruct/client/entity/SlimeRender.java | 11 +- .../client/entity/projectile/ArrowRender.java | 2 - .../entity/projectile/DaggerRender.java | 2 - .../client/gui/ArmorExtendedGui.java | 3 - .../tconstruct/client/gui/GuiManual.java | 1 - .../tconstruct/client/gui/KnapsackGui.java | 5 - .../tconstruct/client/gui/MiniGardyGui.java | 1 - .../client/gui/NewContainerGui.java | 2 +- .../tconstruct/client/gui/PartCrafterGui.java | 1 - .../tconstruct/client/gui/SmelteryGui.java | 8 - .../tconstruct/client/gui/ToolForgeGui.java | 17 - .../client/pages/BlockCastPage.java | 2 - .../tconstruct/client/pages/BookPage.java | 2 +- .../client/pages/ContentsTablePage.java | 2 - .../tconstruct/client/pages/CraftingPage.java | 2 - .../tconstruct/client/pages/FurnacePage.java | 2 - .../tconstruct/client/pages/ModifierPage.java | 2 - .../tconstruct/client/pages/PicturePage.java | 8 - .../tconstruct/client/pages/SectionPage.java | 8 - .../tconstruct/client/pages/SidebarPage.java | 2 - .../tconstruct/client/pages/TextPage.java | 8 - .../tconstruct/client/pages/TitlePage.java | 8 - .../tconstruct/client/pages/ToolPage.java | 4 - .../tinker/tconstruct/client/tmt/Angle3D.java | 99 - mods/tinker/tconstruct/client/tmt/Bone.java | 550 ----- .../tinker/tconstruct/client/tmt/Coord2D.java | 30 - .../tconstruct/client/tmt/ModelPool.java | 57 - .../tconstruct/client/tmt/ModelPoolEntry.java | 118 - .../client/tmt/ModelPoolObjEntry.java | 223 -- .../client/tmt/ModelRendererTurbo.java | 1905 ----------------- .../client/tmt/PositionTransformVertex.java | 78 - .../tinker/tconstruct/client/tmt/Shape2D.java | 147 -- .../tinker/tconstruct/client/tmt/Shape3D.java | 13 - .../tconstruct/client/tmt/TextureGroup.java | 42 - .../client/tmt/TexturedPolygon.java | 106 - .../tconstruct/client/tmt/TransformGroup.java | 10 - .../client/tmt/TransformGroupBone.java | 111 - mods/tinker/tconstruct/common/TContent.java | 167 +- .../tconstruct/common/TProxyCommon.java | 4 +- .../tconstruct/crystal/TheftValueTracker.java | 2 - .../dimension/TinkerWorldProvider.java | 1 - mods/tinker/tconstruct/entity/Automaton.java | 7 +- mods/tinker/tconstruct/entity/BlueSlime.java | 3 +- mods/tinker/tconstruct/entity/CartEntity.java | 2 +- mods/tinker/tconstruct/entity/Crystal.java | 3 +- .../tconstruct/entity/CrystalGuardian.java | 6 +- mods/tinker/tconstruct/entity/GolemBase.java | 6 +- mods/tinker/tconstruct/entity/MetalSlime.java | 3 - mods/tinker/tconstruct/entity/MiniGardy.java | 2 +- mods/tinker/tconstruct/entity/Skyla.java | 3 +- mods/tinker/tconstruct/entity/SlimeClone.java | 2 - .../entity/projectile/ArrowEntity.java | 36 +- .../entity/projectile/LaunchedPotion.java | 10 +- .../entity/projectile/RotatingBase.java | 8 +- .../tconstruct/inventory/ActiveContainer.java | 3 - .../inventory/ArmorExtendedContainer.java | 1 - .../inventory/KnapsackContainer.java | 1 - .../inventory/MiniGardyContainer.java | 1 - .../inventory/PartCrafterContainer.java | 1 - .../inventory/PatternShaperContainer.java | 4 +- .../tconstruct/inventory/SlotToolForge.java | 1 - .../inventory/SmelteryContainer.java | 4 - .../inventory/ToolForgeContainer.java | 1 - .../inventory/ToolStationContainer.java | 1 - mods/tinker/tconstruct/items/Bowstring.java | 6 - mods/tinker/tconstruct/items/Fletching.java | 9 - mods/tinker/tconstruct/items/GoldenHead.java | 1 - .../items/RedstoneBallRepeaterItem.java | 5 +- mods/tinker/tconstruct/items/SpecialFood.java | 5 +- mods/tinker/tconstruct/items/TitleIcon.java | 4 - mods/tinker/tconstruct/items/ToolShard.java | 5 +- .../tconstruct/items/armor/Knapsack.java | 4 - .../tconstruct/items/armor/TArmorBase.java | 8 +- .../items/blocks/CraftedSoilItemBlock.java | 4 +- .../items/blocks/GlassBlockItem.java | 5 - .../items/blocks/GlassPaneItem.java | 5 - .../items/blocks/LightCrystalItem.java | 2 - .../items/blocks/LiquidItemBlock.java | 4 +- .../items/blocks/MultiBrickFancyItem.java | 4 +- .../items/blocks/MultiBrickItem.java | 4 +- .../items/blocks/SearedSlabItem.java | 5 - .../tconstruct/items/blocks/SoilSlabItem.java | 4 +- .../items/blocks/StainedGlassClearItem.java | 5 - .../blocks/StainedGlassClearPaneItem.java | 5 - .../items/blocks/ToolForgeItemBlock.java | 2 - mods/tinker/tconstruct/items/tools/Arrow.java | 5 +- .../tconstruct/items/tools/Broadsword.java | 6 - .../tconstruct/items/tools/Cleaver.java | 4 +- .../tinker/tconstruct/items/tools/Dagger.java | 2 - .../tconstruct/items/tools/Excavator.java | 3 - .../tinker/tconstruct/items/tools/Hammer.java | 4 - .../tconstruct/items/tools/Longsword.java | 6 +- .../tconstruct/items/tools/LumberAxe.java | 11 +- .../items/tools/PotionLauncher.java | 7 +- .../tinker/tconstruct/items/tools/Rapier.java | 1 - .../tconstruct/items/tools/Shortbow.java | 5 +- .../tconstruct/library/ActiveToolMod.java | 15 +- .../library/TConstructRegistry.java | 12 +- .../library/blocks/InventoryBlock.java | 4 +- .../library/blocks/InventoryLogic.java | 2 +- .../tconstruct/library/crafting/AlloyMix.java | 2 - .../library/crafting/CastingRecipe.java | 1 - .../library/crafting/Detailing.java | 1 - .../library/crafting/LiquidCasting.java | 4 - .../library/crafting/PatternBuilder.java | 1 - .../tconstruct/library/crafting/Smeltery.java | 1 - .../library/event/PartBuilderEvent.java | 3 - .../library/tools/AbilityHelper.java | 42 +- .../tconstruct/library/tools/ToolCore.java | 5 +- .../tconstruct/library/tools/ToolMod.java | 1 - .../tconstruct/library/tools/Weapon.java | 4 +- .../tconstruct/library/util/IFacingLogic.java | 4 +- .../tconstruct/modifiers/ModAntiSpider.java | 4 - .../tconstruct/modifiers/ModButtertouch.java | 2 - .../modifiers/ModExtraModifier.java | 3 +- .../tinker/tconstruct/modifiers/ModSmite.java | 4 - .../tconstruct/modifiers/TActiveOmniMod.java | 22 +- .../grindables/GrindableStandard.java | 1 - .../harvestables/HarvestableOreBerry.java | 1 - mods/tinker/tconstruct/skill/Jump.java | 1 - mods/tinker/tconstruct/skill/Skill.java | 3 - .../tinker/tconstruct/skill/WallBuilding.java | 2 - mods/tinker/tconstruct/util/PHConstruct.java | 4 - .../util/TDispenserBehaviorSpawnEgg.java | 2 +- .../tinker/tconstruct/util/TEventHandler.java | 1 - .../tconstruct/util/player/ArmorExtended.java | 4 +- .../util/player/ArmorExtendedClient.java | 4 - .../util/player/KnapsackInventory.java | 2 +- .../tconstruct/util/player/TFoodStats.java | 185 -- .../util/player/TPlayerHandler.java | 8 +- .../tconstruct/worldgen/OreberryBushGen.java | 1 - .../worldgen/TerrainGenEventHandler.java | 15 +- .../worldgen/village/ComponentSmeltery.java | 2 - test/XinStick.java | 9 +- 195 files changed, 930 insertions(+), 5179 deletions(-) delete mode 100644 mods/tinker/tconstruct/client/ChiselRotator.java delete mode 100644 mods/tinker/tconstruct/client/entity/GolemRender.java delete mode 100644 mods/tinker/tconstruct/client/tmt/Angle3D.java delete mode 100644 mods/tinker/tconstruct/client/tmt/Bone.java delete mode 100644 mods/tinker/tconstruct/client/tmt/Coord2D.java delete mode 100644 mods/tinker/tconstruct/client/tmt/ModelPool.java delete mode 100644 mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java delete mode 100644 mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java delete mode 100644 mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java delete mode 100644 mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java delete mode 100644 mods/tinker/tconstruct/client/tmt/Shape2D.java delete mode 100644 mods/tinker/tconstruct/client/tmt/Shape3D.java delete mode 100644 mods/tinker/tconstruct/client/tmt/TextureGroup.java delete mode 100644 mods/tinker/tconstruct/client/tmt/TexturedPolygon.java delete mode 100644 mods/tinker/tconstruct/client/tmt/TransformGroup.java delete mode 100644 mods/tinker/tconstruct/client/tmt/TransformGroupBone.java delete mode 100644 mods/tinker/tconstruct/util/player/TFoodStats.java diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index c4ac7a0a..43b20240 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -16,6 +16,7 @@ import mods.tinker.tconstruct.worldgen.TerrainGenEventHandler; import mods.tinker.tconstruct.worldgen.village.TVillageTrades; import mods.tinker.tconstruct.worldgen.village.VillageSmelteryHandler; import mods.tinker.tconstruct.worldgen.village.VillageToolStationHandler; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -99,7 +100,7 @@ public class TConstruct GameRegistry.registerCraftingHandler(new TCraftingHandler()); NetworkRegistry.instance().registerGuiHandler(instance, proxy); - VillagerRegistry.instance().registerVillagerType(78943, "/mods/tinker/textures/mob/villagertools.png"); + VillagerRegistry.instance().registerVillagerSkin(78943, new ResourceLocation("/mods/tinker/textures/mob/villagertools.png")); VillagerRegistry.instance().registerVillageTradeHandler(78943, new TVillageTrades()); if (PHConstruct.addToVillages) { diff --git a/mods/tinker/tconstruct/blocks/DryingRack.java b/mods/tinker/tconstruct/blocks/DryingRack.java index 34134892..f8764de8 100644 --- a/mods/tinker/tconstruct/blocks/DryingRack.java +++ b/mods/tinker/tconstruct/blocks/DryingRack.java @@ -3,9 +3,7 @@ package mods.tinker.tconstruct.blocks; import java.util.List; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.blocks.logic.CastingBasinLogic; import mods.tinker.tconstruct.blocks.logic.DryingRackLogic; -import mods.tinker.tconstruct.blocks.logic.FaucetLogic; import mods.tinker.tconstruct.client.block.DryingRackRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.blocks.InventoryBlock; diff --git a/mods/tinker/tconstruct/blocks/GlassBlockStained.java b/mods/tinker/tconstruct/blocks/GlassBlockStained.java index e20ee3a1..13622037 100644 --- a/mods/tinker/tconstruct/blocks/GlassBlockStained.java +++ b/mods/tinker/tconstruct/blocks/GlassBlockStained.java @@ -2,10 +2,8 @@ package mods.tinker.tconstruct.blocks; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.Entity; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/mods/tinker/tconstruct/blocks/GlassPane.java b/mods/tinker/tconstruct/blocks/GlassPane.java index fdc11c74..82eb0637 100644 --- a/mods/tinker/tconstruct/blocks/GlassPane.java +++ b/mods/tinker/tconstruct/blocks/GlassPane.java @@ -1,15 +1,7 @@ package mods.tinker.tconstruct.blocks; -import java.util.List; - import mods.tinker.tconstruct.library.TConstructRegistry; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class GlassPane extends PaneBase { diff --git a/mods/tinker/tconstruct/blocks/GlassPaneStained.java b/mods/tinker/tconstruct/blocks/GlassPaneStained.java index d66cd18f..40e08775 100644 --- a/mods/tinker/tconstruct/blocks/GlassPaneStained.java +++ b/mods/tinker/tconstruct/blocks/GlassPaneStained.java @@ -1,15 +1,7 @@ package mods.tinker.tconstruct.blocks; -import java.util.List; - import mods.tinker.tconstruct.library.TConstructRegistry; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class GlassPaneStained extends PaneBase { diff --git a/mods/tinker/tconstruct/blocks/GolemHeadBlock.java b/mods/tinker/tconstruct/blocks/GolemHeadBlock.java index 1d17fada..4dc05c26 100644 --- a/mods/tinker/tconstruct/blocks/GolemHeadBlock.java +++ b/mods/tinker/tconstruct/blocks/GolemHeadBlock.java @@ -6,7 +6,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; @@ -102,7 +102,7 @@ public class GolemHeadBlock extends Block }*/ @Override - public void onBlockPlacedBy (World world, int i, int j, int k, EntityLiving entityliving, ItemStack par6ItemStack) + public void onBlockPlacedBy (World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack par6ItemStack) { int l = MathHelper.floor_double((double) ((entityliving.rotationYaw * 4F) / 360F) + 2.5D) & 3; world.setBlockMetadataWithNotify(i, j, k, l, 3); diff --git a/mods/tinker/tconstruct/blocks/GravelOre.java b/mods/tinker/tconstruct/blocks/GravelOre.java index 5d06f575..0f72fef0 100644 --- a/mods/tinker/tconstruct/blocks/GravelOre.java +++ b/mods/tinker/tconstruct/blocks/GravelOre.java @@ -8,7 +8,6 @@ import net.minecraft.block.BlockSand; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; diff --git a/mods/tinker/tconstruct/blocks/LavaTankBlock.java b/mods/tinker/tconstruct/blocks/LavaTankBlock.java index 30d11ac8..f4f2e2fe 100644 --- a/mods/tinker/tconstruct/blocks/LavaTankBlock.java +++ b/mods/tinker/tconstruct/blocks/LavaTankBlock.java @@ -18,9 +18,6 @@ import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.LiquidContainerRegistry; -import net.minecraftforge.liquids.LiquidStack; public class LavaTankBlock extends BlockContainer { diff --git a/mods/tinker/tconstruct/blocks/LightCrystalBase.java b/mods/tinker/tconstruct/blocks/LightCrystalBase.java index 87c8ecf8..343e3c68 100644 --- a/mods/tinker/tconstruct/blocks/LightCrystalBase.java +++ b/mods/tinker/tconstruct/blocks/LightCrystalBase.java @@ -2,7 +2,6 @@ package mods.tinker.tconstruct.blocks; import java.util.List; -import mods.natura.common.NContent; import mods.tinker.tconstruct.client.block.CrystalBlockRender; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.crystal.TheftValueTracker; diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalBase.java b/mods/tinker/tconstruct/blocks/LiquidMetalBase.java index 22b7f5cd..516a5b12 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalBase.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalBase.java @@ -13,7 +13,6 @@ import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java b/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java index b2f7c9c2..6aa917d7 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java @@ -8,9 +8,8 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.liquids.ILiquid; -public class LiquidMetalFlowing extends LiquidMetalBase implements ILiquid +public class LiquidMetalFlowing extends LiquidMetalBase// implements ILiquid { boolean isOptimalFlowDirection[] = new boolean[4]; int flowCost[] = new int[4]; @@ -295,19 +294,19 @@ public class LiquidMetalFlowing extends LiquidMetalBase implements ILiquid } } - @Override + //@Override public int stillLiquidMeta () { return 0; } - @Override + //@Override public boolean isMetaSensitive () { return false; } - @Override + //@Override public int stillLiquidId () { return TContent.liquidMetalStill.blockID; diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java index 395b740e..27f8355d 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java @@ -9,9 +9,8 @@ import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.liquids.ILiquid; -public class LiquidMetalStill extends LiquidMetalBase implements ILiquid +public class LiquidMetalStill extends LiquidMetalBase// implements ILiquid { public LiquidMetalStill(int id) { @@ -19,7 +18,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid //this.setCreativeTab(TConstruct.blockTab); } - @Override + //@Override public int stillLiquidId () { return this.blockID; @@ -30,13 +29,13 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid return TContent.liquidMetalFlowing.blockID; } - @Override + //@Override public boolean isMetaSensitive () { return false; } - @Override + //@Override public int stillLiquidMeta () { return 0; diff --git a/mods/tinker/tconstruct/blocks/MultiBrick.java b/mods/tinker/tconstruct/blocks/MultiBrick.java index 760c179f..c6297b9a 100644 --- a/mods/tinker/tconstruct/blocks/MultiBrick.java +++ b/mods/tinker/tconstruct/blocks/MultiBrick.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.blocks; -import mods.tinker.tconstruct.client.block.BrickRender; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; diff --git a/mods/tinker/tconstruct/blocks/MultiBrickFancy.java b/mods/tinker/tconstruct/blocks/MultiBrickFancy.java index 1026295b..195b49da 100644 --- a/mods/tinker/tconstruct/blocks/MultiBrickFancy.java +++ b/mods/tinker/tconstruct/blocks/MultiBrickFancy.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.blocks; -import mods.tinker.tconstruct.client.block.BrickRender; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; diff --git a/mods/tinker/tconstruct/blocks/OreberryBushEssence.java b/mods/tinker/tconstruct/blocks/OreberryBushEssence.java index 2c5c8b71..eac20a0a 100644 --- a/mods/tinker/tconstruct/blocks/OreberryBushEssence.java +++ b/mods/tinker/tconstruct/blocks/OreberryBushEssence.java @@ -1,31 +1,9 @@ package mods.tinker.tconstruct.blocks; -import java.util.List; import java.util.Random; -import mods.tinker.tconstruct.client.block.OreberryRender; -import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.library.TConstructRegistry; -import mods.tinker.tconstruct.library.tools.AbilityHelper; -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.EnumPlantType; -import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.IPlantable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class OreberryBushEssence extends OreberryBush implements IPlantable { diff --git a/mods/tinker/tconstruct/blocks/PaneBase.java b/mods/tinker/tconstruct/blocks/PaneBase.java index 427631e2..34cc02e4 100644 --- a/mods/tinker/tconstruct/blocks/PaneBase.java +++ b/mods/tinker/tconstruct/blocks/PaneBase.java @@ -2,9 +2,6 @@ package mods.tinker.tconstruct.blocks; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.client.block.PaneRender; import net.minecraft.block.Block; import net.minecraft.block.BlockPane; @@ -17,6 +14,8 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class PaneBase extends Block { diff --git a/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java b/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java index 949e179a..6c6a2b61 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java +++ b/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java @@ -3,13 +3,10 @@ package mods.tinker.tconstruct.blocks; import java.util.Random; import mods.tinker.tconstruct.client.block.BallRepeaterRender; -import mods.tinker.tconstruct.common.TContent; import net.minecraft.block.Block; import net.minecraft.block.BlockRedstoneLogic; import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.util.Direction; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; diff --git a/mods/tinker/tconstruct/blocks/RedstoneMachine.java b/mods/tinker/tconstruct/blocks/RedstoneMachine.java index d74c111e..33ea16d7 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneMachine.java +++ b/mods/tinker/tconstruct/blocks/RedstoneMachine.java @@ -10,7 +10,6 @@ import mods.tinker.tconstruct.blocks.logic.FirestarterLogic; import mods.tinker.tconstruct.client.block.MachineRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.blocks.InventoryBlock; -import mods.tinker.tconstruct.library.blocks.InventoryLogic; import mods.tinker.tconstruct.library.util.IActiveLogic; import mods.tinker.tconstruct.library.util.IFacingLogic; import net.minecraft.block.Block; diff --git a/mods/tinker/tconstruct/blocks/SearedBlock.java b/mods/tinker/tconstruct/blocks/SearedBlock.java index 49dec7d3..9ac4dbe9 100644 --- a/mods/tinker/tconstruct/blocks/SearedBlock.java +++ b/mods/tinker/tconstruct/blocks/SearedBlock.java @@ -12,7 +12,6 @@ import mods.tinker.tconstruct.library.blocks.InventoryBlock; import mods.tinker.tconstruct.library.tools.AbilityHelper; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; diff --git a/mods/tinker/tconstruct/blocks/SoilBlock.java b/mods/tinker/tconstruct/blocks/SoilBlock.java index 6aa1ecf6..6c604336 100644 --- a/mods/tinker/tconstruct/blocks/SoilBlock.java +++ b/mods/tinker/tconstruct/blocks/SoilBlock.java @@ -5,7 +5,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.util.DamageSource; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class SoilBlock extends TConstructBlock diff --git a/mods/tinker/tconstruct/blocks/TConstructBlock.java b/mods/tinker/tconstruct/blocks/TConstructBlock.java index f72ec0f6..993f6656 100644 --- a/mods/tinker/tconstruct/blocks/TConstructBlock.java +++ b/mods/tinker/tconstruct/blocks/TConstructBlock.java @@ -2,9 +2,6 @@ package mods.tinker.tconstruct.blocks; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.library.TConstructRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -12,6 +9,8 @@ import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class TConstructBlock extends Block { diff --git a/mods/tinker/tconstruct/blocks/TMetalBlock.java b/mods/tinker/tconstruct/blocks/TMetalBlock.java index 66dd8a74..6d5aeb62 100644 --- a/mods/tinker/tconstruct/blocks/TMetalBlock.java +++ b/mods/tinker/tconstruct/blocks/TMetalBlock.java @@ -1,11 +1,7 @@ package mods.tinker.tconstruct.blocks; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class TMetalBlock extends TConstructBlock diff --git a/mods/tinker/tconstruct/blocks/ToolForgeBlock.java b/mods/tinker/tconstruct/blocks/ToolForgeBlock.java index 7201beee..85b0b7e2 100644 --- a/mods/tinker/tconstruct/blocks/ToolForgeBlock.java +++ b/mods/tinker/tconstruct/blocks/ToolForgeBlock.java @@ -5,7 +5,6 @@ import java.util.List; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic; import mods.tinker.tconstruct.client.block.TableForgeRender; -import mods.tinker.tconstruct.client.block.TableRender; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TProxyCommon; import mods.tinker.tconstruct.library.TConstructRegistry; diff --git a/mods/tinker/tconstruct/blocks/logic/AggregatorLogic.java b/mods/tinker/tconstruct/blocks/logic/AggregatorLogic.java index 259a4248..9c6b9a96 100644 --- a/mods/tinker/tconstruct/blocks/logic/AggregatorLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/AggregatorLogic.java @@ -1,8 +1,5 @@ package mods.tinker.tconstruct.blocks.logic; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.world.World; import mods.tinker.tconstruct.library.blocks.InventoryLogic; public abstract class AggregatorLogic extends InventoryLogic diff --git a/mods/tinker/tconstruct/blocks/logic/AqueductLogic.java b/mods/tinker/tconstruct/blocks/logic/AqueductLogic.java index 57e73805..c930a3d0 100644 --- a/mods/tinker/tconstruct/blocks/logic/AqueductLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/AqueductLogic.java @@ -2,14 +2,11 @@ package mods.tinker.tconstruct.blocks.logic; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidStack; -public class AqueductLogic extends TileEntity implements ITankContainer +public class AqueductLogic extends TileEntity //implements ITankContainer { - @Override + /*@Override public int fill (ForgeDirection from, LiquidStack resource, boolean doFill) { return 0; @@ -43,6 +40,6 @@ public class AqueductLogic extends TileEntity implements ITankContainer public ILiquidTank getTank (ForgeDirection direction, LiquidStack type) { return null; - } + }*/ } diff --git a/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java b/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java index db8a79c1..c5088f86 100644 --- a/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java @@ -14,10 +14,6 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidEvent; -import net.minecraftforge.liquids.LiquidStack; public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, ITankContainer, ISidedInventory { diff --git a/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java b/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java index c214bffd..71a0d6ba 100644 --- a/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java @@ -14,10 +14,6 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidEvent; -import net.minecraftforge.liquids.LiquidStack; public class CastingTableLogic extends InventoryLogic implements ILiquidTank, ITankContainer, ISidedInventory { diff --git a/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java b/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java index e21abcbf..71d28ee9 100644 --- a/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java @@ -1,15 +1,11 @@ package mods.tinker.tconstruct.blocks.logic; -import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.inventory.DrawbridgeContainer; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.blocks.InventoryLogic; -import mods.tinker.tconstruct.library.util.CoordTuple; import mods.tinker.tconstruct.library.util.IActiveLogic; import mods.tinker.tconstruct.library.util.IFacingLogic; import net.minecraft.block.Block; -import net.minecraft.block.BlockPistonMoving; -import net.minecraft.block.BlockSnow; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -18,7 +14,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; -import net.minecraft.util.Facing; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; diff --git a/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java b/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java index cf270adc..29bc20a4 100644 --- a/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java @@ -1,12 +1,7 @@ package mods.tinker.tconstruct.blocks.logic; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.blocks.InventoryLogic; import mods.tinker.tconstruct.library.crafting.DryingRackRecipes; -import mods.tinker.tconstruct.library.util.IActiveLogic; -import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; @@ -16,6 +11,8 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class DryingRackLogic extends InventoryLogic { diff --git a/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java b/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java index 98a439ca..4a4f50bb 100644 --- a/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java @@ -11,9 +11,6 @@ import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidStack; public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogic, ITankContainer { diff --git a/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java b/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java index 25b8e617..a6c03f64 100644 --- a/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java @@ -82,7 +82,7 @@ public class GolemCoreLogic extends InventoryLogic implements IInventory } @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) + public boolean isItemValidForSlot (int i, ItemStack itemstack) { return true; } diff --git a/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java b/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java index 669b96b3..895657f1 100644 --- a/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java @@ -53,7 +53,7 @@ public class GolemPedestalLogic extends TileEntity implements IInventory cost[Block.mushroomBrown.blockID] = 16; cost[Block.mushroomRed.blockID] = cost[Block.mushroomBrown.blockID]; cost[Block.netherStalk.blockID] = 6; - cost[Item.lightStoneDust.itemID] = 4; + cost[Item.glowstone.itemID] = 4; cost[Item.diamond.itemID] = 1; cost[Item.ingotIron.itemID] = 8; cost[Item.ingotGold.itemID] = 2; @@ -127,7 +127,7 @@ public class GolemPedestalLogic extends TileEntity implements IInventory souls[Block.mushroomBrown.blockID] = 1; souls[Block.mushroomRed.blockID] = souls[Block.mushroomBrown.blockID]; souls[Block.netherStalk.blockID] = 1; - souls[Item.lightStoneDust.itemID] = 1; + souls[Item.glowstone.itemID] = 1; souls[Item.diamond.itemID] = 3; souls[Item.ingotIron.itemID] = 1; souls[Item.ingotGold.itemID] = 1; @@ -352,7 +352,7 @@ public class GolemPedestalLogic extends TileEntity implements IInventory } @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) + public boolean isItemValidForSlot (int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; diff --git a/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java b/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java index 9260770c..761f61da 100644 --- a/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java @@ -6,11 +6,6 @@ import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidContainerRegistry; -import net.minecraftforge.liquids.LiquidStack; -import net.minecraftforge.liquids.LiquidTank; public class LavaTankLogic extends MultiServantLogic implements ITankContainer { diff --git a/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java b/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java index 88e875b7..e43990f7 100644 --- a/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java @@ -4,12 +4,10 @@ import mods.tinker.tconstruct.library.util.CoordTuple; import mods.tinker.tconstruct.library.util.IMasterLogic; import mods.tinker.tconstruct.library.util.IServantLogic; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.liquids.LiquidStack; public class MultiServantLogic extends TileEntity implements IServantLogic { diff --git a/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java b/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java index 37a53b76..b69a7d7d 100644 --- a/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.blocks.logic; -import mods.tinker.tconstruct.library.util.CoordTuple; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; diff --git a/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java b/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java index 76b98e94..dc185ce8 100644 --- a/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java @@ -8,9 +8,6 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.util.MathHelper; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidStack; public class SmelteryDrainLogic extends MultiServantLogic implements ITankContainer, IFacingLogic { diff --git a/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java b/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java index a723fc2f..92d6d5bc 100644 --- a/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java @@ -28,13 +28,9 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidStack; /* Simple class for storing items in the block */ diff --git a/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java b/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java index d1001ef8..d2e6eefa 100644 --- a/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.blocks.logic; import mods.tinker.tconstruct.inventory.ToolForgeContainer; -import mods.tinker.tconstruct.library.blocks.InventoryLogic; import mods.tinker.tconstruct.library.crafting.ToolBuilder; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; diff --git a/mods/tinker/tconstruct/client/ChiselRotator.java b/mods/tinker/tconstruct/client/ChiselRotator.java deleted file mode 100644 index db2eac44..00000000 --- a/mods/tinker/tconstruct/client/ChiselRotator.java +++ /dev/null @@ -1,106 +0,0 @@ -package mods.tinker.tconstruct.client; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -public class ChiselRotator implements IItemRenderer -{ - static Minecraft mc = Minecraft.getMinecraft(); - - @Override - public boolean handleRenderType (ItemStack item, ItemRenderType type) - { - return type == ItemRenderType.EQUIPPED; - } - - @Override - public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem (ItemRenderType type, ItemStack item, Object... data) - { - renderEquippedItem(item, (RenderBlocks) data[0], (EntityLiving) data[1]); - } - - void renderEquippedItem (ItemStack stack, RenderBlocks renderer, EntityLiving living) - { - float f4 = 0.0F; - float f5 = 0.3F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glTranslatef(-f4, -f5, 0.0F); - float f6 = 1.5F; - GL11.glScalef(f6, f6, f6); - GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.875F, -1.5F, 0.25F); - this.renderItem(stack, living, 0); - float f3 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(living.posX), MathHelper.floor_double(living.posY), MathHelper.floor_double(living.posZ)); - for (int x = 1; x < stack.getItem().getRenderPasses(stack.getItemDamage()); x++) - { - int i1 = Item.itemsList[stack.itemID].getColorFromItemStack(stack, x); - float f10 = (float) (i1 >> 16 & 255) / 255.0F; - float f11 = (float) (i1 >> 8 & 255) / 255.0F; - float f12 = (float) (i1 & 255) / 255.0F; - GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F); - this.renderItem(stack, living, x); - } - } - - void renderItem (ItemStack stack, EntityLiving living, int pass) - { - GL11.glPushMatrix(); - - Icon icon = living.getItemIcon(stack, pass); - - if (icon == null) - { - GL11.glPopMatrix(); - return; - } - - if (stack.getItemSpriteNumber() == 0) - { - this.mc.renderEngine.bindTexture("/terrain.png"); - } - else - { - this.mc.renderEngine.bindTexture("/gui/items.png"); - } - - Tessellator tessellator = Tessellator.instance; - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float f4 = 0.0F; - float f5 = 0.3F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glTranslatef(-f4, -f5, 0.0F); - float f6 = 1.5F; - GL11.glScalef(f6, f6, f6); - GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); - ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getSheetWidth(), icon.getSheetHeight(), 0.0625F); - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - - GL11.glPopMatrix(); - } -} diff --git a/mods/tinker/tconstruct/client/CustomFont.java b/mods/tinker/tconstruct/client/CustomFont.java index 84355732..c2ca1ab2 100644 --- a/mods/tinker/tconstruct/client/CustomFont.java +++ b/mods/tinker/tconstruct/client/CustomFont.java @@ -127,7 +127,8 @@ public class CustomFont // Render the finished bitmap into the Minecraft // graphics engine. - texID = mc.renderEngine.allocateAndSetupTexture(img); + // Sadly broken by 1.6 + //texID = mc.renderEngine.allocateAndSetupTexture(img); } /** diff --git a/mods/tinker/tconstruct/client/RenderItemCopy.java b/mods/tinker/tconstruct/client/RenderItemCopy.java index 6b5068de..cb3a795f 100644 --- a/mods/tinker/tconstruct/client/RenderItemCopy.java +++ b/mods/tinker/tconstruct/client/RenderItemCopy.java @@ -2,20 +2,22 @@ package mods.tinker.tconstruct.client; import java.util.Random; -import mods.tinker.tconstruct.client.block.SmallFontRenderer; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ForgeHooksClient; import org.lwjgl.opengl.GL11; @@ -27,6 +29,7 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderItemCopy extends Render { + private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png"); private RenderBlocks itemRenderBlocks = new RenderBlocks(); /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ @@ -34,8 +37,8 @@ public class RenderItemCopy extends Render public boolean renderWithColor = true; /** Defines the zLevel of rendering of item on GUI. */ - public float zLevel = 0.0F; - public static boolean renderInFrame = false; + public float zLevel; + public static boolean renderInFrame; public RenderItemCopy() { @@ -48,6 +51,7 @@ public class RenderItemCopy extends Render */ public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9) { + this.func_110777_b(par1EntityItem); this.random.setSeed(187L); ItemStack itemstack = par1EntityItem.getEntityItem(); @@ -60,10 +64,10 @@ public class RenderItemCopy extends Render GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - int i; float f4; float f5; float f6; + int i; Block block = null; if (itemstack.itemID < Block.blocksList.length) @@ -86,7 +90,6 @@ public class RenderItemCopy extends Render GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); } - this.loadTexture("/terrain.png"); float f7 = 0.25F; int j = block.getRenderType(); @@ -118,7 +121,7 @@ public class RenderItemCopy extends Render { float f8; - if (itemstack.getItem().requiresMultipleRenderPasses()) + if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses()) { if (renderInFrame) { @@ -130,8 +133,6 @@ public class RenderItemCopy extends Render GL11.glScalef(0.5F, 0.5F, 0.5F); } - this.loadTexture("/gui/items.png"); - for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k) { this.random.setSeed(187L); @@ -145,11 +146,11 @@ public class RenderItemCopy extends Render f4 = (float) (i >> 8 & 255) / 255.0F; f6 = (float) (i & 255) / 255.0F; GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F); - this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8); + this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k); } else { - this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F); + this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F, k); } } } @@ -167,15 +168,6 @@ public class RenderItemCopy extends Render Icon icon1 = itemstack.getIconIndex(); - if (itemstack.getItemSpriteNumber() == 0) - { - this.loadTexture("/terrain.png"); - } - else - { - this.loadTexture("/gui/items.png"); - } - if (this.renderWithColor) { int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); @@ -197,22 +189,34 @@ public class RenderItemCopy extends Render } } + protected ResourceLocation func_110796_a (EntityItem par1EntityItem) + { + return this.renderManager.renderEngine.func_130087_a(par1EntityItem.getEntityItem().getItemSpriteNumber()); + } + /** * Renders a dropped item */ private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) + { + renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0); + } + + private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) { Tessellator tessellator = Tessellator.instance; if (par2Icon == null) { - par2Icon = this.renderManager.renderEngine.getMissingIcon(par1EntityItem.getEntityItem().getItemSpriteNumber()); + TextureManager texturemanager = Minecraft.getMinecraft().func_110434_K(); + ResourceLocation resourcelocation = texturemanager.func_130087_a(par1EntityItem.getEntityItem().getItemSpriteNumber()); + par2Icon = ((TextureMap) texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno"); } - float f4 = par2Icon.getMinU(); - float f5 = par2Icon.getMaxU(); - float f6 = par2Icon.getMinV(); - float f7 = par2Icon.getMaxV(); + float f4 = ((Icon) par2Icon).getMinU(); + float f5 = ((Icon) par2Icon).getMaxU(); + float f6 = ((Icon) par2Icon).getMinV(); + float f7 = ((Icon) par2Icon).getMaxV(); float f8 = 1.0F; float f9 = 0.5F; float f10 = 0.25F; @@ -256,21 +260,21 @@ public class RenderItemCopy extends Render if (itemstack.getItemSpriteNumber() == 0) { - this.loadTexture("/terrain.png"); + this.func_110776_a(TextureMap.field_110575_b); } else { - this.loadTexture("/gui/items.png"); + this.func_110776_a(TextureMap.field_110576_c); } GL11.glColor4f(par5, par6, par7, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, par2Icon.getSheetWidth(), par2Icon.getSheetHeight(), f12); + ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getOriginX(), ((Icon) par2Icon).getOriginY(), f12); - if (itemstack != null && itemstack.hasEffect()) + if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); - this.renderManager.renderEngine.bindTexture("%blur%/misc/glint.png"); + this.renderManager.renderEngine.func_110577_a(field_110798_h); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f13 = 0.76F; @@ -335,19 +339,25 @@ public class RenderItemCopy extends Render /** * Renders the item's icon or block into the UI at the specified position. */ - public void renderItemIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + { + renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false); + } + + public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) { int k = par3ItemStack.itemID; int l = par3ItemStack.getItemDamage(); - Icon icon = par3ItemStack.getIconIndex(); + Object object = par3ItemStack.getIconIndex(); float f; + int i1; float f1; float f2; Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null); if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType())) { - par2RenderEngine.bindTexture("/terrain.png"); + par2TextureManager.func_110577_a(TextureMap.field_110575_b); GL11.glPushMatrix(); GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel); GL11.glScalef(10.0F, 10.0F, 10.0F); @@ -355,14 +365,14 @@ public class RenderItemCopy extends Render GL11.glScalef(1.0F, 1.0F, -1.0F); GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - int i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f2 = (float) (i1 >> 16 & 255) / 255.0F; - f = (float) (i1 >> 8 & 255) / 255.0F; - f1 = (float) (i1 & 255) / 255.0F; + i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); + f = (float) (i1 >> 16 & 255) / 255.0F; + f1 = (float) (i1 >> 8 & 255) / 255.0F; + f2 = (float) (i1 & 255) / 255.0F; if (this.renderWithColor) { - GL11.glColor4f(f2, f, f1, 1.0F); + GL11.glColor4f(f, f1, f2, 1.0F); } GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); @@ -371,87 +381,104 @@ public class RenderItemCopy extends Render this.itemRenderBlocks.useInventoryTint = true; GL11.glPopMatrix(); } - else + else if (Item.itemsList[k].requiresMultipleRenderPasses()) { - int j1; + GL11.glDisable(GL11.GL_LIGHTING); - if (Item.itemsList[k].requiresMultipleRenderPasses()) + for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) { - GL11.glDisable(GL11.GL_LIGHTING); - par2RenderEngine.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? "/terrain.png" : "/gui/items.png"); - - for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) - { - Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1); - int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); - f = (float) (k1 >> 16 & 255) / 255.0F; - f1 = (float) (k1 >> 8 & 255) / 255.0F; - float f3 = (float) (k1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f, f1, f3, 1.0F); - } - - this.renderIcon(par4, par5, icon1, 16, 16); - } - - GL11.glEnable(GL11.GL_LIGHTING); - } - else - { - GL11.glDisable(GL11.GL_LIGHTING); - - if (par3ItemStack.getItemSpriteNumber() == 0) - { - par2RenderEngine.bindTexture("/terrain.png"); - } - else - { - par2RenderEngine.bindTexture("/gui/items.png"); - } - - if (icon == null) - { - icon = par2RenderEngine.getMissingIcon(par3ItemStack.getItemSpriteNumber()); - } - - j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - float f4 = (float) (j1 >> 16 & 255) / 255.0F; - f2 = (float) (j1 >> 8 & 255) / 255.0F; - f = (float) (j1 & 255) / 255.0F; + par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c); + Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1); + int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); + f1 = (float) (k1 >> 16 & 255) / 255.0F; + f2 = (float) (k1 >> 8 & 255) / 255.0F; + float f3 = (float) (k1 & 255) / 255.0F; if (this.renderWithColor) { - GL11.glColor4f(f4, f2, f, 1.0F); + GL11.glColor4f(f1, f2, f3, 1.0F); } this.renderIcon(par4, par5, icon, 16, 16); - GL11.glEnable(GL11.GL_LIGHTING); + + if (par3ItemStack.hasEffect(j1)) + { + renderEffect(par2TextureManager, par4, par5); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + } + else + { + GL11.glDisable(GL11.GL_LIGHTING); + ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.getItemSpriteNumber()); + par2TextureManager.func_110577_a(resourcelocation); + + if (object == null) + { + object = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno"); + } + + i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); + f = (float) (i1 >> 16 & 255) / 255.0F; + f1 = (float) (i1 >> 8 & 255) / 255.0F; + f2 = (float) (i1 & 255) / 255.0F; + + if (this.renderWithColor) + { + GL11.glColor4f(f, f1, f2, 1.0F); + } + + this.renderIcon(par4, par5, (Icon) object, 16, 16); + GL11.glEnable(GL11.GL_LIGHTING); + + if (par3ItemStack.hasEffect(0)) + { + renderEffect(par2TextureManager, par4, par5); } } GL11.glEnable(GL11.GL_CULL_FACE); } + private void renderEffect (TextureManager manager, int x, int y) + { + GL11.glDepthFunc(GL11.GL_GREATER); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + manager.func_110577_a(field_110798_h); + this.zLevel -= 50.0F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); + GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); + this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + this.zLevel += 50.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + /** * Render the item's icon or block into the GUI, including the glint effect. */ - public void renderItemAndEffectIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { if (par3ItemStack != null) { - if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) + if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) { - this.renderItemIntoGUI(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5); + this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); } + /* Modders must handle this themselves if they use custom renderers! if (par3ItemStack.hasEffect()) { GL11.glDepthFunc(GL11.GL_GREATER); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); - par2RenderEngine.bindTexture("%blur%/misc/glint.png"); + par2TextureManager.func_110577_a(field_110798_h); this.zLevel -= 50.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); @@ -463,6 +490,7 @@ public class RenderItemCopy extends Render GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); } + */ } } @@ -506,12 +534,12 @@ public class RenderItemCopy extends Render * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the * specified position. */ - public void renderItemOverlayIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { - this.renderItemOverlayIntoGUI(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null); + this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null); } - public void renderItemOverlayIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str) + public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str) { if (par3ItemStack != null) { @@ -520,7 +548,7 @@ public class RenderItemCopy extends Render String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str; GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); - par1SmallFontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1SmallFontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215); + par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_DEPTH_TEST); } @@ -572,6 +600,11 @@ public class RenderItemCopy extends Render tessellator.draw(); } + protected ResourceLocation func_110775_a (Entity par1Entity) + { + return this.func_110796_a((EntityItem) par1Entity); + } + /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic diff --git a/mods/tinker/tconstruct/client/TClientEvents.java b/mods/tinker/tconstruct/client/TClientEvents.java index c1885c47..064d2556 100644 --- a/mods/tinker/tconstruct/client/TClientEvents.java +++ b/mods/tinker/tconstruct/client/TClientEvents.java @@ -15,7 +15,6 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.liquids.LiquidStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/mods/tinker/tconstruct/client/TClientTickHandler.java b/mods/tinker/tconstruct/client/TClientTickHandler.java index 9629bfac..a6cb3419 100644 --- a/mods/tinker/tconstruct/client/TClientTickHandler.java +++ b/mods/tinker/tconstruct/client/TClientTickHandler.java @@ -5,7 +5,6 @@ import java.util.EnumSet; import mods.tinker.tconstruct.common.TContent; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; import cpw.mods.fml.common.ITickHandler; diff --git a/mods/tinker/tconstruct/client/TControls.java b/mods/tinker/tconstruct/client/TControls.java index 77b668db..2e66454c 100644 --- a/mods/tinker/tconstruct/client/TControls.java +++ b/mods/tinker/tconstruct/client/TControls.java @@ -5,8 +5,6 @@ import java.io.DataOutputStream; import java.util.EnumSet; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.skill.Skill; -import mods.tinker.tconstruct.util.player.TPlayerStats; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiInventory; diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index 864eff1f..36a2cf30 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.client; -import java.io.File; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; @@ -10,21 +9,93 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.blocks.logic.*; -import mods.tinker.tconstruct.client.block.*; -import mods.tinker.tconstruct.client.entity.*; -import mods.tinker.tconstruct.client.entity.projectile.*; -import mods.tinker.tconstruct.client.gui.*; -import mods.tinker.tconstruct.client.pages.*; -import mods.tinker.tconstruct.common.*; -import mods.tinker.tconstruct.entity.*; -import mods.tinker.tconstruct.entity.projectile.*; -import mods.tinker.tconstruct.inventory.MiniGardyContainer; -import mods.tinker.tconstruct.library.*; -import mods.tinker.tconstruct.library.client.*; -import mods.tinker.tconstruct.library.crafting.*; -import mods.tinker.tconstruct.library.tools.*; -import mods.tinker.tconstruct.util.player.*; +import mods.tinker.tconstruct.blocks.logic.CastingBasinLogic; +import mods.tinker.tconstruct.blocks.logic.CastingTableLogic; +import mods.tinker.tconstruct.blocks.logic.DrawbridgeLogic; +import mods.tinker.tconstruct.blocks.logic.DryingRackLogic; +import mods.tinker.tconstruct.blocks.logic.FrypanLogic; +import mods.tinker.tconstruct.blocks.logic.GlowstoneAggregator; +import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic; +import mods.tinker.tconstruct.blocks.logic.PatternChestLogic; +import mods.tinker.tconstruct.blocks.logic.SmelteryLogic; +import mods.tinker.tconstruct.blocks.logic.StencilTableLogic; +import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic; +import mods.tinker.tconstruct.blocks.logic.ToolStationLogic; +import mods.tinker.tconstruct.client.block.BarricadeRender; +import mods.tinker.tconstruct.client.block.CastingBasinSpecialRender; +import mods.tinker.tconstruct.client.block.CastingTableSpecialRenderer; +import mods.tinker.tconstruct.client.block.CrystalBlockRender; +import mods.tinker.tconstruct.client.block.DryingRackRender; +import mods.tinker.tconstruct.client.block.DryingRackSpecialRender; +import mods.tinker.tconstruct.client.block.FluidRender; +import mods.tinker.tconstruct.client.block.FrypanRender; +import mods.tinker.tconstruct.client.block.MachineRender; +import mods.tinker.tconstruct.client.block.OreberryRender; +import mods.tinker.tconstruct.client.block.PaneRender; +import mods.tinker.tconstruct.client.block.SearedRender; +import mods.tinker.tconstruct.client.block.SmallFontRenderer; +import mods.tinker.tconstruct.client.block.SmelteryRender; +import mods.tinker.tconstruct.client.block.TableForgeRender; +import mods.tinker.tconstruct.client.block.TableRender; +import mods.tinker.tconstruct.client.block.TankRender; +import mods.tinker.tconstruct.client.entity.CartRender; +import mods.tinker.tconstruct.client.entity.CloneHeadModel; +import mods.tinker.tconstruct.client.entity.CrystalGuardianRender; +import mods.tinker.tconstruct.client.entity.CrystalRender; +import mods.tinker.tconstruct.client.entity.FancyItemRender; +import mods.tinker.tconstruct.client.entity.MiniGardyRender; +import mods.tinker.tconstruct.client.entity.SlimeCloneRender; +import mods.tinker.tconstruct.client.entity.SlimeRender; +import mods.tinker.tconstruct.client.entity.projectile.ArrowRender; +import mods.tinker.tconstruct.client.entity.projectile.DaggerRender; +import mods.tinker.tconstruct.client.entity.projectile.LaunchedItemRender; +import mods.tinker.tconstruct.client.gui.ArmorExtendedGui; +import mods.tinker.tconstruct.client.gui.DrawbridgeGui; +import mods.tinker.tconstruct.client.gui.FrypanGui; +import mods.tinker.tconstruct.client.gui.GlowstoneAggregatorGui; +import mods.tinker.tconstruct.client.gui.GuiManual; +import mods.tinker.tconstruct.client.gui.InventoryTab; +import mods.tinker.tconstruct.client.gui.KnapsackGui; +import mods.tinker.tconstruct.client.gui.MiniGardyGui; +import mods.tinker.tconstruct.client.gui.PartCrafterGui; +import mods.tinker.tconstruct.client.gui.PatternChestGui; +import mods.tinker.tconstruct.client.gui.SmelteryGui; +import mods.tinker.tconstruct.client.gui.StencilTableGui; +import mods.tinker.tconstruct.client.gui.ToolForgeGui; +import mods.tinker.tconstruct.client.gui.ToolStationGui; +import mods.tinker.tconstruct.client.pages.BlankPage; +import mods.tinker.tconstruct.client.pages.BlockCastPage; +import mods.tinker.tconstruct.client.pages.BookPage; +import mods.tinker.tconstruct.client.pages.ContentsTablePage; +import mods.tinker.tconstruct.client.pages.CraftingPage; +import mods.tinker.tconstruct.client.pages.FurnacePage; +import mods.tinker.tconstruct.client.pages.MaterialPage; +import mods.tinker.tconstruct.client.pages.ModifierPage; +import mods.tinker.tconstruct.client.pages.PicturePage; +import mods.tinker.tconstruct.client.pages.SectionPage; +import mods.tinker.tconstruct.client.pages.SidebarPage; +import mods.tinker.tconstruct.client.pages.TextPage; +import mods.tinker.tconstruct.client.pages.TitlePage; +import mods.tinker.tconstruct.client.pages.ToolPage; +import mods.tinker.tconstruct.common.TContent; +import mods.tinker.tconstruct.common.TProxyCommon; +import mods.tinker.tconstruct.entity.Automaton; +import mods.tinker.tconstruct.entity.BlueSlime; +import mods.tinker.tconstruct.entity.CartEntity; +import mods.tinker.tconstruct.entity.Crystal; +import mods.tinker.tconstruct.entity.FancyEntityItem; +import mods.tinker.tconstruct.entity.MiniGardy; +import mods.tinker.tconstruct.entity.SlimeClone; +import mods.tinker.tconstruct.entity.projectile.ArrowEntity; +import mods.tinker.tconstruct.entity.projectile.DaggerEntity; +import mods.tinker.tconstruct.entity.projectile.LaunchedPotion; +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.client.TConstructClientRegistry; +import mods.tinker.tconstruct.library.client.ToolGuiElement; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.util.player.ArmorExtended; +import mods.tinker.tconstruct.util.player.KnapsackInventory; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; @@ -66,7 +137,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; -import net.minecraft.world.ColorizerGrass; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; @@ -274,7 +345,7 @@ public class TProxyClient extends TProxyCommon { Minecraft mc = Minecraft.getMinecraft(); MinecraftForge.EVENT_BUS.register(new TClientEvents()); - smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false); + smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("/font/default.png"), mc.renderEngine, false); RenderingRegistry.registerBlockHandler(new TableRender()); RenderingRegistry.registerBlockHandler(new TableForgeRender()); RenderingRegistry.registerBlockHandler(new FrypanRender()); @@ -933,7 +1004,7 @@ public class TProxyClient extends TProxyCommon } else if (par1Str.equals("snowballpoof")) { - entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.snowball, mc.renderEngine); + entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.snowball); } else if (par1Str.equals("dripWater")) { @@ -949,7 +1020,7 @@ public class TProxyClient extends TProxyCommon } else if (par1Str.equals("blueslime")) { - entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TContent.strangeFood, mc.renderEngine); + entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TContent.strangeFood); } else if (par1Str.equals("heart")) { @@ -967,18 +1038,6 @@ public class TProxyClient extends TProxyCommon ((EntityFX) entityfx).setParticleTextureIndex(82); ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); } - else if (par1Str.startsWith("iconcrack_")) - { - int j = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1)); - entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[j], mc.renderEngine); - } - else if (par1Str.startsWith("tilecrack_")) - { - String[] astring = par1Str.split("_", 3); - int k = Integer.parseInt(astring[1]); - int l = Integer.parseInt(astring[2]); - entityfx = (new EntityDiggingFX(mc.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[k], 0, l, mc.renderEngine)).applyRenderColor(l); - } if (entityfx != null) { diff --git a/mods/tinker/tconstruct/client/armor/WingModel.java b/mods/tinker/tconstruct/client/armor/WingModel.java index 6043ba85..8e0a3742 100644 --- a/mods/tinker/tconstruct/client/armor/WingModel.java +++ b/mods/tinker/tconstruct/client/armor/WingModel.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.client.armor; -import mods.tinker.tconstruct.client.tmt.ModelRendererTurbo; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; diff --git a/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java b/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java index 80e2957f..ab1354ba 100644 --- a/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java +++ b/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.client.block; import net.minecraft.block.Block; -import net.minecraft.block.BlockGrass; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.RenderBlocks; diff --git a/mods/tinker/tconstruct/client/block/BreakingFX.java b/mods/tinker/tconstruct/client/block/BreakingFX.java index 7bacb583..50ab5116 100644 --- a/mods/tinker/tconstruct/client/block/BreakingFX.java +++ b/mods/tinker/tconstruct/client/block/BreakingFX.java @@ -2,10 +2,8 @@ package mods.tinker.tconstruct.client.block; import net.minecraft.block.Block; import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.Item; -import net.minecraft.util.Icon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -13,18 +11,23 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class BreakingFX extends EntityFX { - public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, RenderEngine par9RenderEngine) + public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item) + { + this(par1World, par2, par4, par6, par8Item, 0); + } + + public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, int par9) { super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); - this.setParticleIcon(par9RenderEngine, par8Item.getIconFromDamage(0)); + this.func_110125_a(par8Item.getIconFromDamage(par9)); this.particleRed = this.particleGreen = this.particleBlue = 1.0F; this.particleGravity = Block.blockSnow.blockParticleGravity; this.particleScale /= 2.0F; } - public BreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, RenderEngine par15RenderEngine) + public BreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, int par15) { - this(par1World, par2, par4, par6, par14Item, par15RenderEngine); + this(par1World, par2, par4, par6, par14Item, par15); this.motionX *= 0.10000000149011612D; this.motionY *= 0.10000000149011612D; this.motionZ *= 0.10000000149011612D; @@ -33,35 +36,35 @@ public class BreakingFX extends EntityFX this.motionZ += par12; } - public int getFXLayer () + public int getFXLayer() { return 2; } - public void renderParticle (Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { - float f6 = ((float) this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f6 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; float f7 = f6 + 0.015609375F; - float f8 = ((float) this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f8 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; float f9 = f8 + 0.015609375F; float f10 = 0.1F * this.particleScale; if (this.particleIcon != null) { - f6 = this.particleIcon.getInterpolatedU((double) (this.particleTextureJitterX / 4.0F * 16.0F)); - f7 = this.particleIcon.getInterpolatedU((double) ((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); - f8 = this.particleIcon.getInterpolatedV((double) (this.particleTextureJitterY / 4.0F * 16.0F)); - f9 = this.particleIcon.getInterpolatedV((double) ((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + f6 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + f7 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f8 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + f9 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); } - float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); - float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); - float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); float f14 = 1.0F; par1Tessellator.setColorOpaque_F(f14 * this.particleRed, f14 * this.particleGreen, f14 * this.particleBlue); - par1Tessellator.addVertexWithUV((double) (f11 - par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 - par5 * f10 - par7 * f10), (double) f6, (double) f9); - par1Tessellator.addVertexWithUV((double) (f11 - par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 - par5 * f10 + par7 * f10), (double) f6, (double) f8); - par1Tessellator.addVertexWithUV((double) (f11 + par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 + par5 * f10 + par7 * f10), (double) f7, (double) f8); - par1Tessellator.addVertexWithUV((double) (f11 + par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 + par5 * f10 - par7 * f10), (double) f7, (double) f9); + par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f6, (double)f9); + par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f6, (double)f8); + par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f7, (double)f8); + par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f7, (double)f9); } } diff --git a/mods/tinker/tconstruct/client/block/GolemCoreRender.java b/mods/tinker/tconstruct/client/block/GolemCoreRender.java index 5e212e61..102bf92f 100644 --- a/mods/tinker/tconstruct/client/block/GolemCoreRender.java +++ b/mods/tinker/tconstruct/client/block/GolemCoreRender.java @@ -1,14 +1,9 @@ package mods.tinker.tconstruct.client.block; -import org.lwjgl.opengl.GL11; - import mods.tinker.tconstruct.client.TProxyClient; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.src.ModLoader; import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; diff --git a/mods/tinker/tconstruct/client/block/OreberryRender.java b/mods/tinker/tconstruct/client/block/OreberryRender.java index 4557f934..d697900c 100644 --- a/mods/tinker/tconstruct/client/block/OreberryRender.java +++ b/mods/tinker/tconstruct/client/block/OreberryRender.java @@ -3,11 +3,7 @@ package mods.tinker.tconstruct.client.block; import mods.tinker.tconstruct.client.TProxyClient; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; diff --git a/mods/tinker/tconstruct/client/block/SmallFontRenderer.java b/mods/tinker/tconstruct/client/block/SmallFontRenderer.java index 819ad8ac..425a27d1 100644 --- a/mods/tinker/tconstruct/client/block/SmallFontRenderer.java +++ b/mods/tinker/tconstruct/client/block/SmallFontRenderer.java @@ -12,15 +12,20 @@ import java.util.List; import java.util.Random; import javax.imageio.ImageIO; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.ResourceManager; +import net.minecraft.client.resources.ResourceManagerReloadListener; import net.minecraft.client.settings.GameSettings; import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class SmallFontRenderer +public class SmallFontRenderer implements ResourceManagerReloadListener { + private static final ResourceLocation[] field_111274_c = new ResourceLocation[256]; + /** Array of width of all the characters in default.png */ private int[] charWidth = new int[256]; @@ -38,10 +43,10 @@ public class SmallFontRenderer * drop shadows. */ private int[] colorCode = new int[32]; - private final String fontTextureName; + private final ResourceLocation field_111273_g; /** The RenderEngine used to load and setup glyph textures. */ - private final RenderEngine renderEngine; + private final TextureManager renderEngine; /** Current X coordinate at which to draw the next character. */ private float posX; @@ -75,38 +80,30 @@ public class SmallFontRenderer private int textColor; /** Set if the "k" style (random) is active in currently rendering string */ - private boolean randomStyle = false; + private boolean randomStyle; /** Set if the "l" style (bold) is active in currently rendering string */ - private boolean boldStyle = false; + private boolean boldStyle; /** Set if the "o" style (italic) is active in currently rendering string */ - private boolean italicStyle = false; + private boolean italicStyle; /** * Set if the "n" style (underlined) is active in currently rendering string */ - private boolean underlineStyle = false; + private boolean underlineStyle; /** * Set if the "m" style (strikethrough) is active in currently rendering string */ - private boolean strikethroughStyle = false; + private boolean strikethroughStyle; - SmallFontRenderer() + public SmallFontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) { - this.renderEngine = null; - this.fontTextureName = null; + this.field_111273_g = par2ResourceLocation; + this.renderEngine = par3TextureManager; this.unicodeFlag = true; - } - - public SmallFontRenderer(GameSettings par1GameSettings, String par2Str, RenderEngine par3RenderEngine, boolean par4) - { - this.fontTextureName = par2Str; - this.renderEngine = par3RenderEngine; - this.unicodeFlag = true; - this.readFontData(); - par3RenderEngine.bindTexture(par2Str); + par3TextureManager.func_110577_a(this.field_111273_g); for (int i = 0; i < 32; ++i) { @@ -139,21 +136,22 @@ public class SmallFontRenderer this.colorCode[i] = (k & 255) << 16 | (l & 255) << 8 | i1 & 255; } - } - public void readFontData () - { this.readGlyphSizes(); - this.readFontTexture(this.fontTextureName); } - private void readFontTexture (String par1Str) + public void func_110549_a(ResourceManager par1ResourceManager) + { + this.func_111272_d(); + } + + private void func_111272_d() { BufferedImage bufferedimage; try { - bufferedimage = ImageIO.read(RenderEngine.class.getResourceAsStream(par1Str)); + bufferedimage = ImageIO.read(Minecraft.getMinecraft().func_110442_L().func_110536_a(this.field_111273_g).func_110527_b()); } catch (IOException ioexception) { @@ -164,27 +162,36 @@ public class SmallFontRenderer int j = bufferedimage.getHeight(); int[] aint = new int[i * j]; bufferedimage.getRGB(0, 0, i, j, aint, 0, i); - int k = 0; + int k = j / 16; + int l = i / 16; + byte b0 = 1; + float f = 8.0F / (float)l; + int i1 = 0; - while (k < 256) + while (i1 < 256) { - int l = k % 16; - int i1 = k / 16; - int j1 = 7; + int j1 = i1 % 16; + int k1 = i1 / 16; + + if (i1 == 32) + { + this.charWidth[i1] = 3 + b0; + } + + int l1 = l - 1; while (true) { - if (j1 >= 0) + if (l1 >= 0) { - int k1 = l * 8 + j1; + int i2 = j1 * l + l1; boolean flag = true; - for (int l1 = 0; l1 < 8 && flag; ++l1) + for (int j2 = 0; j2 < k && flag; ++j2) { - int i2 = (i1 * 8 + l1) * i; - int j2 = aint[k1 + i2] & 255; + int k2 = (k1 * l + j2) * i; - if (j2 > 0) + if ((aint[i2 + k2] >> 24 & 255) != 0) { flag = false; } @@ -192,28 +199,24 @@ public class SmallFontRenderer if (flag) { - --j1; + --l1; continue; } } - if (k == 32) - { - j1 = 2; - } - - this.charWidth[k] = j1 + 2; - ++k; + ++l1; + this.charWidth[i1] = (int)(0.5D + (double)((float)l1 * f)) + b0; + ++i1; break; } } } - private void readGlyphSizes () + private void readGlyphSizes() { try { - InputStream inputstream = Minecraft.getMinecraft().texturePackList.getSelectedTexturePack().getResourceAsStream("/font/glyph_sizes.bin"); + InputStream inputstream = Minecraft.getMinecraft().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")).func_110527_b(); inputstream.read(this.glyphWidth); } catch (IOException ioexception) @@ -225,7 +228,7 @@ public class SmallFontRenderer /** * Pick how to render a single character and return the width used. */ - private float renderCharAtPos (int par1, char par2, boolean par3) + private float renderCharAtPos(int par1, char par2, boolean par3) { return par2 == 32 ? 4.0F : (par1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(par1 + 32, par3) : this.renderUnicodeChar(par2, par3)); } @@ -233,39 +236,48 @@ public class SmallFontRenderer /** * Render a single character with the default.png font at current (posX,posY) location... */ - private float renderDefaultChar (int par1, boolean par2) + private float renderDefaultChar(int par1, boolean par2) { - float f = (float) (par1 % 16 * 8); - float f1 = (float) (par1 / 16 * 8); + float f = (float)(par1 % 16 * 8); + float f1 = (float)(par1 / 16 * 8); float f2 = par2 ? 1.0F : 0.0F; - this.renderEngine.bindTexture(this.fontTextureName); - float f3 = (float) this.charWidth[par1] - 0.01F; + this.renderEngine.func_110577_a(this.field_111273_g); + float f3 = (float)this.charWidth[par1] - 0.01F; GL11.glBegin(GL11.GL_TRIANGLE_STRIP); GL11.glTexCoord2f(f / 128.0F, f1 / 128.0F); GL11.glVertex3f(this.posX + f2, this.posY, 0.0F); GL11.glTexCoord2f(f / 128.0F, (f1 + 7.99F) / 128.0F); GL11.glVertex3f(this.posX - f2, this.posY + 7.99F, 0.0F); - GL11.glTexCoord2f((f + f3) / 128.0F, f1 / 128.0F); - GL11.glVertex3f(this.posX + f3 + f2, this.posY, 0.0F); - GL11.glTexCoord2f((f + f3) / 128.0F, (f1 + 7.99F) / 128.0F); - GL11.glVertex3f(this.posX + f3 - f2, this.posY + 7.99F, 0.0F); + GL11.glTexCoord2f((f + f3 - 1.0F) / 128.0F, f1 / 128.0F); + GL11.glVertex3f(this.posX + f3 - 1.0F + f2, this.posY, 0.0F); + GL11.glTexCoord2f((f + f3 - 1.0F) / 128.0F, (f1 + 7.99F) / 128.0F); + GL11.glVertex3f(this.posX + f3 - 1.0F - f2, this.posY + 7.99F, 0.0F); GL11.glEnd(); - return (float) this.charWidth[par1]; + return (float)this.charWidth[par1]; + } + + private ResourceLocation func_111271_a(int par1) + { + if (field_111274_c[par1] == null) + { + field_111274_c[par1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] {Integer.valueOf(par1)})); + } + + return field_111274_c[par1]; } /** * Load one of the /font/glyph_XX.png into a new GL texture and store the texture ID in glyphTextureName array. */ - private void loadGlyphTexture (int par1) + private void loadGlyphTexture(int par1) { - String s = String.format("/font/glyph_%02X.png", new Object[] { Integer.valueOf(par1) }); - this.renderEngine.bindTexture(s); + this.renderEngine.func_110577_a(this.func_111271_a(par1)); } /** * Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files... */ - private float renderUnicodeChar (char par1, boolean par2) + private float renderUnicodeChar(char par1, boolean par2) { if (this.glyphWidth[par1] == 0) { @@ -277,10 +289,10 @@ public class SmallFontRenderer this.loadGlyphTexture(i); int j = this.glyphWidth[par1] >>> 4; int k = this.glyphWidth[par1] & 15; - float f = (float) j; - float f1 = (float) (k + 1); - float f2 = (float) (par1 % 16 * 16) + f; - float f3 = (float) ((par1 & 255) / 16 * 16); + float f = (float)j; + float f1 = (float)(k + 1); + float f2 = (float)(par1 % 16 * 16) + f; + float f3 = (float)((par1 & 255) / 16 * 16); float f4 = f1 - f - 0.02F; float f5 = par2 ? 1.0F : 0.0F; GL11.glBegin(GL11.GL_TRIANGLE_STRIP); @@ -300,7 +312,7 @@ public class SmallFontRenderer /** * Draws the specified string with a shadow. */ - public int drawStringWithShadow (String par1Str, int par2, int par3, int par4) + public int drawStringWithShadow(String par1Str, int par2, int par3, int par4) { return this.drawString(par1Str, par2, par3, par4, true); } @@ -308,7 +320,7 @@ public class SmallFontRenderer /** * Draws the specified string. */ - public int drawString (String par1Str, int par2, int par3, int par4) + public int drawString(String par1Str, int par2, int par3, int par4) { return this.drawString(par1Str, par2, par3, par4, false); } @@ -316,7 +328,7 @@ public class SmallFontRenderer /** * Draws the specified string. Args: string, x, y, color, dropShadow */ - public int drawString (String par1Str, int par2, int par3, int par4, boolean par5) + public int drawString(String par1Str, int par2, int par3, int par4, boolean par5) { this.resetStyles(); @@ -343,7 +355,7 @@ public class SmallFontRenderer /** * Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. */ - private String bidiReorder (String par1Str) + private String bidiReorder(String par1Str) { if (par1Str != null && Bidi.requiresBidi(par1Str.toCharArray(), 0, par1Str.length())) { @@ -358,11 +370,11 @@ public class SmallFontRenderer i = bidi.getRunLimit(j); int l = bidi.getRunLevel(j); String s1 = par1Str.substring(k, i); - abyte[j] = (byte) l; + abyte[j] = (byte)l; astring[j] = s1; } - String[] astring1 = (String[]) astring.clone(); + String[] astring1 = (String[])astring.clone(); Bidi.reorderVisually(abyte, 0, astring, 0, abyte.length); StringBuilder stringbuilder = new StringBuilder(); i = 0; @@ -424,7 +436,7 @@ public class SmallFontRenderer /** * Reset all style flag fields in the class to false; called at the start of string rendering */ - private void resetStyles () + private void resetStyles() { this.randomStyle = false; this.boldStyle = false; @@ -436,7 +448,7 @@ public class SmallFontRenderer /** * Render a single line string at the current (posX,posY) and update posX */ - private void renderStringAtPos (String par1Str, boolean par2) + private void renderStringAtPos(String par1Str, boolean par2) { for (int i = 0; i < par1Str.length(); ++i) { @@ -468,7 +480,7 @@ public class SmallFontRenderer k = this.colorCode[j]; this.textColor = k; - GL11.glColor4f((float) (k >> 16) / 255.0F, (float) (k >> 8 & 255) / 255.0F, (float) (k & 255) / 255.0F, this.alpha); + GL11.glColor4f((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.alpha); } else if (j == 16) { @@ -511,7 +523,8 @@ public class SmallFontRenderer do { k = this.fontRandom.nextInt(ChatAllowedCharacters.allowedCharacters.length()); - } while (this.charWidth[j + 32] != this.charWidth[k + 32]); + } + while (this.charWidth[j + 32] != this.charWidth[k + 32]); j = k; } @@ -562,10 +575,10 @@ public class SmallFontRenderer tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); - tessellator.addVertex((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D); - tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D); - tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D); - tessellator.addVertex((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D); + tessellator.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); + tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); + tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); + tessellator.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); } @@ -576,15 +589,15 @@ public class SmallFontRenderer GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); int l = this.underlineStyle ? -1 : 0; - tessellator.addVertex((double) (this.posX + (float) l), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D); - tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D); - tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D); - tessellator.addVertex((double) (this.posX + (float) l), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D); + tessellator.addVertex((double)(this.posX + (float)l), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); + tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); + tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); + tessellator.addVertex((double)(this.posX + (float)l), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); } - this.posX += (float) ((int) f1); + this.posX += (float)((int)f1); } } } @@ -592,7 +605,7 @@ public class SmallFontRenderer /** * Render string either left or right aligned depending on bidiFlag */ - private int renderStringAligned (String par1Str, int par2, int par3, int par4, int par5, boolean par6) + private int renderStringAligned(String par1Str, int par2, int par3, int par4, int par5, boolean par6) { if (this.bidiFlag) { @@ -607,7 +620,7 @@ public class SmallFontRenderer /** * Render single line string by setting GL color, current (posX,posY), and calling renderStringAtPos() */ - private int renderString (String par1Str, int par2, int par3, int par4, boolean par5) + private int renderString(String par1Str, int par2, int par3, int par4, boolean par5) { if (par1Str == null) { @@ -625,22 +638,22 @@ public class SmallFontRenderer par4 = (par4 & 16579836) >> 2 | par4 & -16777216; } - this.red = (float) (par4 >> 16 & 255) / 255.0F; - this.blue = (float) (par4 >> 8 & 255) / 255.0F; - this.green = (float) (par4 & 255) / 255.0F; - this.alpha = (float) (par4 >> 24 & 255) / 255.0F; + this.red = (float)(par4 >> 16 & 255) / 255.0F; + this.blue = (float)(par4 >> 8 & 255) / 255.0F; + this.green = (float)(par4 & 255) / 255.0F; + this.alpha = (float)(par4 >> 24 & 255) / 255.0F; GL11.glColor4f(this.red, this.blue, this.green, this.alpha); - this.posX = (float) par2; - this.posY = (float) par3; + this.posX = (float)par2; + this.posY = (float)par3; this.renderStringAtPos(par1Str, par5); - return (int) this.posX; + return (int)this.posX; } } /** * Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). */ - public int getStringWidth (String par1Str) + public int getStringWidth(String par1Str) { if (par1Str == null) { @@ -691,7 +704,7 @@ public class SmallFontRenderer /** * Returns the width of this character as rendered. */ - public int getCharWidth (char par1) + public int getCharWidth(char par1) { if (par1 == 167) { @@ -733,7 +746,7 @@ public class SmallFontRenderer /** * Trims a string to fit a specified Width. */ - public String trimStringToWidth (String par1Str, int par2) + public String trimStringToWidth(String par1Str, int par2) { return this.trimStringToWidth(par1Str, par2, false); } @@ -741,7 +754,7 @@ public class SmallFontRenderer /** * Trims a string to a specified width, and will reverse it if par3 is set. */ - public String trimStringToWidth (String par1Str, int par2, boolean par3) + public String trimStringToWidth(String par1Str, int par2, boolean par3) { StringBuilder stringbuilder = new StringBuilder(); int j = 0; @@ -806,7 +819,7 @@ public class SmallFontRenderer /** * Remove all newline characters from the end of the string */ - private String trimStringNewline (String par1Str) + private String trimStringNewline(String par1Str) { while (par1Str != null && par1Str.endsWith("\n")) { @@ -819,7 +832,7 @@ public class SmallFontRenderer /** * Splits and draws a String with wordwrap (maximum length is parameter k) */ - public void drawSplitString (String par1Str, int par2, int par3, int par4, int par5) + public void drawSplitString(String par1Str, int par2, int par3, int par4, int par5) { this.resetStyles(); this.textColor = par5; @@ -831,13 +844,13 @@ public class SmallFontRenderer * Perform actual work of rendering a multi-line string with wordwrap and with darker drop shadow color if flag is * set */ - private void renderSplitString (String par1Str, int par2, int par3, int par4, boolean par5) + private void renderSplitString(String par1Str, int par2, int par3, int par4, boolean par5) { List list = this.listFormattedStringToWidth(par1Str, par4); for (Iterator iterator = list.iterator(); iterator.hasNext(); par3 += this.FONT_HEIGHT) { - String s1 = (String) iterator.next(); + String s1 = (String)iterator.next(); this.renderStringAligned(s1, par2, par3, par4, this.textColor, par5); } } @@ -845,7 +858,7 @@ public class SmallFontRenderer /** * Returns the width of the wordwrapped String (maximum length is parameter k) */ - public int splitStringWidth (String par1Str, int par2) + public int splitStringWidth(String par1Str, int par2) { return this.FONT_HEIGHT * this.listFormattedStringToWidth(par1Str, par2).size(); } @@ -854,7 +867,7 @@ public class SmallFontRenderer * Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png * font. */ - public void setUnicodeFlag (boolean par1) + public void setUnicodeFlag(boolean par1) { this.unicodeFlag = par1; } @@ -863,7 +876,7 @@ public class SmallFontRenderer * Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png * font. */ - public boolean getUnicodeFlag () + public boolean getUnicodeFlag() { return this.unicodeFlag; } @@ -871,7 +884,7 @@ public class SmallFontRenderer /** * Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. */ - public void setBidiFlag (boolean par1) + public void setBidiFlag(boolean par1) { this.bidiFlag = par1; } @@ -879,7 +892,7 @@ public class SmallFontRenderer /** * Breaks a string into a list of pieces that will fit a specified width. */ - public List listFormattedStringToWidth (String par1Str, int par2) + public List listFormattedStringToWidth(String par1Str, int par2) { return Arrays.asList(this.wrapFormattedStringToWidth(par1Str, par2).split("\n")); } @@ -887,7 +900,7 @@ public class SmallFontRenderer /** * Inserts newline and formatting into a string to wrap it within the specified width. */ - String wrapFormattedStringToWidth (String par1Str, int par2) + String wrapFormattedStringToWidth(String par1Str, int par2) { int j = this.sizeStringToWidth(par1Str, par2); @@ -908,7 +921,7 @@ public class SmallFontRenderer /** * Determines how many characters from the string will fit into the specified width. */ - private int sizeStringToWidth (String par1Str, int par2) + private int sizeStringToWidth(String par1Str, int par2) { int j = par1Str.length(); int k = 0; @@ -921,38 +934,38 @@ public class SmallFontRenderer switch (c0) { - case 10: - --l; - break; - case 167: - if (l < j - 1) - { - ++l; - char c1 = par1Str.charAt(l); - - if (c1 != 108 && c1 != 76) + case 10: + --l; + break; + case 167: + if (l < j - 1) { - if (c1 == 114 || c1 == 82 || isFormatColor(c1)) + ++l; + char c1 = par1Str.charAt(l); + + if (c1 != 108 && c1 != 76) { - flag = false; + if (c1 == 114 || c1 == 82 || isFormatColor(c1)) + { + flag = false; + } + } + else + { + flag = true; } } - else + + break; + case 32: + i1 = l; + default: + k += this.getCharWidth(c0); + + if (flag) { - flag = true; + ++k; } - } - - break; - case 32: - i1 = l; - default: - k += this.getCharWidth(c0); - - if (flag) - { - ++k; - } } if (c0 == 10) @@ -974,7 +987,7 @@ public class SmallFontRenderer /** * Checks if the char code is a hexadecimal character, used to set colour. */ - private static boolean isFormatColor (char par0) + private static boolean isFormatColor(char par0) { return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; } @@ -982,7 +995,7 @@ public class SmallFontRenderer /** * Checks if the char code is O-K...lLrRk-o... used to set special formatting. */ - private static boolean isFormatSpecial (char par0) + private static boolean isFormatSpecial(char par0) { return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; } @@ -990,7 +1003,7 @@ public class SmallFontRenderer /** * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. */ - private static String getFormatFromString (String par0Str) + private static String getFormatFromString(String par0Str) { String s1 = ""; int i = -1; @@ -1019,7 +1032,7 @@ public class SmallFontRenderer /** * Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string */ - public boolean getBidiFlag () + public boolean getBidiFlag() { return this.bidiFlag; } diff --git a/mods/tinker/tconstruct/client/block/SmelteryRender.java b/mods/tinker/tconstruct/client/block/SmelteryRender.java index 72d7ef84..e30028ca 100644 --- a/mods/tinker/tconstruct/client/block/SmelteryRender.java +++ b/mods/tinker/tconstruct/client/block/SmelteryRender.java @@ -5,16 +5,10 @@ import mods.tinker.tconstruct.client.TProxyClient; import mods.tinker.tconstruct.library.crafting.Smeltery; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.liquids.LiquidStack; - -import org.lwjgl.opengl.GL11; - import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; diff --git a/mods/tinker/tconstruct/client/block/TankRender.java b/mods/tinker/tconstruct/client/block/TankRender.java index 2ceddefc..61a6aefc 100644 --- a/mods/tinker/tconstruct/client/block/TankRender.java +++ b/mods/tinker/tconstruct/client/block/TankRender.java @@ -7,8 +7,6 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.Item; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.liquids.LiquidStack; import org.lwjgl.opengl.GL11; diff --git a/mods/tinker/tconstruct/client/entity/CartRender.java b/mods/tinker/tconstruct/client/entity/CartRender.java index 6b9dcc19..cfcb1347 100644 --- a/mods/tinker/tconstruct/client/entity/CartRender.java +++ b/mods/tinker/tconstruct/client/entity/CartRender.java @@ -7,6 +7,7 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import org.lwjgl.opengl.GL11; @@ -129,4 +130,11 @@ public class CartRender extends Render { this.renderPullcart((CartEntity) par1Entity, par2, par4, par6, par8, par9); } + + protected ResourceLocation func_110775_a(Entity par1Entity) + { + return texture; + } + + static final ResourceLocation texture = new ResourceLocation("assets/tinker/textures/mob/pullcart.png"); } diff --git a/mods/tinker/tconstruct/client/entity/CrystalGuardianModel.java b/mods/tinker/tconstruct/client/entity/CrystalGuardianModel.java index 629ec33d..a37ca0b5 100644 --- a/mods/tinker/tconstruct/client/entity/CrystalGuardianModel.java +++ b/mods/tinker/tconstruct/client/entity/CrystalGuardianModel.java @@ -4,7 +4,7 @@ import mods.tinker.tconstruct.entity.Automaton; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; public class CrystalGuardianModel extends ModelBase { @@ -103,7 +103,7 @@ public class CrystalGuardianModel extends ModelBase } @Override - public void setLivingAnimations (EntityLiving par1EntityLiving, float par2, float par3, float par4) + public void setLivingAnimations (EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { Automaton entityirongolem = (Automaton) par1EntityLiving; int i = 0;//entityirongolem.getAttackTimer(); diff --git a/mods/tinker/tconstruct/client/entity/CrystalGuardianRender.java b/mods/tinker/tconstruct/client/entity/CrystalGuardianRender.java index 1296d368..f4595939 100644 --- a/mods/tinker/tconstruct/client/entity/CrystalGuardianRender.java +++ b/mods/tinker/tconstruct/client/entity/CrystalGuardianRender.java @@ -6,10 +6,13 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; @@ -30,13 +33,13 @@ public class CrystalGuardianRender extends RenderLiving } @Override - protected void renderEquippedItems (EntityLiving par1EntityLiving, float par2) + protected void renderEquippedItems (EntityLivingBase par1EntityLiving, float par2) { float f1 = 1.0F; GL11.glColor3f(f1, f1, f1); super.renderEquippedItems(par1EntityLiving, par2); ItemStack itemstack = par1EntityLiving.getHeldItem(); - ItemStack itemstack1 = par1EntityLiving.getCurrentArmor(3); + ItemStack itemstack1 = par1EntityLiving.getCurrentItemOrArmor(4); float f2; if (itemstack1 != null) @@ -182,4 +185,12 @@ public class CrystalGuardianRender extends RenderLiving { GL11.glTranslatef(0.0F, 0.1875F, 0.0F); } + + @Override + protected ResourceLocation func_110775_a(Entity par1Entity) + { + return texture; + } + + static final ResourceLocation texture = new ResourceLocation("assets/tinker/textures/mob/crystalguardamber.png"); } diff --git a/mods/tinker/tconstruct/client/entity/CrystalRender.java b/mods/tinker/tconstruct/client/entity/CrystalRender.java index af6d2ef4..06b69b31 100644 --- a/mods/tinker/tconstruct/client/entity/CrystalRender.java +++ b/mods/tinker/tconstruct/client/entity/CrystalRender.java @@ -1,10 +1,11 @@ package mods.tinker.tconstruct.client.entity; import mods.tinker.tconstruct.entity.Crystal; -import mods.tinker.tconstruct.entity.Skyla; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -62,4 +63,11 @@ public class CrystalRender extends RenderLiving { return this.func_77061_b((Crystal) par1EntityLiving, par2, par3); } + + protected ResourceLocation func_110775_a(Entity par1Entity) + { + return texture; + } + + static final ResourceLocation texture = new ResourceLocation("assets/tinker/textures/mob/crystalwater.png"); } diff --git a/mods/tinker/tconstruct/client/entity/FancyItemRender.java b/mods/tinker/tconstruct/client/entity/FancyItemRender.java index de8949c0..85ec6fa3 100644 --- a/mods/tinker/tconstruct/client/entity/FancyItemRender.java +++ b/mods/tinker/tconstruct/client/entity/FancyItemRender.java @@ -7,15 +7,17 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ForgeHooksClient; import org.lwjgl.opengl.GL11; @@ -27,6 +29,7 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class FancyItemRender extends Render { + private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png"); private RenderBlocks itemRenderBlocks = new RenderBlocks(); /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ @@ -34,8 +37,8 @@ public class FancyItemRender extends Render public boolean renderWithColor = true; /** Defines the zLevel of rendering of item on GUI. */ - public float zLevel = 0.0F; - public static boolean renderInFrame = false; + public float zLevel; + public static boolean renderInFrame; public FancyItemRender() { @@ -48,6 +51,7 @@ public class FancyItemRender extends Render */ public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9) { + this.func_110777_b(par1EntityItem); this.random.setSeed(187L); ItemStack itemstack = par1EntityItem.getEntityItem(); @@ -60,10 +64,10 @@ public class FancyItemRender extends Render GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - int i; float f4; float f5; float f6; + int i; Block block = null; if (itemstack.itemID < Block.blocksList.length) @@ -86,7 +90,6 @@ public class FancyItemRender extends Render GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); } - this.loadTexture("/terrain.png"); float f7 = 0.25F; int j = block.getRenderType(); @@ -118,7 +121,7 @@ public class FancyItemRender extends Render { float f8; - if (itemstack.getItem().requiresMultipleRenderPasses()) + if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses()) { if (renderInFrame) { @@ -130,8 +133,6 @@ public class FancyItemRender extends Render GL11.glScalef(0.5F, 0.5F, 0.5F); } - this.loadTexture("/gui/items.png"); - for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k) { this.random.setSeed(187L); @@ -145,11 +146,11 @@ public class FancyItemRender extends Render f4 = (float) (i >> 8 & 255) / 255.0F; f6 = (float) (i & 255) / 255.0F; GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F); - this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8); + this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k); } else { - this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F); + this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F, k); } } } @@ -167,15 +168,6 @@ public class FancyItemRender extends Render Icon icon1 = itemstack.getIconIndex(); - if (itemstack.getItemSpriteNumber() == 0) - { - this.loadTexture("/terrain.png"); - } - else - { - this.loadTexture("/gui/items.png"); - } - if (this.renderWithColor) { int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); @@ -197,22 +189,34 @@ public class FancyItemRender extends Render } } + protected ResourceLocation func_110796_a (EntityItem par1EntityItem) + { + return this.renderManager.renderEngine.func_130087_a(par1EntityItem.getEntityItem().getItemSpriteNumber()); + } + /** * Renders a dropped item */ private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) + { + renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0); + } + + private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) { Tessellator tessellator = Tessellator.instance; if (par2Icon == null) { - par2Icon = this.renderManager.renderEngine.getMissingIcon(par1EntityItem.getEntityItem().getItemSpriteNumber()); + TextureManager texturemanager = Minecraft.getMinecraft().func_110434_K(); + ResourceLocation resourcelocation = texturemanager.func_130087_a(par1EntityItem.getEntityItem().getItemSpriteNumber()); + par2Icon = ((TextureMap) texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno"); } - float f4 = par2Icon.getMinU(); - float f5 = par2Icon.getMaxU(); - float f6 = par2Icon.getMinV(); - float f7 = par2Icon.getMaxV(); + float f4 = ((Icon) par2Icon).getMinU(); + float f5 = ((Icon) par2Icon).getMaxU(); + float f6 = ((Icon) par2Icon).getMinV(); + float f7 = ((Icon) par2Icon).getMaxV(); float f8 = 1.0F; float f9 = 0.5F; float f10 = 0.25F; @@ -239,9 +243,7 @@ public class FancyItemRender extends Render for (int k = 0; k < b0; ++k) { - GL11.glTranslatef(0.0F, 0.0F, f12 + f11); - // Makes items offset when in 3D, like when in 2D, looks much - // better. Considered a vanilla bug... + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... if (k > 0 && shouldSpreadItems()) { float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; @@ -256,21 +258,21 @@ public class FancyItemRender extends Render if (itemstack.getItemSpriteNumber() == 0) { - this.loadTexture("/terrain.png"); + this.func_110776_a(TextureMap.field_110575_b); } else { - this.loadTexture("/gui/items.png"); + this.func_110776_a(TextureMap.field_110576_c); } GL11.glColor4f(par5, par6, par7, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, par2Icon.getSheetWidth(), par2Icon.getSheetHeight(), f12); + ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getOriginX(), ((Icon) par2Icon).getOriginY(), f12); - if (itemstack != null && itemstack.hasEffect()) + if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); - this.renderManager.renderEngine.bindTexture("%blur%/misc/glint.png"); + this.renderManager.renderEngine.func_110577_a(field_110798_h); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f13 = 0.76F; @@ -305,19 +307,25 @@ public class FancyItemRender extends Render /** * Renders the item's icon or block into the UI at the specified position. */ - public void renderItemIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + { + renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false); + } + + public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) { int k = par3ItemStack.itemID; int l = par3ItemStack.getItemDamage(); - Icon icon = par3ItemStack.getIconIndex(); + Object object = par3ItemStack.getIconIndex(); float f; + int i1; float f1; float f2; Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null); if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType())) { - par2RenderEngine.bindTexture("/terrain.png"); + par2TextureManager.func_110577_a(TextureMap.field_110575_b); GL11.glPushMatrix(); GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel); GL11.glScalef(10.0F, 10.0F, 10.0F); @@ -325,14 +333,14 @@ public class FancyItemRender extends Render GL11.glScalef(1.0F, 1.0F, -1.0F); GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - int i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f2 = (float) (i1 >> 16 & 255) / 255.0F; - f = (float) (i1 >> 8 & 255) / 255.0F; - f1 = (float) (i1 & 255) / 255.0F; + i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); + f = (float) (i1 >> 16 & 255) / 255.0F; + f1 = (float) (i1 >> 8 & 255) / 255.0F; + f2 = (float) (i1 & 255) / 255.0F; if (this.renderWithColor) { - GL11.glColor4f(f2, f, f1, 1.0F); + GL11.glColor4f(f, f1, f2, 1.0F); } GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); @@ -341,87 +349,104 @@ public class FancyItemRender extends Render this.itemRenderBlocks.useInventoryTint = true; GL11.glPopMatrix(); } - else + else if (Item.itemsList[k].requiresMultipleRenderPasses()) { - int j1; + GL11.glDisable(GL11.GL_LIGHTING); - if (Item.itemsList[k].requiresMultipleRenderPasses()) + for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) { - GL11.glDisable(GL11.GL_LIGHTING); - par2RenderEngine.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? "/terrain.png" : "/gui/items.png"); - - for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) - { - Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1); - int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); - f = (float) (k1 >> 16 & 255) / 255.0F; - f1 = (float) (k1 >> 8 & 255) / 255.0F; - float f3 = (float) (k1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f, f1, f3, 1.0F); - } - - this.renderIcon(par4, par5, icon1, 16, 16); - } - - GL11.glEnable(GL11.GL_LIGHTING); - } - else - { - GL11.glDisable(GL11.GL_LIGHTING); - - if (par3ItemStack.getItemSpriteNumber() == 0) - { - par2RenderEngine.bindTexture("/terrain.png"); - } - else - { - par2RenderEngine.bindTexture("/gui/items.png"); - } - - if (icon == null) - { - icon = par2RenderEngine.getMissingIcon(par3ItemStack.getItemSpriteNumber()); - } - - j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - float f4 = (float) (j1 >> 16 & 255) / 255.0F; - f2 = (float) (j1 >> 8 & 255) / 255.0F; - f = (float) (j1 & 255) / 255.0F; + par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c); + Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1); + int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); + f1 = (float) (k1 >> 16 & 255) / 255.0F; + f2 = (float) (k1 >> 8 & 255) / 255.0F; + float f3 = (float) (k1 & 255) / 255.0F; if (this.renderWithColor) { - GL11.glColor4f(f4, f2, f, 1.0F); + GL11.glColor4f(f1, f2, f3, 1.0F); } this.renderIcon(par4, par5, icon, 16, 16); - GL11.glEnable(GL11.GL_LIGHTING); + + if (par3ItemStack.hasEffect(j1)) + { + renderEffect(par2TextureManager, par4, par5); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + } + else + { + GL11.glDisable(GL11.GL_LIGHTING); + ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.getItemSpriteNumber()); + par2TextureManager.func_110577_a(resourcelocation); + + if (object == null) + { + object = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno"); + } + + i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); + f = (float) (i1 >> 16 & 255) / 255.0F; + f1 = (float) (i1 >> 8 & 255) / 255.0F; + f2 = (float) (i1 & 255) / 255.0F; + + if (this.renderWithColor) + { + GL11.glColor4f(f, f1, f2, 1.0F); + } + + this.renderIcon(par4, par5, (Icon) object, 16, 16); + GL11.glEnable(GL11.GL_LIGHTING); + + if (par3ItemStack.hasEffect(0)) + { + renderEffect(par2TextureManager, par4, par5); } } GL11.glEnable(GL11.GL_CULL_FACE); } + private void renderEffect (TextureManager manager, int x, int y) + { + GL11.glDepthFunc(GL11.GL_GREATER); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + manager.func_110577_a(field_110798_h); + this.zLevel -= 50.0F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); + GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); + this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + this.zLevel += 50.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + /** * Render the item's icon or block into the GUI, including the glint effect. */ - public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { if (par3ItemStack != null) { - if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) + if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) { - this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5); + this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); } + /* Modders must handle this themselves if they use custom renderers! if (par3ItemStack.hasEffect()) { GL11.glDepthFunc(GL11.GL_GREATER); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); - par2RenderEngine.bindTexture("%blur%/misc/glint.png"); + par2TextureManager.func_110577_a(field_110798_h); this.zLevel -= 50.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); @@ -433,6 +458,7 @@ public class FancyItemRender extends Render GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); } + */ } } @@ -473,15 +499,15 @@ public class FancyItemRender extends Render } /** - * Renders the item's overlay information. Examples being stack count or - * damage on top of the item's image at the specified position. + * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the + * specified position. */ - public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { - this.renderItemStack(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null); + this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null); } - public void renderItemStack (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str) + public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str) { if (par3ItemStack != null) { @@ -517,8 +543,8 @@ public class FancyItemRender extends Render } /** - * Adds a quad to the tesselator at the specified position with the set - * width and height and color. Args: tessellator, x, y, width, height, color + * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: + * tessellator, x, y, width, height, color */ private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) { @@ -542,13 +568,16 @@ public class FancyItemRender extends Render tessellator.draw(); } + protected ResourceLocation func_110775_a (Entity par1Entity) + { + return this.func_110796_a((EntityItem) par1Entity); + } + /** - * Actually renders the given argument. This is a synthetic bridge method, - * always casting down its argument and then handing it off to a worker - * function which does the actual work. In all probabilty, the class Render - * is generic (Render= 3) - { - break; - } - if (golembase.body[1][j] == mod_Golems.golemHead.blockID) - { - i = j; - break; - } - j++; - } while (true);*/ - i = 0; - super.doRenderLiving((EntityLiving) entity, d, d1, d2, f, f1); - loadTexture("/terrain.png"); - GL11.glDisable(2896 /*GL_LIGHTING*/); - j = 3; - World world = entity.worldObj; - GL11.glPushMatrix(); - GL11.glTranslatef((float) d, (float) d1, (float) d2); - /*if (entitygenericgolem.lifespan <= 0L) - { - entitygenericgolem.rotationYaw = entitygenericgolem.yawFreeze; - }*/ - GL11.glRotatef(entity.rotationYaw, 0.0F, -1F, 0.0F); - GL11.glScalef(0.7F, 0.7F, 0.7F); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - GL11.glRotatef(i == 2 ? modelgenericgolem.head.rotateAngleY * -57.29578F : 0.0F, 0.0F, 1.0F, 0.0F); - Block block = Block.brick; - /*if (golembase.isSlime()) - { - preRenderScale(golembase, f); - }*/ - if (block != null) - { - /*if (block.blockID == mod_Golems.Golem_Head_ID) - { - renderFace(golembase, block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), - golembase.meta[1][j - 1]); - }*/ - renderBlock(block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), 0); - } - /*else if (block == mod_Golems.golemCore) - { - renderCore(golembase, block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), 0.5F, 0.5F, 0.5F, 0.0D); - }*/ - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 1.5625F, 0.0F); - GL11.glRotatef(i == 1 ? modelgenericgolem.head.rotateAngleY * -57.29578F : 0.0F, 0.0F, 1.0F, 0.0F); - block = Block.cobblestone; - if (block != null)// && block != mod_Golems.golemCore) - { - /*if (block.blockID == mod_Golems.Golem_Head_ID) - { - renderFace(golembase, block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), - golembase.meta[1][j - 2]); - }*/ - renderBlock(block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), 0); - } - /*else if (block == mod_Golems.golemCore) - { - renderCore(golembase, block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), 0.5F, 0.5F, 0.5F, 1.0D); - }*/ - GL11.glPopMatrix(); - /*GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 2.625F, 0.0F); - GL11.glRotatef(i == 0 ? modelgenericgolem.head.rotateAngleY * -57.29578F : 0.0F, 0.0F, 1.0F, 0.0F); - block = Block.blocksList[golembase.body[1][j - 3]]; - if (block != null && block != mod_Golems.golemCore) - { - if (block.blockID == mod_Golems.Golem_Head_ID) - { - renderFace(golembase, block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), - golembase.meta[1][j - 3]); - } - renderBlock(block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), golembase.meta[1][j - 3]); - } - else if (block == mod_Golems.golemCore) - { - renderCore(golembase, block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), 0.5F, 0.5F, 0.5F, 2D); - } - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - GL11.glTranslatef(0.7F, 0.9F, 0.0F); - if (golembase.isSwinging && golembase.arms[0]) - { - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - golembase.swingAge -= golembase.dt; - GL11.glRotatef(-((float) golembase.swingAge / (float) golembase.swingMax) * 70F, 1.0F, 0.0F, 0.0F); - if (golembase.swingAge <= 0) - { - golembase.isSwinging = false; - } - GL11.glTranslatef(0.0F, -0.5F, 0.0F); - } - GL11.glScalef(0.4F, 1.3F, 0.4F); - block = Block.blocksList[golembase.body[0][j - 2]]; - if (block != null) - { - renderBlock(block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), golembase.meta[0][j - 2]); - } - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - GL11.glTranslatef(-0.7F, 0.9F, 0.0F); - if (golembase.isSwinging && golembase.arms[1] && !golembase.arms[0]) - { - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - golembase.swingAge -= golembase.dt; - GL11.glRotatef(-((float) golembase.swingAge / (float) golembase.swingMax) * 70F, 1.0F, 0.0F, 0.0F); - if (golembase.swingAge <= 0) - { - golembase.isSwinging = false; - } - GL11.glTranslatef(0.0F, -0.5F, 0.0F); - } - GL11.glScalef(0.4F, 1.3F, 0.4F); - block = Block.blocksList[golembase.body[2][j - 2]]; - if (block != null) - { - renderBlock(block, world, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ), golembase.meta[2][j - 2]); - } - GL11.glPopMatrix();*/ - GL11.glPopMatrix(); - GL11.glEnable(2896 /*GL_LIGHTING*/); - } - - protected void preRenderCallback (EntityLiving entityliving, float f) - { - preRenderScale(entityliving, f); - } - - public void renderBlock (Block block, World world, int x, int y, int z, int side) - { - /*float f = 0.5F; - float f1 = 1.0F; - float f2 = 0.8F; - float f3 = 0.6F; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - float f4 = 1.0F; - float f5 = 1.0F; - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f * f5, f * f5, f * f5); - renderBlocks.renderBottomFace(block, -0.5D, -0.5D, -0.5D, block.getIcon(0, side)); - f5 = 1.0F; - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5); - renderBlocks.renderTopFace(block, -0.5D, -0.5D, -0.5D, block.getIcon(1, side)); - f5 = 1.0F; - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5); - renderBlocks.renderEastFace(block, -0.5D, -0.5D, -0.5D, block.getIcon(2, side)); - f5 = 1.0F; - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5); - renderBlocks.renderWestFace(block, -0.5D, -0.5D, -0.5D, block.getIcon(3, side)); - f5 = 1.0F; - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5); - renderBlocks.renderNorthFace(block, -0.5D, -0.5D, -0.5D, block.getIcon(4, side)); - f5 = 1.0F; - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5); - renderBlocks.renderSouthFace(block, -0.5D, -0.5D, -0.5D, block.getIcon(5, side)); - tessellator.draw();*/ - } - - /*public void renderFace (GolemBase entitygenericgolem, Block block, World world, int i, int j, int k, int l) - { - float f = 0.5F; - float f1 = 1.0F; - float f2 = 0.8F; - float f3 = 0.6F; - float f4 = entitygenericgolem.getFaceR(); - float f5 = entitygenericgolem.getFaceG(); - float f6 = entitygenericgolem.getFaceB(); - double d = 0.001D; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, i, j, k)); - float f7 = 1.0F; - float f8 = 1.0F; - if (f8 < f7) - { - f8 = f7; - } - tessellator.setColorOpaque_F(f4, f5, f6); - if (block.getIcon(2, l) == BlockGolemHead.face) - { - renderBlocks.renderEastFace(block, -0.5D, -0.5D, -0.5D - d, mod_Golems.faceTex); - } - f8 = 1.0F; - if (f8 < f7) - { - f8 = f7; - } - tessellator.setColorOpaque_F(f4, f5, f6); - if (block.getIcon(3, l) == BlockGolemHead.face) - { - renderBlocks.renderWestFace(block, -0.5D, -0.5D, -0.5D + d, mod_Golems.faceTex); - } - f8 = 1.0F; - if (f8 < f7) - { - f8 = f7; - } - tessellator.setColorOpaque_F(f4, f5, f6); - if (block.getIcon(4, l) == BlockGolemHead.face) - { - renderBlocks.renderNorthFace(block, -0.5D - d, -0.5D, -0.5D, mod_Golems.faceTex); - } - f8 = 1.0F; - if (f8 < f7) - { - f8 = f7; - } - tessellator.setColorOpaque_F(f4, f5, f6); - if (block.getIcon(5, l) == BlockGolemHead.face) - { - renderBlocks.renderSouthFace(block, -0.5D + d, -0.5D, -0.5D, mod_Golems.faceTex); - } - tessellator.draw(); - }*/ -} diff --git a/mods/tinker/tconstruct/client/entity/MiniGardyRender.java b/mods/tinker/tconstruct/client/entity/MiniGardyRender.java index 65c485c1..8cb984d1 100644 --- a/mods/tinker/tconstruct/client/entity/MiniGardyRender.java +++ b/mods/tinker/tconstruct/client/entity/MiniGardyRender.java @@ -2,21 +2,21 @@ package mods.tinker.tconstruct.client.entity; import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED; import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D; - -import org.lwjgl.opengl.GL11; - -import mods.tinker.tconstruct.entity.MiniGardy; import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; + +import org.lwjgl.opengl.GL11; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -29,13 +29,13 @@ public class MiniGardyRender extends RenderLiving } @Override - protected void renderEquippedItems (EntityLiving par1EntityLiving, float par2) + protected void renderEquippedItems (EntityLivingBase par1EntityLiving, float par2) { float f1 = 1.0F; GL11.glColor3f(f1, f1, f1); super.renderEquippedItems(par1EntityLiving, par2); ItemStack heldItem = par1EntityLiving.getHeldItem(); - ItemStack helmetItem = par1EntityLiving.getCurrentArmor(3); + ItemStack helmetItem = par1EntityLiving.getCurrentItemOrArmor(4); float f2; ModelMiniGardy model = (ModelMiniGardy) this.mainModel; @@ -175,4 +175,12 @@ public class MiniGardyRender extends RenderLiving { GL11.glTranslatef(0.0F, 0.1875F, 0.0F); } + + @Override + protected ResourceLocation func_110775_a(Entity par1Entity) + { + return texture; + } + + static final ResourceLocation texture = new ResourceLocation("assets/tinker/textures/mob/googirl.png"); } diff --git a/mods/tinker/tconstruct/client/entity/SkylaRender.java b/mods/tinker/tconstruct/client/entity/SkylaRender.java index 1a66261d..46e82afe 100644 --- a/mods/tinker/tconstruct/client/entity/SkylaRender.java +++ b/mods/tinker/tconstruct/client/entity/SkylaRender.java @@ -3,7 +3,9 @@ package mods.tinker.tconstruct.client.entity; import mods.tinker.tconstruct.entity.Skyla; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -61,4 +63,11 @@ public class SkylaRender extends RenderLiving { return this.func_77061_b((Skyla) par1EntityLiving, par2, par3); } + + @Override + protected ResourceLocation func_110775_a (Entity entity) + { + // TODO Auto-generated method stub + return null; + } } diff --git a/mods/tinker/tconstruct/client/entity/SlimeRender.java b/mods/tinker/tconstruct/client/entity/SlimeRender.java index 0714e55f..25e2deca 100644 --- a/mods/tinker/tconstruct/client/entity/SlimeRender.java +++ b/mods/tinker/tconstruct/client/entity/SlimeRender.java @@ -3,9 +3,10 @@ package mods.tinker.tconstruct.client.entity; import mods.tinker.tconstruct.entity.BlueSlime; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.boss.BossStatus; -import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -91,4 +92,12 @@ public class SlimeRender extends RenderLiving { return this.shouldSlimeRenderPass((BlueSlime) par1EntityLiving, par2, par3); } + + @Override + protected ResourceLocation func_110775_a(Entity par1Entity) + { + return texture; + } + + static final ResourceLocation texture = new ResourceLocation("assets/tinker/textures/mob/slimeedible.png"); } diff --git a/mods/tinker/tconstruct/client/entity/projectile/ArrowRender.java b/mods/tinker/tconstruct/client/entity/projectile/ArrowRender.java index 888d4910..1d2e6a67 100644 --- a/mods/tinker/tconstruct/client/entity/projectile/ArrowRender.java +++ b/mods/tinker/tconstruct/client/entity/projectile/ArrowRender.java @@ -6,11 +6,9 @@ import mods.tinker.tconstruct.entity.projectile.ArrowEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; diff --git a/mods/tinker/tconstruct/client/entity/projectile/DaggerRender.java b/mods/tinker/tconstruct/client/entity/projectile/DaggerRender.java index 435dd268..ad654aa0 100644 --- a/mods/tinker/tconstruct/client/entity/projectile/DaggerRender.java +++ b/mods/tinker/tconstruct/client/entity/projectile/DaggerRender.java @@ -6,11 +6,9 @@ import mods.tinker.tconstruct.entity.projectile.RotatingBase; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; diff --git a/mods/tinker/tconstruct/client/gui/ArmorExtendedGui.java b/mods/tinker/tconstruct/client/gui/ArmorExtendedGui.java index 545f678c..9ceb0e3c 100644 --- a/mods/tinker/tconstruct/client/gui/ArmorExtendedGui.java +++ b/mods/tinker/tconstruct/client/gui/ArmorExtendedGui.java @@ -1,13 +1,10 @@ package mods.tinker.tconstruct.client.gui; -import mods.tinker.tconstruct.client.TControls; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.inventory.ArmorExtendedContainer; import mods.tinker.tconstruct.util.player.ArmorExtended; -import mods.tinker.tconstruct.util.player.TPlayerStats; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.InventoryEffectRenderer; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; diff --git a/mods/tinker/tconstruct/client/gui/GuiManual.java b/mods/tinker/tconstruct/client/gui/GuiManual.java index 3422d2e2..e69b632f 100644 --- a/mods/tinker/tconstruct/client/gui/GuiManual.java +++ b/mods/tinker/tconstruct/client/gui/GuiManual.java @@ -6,7 +6,6 @@ import mods.tinker.tconstruct.client.block.SmallFontRenderer; import mods.tinker.tconstruct.client.pages.BookPage; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiParticle; import net.minecraft.client.gui.GuiScreen; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/gui/KnapsackGui.java b/mods/tinker/tconstruct/client/gui/KnapsackGui.java index af01525d..02a4fcd7 100644 --- a/mods/tinker/tconstruct/client/gui/KnapsackGui.java +++ b/mods/tinker/tconstruct/client/gui/KnapsackGui.java @@ -4,18 +4,13 @@ import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.inventory.KnapsackContainer; import mods.tinker.tconstruct.util.player.KnapsackInventory; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; public class KnapsackGui extends GuiContainer { diff --git a/mods/tinker/tconstruct/client/gui/MiniGardyGui.java b/mods/tinker/tconstruct/client/gui/MiniGardyGui.java index f52dd263..2ff189db 100644 --- a/mods/tinker/tconstruct/client/gui/MiniGardyGui.java +++ b/mods/tinker/tconstruct/client/gui/MiniGardyGui.java @@ -5,7 +5,6 @@ import mods.tinker.tconstruct.inventory.MiniGardyContainer; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.StatCollector; -import net.minecraft.world.World; import org.lwjgl.opengl.GL11; diff --git a/mods/tinker/tconstruct/client/gui/NewContainerGui.java b/mods/tinker/tconstruct/client/gui/NewContainerGui.java index f6a4c1db..8e81054f 100644 --- a/mods/tinker/tconstruct/client/gui/NewContainerGui.java +++ b/mods/tinker/tconstruct/client/gui/NewContainerGui.java @@ -875,7 +875,7 @@ public abstract class NewContainerGui extends GuiScreen { if (this.mc.thePlayer != null) { - this.container.onCraftGuiClosed(this.mc.thePlayer); + this.container.onContainerClosed(this.mc.thePlayer); } } diff --git a/mods/tinker/tconstruct/client/gui/PartCrafterGui.java b/mods/tinker/tconstruct/client/gui/PartCrafterGui.java index eb08ac00..4e3277a0 100644 --- a/mods/tinker/tconstruct/client/gui/PartCrafterGui.java +++ b/mods/tinker/tconstruct/client/gui/PartCrafterGui.java @@ -7,7 +7,6 @@ import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.crafting.PatternBuilder; import mods.tinker.tconstruct.library.tools.ToolMaterial; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; diff --git a/mods/tinker/tconstruct/client/gui/SmelteryGui.java b/mods/tinker/tconstruct/client/gui/SmelteryGui.java index 6448fae9..e07f644a 100644 --- a/mods/tinker/tconstruct/client/gui/SmelteryGui.java +++ b/mods/tinker/tconstruct/client/gui/SmelteryGui.java @@ -10,20 +10,12 @@ import mods.tinker.tconstruct.inventory.SmelteryContainer; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.Icon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.liquids.LiquidDictionary; -import net.minecraftforge.liquids.LiquidStack; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; diff --git a/mods/tinker/tconstruct/client/gui/ToolForgeGui.java b/mods/tinker/tconstruct/client/gui/ToolForgeGui.java index 833749d4..ca5ab7af 100644 --- a/mods/tinker/tconstruct/client/gui/ToolForgeGui.java +++ b/mods/tinker/tconstruct/client/gui/ToolForgeGui.java @@ -1,28 +1,11 @@ package mods.tinker.tconstruct.client.gui; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic; -import mods.tinker.tconstruct.inventory.ActiveContainer; -import mods.tinker.tconstruct.inventory.ToolForgeContainer; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import mods.tinker.tconstruct.library.client.ToolGuiElement; -import mods.tinker.tconstruct.library.tools.ToolCore; -import mods.tinker.tconstruct.library.tools.Weapon; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet250CustomPayload; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/mods/tinker/tconstruct/client/pages/BlockCastPage.java b/mods/tinker/tconstruct/client/pages/BlockCastPage.java index f32c4d37..cda6770c 100644 --- a/mods/tinker/tconstruct/client/pages/BlockCastPage.java +++ b/mods/tinker/tconstruct/client/pages/BlockCastPage.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/pages/BookPage.java b/mods/tinker/tconstruct/client/pages/BookPage.java index e527647a..bdfe0927 100644 --- a/mods/tinker/tconstruct/client/pages/BookPage.java +++ b/mods/tinker/tconstruct/client/pages/BookPage.java @@ -2,7 +2,7 @@ package mods.tinker.tconstruct.client.pages; import mods.tinker.tconstruct.client.gui.GuiManual; -import org.w3c.dom.*; +import org.w3c.dom.Element; public abstract class BookPage { diff --git a/mods/tinker/tconstruct/client/pages/ContentsTablePage.java b/mods/tinker/tconstruct/client/pages/ContentsTablePage.java index 7472183c..6149cc19 100644 --- a/mods/tinker/tconstruct/client/pages/ContentsTablePage.java +++ b/mods/tinker/tconstruct/client/pages/ContentsTablePage.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/pages/CraftingPage.java b/mods/tinker/tconstruct/client/pages/CraftingPage.java index f7e985ab..b4359fa0 100644 --- a/mods/tinker/tconstruct/client/pages/CraftingPage.java +++ b/mods/tinker/tconstruct/client/pages/CraftingPage.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/pages/FurnacePage.java b/mods/tinker/tconstruct/client/pages/FurnacePage.java index 56a5f188..97278413 100644 --- a/mods/tinker/tconstruct/client/pages/FurnacePage.java +++ b/mods/tinker/tconstruct/client/pages/FurnacePage.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/pages/ModifierPage.java b/mods/tinker/tconstruct/client/pages/ModifierPage.java index 83ee74ed..af3ea9e3 100644 --- a/mods/tinker/tconstruct/client/pages/ModifierPage.java +++ b/mods/tinker/tconstruct/client/pages/ModifierPage.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/pages/PicturePage.java b/mods/tinker/tconstruct/client/pages/PicturePage.java index 4e387c65..43627d7a 100644 --- a/mods/tinker/tconstruct/client/pages/PicturePage.java +++ b/mods/tinker/tconstruct/client/pages/PicturePage.java @@ -1,13 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; -import mods.tinker.tconstruct.library.client.TConstructClientRegistry; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.item.ItemStack; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/mods/tinker/tconstruct/client/pages/SectionPage.java b/mods/tinker/tconstruct/client/pages/SectionPage.java index 803bf7a8..8ad8b329 100644 --- a/mods/tinker/tconstruct/client/pages/SectionPage.java +++ b/mods/tinker/tconstruct/client/pages/SectionPage.java @@ -1,13 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; -import mods.tinker.tconstruct.library.client.TConstructClientRegistry; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.item.ItemStack; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/mods/tinker/tconstruct/client/pages/SidebarPage.java b/mods/tinker/tconstruct/client/pages/SidebarPage.java index de260f84..180d7d60 100644 --- a/mods/tinker/tconstruct/client/pages/SidebarPage.java +++ b/mods/tinker/tconstruct/client/pages/SidebarPage.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/pages/TextPage.java b/mods/tinker/tconstruct/client/pages/TextPage.java index 33494ee7..28f3a521 100644 --- a/mods/tinker/tconstruct/client/pages/TextPage.java +++ b/mods/tinker/tconstruct/client/pages/TextPage.java @@ -1,13 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; -import mods.tinker.tconstruct.library.client.TConstructClientRegistry; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.item.ItemStack; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/mods/tinker/tconstruct/client/pages/TitlePage.java b/mods/tinker/tconstruct/client/pages/TitlePage.java index 2b55f781..441e77de 100644 --- a/mods/tinker/tconstruct/client/pages/TitlePage.java +++ b/mods/tinker/tconstruct/client/pages/TitlePage.java @@ -1,13 +1,5 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.client.gui.GuiManual; -import mods.tinker.tconstruct.library.client.TConstructClientRegistry; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.item.ItemStack; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/mods/tinker/tconstruct/client/pages/ToolPage.java b/mods/tinker/tconstruct/client/pages/ToolPage.java index 488e13d6..1aa5442b 100644 --- a/mods/tinker/tconstruct/client/pages/ToolPage.java +++ b/mods/tinker/tconstruct/client/pages/ToolPage.java @@ -1,10 +1,6 @@ package mods.tinker.tconstruct.client.pages; -import mods.tinker.tconstruct.client.gui.PartCrafterGui; -import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; -import mods.tinker.tconstruct.library.crafting.PatternBuilder; -import mods.tinker.tconstruct.library.tools.ToolMaterial; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/client/tmt/Angle3D.java b/mods/tinker/tconstruct/client/tmt/Angle3D.java deleted file mode 100644 index 152b982b..00000000 --- a/mods/tinker/tconstruct/client/tmt/Angle3D.java +++ /dev/null @@ -1,99 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -/** - * This class handles angles. Basically all it does it store angles. You can - * directly alter the angles. - * @author GaryCXJk - * - */ -public class Angle3D -{ - /** - * The constructor to create a new Angle3D. - * @param x the x-rotation - * @param y the y-rotation - * @param z the z-rotation - */ - public Angle3D(float x, float y, float z) - { - angleX = x; - angleY = y; - angleZ = z; - } - - /** - * Adds the given angles to the current angles. - * @param x the x-rotation - * @param y the y-rotation - * @param z the z-rotation - */ - public void addAngles (float x, float y, float z) - { - angleX += x; - angleY += y; - angleZ += z; - } - - /** - * Adds the angles of another Angle3D to the current angles. - * @param angles the Angle3D - */ - public void addAngles (Angle3D angles) - { - angleX += angles.angleX; - angleY += angles.angleY; - angleZ += angles.angleZ; - } - - /** - * Multiplies the angles with the given angles. - * @param x the x-rotation - * @param y the y-rotation - * @param z the z-rotation - */ - public void multiplyAngles (float x, float y, float z) - { - angleX *= x; - angleY *= y; - angleZ *= z; - } - - /** - * Multiplies the angles with a given Angle3D. - * @param angles the Angle3D - */ - public void multiplyAngles (Angle3D angles) - { - angleX *= angles.angleX; - angleY *= angles.angleY; - angleZ *= angles.angleZ; - } - - /** - * Gets the center angle between two angles. - * @param angles1 the first Angle3D - * @param angles2 the second Angle3D - * @return the center Angle3D - */ - public static Angle3D getCenter (Angle3D angles1, Angle3D angles2) - { - Angle3D angles = new Angle3D(0, 0, 0); - angles.addAngles(angles1); - angles.addAngles(angles2); - angles.multiplyAngles(0.5F, 0.5F, 0.5F); - return angles; - } - - /** - * Copies the current Angle3D over to a new Angle3D instance. - * @return a copy of the Angle3D instance - */ - public Angle3D copy () - { - return new Angle3D(angleX, angleY, angleZ); - } - - public float angleX; - public float angleY; - public float angleZ; -} diff --git a/mods/tinker/tconstruct/client/tmt/Bone.java b/mods/tinker/tconstruct/client/tmt/Bone.java deleted file mode 100644 index 0d1c1795..00000000 --- a/mods/tinker/tconstruct/client/tmt/Bone.java +++ /dev/null @@ -1,550 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; - -/** - * The Bone class makes it possible to create skeletons, which should help you out in - * animating your mobs a little bit more easy. However, since you won't work with a - * graphical interface, creating bones will be different from what you are probably - * used to. - *

- * First, you will need to instantiate every Bone in the constructor of your model - * file. The default orientation, when all angles are set to zero, will be in the - * vector (0, 0, length), meaning it will always point backwards on a regular model. - * You can also set what its parent node is. If a Bone does not have a parent node, - * it is assumed it is the root node. Each Bone can only have one parent, but several - * children. Also, all children will inherit the offset position of the root node. - *

- * The neutral position basically defines in what direction the Bone normally faces - * when in rest. This will not affect the rotation of any model currently attached - * to it or the rotation of the child nodes, but will affect the position of the - * child nodes when recalculating their positions. The length always defines how far - * each child Bone will be placed, since child Bones are always placed at the end of - * their parent Bone. - *

- * Once you're ready to render, you can call the prepareDraw method. You only need - * to apply it to one Bone, since it will always search for the root node to execute - * the code there. It will then automatically rotate every child Bone and places - * them at the right position. Finally, use the setAnglesToModels method to rotate - * each model and place them at the correct spot. Note that if you also apply custom - * rotation for the individual models that you should apply that after you've run - * setAnglesToModels, since this will override the settings the model originally had. - * The best way to solve this is to make a separate method to rotate the Bones. - *

- * The following would be an example of a biped with a skeleton. It takes ModelBiped - * as an example and extends it with a skeleton. First, we have the part that goes - * in the constructor. - *
- * // First, the origin will be placed. This is where the rest is attached to.
- * skeletonOrigin = new Bone(0, 0, 0, 0);
- * 
- * // Next, the entire skeleton is built up.
- * skeletonHead = new Bone(-3.141593F / 2, 0, 0, 0, skeletonOrigin);
- * skeletonBody = new Bone(3.141593F / 2, 0, 0, 12, skeletonOrigin);
- * skeletonShoulderRight = new Bone(0, -3.141593F / 2, 0, 5, skeletonOrigin);
- * skeletonShoulderLeft = new Bone(0, 3.141593F / 2, 0, 5, skeletonOrigin);
- * skeletonArmRight = new Bone(3.141593F / 2, 0, 0, 12, skeletonShoulderRight);
- * skeletonArmLeft = new Bone(3.141593F / 2, 0, 0, 12, skeletonShoulderLeft);
- * skeletonPelvisRight = new Bone(0, -3.141593F / 2, 0, 2, skeletonBody);
- * skeletonPelvisLeft = new Bone(0, 3.141593F / 2, 0, 2, skeletonBody);
- * skeletonLegRight = new Bone(3.141593F / 2, 0, 0, 12, skeletonPelvisRight);
- * skeletonLegLeft = new Bone(3.141593F / 2, 0, 0, 12, skeletonPelvisLeft);
- * 
- * // Finally, all models will be attached to the skeletons.
- * skeletonHead.addModel(bipedHead);
- * skeletonHead.addModel(bipedHeadwear);
- * skeletonBody.addModel(bipedBody);
- * skeletonArmRight.addModel(bipedRightArm);
- * skeletonArmLeft.addModel(bipedLeftArm);
- * skeletonLegRight.addModel(bipedRightLeg);
- * skeletonLegLeft.addModel(bipedRightLeg);
- * 
- *

- * After that, you could replace anything in the setRotationAngles method with - * the following code. It's not a complete code, but you'll get the basics. - *

- *
- * skeletonHead.relativeAngles.angleY = f3 / 57.29578F;
- * skeletonHead.relativeAngles.angleX = f4 / 57.29578F;
- * skeletonArmRight.relativeAngles.angleX = MathHelper.cos(f * 0.6662F + 3.141593F) * 2.0F * f1 * 0.5F;
- * skeletonArmRight.relativeAngles.angleZ = 0.0F;
- * skeletonArmLeft.relativeAngles.angleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
- * skeletonArmLeft.relativeAngles.angleZ = 0.0F;
- * skeletonLegRight.relativeAngles.angleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
- * skeletonLegRight.relativeAngles.angleY = 0.0F;
- * skeletonLegLeft.relativeAngles.angleX = MathHelper.cos(f * 0.6662F + 3.141593F) * 1.4F * f1;
- * skeletonLegLeft.relativeAngles.angleY = 0.0F;
- * 
- *

- * Finally, in the render method, you could use the following code. - *

- *
- * setRotationAngles(f, f1, f2, f3, f4, f5);
- * skeletonOrigin.prepareDraw();
- * skeletonOrigin.setAnglesToModels();
- * 
- *

- * This should generate the same animation of the regular biped. Don't forget to add - * the individual render methods for each model though, as it won't automatically - * render them. - *

- * @author GaryCXJk - * - */ -public class Bone -{ - /** - * Constructor to create a bone. - * @param x the x-rotation of the bone - * @param y the y-rotation of the bone - * @param z the z-rotation of the bone - * @param l the length of the bone - */ - public Bone(float x, float y, float z, float l) - { - neutralAngles = new Angle3D(x, y, z); - relativeAngles = new Angle3D(0, 0, 0); - absoluteAngles = new Angle3D(0, 0, 0); - positionVector = Vec3.createVectorHelper(0, 0, 0); - length = l; - childNodes = new ArrayList(); - models = new ArrayList(); - modelBaseRot = new HashMap(); - parentNode = null; - offsetX = 0; - offsetY = 0; - offsetZ = 0; - positionVector = Vec3.createVectorHelper(0, 0, 0); - } - - /** - * Constructor to create a bone. - * @param xOrig the x-offset of the origin - * @param yOrig the y-offset of the origin - * @param zOrig the z-offset of the origin - * @param xRot the x-rotation of the bone - * @param yRot the y-rotation of the bone - * @param zRot the z-rotation of the bone - * @param l the length of the bone - */ - public Bone(float xOrig, float yOrig, float zOrig, float xRot, float yRot, float zRot, float l) - { - this(xRot, yRot, zRot, l); - positionVector = setOffset(xOrig, yOrig, zOrig); - } - - /** - * Constructor to create a bone. This attaches the bone to a parent bone, and will - * calculate its current position relative to the origin. - * @param x the x-rotation of the bone - * @param y the y-rotation of the bone - * @param z the z-rotation of the bone - * @param l the length of the bone - * @param parent the parent Bone node this Bone is attached to - */ - public Bone(float x, float y, float z, float l, Bone parent) - { - this(x, y, z, l); - attachBone(parent); - } - - /** - * Detaches the bone from its parent. - */ - public void detachBone () - { - parentNode.childNodes.remove(this); - parentNode = null; - } - - /** - * Attaches the bone to a parent. If the parent is already set, detaches the bone - * from the previous parent. - * @param parent the parent Bone node this Bone is attached to - */ - public void attachBone (Bone parent) - { - if (parentNode != null) - detachBone(); - parentNode = parent; - parent.addChildBone(this); - offsetX = parent.offsetX; - offsetY = parent.offsetY; - offsetZ = parent.offsetZ; - resetOffset(); - } - - /** - * Sets the current offset of the parent root Bone. Note that this will - * always set the parent root Bone, not the current Bone, as its offset - * is determined by the offset, rotation and length of its parent. - * @param x the x-position - * @param y the y-position - * @param z the z-position - * @return a Vec3 with the new coordinates of the current bone - */ - public Vec3 setOffset (float x, float y, float z) - { - if (parentNode != null) - { - Vec3 vector = parentNode.setOffset(x, y, z); - offsetX = (float) vector.xCoord; - offsetY = (float) vector.yCoord; - offsetZ = (float) vector.zCoord; - return vector; - } - offsetX = x; - offsetY = y; - offsetZ = z; - resetOffset(true); - return Vec3.createVectorHelper(x, y, z); - } - - /** - * Resets the offset. - */ - public void resetOffset () - { - resetOffset(false); - } - - /** - * Resets the offset. - * @param doRecursive - */ - public void resetOffset (boolean doRecursive) - { - if (parentNode != null) - { - positionVector = Vec3.createVectorHelper(0, 0, parentNode.length); - parentNode.setVectorRotations(positionVector); - positionVector.xCoord += parentNode.positionVector.xCoord; - positionVector.yCoord += parentNode.positionVector.yCoord; - positionVector.zCoord += parentNode.positionVector.zCoord; - } - if (doRecursive && !childNodes.isEmpty()) - { - for (int index = 0; index < childNodes.size(); index++) - { - childNodes.get(index).resetOffset(doRecursive); - } - } - } - - /** - * Sets the current neutral rotation of the bone. This is the same rotation as in - * the constructor. - * @param x the x-rotation of the bone - * @param y the y-rotation of the bone - * @param z the z-rotation of the bone - */ - public void setNeutralRotation (float x, float y, float z) - { - neutralAngles.angleX = x; - neutralAngles.angleY = y; - neutralAngles.angleZ = z; - } - - /** - * Gets the root parent bone. - * @return the root parent Bone. - */ - public Bone getRootParent () - { - if (parentNode == null) - return this; - else - return parentNode.getRootParent(); - } - - /** - * Attaches a model to the bone. Its base rotation will be set to the neutral - * rotation of the model. - * @param model the model to attach - */ - public void addModel (ModelRenderer model) - { - addModel(model, false); - } - - /** - * Attaches a model to the bone. If inherit is true, it sets the base rotation - * to the neutral rotation of the Bone, otherwise it's set to the neutral - * rotation of the model. - * @param model the model to attach - * @param inherit whether the model should inherit the Bone's base rotations - */ - public void addModel (ModelRenderer model, boolean inherit) - { - addModel(model, 0F, 0F, 0F, inherit); - } - - /** - * Attaches a model to the bone. If inherit is true, it sets the base rotation - * to the neutral rotation of the Bone, otherwise it's set to the neutral - * rotation of the model. When isUpright is set, the model will be rotated - * (-PI / 2, 0, 0). - * @param model the model to attach - * @param inherit whether the model should inherit the Bone's base rotations - * @param isUpright whether the model is modeled in the upright position - */ - public void addModel (ModelRenderer model, boolean inherit, boolean isUpright) - { - addModel(model, 0F, 0F, 0F, inherit, isUpright); - } - - /** - * Attaches a model to the bone with a given base rotation. - * @param model the model to attach - * @param x the base x-rotation - * @param y the base y-rotation - * @param z the base z-rotation - */ - public void addModel (ModelRenderer model, float x, float y, float z) - { - addModel(model, x, y, z, false); - } - - /** - * Attaches a model to the bone with a given base rotation. When inherit is - * true, it will add the Bone's neutral rotation to the given angles. - * @param model the model to attach - * @param x the base x-rotation - * @param y the base y-rotation - * @param z the base z-rotation - * @param inherit whether the model should inherit the Bone's base rotations - */ - public void addModel (ModelRenderer model, float x, float y, float z, boolean inherit) - { - addModel(model, x, y, z, inherit, false); - } - - /** - * Attaches a model to the bone with a given base rotation. When inherit is - * true, it will add the Bone's neutral rotation to the given angles. - * When isUpright is set, the model will be rotated (-PI / 2, 0, 0). - * @param model the model to attach - * @param x the base x-rotation - * @param y the base y-rotation - * @param z the base z-rotation - * @param inherit whether the model should inherit the Bone's base rotations - * @param isUpright whether the model is modeled in the upright position - */ - public void addModel (ModelRenderer model, float x, float y, float z, boolean inherit, boolean isUpright) - { - if (inherit) - { - x += neutralAngles.angleX + (isUpright ? (float) Math.PI / 2 : 0); - y += neutralAngles.angleY; - z += neutralAngles.angleZ; - } - models.add(model); - modelBaseRot.put(model, new Angle3D(x, y, z)); - } - - /** - * Removes the given model from the Bone. Always detach the model before adding - * it to another Bone. The best thing however is to just keep the model to one - * bone. - * @param model the model to remove from the bone - */ - public void removeModel (ModelRenderer model) - { - models.remove(model); - modelBaseRot.remove(model); - } - - /** - * Gets the current absolute angles. The absolute angle is calculated by getting - * the sum of all parent Bones' relative angles plus the current relative angle. - * This must be called after using the prepareDraw method. - * @return an Angle3D object which holds the current angles of the current node. - */ - public Angle3D getAbsoluteAngle () - { - return new Angle3D(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); - } - - /** - * Gets the current position of the bone. You should call this after all rotations - * and positions are applied, e.g. after prepareDraw has been called. - * @return a vector containing the current position relative to the origin. - */ - public Vec3 getPosition () - { - return Vec3.createVectorHelper(positionVector.xCoord, positionVector.yCoord, positionVector.zCoord); - } - - protected void addChildBone (Bone bone) - { - childNodes.add(bone); - } - - /** - * Prepares the bones for rendering. This will automatically take the root Bone - * if it isn't. - */ - public void prepareDraw () - { - if (parentNode != null) - parentNode.prepareDraw(); - else - { - setAbsoluteRotations(); - setVectors(); - } - } - - /** - * Sets the current rotation of the Bone, not calculating any parent bones in. - * @param x - * @param y - * @param z - */ - public void setRotations (float x, float y, float z) - { - relativeAngles.angleX = x; - relativeAngles.angleY = y; - relativeAngles.angleZ = z; - } - - protected void setAbsoluteRotations () - { - absoluteAngles.angleX = relativeAngles.angleX; - absoluteAngles.angleY = relativeAngles.angleY; - absoluteAngles.angleZ = relativeAngles.angleZ; - for (int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); - } - } - - protected void setAbsoluteRotations (float x, float y, float z) - { - absoluteAngles.angleX = relativeAngles.angleX + x; - absoluteAngles.angleY = relativeAngles.angleY + y; - absoluteAngles.angleZ = relativeAngles.angleZ + z; - for (int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); - } - - } - - protected void setVectorRotations (Vec3 vector) - { - float x = neutralAngles.angleX + absoluteAngles.angleX; - float y = neutralAngles.angleY + absoluteAngles.angleY; - float z = neutralAngles.angleZ + absoluteAngles.angleZ; - setVectorRotations(vector, x, y, z); - } - - protected void setVectorRotations (Vec3 vector, float xRot, float yRot, float zRot) - { - float x = xRot; - float y = yRot; - float z = zRot; - float xC = MathHelper.cos(x); - float xS = MathHelper.sin(x); - float yC = MathHelper.cos(y); - float yS = MathHelper.sin(y); - float zC = MathHelper.cos(z); - float zS = MathHelper.sin(z); - - double xVec = vector.xCoord; - double yVec = vector.yCoord; - double zVec = vector.zCoord; - - // rotation around x - double xy = xC * yVec - xS * zVec; - double xz = xC * zVec + xS * yVec; - // rotation around y - double yz = yC * xz - yS * xVec; - double yx = yC * xVec + yS * xz; - // rotation around z - double zx = zC * yx - zS * xy; - double zy = zC * xy + zS * yx; - - xVec = zx; - yVec = zy; - zVec = yz; - - vector.xCoord = xVec; - vector.yCoord = yVec; - vector.zCoord = zVec; - } - - protected void addVector (Vec3 destVec, Vec3 srcVec) - { - destVec.xCoord += srcVec.xCoord; - destVec.yCoord += srcVec.yCoord; - destVec.zCoord += srcVec.zCoord; - } - - protected void setVectors () - { - Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); - positionVector = Vec3.createVectorHelper(offsetX, offsetY, offsetZ); - addVector(tempVec, positionVector); - setVectorRotations(tempVec); - for (int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setVectors(tempVec); - } - } - - protected void setVectors (Vec3 vector) - { - positionVector = vector; - Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); - setVectorRotations(tempVec); - addVector(tempVec, vector); - for (int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setVectors(tempVec); - } - - } - - /** - * Sets the current angles of the Bone to the models attached to it. - */ - public void setAnglesToModels () - { - for (int i = 0; i < models.size(); i++) - { - ModelRenderer currentModel = models.get(i); - Angle3D baseAngles = modelBaseRot.get(currentModel); - currentModel.rotateAngleX = baseAngles.angleX + absoluteAngles.angleX; - currentModel.rotateAngleY = baseAngles.angleY + absoluteAngles.angleY; - currentModel.rotateAngleZ = baseAngles.angleZ + absoluteAngles.angleZ; - currentModel.rotationPointX = (float) positionVector.xCoord; - currentModel.rotationPointY = (float) positionVector.yCoord; - currentModel.rotationPointZ = (float) positionVector.zCoord; - } - - for (int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setAnglesToModels(); - } - } - - protected Angle3D neutralAngles; - public Angle3D relativeAngles; - protected Angle3D absoluteAngles; - private Vec3 positionVector; - private float length; - private Bone parentNode; - protected ArrayList childNodes; - private ArrayList models; - private Map modelBaseRot; - private float offsetX; - private float offsetY; - private float offsetZ; -} diff --git a/mods/tinker/tconstruct/client/tmt/Coord2D.java b/mods/tinker/tconstruct/client/tmt/Coord2D.java deleted file mode 100644 index c55282c2..00000000 --- a/mods/tinker/tconstruct/client/tmt/Coord2D.java +++ /dev/null @@ -1,30 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -/** - * This class represents a coordinate space and its UV coordinates. This allows for - * easier flat shape planning. - * @author GaryCXJk - * - */ -public class Coord2D -{ - public Coord2D(double x, double y) - { - xCoord = x; - yCoord = y; - uCoord = (int) Math.floor(x); - vCoord = (int) Math.floor(y); - } - - public Coord2D(double x, double y, int u, int v) - { - this(x, y); - uCoord = u; - vCoord = v; - } - - public double xCoord; - public double yCoord; - public int uCoord; - public int vCoord; -} diff --git a/mods/tinker/tconstruct/client/tmt/ModelPool.java b/mods/tinker/tconstruct/client/tmt/ModelPool.java deleted file mode 100644 index ab348ade..00000000 --- a/mods/tinker/tconstruct/client/tmt/ModelPool.java +++ /dev/null @@ -1,57 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.client.Minecraft; - -public class ModelPool -{ - public static ModelPoolEntry addFile (String file, Class modelClass, Map group, Map textureGroup) - { - ModelPoolEntry entry = null; - if (modelMap.containsKey(file)) - { - entry = modelMap.get(file); - entry.applyGroups(group, textureGroup); - return entry; - } - try - { - entry = (ModelPoolEntry) modelClass.newInstance(); - } - catch (Exception e) - { - System.out.println("A new " + entry.getClass().getName() + " could not be initialized."); - System.out.println(e.getMessage()); - return null; - } - File modelFile = null; - for (int i = 0; i < resourceDir.length && (modelFile == null || !modelFile.exists()); i++) - { - String absPath = Minecraft.getAppDir(resourceDir[i]).getAbsolutePath(); - if (!absPath.endsWith("/") || !absPath.endsWith("\\")) - absPath += "/"; - modelFile = entry.checkValidPath(absPath + file); - } - if (modelFile == null || !modelFile.exists()) - { - System.out.println("The model with the name " + file + " does not exist."); - return null; - } - entry.groups = new HashMap(); - entry.textures = new HashMap(); - entry.name = file; - entry.setGroup("0"); - entry.setTextureGroup("0"); - entry.getModel(modelFile); - entry.applyGroups(group, textureGroup); - modelMap.put(file, entry); - return entry; - } - - private static Map modelMap = new HashMap(); - private static String[] resourceDir = new String[] { "minecraft/resources/models/", "minecraft/resources/mod/models/" }; - public static final Class OBJ = ModelPoolObjEntry.class; -} diff --git a/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java b/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java deleted file mode 100644 index 74d9790d..00000000 --- a/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java +++ /dev/null @@ -1,118 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.io.File; -import java.util.Collection; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -public abstract class ModelPoolEntry -{ - public File checkValidPath (String path) - { - File file = null; - - for (int index = 0; index < fileExtensions.length && (file == null || !file.exists()); index++) - { - String absPath = path; - - if (!path.endsWith("." + fileExtensions[index])) - absPath += "." + fileExtensions[index]; - - file = new File(absPath); - } - if (file == null || !file.exists()) - return null; - return file; - } - - public abstract void getModel (File file); - - /** - * Sets the current transformation group. The transformation group is used - * to allow for vertex transformation. If a transformation group does not exist, - * a new one will be created. - * @param groupName the name of the transformation group you want to switch to - */ - protected void setGroup (String groupName) - { - setGroup(groupName, new Bone(0, 0, 0, 0), 1D); - } - - /** - * Sets the current transformation group. The transformation group is used - * to allow for vertex transformation. If a transformation group does not exist, - * a new one will be created. - * @param groupName the name of the transformation group you want to switch to - * @param bone the Bone this transformation group is attached to - * @param weight the weight of the transformation group - */ - protected void setGroup (String groupName, Bone bone, double weight) - { - if (groups.size() == 0 || !groups.containsKey(groupName)) - groups.put(groupName, new TransformGroupBone(bone, weight)); - group = groups.get(groupName); - } - - /** - * Sets the current texture group, which is used to switch the - * textures on a per-model base. Do note that any model that is - * rendered afterwards will use the same texture. To counter it, - * set a default texture, either at initialization or before - * rendering. - * @param groupName The name of the texture group. If the texture - * group doesn't exist, it creates a new group automatically. - */ - protected void setTextureGroup (String groupName) - { - if (textures.size() == 0 || !textures.containsKey(groupName)) - { - textures.put(groupName, new TextureGroup()); - } - texture = textures.get(groupName); - } - - protected void applyGroups (Map groupsMap, Map texturesMap) - { - Set groupsCol = groups.keySet(); - Collection texturesCol = textures.keySet(); - - Iterator groupsItr = groupsCol.iterator(); - Iterator texturesItr = texturesCol.iterator(); - - while (groupsItr.hasNext()) - { - int nameIdx = 0; - String groupKey = groupsItr.next(); - String currentGroup = name + "_" + nameIdx + ":" + groupKey; - while (groupsMap.size() > 0 && groupsMap.containsKey(currentGroup)) - { - nameIdx++; - currentGroup = name + "_" + nameIdx + ":" + groupKey; - } - groupsMap.put(currentGroup, groups.get(groupKey)); - } - - while (texturesItr.hasNext()) - { - int nameIdx = 0; - String groupKey = texturesItr.next(); - String currentGroup = name + "_" + nameIdx + ":" + groupKey; - while (groupsMap.size() > 0 && texturesMap.containsKey(currentGroup)) - { - nameIdx++; - currentGroup = name + "_" + nameIdx + ":" + groupKey; - } - texturesMap.put(currentGroup, textures.get(groupKey)); - } - } - - public String name; - public PositionTransformVertex[] vertices; - public TexturedPolygon[] faces; - public Map groups; - public Map textures; - protected TransformGroupBone group; - protected TextureGroup texture; - protected String[] fileExtensions; -} diff --git a/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java b/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java deleted file mode 100644 index a182c2e8..00000000 --- a/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java +++ /dev/null @@ -1,223 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.util.ArrayList; - -import net.minecraft.client.model.PositionTextureVertex; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; - -public class ModelPoolObjEntry extends ModelPoolEntry -{ - public ModelPoolObjEntry() - { - fileExtensions = new String[] { "obj" }; - } - - public void getModel (File file) - { - try - { - BufferedReader in = new BufferedReader(new FileReader(file)); - - String s; - - ArrayList verts = new ArrayList(); - ArrayList uvs = new ArrayList(); - ArrayList normals = new ArrayList(); - ArrayList face = new ArrayList(); - - while ((s = in.readLine()) != null) - { - if (s.indexOf("#") > -1) - { - s = s.substring(0, s.indexOf("#")); - } - - s = s.trim(); - - if (s.equals("")) - continue; - - if (s.startsWith("g ")) - { - setTextureGroup(s.substring(s.indexOf(" ") + 1).trim()); - continue; - } - if (s.startsWith("v ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - float[] v = new float[3]; - for (int i = 0; i < 3; i++) - { - int ind = s.indexOf(" "); - if (ind > -1) - v[i] = Float.parseFloat(s.substring(0, ind)); - else - v[i] = Float.parseFloat(s.substring(0)); - s = s.substring(s.indexOf(" ") + 1).trim(); - } - - float flt = v[2]; - v[2] = -v[1]; - v[1] = flt; - - verts.add(new PositionTransformVertex(v[0], v[1], v[2], 0, 0)); - continue; - } - if (s.startsWith("vt ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - float[] v = new float[2]; - for (int i = 0; i < 2; i++) - { - int ind = s.indexOf(" "); - if (ind > -1) - v[i] = Float.parseFloat(s.substring(0, ind)); - else - v[i] = Float.parseFloat(s.substring(0)); - s = s.substring(s.indexOf(" ") + 1).trim(); - } - - uvs.add(new float[] { v[0], 1F - v[1] }); - continue; - } - if (s.startsWith("vn ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - float[] v = new float[3]; - for (int i = 0; i < 3; i++) - { - int ind = s.indexOf(" "); - if (ind > -1) - v[i] = Float.parseFloat(s.substring(0, ind)); - else - v[i] = Float.parseFloat(s.substring(0)); - s = s.substring(s.indexOf(" ") + 1).trim(); - } - - float flt = v[2]; - v[2] = v[1]; - v[1] = flt; - - normals.add(new float[] { v[0], v[1], v[2] }); - continue; - } - if (s.startsWith("f ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - ArrayList v = new ArrayList(); - String s1; - int finalPhase = 0; - float[] normal = new float[] { 0F, 0F, 0F }; - ArrayList iNormal = new ArrayList(); - do - { - int vInt; - float[] curUV; - float[] curNormals; - int ind = s.indexOf(" "); - s1 = s; - if (ind > -1) - s1 = s.substring(0, ind); - if (s1.indexOf("/") > -1) - { - String[] f = s1.split("/"); - vInt = Integer.parseInt(f[0]) - 1; - if (f[1].equals("")) - f[1] = f[0]; - int vtInt = Integer.parseInt(f[1]) - 1; - if (uvs.size() > vtInt) - curUV = uvs.get(vtInt); - else - curUV = new float[] { 0, 0 }; - int vnInt = 0; - if (f.length == 3) - { - if (f[2].equals("")) - f[2] = f[0]; - vnInt = Integer.parseInt(f[2]) - 1; - } - else - vnInt = Integer.parseInt(f[0]) - 1; - if (normals.size() > vnInt) - curNormals = normals.get(vnInt); - else - curNormals = new float[] { 0, 0, 0 }; - } - else - { - vInt = Integer.parseInt(s1) - 1; - if (uvs.size() > vInt) - curUV = uvs.get(vInt); - else - curUV = new float[] { 0, 0 }; - if (normals.size() > vInt) - curNormals = normals.get(vInt); - else - curNormals = new float[] { 0, 0, 0 }; - } - - iNormal.add(Vec3.createVectorHelper(curNormals[0], curNormals[1], curNormals[2])); - - normal[0] += curNormals[0]; - normal[1] += curNormals[1]; - normal[2] += curNormals[2]; - - if (vInt < verts.size()) - { - v.add(verts.get(vInt).setTexturePosition(curUV[0], curUV[1])); - if (verts.get(vInt) instanceof PositionTransformVertex) - { - ((PositionTransformVertex) verts.get(vInt)).addGroup(group); - } - } - if (ind > -1) - s = s.substring(s.indexOf(" ") + 1).trim(); - else - finalPhase++; - } while (finalPhase < 1); - - float d = MathHelper.sqrt_double(normal[0] * normal[0] + normal[1] * normal[1] + normal[2] * normal[2]); - - normal[0] /= d; - normal[1] /= d; - normal[2] /= d; - - PositionTextureVertex[] vToArr = new PositionTextureVertex[v.size()]; - - for (int i = 0; i < v.size(); i++) - { - vToArr[i] = v.get(i); - } - - TexturedPolygon poly = new TexturedPolygon(vToArr); - poly.setNormals(normal[0], normal[1], normal[2]); - poly.setNormals(iNormal); - - face.add(poly); - texture.addPoly(poly); - continue; - } - } - - vertices = new PositionTransformVertex[verts.size()]; - for (int i = 0; i < verts.size(); i++) - { - vertices[i] = verts.get(i); - } - faces = new TexturedPolygon[face.size()]; - for (int i = 0; i < face.size(); i++) - { - faces[i] = face.get(i); - } - in.close(); - } - catch (Throwable e) - { - - } - } -} diff --git a/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java b/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java deleted file mode 100644 index 086b3e57..00000000 --- a/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java +++ /dev/null @@ -1,1905 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.model.PositionTextureVertex; -import net.minecraft.client.model.TexturedQuad; -import net.minecraft.client.renderer.GLAllocation; -import net.minecraft.client.renderer.RenderEngine; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -/** - * An extension to the ModelRenderer class. It basically is a copy to ModelRenderer, - * however, it contains various new methods to make your models. - *

- * Since the ModelRendererTurbo class gets loaded during startup, the models made - * can be very complex. This is why I can afford to add, for example, Wavefont OBJ - * support or have the addSprite method, methods that add a lot of vertices and - * polygons. - * @author GaryCXJk - * - */ -public class ModelRendererTurbo extends ModelRenderer -{ - public ModelRendererTurbo(ModelBase modelbase, String s) - { - super(modelbase, s); - flip = false; - compiled = false; - displayList = 0; - mirror = false; - showModel = true; - field_1402_i = false; - vertices = new PositionTextureVertex[0]; - faces = new TexturedPolygon[0]; - forcedRecompile = false; - transformGroup = new HashMap(); - transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D)); - textureGroup = new HashMap(); - textureGroup.put("0", new TextureGroup()); - currentTextureGroup = textureGroup.get("0"); - boxName = s; - - defaultTexture = ""; - - useLegacyCompiler = false; - } - - public ModelRendererTurbo(ModelBase modelbase) - { - this(modelbase, null); - } - - /** - * Creates a new ModelRenderTurbo object. It requires the coordinates of the - * position of the texture. - * @param modelbase - * @param textureX the x-coordinate on the texture - * @param textureY the y-coordinate on the texture - */ - public ModelRendererTurbo(ModelBase modelbase, int textureX, int textureY) - { - this(modelbase, textureX, textureY, 64, 32); - } - - /** - * Creates a new ModelRenderTurbo object. It requires the coordinates of the - * position of the texture, but also allows you to specify the width and height - * of the texture, allowing you to use bigger textures instead. - * @param modelbase - * @param textureX - * @param textureY - * @param textureU - * @param textureV - */ - public ModelRendererTurbo(ModelBase modelbase, int textureX, int textureY, int textureU, int textureV) - { - this(modelbase); - textureOffsetX = textureX; - textureOffsetY = textureY; - textureWidth = textureU; - textureHeight = textureV; - } - - /** - * Creates a new polygon. - * @param verts an array of vertices - */ - public void addPolygon (PositionTextureVertex[] verts) - { - copyTo(verts, new TexturedPolygon[] { new TexturedPolygon(verts) }); - } - - /** - * Creates a new polygon, and adds UV mapping to it. - * @param verts an array of vertices - * @param uv an array of UV coordinates - */ - public void addPolygon (PositionTextureVertex[] verts, int[][] uv) - { - try - { - for (int i = 0; i < verts.length; i++) - { - verts[i] = verts[i].setTexturePosition((float) uv[i][0] / textureWidth, (float) uv[i][1] / textureHeight); - } - } - finally - { - addPolygon(verts); - } - } - - /** - * Creates a new polygon with a given UV. - * @param verts an array of vertices - * @param u1 - * @param v1 - * @param u2 - * @param v2 - */ - public void addPolygon (PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) - { - copyTo(verts, new TexturedPolygon[] { addPolygonReturn(verts, u1, v1, u2, v2) }); - } - - private TexturedPolygon addPolygonReturn (PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) - { - if (verts.length < 3) - return null; - float uOffs = 1.0F / ((float) textureWidth * 10.0F); - float vOffs = 1.0F / ((float) textureHeight * 10.0F); - if (verts.length < 4) - { - float xMin = -1; - float yMin = -1; - float xMax = 0; - float yMax = 0; - - for (int i = 0; i < verts.length; i++) - { - float xPos = verts[i].texturePositionX; - float yPos = verts[i].texturePositionY; - xMax = Math.max(xMax, xPos); - xMin = (xMin < -1 ? xPos : Math.min(xMin, xPos)); - yMax = Math.max(yMax, yPos); - yMin = (yMin < -1 ? yPos : Math.min(yMin, yPos)); - } - float uMin = (float) u1 / (float) textureWidth + uOffs; - float vMin = (float) v1 / (float) textureHeight + vOffs; - float uSize = (float) (u2 - u1) / (float) textureWidth - uOffs * 2; - float vSize = (float) (v2 - v1) / (float) textureHeight - vOffs * 2; - - float xSize = xMax - xMin; - float ySize = yMax - yMin; - for (int i = 0; i < verts.length; i++) - { - float xPos = verts[i].texturePositionX; - float yPos = verts[i].texturePositionY; - xPos = (xPos - xMin) / xSize; - yPos = (yPos - yMin) / ySize; - verts[i] = verts[i].setTexturePosition(uMin + (xPos * uSize), vMin + (yPos * vSize)); - } - } - else - { - verts[0] = verts[0].setTexturePosition((float) u2 / (float) textureWidth - uOffs, (float) v1 / (float) textureHeight + vOffs); - verts[1] = verts[1].setTexturePosition((float) u1 / (float) textureWidth + uOffs, (float) v1 / (float) textureHeight + vOffs); - verts[2] = verts[2].setTexturePosition((float) u1 / (float) textureWidth + uOffs, (float) v2 / (float) textureHeight - vOffs); - verts[3] = verts[3].setTexturePosition((float) u2 / (float) textureWidth - uOffs, (float) v2 / (float) textureHeight - vOffs); - } - return new TexturedPolygon(verts); - } - - /** - * Adds a rectangular shape. Basically, you can make any eight-pointed shape you want, - * as the method requires eight vector coordinates. - * @param v a float array with three values, the x, y and z coordinates of the vertex - * @param v1 a float array with three values, the x, y and z coordinates of the vertex - * @param v2 a float array with three values, the x, y and z coordinates of the vertex - * @param v3 a float array with three values, the x, y and z coordinates of the vertex - * @param v4 a float array with three values, the x, y and z coordinates of the vertex - * @param v5 a float array with three values, the x, y and z coordinates of the vertex - * @param v6 a float array with three values, the x, y and z coordinates of the vertex - * @param v7 a float array with three values, the x, y and z coordinates of the vertex - * @param w the width of the shape, used in determining the texture - * @param h the height of the shape, used in determining the texture - * @param d the depth of the shape, used in determining the texture - */ - public void addRectShape (float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d) - { - PositionTextureVertex[] verts = new PositionTextureVertex[8]; - TexturedPolygon[] poly = new TexturedPolygon[6]; - PositionTextureVertex positionTexturevertex = new PositionTextureVertex(v[0], v[1], v[2], 0.0F, 0.0F); - PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(v1[0], v1[1], v1[2], 0.0F, 8F); - PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(v2[0], v2[1], v2[2], 8F, 8F); - PositionTextureVertex positionTexturevertex3 = new PositionTextureVertex(v3[0], v3[1], v3[2], 8F, 0.0F); - PositionTextureVertex positionTexturevertex4 = new PositionTextureVertex(v4[0], v4[1], v4[2], 0.0F, 0.0F); - PositionTextureVertex positionTexturevertex5 = new PositionTextureVertex(v5[0], v5[1], v5[2], 0.0F, 8F); - PositionTextureVertex positionTexturevertex6 = new PositionTextureVertex(v6[0], v6[1], v6[2], 8F, 8F); - PositionTextureVertex positionTexturevertex7 = new PositionTextureVertex(v7[0], v7[1], v7[2], 8F, 0.0F); - verts[0] = positionTexturevertex; - verts[1] = positionTexturevertex1; - verts[2] = positionTexturevertex2; - verts[3] = positionTexturevertex3; - verts[4] = positionTexturevertex4; - verts[5] = positionTexturevertex5; - verts[6] = positionTexturevertex6; - verts[7] = positionTexturevertex7; - poly[0] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 }, textureOffsetX + d + w, - textureOffsetY + d, textureOffsetX + d + w + d, textureOffsetY + d + h); - poly[1] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 }, textureOffsetX + 0, textureOffsetY - + d, textureOffsetX + d, textureOffsetY + d + h); - poly[2] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 }, textureOffsetX + d, - textureOffsetY + 0, textureOffsetX + d + w, textureOffsetY + d); - poly[3] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 }, textureOffsetX + d + w, - textureOffsetY + 0, textureOffsetX + d + w + w, textureOffsetY + d); - poly[4] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 }, textureOffsetX + d, textureOffsetY - + d, textureOffsetX + d + w, textureOffsetY + d + h); - poly[5] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 }, textureOffsetX + d + w + d, - textureOffsetY + d, textureOffsetX + d + w + d + w, textureOffsetY + d + h); - if (mirror ^ flip) - { - for (int l = 0; l < poly.length; l++) - { - poly[l].flipFace(); - } - - } - - copyTo(verts, poly); - } - - /** - * Adds a new box to the model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width (over the x-direction) - * @param h the height (over the y-direction) - * @param d the depth (over the z-direction) - */ - public ModelRendererTurbo addBox (float x, float y, float z, int w, int h, int d) - { - addBox(x, y, z, w, h, d, 0.0F); - return this; - } - - /** - * Adds a new box to the model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width (over the x-direction) - * @param h the height (over the y-direction) - * @param d the depth (over the z-direction) - * @param expansion the expansion of the box. It increases the size in each direction by that many. - */ - public void addBox (float x, float y, float z, int w, int h, int d, float expansion) - { - addBox(x, y, z, w, h, d, expansion, 1F); - } - - /** - * Adds a new box to the model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width (over the x-direction) - * @param h the height (over the y-direction) - * @param d the depth (over the z-direction) - * @param expansion the expansion of the box. It increases the size in each direction by that many. It's independent from the scale. - * @param scale - */ - public void addBox (float x, float y, float z, int w, int h, int d, float expansion, float scale) - { - float scaleX = (float) w * scale; - float scaleY = (float) h * scale; - float scaleZ = (float) d * scale; - - float x1 = x + scaleX; - float y1 = y + scaleY; - float z1 = z + scaleZ; - - float expX = expansion + scaleX - (float) w; - float expY = expansion + scaleY - (float) h; - float expZ = expansion + scaleZ - (float) d; - - x -= expX; - y -= expY; - z -= expZ; - x1 += expansion; - y1 += expansion; - z1 += expansion; - if (mirror) - { - float xTemp = x1; - x1 = x; - x = xTemp; - } - - float[] v = { x, y, z }; - float[] v1 = { x1, y, z }; - float[] v2 = { x1, y1, z }; - float[] v3 = { x, y1, z }; - float[] v4 = { x, y, z1 }; - float[] v5 = { x1, y, z1 }; - float[] v6 = { x1, y1, z1 }; - float[] v7 = { x, y1, z1 }; - addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); - } - - /** - * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. - * You can use the static variables MR_RIGHT, MR_LEFT, - * MR_FRONT, MR_BACK, MR_TOP and - * MR_BOTTOM. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width (over the x-direction) - * @param h the height (over the y-direction) - * @param d the depth (over the z-direction) - * @param scale the "scale" of the box. It only increases the size in each direction by that many. - * @param bottomScale the "scale" of the bottom - * @param dir the side the scaling is applied to - */ - public void addTrapezoid (float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir) - { - float width = x + (float) w; - float height = y + (float) h; - float depth = z + (float) d; - x -= scale; - y -= scale; - z -= scale; - width += scale; - height += scale; - depth += scale; - - int m = (mirror ? -1 : 1); - if (mirror) - { - float f7 = width; - width = x; - x = f7; - } - - float[] v = { x, y, z }; - float[] v1 = { width, y, z }; - float[] v2 = { width, height, z }; - float[] v3 = { x, height, z }; - float[] v4 = { x, y, depth }; - float[] v5 = { width, y, depth }; - float[] v6 = { width, height, depth }; - float[] v7 = { x, height, depth }; - - switch (dir) - { - case MR_RIGHT: - v[1] -= bottomScale; - v[2] -= bottomScale; - v3[1] += bottomScale; - v3[2] -= bottomScale; - v4[1] -= bottomScale; - v4[2] += bottomScale; - v7[1] += bottomScale; - v7[2] += bottomScale; - break; - case MR_LEFT: - v1[1] -= bottomScale; - v1[2] -= bottomScale; - v2[1] += bottomScale; - v2[2] -= bottomScale; - v5[1] -= bottomScale; - v5[2] += bottomScale; - v6[1] += bottomScale; - v6[2] += bottomScale; - break; - case MR_FRONT: - v[0] -= m * bottomScale; - v[1] -= bottomScale; - v1[0] += m * bottomScale; - v1[1] -= bottomScale; - v2[0] += m * bottomScale; - v2[1] += bottomScale; - v3[0] -= m * bottomScale; - v3[1] += bottomScale; - break; - case MR_BACK: - v4[0] -= m * bottomScale; - v4[1] -= bottomScale; - v5[0] += m * bottomScale; - v5[1] -= bottomScale; - v6[0] += m * bottomScale; - v6[1] += bottomScale; - v7[0] -= m * bottomScale; - v7[1] += bottomScale; - break; - case MR_TOP: - v[0] -= m * bottomScale; - v[2] -= bottomScale; - v1[0] += m * bottomScale; - v1[2] -= bottomScale; - v4[0] -= m * bottomScale; - v4[2] += bottomScale; - v5[0] += m * bottomScale; - v5[2] += bottomScale; - break; - case MR_BOTTOM: - v2[0] += m * bottomScale; - v2[2] -= bottomScale; - v3[0] -= m * bottomScale; - v3[2] -= bottomScale; - v6[0] += m * bottomScale; - v6[2] += bottomScale; - v7[0] -= m * bottomScale; - v7[2] += bottomScale; - break; - } - - addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); - } - - /** - * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. - * You can use the static variables MR_RIGHT, MR_LEFT, - * MR_FRONT, MR_BACK, MR_TOP and - * MR_BOTTOM. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width (over the x-direction) - * @param h the height (over the y-direction) - * @param d the depth (over the z-direction) - * @param scale the "scale" of the box. It only increases the size in each direction by that many. - * @param bottomScale the "scale" of the bottom - * @param dir the side the scaling is applied to - */ - /*public void addTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir) - { - float width = x + (float)w; - float height = y + (float)h; - float depth = z + (float)d; - x -= scale; - y -= scale; - z -= scale; - width += scale; - height += scale; - depth += scale; - - int m = (mirror ? -1 : 1); - if(mirror) - { - float f7 = width; - width = x; - x = f7; - } - - float[] v = {x, y, z}; - float[] v1 = {width, y, z}; - float[] v2 = {width, height, z}; - float[] v3 = {x, height, z}; - float[] v4 = {x, y, depth}; - float[] v5 = {width, y, depth}; - float[] v6 = {width, height, depth}; - float[] v7 = {x, height, depth}; - - switch(dir) - { - case MR_RIGHT: - v[1] -= bottomScale; - v[2] -= bottomScale; - v3[1] += bottomScale; - v3[2] -= bottomScale; - v4[1] -= bottomScale; - v4[2] += bottomScale; - v7[1] += bottomScale; - v7[2] += bottomScale; - break; - case MR_LEFT: - v1[1] -= bottomScale; - v1[2] -= bottomScale; - v2[1] += bottomScale; - v2[2] -= bottomScale; - v5[1] -= bottomScale; - v5[2] += bottomScale; - v6[1] += bottomScale; - v6[2] += bottomScale; - break; - case MR_FRONT: - v[0] -= m * bottomScale; - v[1] -= bottomScale; - v1[0] += m * bottomScale; - v1[1] -= bottomScale; - v2[0] += m * bottomScale; - v2[1] += bottomScale; - v3[0] -= m * bottomScale; - v3[1] += bottomScale; - break; - case MR_BACK: - v4[0] -= m * bottomScale; - v4[1] -= bottomScale; - v5[0] += m * bottomScale; - v5[1] -= bottomScale; - v6[0] += m * bottomScale; - v6[1] += bottomScale; - v7[0] -= m * bottomScale; - v7[1] += bottomScale; - break; - case MR_TOP: - v[0] -= m * bottomScale; - v[2] -= bottomScale; - v1[0] += m * bottomScale; - v1[2] -= bottomScale; - v4[0] -= m * bottomScale; - v4[2] += bottomScale; - v5[0] += m * bottomScale; - v5[2] += bottomScale; - break; - case MR_BOTTOM: - v2[0] += m * bottomScale; - v2[2] -= bottomScale; - v3[0] -= m * bottomScale; - v3[2] -= bottomScale; - v6[0] += m * bottomScale; - v6[2] += bottomScale; - v7[0] -= m * bottomScale; - v7[2] += bottomScale; - break; - } - - addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); - }*/ - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param coordinates an array of coordinates that form the shape - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param direction the direction the starting point of the shape is facing - */ - public void addShape3D (float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) - { - addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); - } - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param coordinates an array of coordinates that form the shape - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param direction the direction the starting point of the shape is facing - * @param faceLengths An array with the length of each face. Used to set - * the texture width of each face on the side manually. - */ - public void addShape3D (float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, - float[] faceLengths) - { - addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); - } - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param coordinates an ArrayList of coordinates that form the shape - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param direction the direction the starting point of the shape is facing - */ - public void addShape3D (float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, - int direction) - { - addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); - } - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param coordinates an ArrayList of coordinates that form the shape - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param direction the direction the starting point of the shape is facing - * @param faceLengths An array with the length of each face. Used to set - * the texture width of each face on the side manually. - */ - public void addShape3D (float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, - int direction, float[] faceLengths) - { - addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); - } - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param shape a Shape2D which contains the coordinates of the shape points - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param direction the direction the starting point of the shape is facing - */ - public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) - { - addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); - } - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param shape a Shape2D which contains the coordinates of the shape points - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param direction the direction the starting point of the shape is facing - * @param faceLengths An array with the length of each face. Used to set - * the texture width of each face on the side manually. - */ - public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, - float[] faceLengths) - { - float rotX = 0; - float rotY = 0; - float rotZ = 0; - switch (direction) - { - case MR_LEFT: - rotY = pi / 2; - break; - case MR_RIGHT: - rotY = -pi / 2; - break; - case MR_TOP: - rotX = pi / 2; - break; - case MR_BOTTOM: - rotX = -pi / 2; - break; - case MR_FRONT: - rotY = pi; - break; - case MR_BACK: - break; - } - addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, faceLengths); - } - - /** - * Creates a shape from a 2D vector shape. - * @param x the starting x position - * @param y the starting y position - * @param z the starting z position - * @param shape a Shape2D which contains the coordinates of the shape points - * @param depth the depth of the shape - * @param shapeTextureWidth the width of the texture of one side of the shape - * @param shapeTextureHeight the height of the texture the shape - * @param sideTextureWidth the width of the texture of the side of the shape - * @param sideTextureHeight the height of the texture of the side of the shape - * @param rotX the rotation around the x-axis - * @param rotY the rotation around the y-axis - * @param rotZ the rotation around the z-axis - */ - public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, - float rotZ) - { - addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, null); - } - - public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, - float rotZ, float[] faceLengths) - { - Shape3D shape3D = shape.extrude(x, y, z, rotX, rotY, rotZ, depth, textureOffsetX, textureOffsetY, textureWidth, textureHeight, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, - sideTextureHeight, faceLengths); - - if (flip) - { - for (int idx = 0; idx < shape3D.faces.length; idx++) - { - shape3D.faces[idx].flipFace(); - } - } - - copyTo(shape3D.vertices, shape3D.faces); - } - - /** - * Adds a cube the size of one pixel. It will take a pixel from the texture and - * uses that as the texture of said cube. The accurate name would actually be - * "addVoxel". This method has been added to make it more compatible with Techne, - * and allows for easy single-colored boxes. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param width the width of the box - * @param height the height of the box - * @param length the length of the box - */ - public void addPixel (float x, float y, float z, float width, float height, float length) - { - addPixel(x, y, z, new float[] { width, height, length }, textureOffsetX, textureOffsetY); - } - - /** - * Adds a cube the size of one pixel. It will take a pixel from the texture and - * uses that as the texture of said cube. The accurate name would actually be - * "addVoxel". It will not overwrite the model data, but rather, it will add to - * the model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param scale the "scale" of the cube, where scale is a float integer consisting of three values - * @param w the x-coordinate on the texture - * @param h the y-coordinate on the texture - */ - public void addPixel (float x, float y, float z, float[] scale, int w, int h) - { - PositionTextureVertex[] verts = new PositionTextureVertex[8]; - TexturedPolygon[] poly = new TexturedPolygon[6]; - - float x1 = x + scale[0]; - float y1 = y + scale[1]; - float z1 = z + scale[2]; - - float[] f = { x, y, z }; - float[] f1 = { x1, y, z }; - float[] f2 = { x1, y1, z }; - float[] f3 = { x, y1, z }; - float[] f4 = { x, y, z1 }; - float[] f5 = { x1, y, z1 }; - float[] f6 = { x1, y1, z1 }; - float[] f7 = { x, y1, z1 }; - PositionTextureVertex positionTexturevertex = new PositionTextureVertex(f[0], f[1], f[2], 0.0F, 0.0F); - PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(f1[0], f1[1], f1[2], 0.0F, 8F); - PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(f2[0], f2[1], f2[2], 8F, 8F); - PositionTextureVertex positionTexturevertex3 = new PositionTextureVertex(f3[0], f3[1], f3[2], 8F, 0.0F); - PositionTextureVertex positionTexturevertex4 = new PositionTextureVertex(f4[0], f4[1], f4[2], 0.0F, 0.0F); - PositionTextureVertex positionTexturevertex5 = new PositionTextureVertex(f5[0], f5[1], f5[2], 0.0F, 8F); - PositionTextureVertex positionTexturevertex6 = new PositionTextureVertex(f6[0], f6[1], f6[2], 8F, 8F); - PositionTextureVertex positionTexturevertex7 = new PositionTextureVertex(f7[0], f7[1], f7[2], 8F, 0.0F); - - verts[0] = positionTexturevertex; - verts[1] = positionTexturevertex1; - verts[2] = positionTexturevertex2; - verts[3] = positionTexturevertex3; - verts[4] = positionTexturevertex4; - verts[5] = positionTexturevertex5; - verts[6] = positionTexturevertex6; - verts[7] = positionTexturevertex7; - - poly[0] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 }, w, h, w + 1, h + 1); - poly[1] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 }, w, h, w + 1, h + 1); - poly[2] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 }, w, h, w + 1, h + 1); - poly[3] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 }, w, h, w + 1, h + 1); - poly[4] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 }, w, h, w + 1, h + 1); - poly[5] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 }, w, h, w + 1, h + 1); - - copyTo(verts, poly); - } - - /** - * Creates a model shaped like the exact image on the texture. Note that this method will - * increase the amount of quads on your model, which could effectively slow down your - * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this - * method to create your model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width of the sprite - * @param h the height of the sprite - * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. - */ - public void addSprite (float x, float y, float z, int w, int h, float expansion) - { - addSprite(x, y, z, w, h, 1, false, false, false, false, false, expansion); - } - - /** - * Creates a model shaped like the exact image on the texture. Note that this method will - * increase the amount of quads on your model, which could effectively slow down your - * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this - * method to create your model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width of the sprite - * @param h the height of the sprite - * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis - * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis - * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis - * @param mirrorX a boolean to define if the sprite should be mirrored - * @param mirrorY a boolean to define if the sprite should be flipped - * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. - */ - public void addSprite (float x, float y, float z, int w, int h, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) - { - addSprite(x, y, z, w, h, 1, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); - } - - /** - * Creates a model shaped like the exact image on the texture. Note that this method will - * increase the amount of quads on your model, which could effectively slow down your - * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this - * method to create your model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width of the sprite - * @param h the height of the sprite - * @param d the depth of the shape itself - * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis - * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis - * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis - * @param mirrorX a boolean to define if the sprite should be mirrored - * @param mirrorY a boolean to define if the sprite should be flipped - * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. - */ - public void addSprite (float x, float y, float z, int w, int h, int d, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) - { - addSprite(x, y, z, w, h, d, 1.0F, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); - } - - /** - * Creates a model shaped like the exact image on the texture. Note that this method will - * increase the amount of quads on your model, which could effectively slow down your - * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this - * method to create your model. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param w the width of the sprite - * @param h the height of the sprite - * @param d the depth of the shape itself - * @param pixelScale the scale of each individual pixel - * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis - * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis - * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis - * @param mirrorX a boolean to define if the sprite should be mirrored - * @param mirrorY a boolean to define if the sprite should be flipped - * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. - */ - public void addSprite (float x, float y, float z, int w, int h, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) - { - String[] mask = new String[h]; - char[] str = new char[w]; - Arrays.fill(str, '1'); - Arrays.fill(mask, new String(str)); - - addSprite(x, y, z, mask, d, pixelScale, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); - } - - /** - * Creates a model shaped like the exact image on the texture. Note that this method will - * increase the amount of quads on your model, which could effectively slow down your - * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this - * method to create your model. - *

- * This method uses a mask string. This way you can reduce the amount of quads used. To - * use this, create a String array, where you use a 1 to signify that the pixel will be - * drawn. Any other character will cause that pixel to not be drawn. - * @param x the starting x-position - * @param y the starting y-position - * @param z the starting z-position - * @param mask an array with the mask string - * @param d the depth of the shape itself - * @param pixelScale the scale of each individual pixel - * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis - * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis - * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis - * @param mirrorX a boolean to define if the sprite should be mirrored - * @param mirrorY a boolean to define if the sprite should be flipped - * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. - */ - public void addSprite (float x, float y, float z, String[] mask, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) - { - int w = mask[0].length(); - int h = mask.length; - - float x1 = x - expansion; - float y1 = y - expansion; - float z1 = z - expansion; - - int wDir = 0; - int hDir = 0; - int dDir = 0; - - float wScale = 1F + (expansion / ((float) w * pixelScale)); - float hScale = 1F + (expansion / ((float) h * pixelScale)); - - if (!rotX) - { - if (!rotY) - { - if (!rotZ) - { - wDir = 0; - hDir = 1; - dDir = 2; - } - else - { - wDir = 1; - hDir = 0; - dDir = 2; - } - } - else - { - if (!rotZ) - { - wDir = 2; - hDir = 1; - dDir = 0; - } - else - { - wDir = 2; - hDir = 0; - dDir = 1; - } - } - } - else - { - if (!rotY) - { - if (!rotZ) - { - wDir = 0; - hDir = 2; - dDir = 1; - } - else - { - wDir = 1; - hDir = 2; - dDir = 0; - } - } - else - { - if (!rotZ) - { - wDir = 2; - hDir = 0; - dDir = 1; - } - else - { - wDir = 2; - hDir = 1; - dDir = 0; - } - } - } - - int texStartX = textureOffsetX + (mirrorX ? w * 1 - 1 : 0); - int texStartY = textureOffsetY + (mirrorY ? h * 1 - 1 : 0); - int texDirX = (mirrorX ? -1 : 1); - int texDirY = (mirrorY ? -1 : 1); - - float wVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, wDir, 1, 1); - float hVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, hDir, 1, 1); - float dVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, dDir, 1, 1); - - for (int i = 0; i < w; i++) - { - for (int j = 0; j < h; j++) - { - if (mask[j].charAt(i) == '1') - { - addPixel(x1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 0, i, j), y1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 1, i, j), - z1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 2, i, j), new float[] { wVoxSize, hVoxSize, dVoxSize }, texStartX + texDirX * i, texStartY + texDirY * j); - } - } - } - } - - private float getPixelSize (float wScale, float hScale, float dScale, int wDir, int hDir, int checkDir, int texPosX, int texPosY) - { - return (wDir == checkDir ? wScale * texPosX : (hDir == checkDir ? hScale * texPosY : dScale)); - } - - /** - * Adds a spherical shape. - * @param x - * @param y - * @param z - * @param r - * @param segs - * @param rings - * @param textureW - * @param textureH - */ - public void addSphere (float x, float y, float z, float r, int segs, int rings, int textureW, int textureH) - { - if (segs < 3) - segs = 3; - rings++; - PositionTextureVertex[] tempVerts = new PositionTextureVertex[segs * (rings - 1) + 2]; - TexturedPolygon[] poly = new TexturedPolygon[segs * rings]; - - tempVerts[0] = new PositionTextureVertex(x, y - r, z, 0, 0); - tempVerts[tempVerts.length - 1] = new PositionTextureVertex(x, y + r, z, 0, 0); - - float uOffs = 1.0F / ((float) textureWidth * 10.0F); - float vOffs = 1.0F / ((float) textureHeight * 10.0F); - float texW = (float) textureW / (float) textureWidth - 2F * uOffs; - float texH = (float) textureH / (float) textureHeight - 2F * vOffs; - float segW = texW / (float) segs; - float segH = texH / (float) rings; - float startU = (float) textureOffsetX / (float) textureWidth; - float startV = (float) textureOffsetY / (float) textureHeight; - - int currentFace = 0; - - for (int j = 1; j < rings; j++) - { - for (int i = 0; i < segs; i++) - { - float yWidth = MathHelper.cos(-pi / 2 + (pi / (float) rings) * (float) j); - float yHeight = MathHelper.sin(-pi / 2 + (pi / (float) rings) * (float) j); - float xSize = MathHelper.sin((pi / (float) segs) * i * 2F + pi) * yWidth; - float zSize = -MathHelper.cos((pi / (float) segs) * i * 2F + pi) * yWidth; - int curVert = 1 + i + segs * (j - 1); - tempVerts[curVert] = new PositionTextureVertex(x + xSize * r, y + yHeight * r, z + zSize * r, 0, 0); - if (i > 0) - { - PositionTextureVertex[] verts; - if (j == 1) - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); - verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); - verts[2] = tempVerts[0].setTexturePosition(startU + segW * (i - 1), startV); - verts[3] = tempVerts[0].setTexturePosition(startU + segW + segW * i, startV); - } - else - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); - verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); - verts[2] = tempVerts[curVert - 1 - segs].setTexturePosition(startU + segW * (i - 1), startV + segH * (j - 1)); - verts[3] = tempVerts[curVert - segs].setTexturePosition(startU + segW * i, startV + segH * (j - 1)); - } - poly[currentFace] = new TexturedPolygon(verts); - currentFace++; - } - } - PositionTextureVertex[] verts; - if (j == 1) - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[1].setTexturePosition(startU + segW * segs, startV + segH * j); - verts[1] = tempVerts[segs].setTexturePosition(startU + segW * (segs - 1), startV + segH * j); - verts[2] = tempVerts[0].setTexturePosition(startU + segW * (segs - 1), startV); - verts[3] = tempVerts[0].setTexturePosition(startU + segW * segs, startV); - } - else - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[1 + segs * (j - 1)].setTexturePosition(startU + texW, startV + segH * j); - verts[1] = tempVerts[segs * (j - 1) + segs].setTexturePosition(startU + texW - segW, startV + segH * j); - verts[2] = tempVerts[segs * (j - 1)].setTexturePosition(startU + texW - segW, startV + segH * (j - 1)); - verts[3] = tempVerts[1 + segs * (j - 1) - segs].setTexturePosition(startU + texW, startV + segH * (j - 1)); - } - poly[currentFace] = new TexturedPolygon(verts); - currentFace++; - } - for (int i = 0; i < segs; i++) - { - PositionTextureVertex[] verts = new PositionTextureVertex[3]; - int curVert = tempVerts.length - (segs + 1); - verts[0] = tempVerts[tempVerts.length - 1].setTexturePosition(startU + segW * (i + 0.5F), startV + texH); - verts[1] = tempVerts[curVert + i].setTexturePosition(startU + segW * i, startV + texH - segH); - verts[2] = tempVerts[curVert + ((i + 1) % segs)].setTexturePosition(startU + segW * (i + 1), startV + texH - segH); - poly[currentFace] = new TexturedPolygon(verts); - currentFace++; - } - - copyTo(tempVerts, poly); - } - - /** - * Adds a cone. - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - */ - public void addCone (float x, float y, float z, float radius, float length, int segments) - { - addCone(x, y, z, radius, length, segments, 1F); - } - - /** - * Adds a cone. - * - * baseScale cannot be zero. If it is, it will automatically be set to 1F. - * - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - * @param baseScale the scaling of the base. Can be negative. - */ - public void addCone (float x, float y, float z, float radius, float length, int segments, float baseScale) - { - addCone(x, y, z, radius, length, segments, baseScale, MR_TOP); - } - - /** - * Adds a cone. - * - * baseScale cannot be zero. If it is, it will automatically be set to 1F. - * - * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in - * the top being placed at the (x,y,z). - * - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - * @param baseScale the scaling of the base. Can be negative. - * @param baseDirection the direction it faces - */ - public void addCone (float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection) - { - addCone(x, y, z, radius, length, segments, baseScale, baseDirection, (int) Math.floor(radius * 2F), (int) Math.floor(radius * 2F)); - } - - /** - * Adds a cone. - * - * baseScale cannot be zero. If it is, it will automatically be set to 1F. - * - * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in - * the top being placed at the (x,y,z). - * - * The textures for the sides are placed next to each other. - * - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - * @param baseScale the scaling of the base. Can be negative. - * @param baseDirection the direction it faces - * @param textureCircleDiameterW the diameter width of the circle on the texture - * @param textureCircleDiameterH the diameter height of the circle on the texture - */ - public void addCone (float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH) - { - addCylinder(x, y, z, radius, length, segments, baseScale, 0.0F, baseDirection, textureCircleDiameterW, textureCircleDiameterH, 1); - } - - /** - * Adds a cylinder. - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - */ - public void addCylinder (float x, float y, float z, float radius, float length, int segments) - { - addCylinder(x, y, z, radius, length, segments, 1F, 1F); - } - - /** - * Adds a cylinder. - * - * You can make cones by either setting baseScale or topScale to zero. Setting both - * to zero will set the baseScale to 1F. - * - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - * @param baseScale the scaling of the base. Can be negative. - * @param topScale the scaling of the top. Can be negative. - */ - public void addCylinder (float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale) - { - addCylinder(x, y, z, radius, length, segments, baseScale, topScale, MR_TOP); - } - - /** - * Adds a cylinder. - * - * You can make cones by either setting baseScale or topScale to zero. Setting both - * to zero will set the baseScale to 1F. - * - * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in - * the top being placed at the (x,y,z). - * - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - * @param baseScale the scaling of the base. Can be negative. - * @param topScale the scaling of the top. Can be negative. - * @param baseDirection the direction it faces - */ - public void addCylinder (float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection) - { - addCylinder(x, y, z, radius, length, segments, baseScale, topScale, baseDirection, (int) Math.floor(radius * 2F), (int) Math.floor(radius * 2F), (int) Math.floor(length)); - } - - /** - * Adds a cylinder. - * - * You can make cones by either setting baseScale or topScale to zero. Setting both - * to zero will set the baseScale to 1F. - * - * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in - * the top being placed at the (x,y,z). - * - * The textures for the base and top are placed next to each other, while the body - * will be placed below the circles. - * - * @param x the x-position of the base - * @param y the y-position of the base - * @param z the z-position of the base - * @param radius the radius of the cylinder - * @param length the length of the cylinder - * @param segments the amount of segments the cylinder is made of - * @param baseScale the scaling of the base. Can be negative. - * @param topScale the scaling of the top. Can be negative. - * @param baseDirection the direction it faces - * @param textureCircleDiameterW the diameter width of the circle on the texture - * @param textureCircleDiameterH the diameter height of the circle on the texture - * @param textureH the height of the texture of the body - */ - public void addCylinder (float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection, int textureCircleDiameterW, - int textureCircleDiameterH, int textureH) - { - boolean dirTop = (baseDirection == MR_TOP || baseDirection == MR_BOTTOM); - boolean dirSide = (baseDirection == MR_RIGHT || baseDirection == MR_LEFT); - boolean dirFront = (baseDirection == MR_FRONT || baseDirection == MR_BACK); - boolean dirMirror = (baseDirection == MR_LEFT || baseDirection == MR_BOTTOM || baseDirection == MR_BACK); - - boolean coneBase = (baseScale == 0); - boolean coneTop = (topScale == 0); - - if (coneBase && coneTop) - { - baseScale = 1F; - coneBase = false; - } - - PositionTextureVertex[] tempVerts = new PositionTextureVertex[segments * (coneBase || coneTop ? 1 : 2) + 2]; - TexturedPolygon[] poly = new TexturedPolygon[segments * (coneBase || coneTop ? 2 : 3)]; - - float xLength = (dirSide ? length : 0); - float yLength = (dirTop ? length : 0); - float zLength = (dirFront ? length : 0); - - float xStart = (dirMirror ? x + xLength : x); - float yStart = (dirMirror ? y + yLength : y); - float zStart = (dirMirror ? z + zLength : z); - float xEnd = (!dirMirror ? x + xLength : x); - float yEnd = (!dirMirror ? y + yLength : y); - float zEnd = (!dirMirror ? z + zLength : z); - - tempVerts[0] = new PositionTextureVertex(xStart, yStart, zStart, 0, 0); - tempVerts[tempVerts.length - 1] = new PositionTextureVertex(xEnd, yEnd, zEnd, 0, 0); - - float xCur = xStart; - float yCur = yStart; - float zCur = zStart; - float sCur = (coneBase ? topScale : baseScale); - for (int repeat = 0; repeat < (coneBase || coneTop ? 1 : 2); repeat++) - { - for (int index = 0; index < segments; index++) - { - float xSize = (mirror ^ dirMirror ? -1 : 1) * MathHelper.sin((pi / (float) segments) * index * 2F + pi) * radius * sCur; - float zSize = -MathHelper.cos((pi / (float) segments) * index * 2F + pi) * radius * sCur; - - float xPlace = xCur + (!dirSide ? xSize : 0); - float yPlace = yCur + (!dirTop ? zSize : 0); - float zPlace = zCur + (dirSide ? xSize : (dirTop ? zSize : 0)); - - tempVerts[1 + index + repeat * segments] = new PositionTextureVertex(xPlace, yPlace, zPlace, 0, 0); - } - xCur = xEnd; - yCur = yEnd; - zCur = zEnd; - sCur = topScale; - } - - float uScale = 1.0F / (float) textureWidth; - float vScale = 1.0F / (float) textureHeight; - float uOffset = uScale / 20.0F; - float vOffset = vScale / 20.0F; - float uCircle = (float) textureCircleDiameterW * uScale; - float vCircle = (float) textureCircleDiameterH * vScale; - float uWidth = (uCircle * 2F - uOffset * 2F) / (float) segments; - float vHeight = (float) textureH * vScale - uOffset * 2f; - float uStart = (float) textureOffsetX * uScale; - float vStart = (float) textureOffsetY * vScale; - - PositionTextureVertex[] vert; - for (int index = 0; index < segments; index++) - { - int index2 = (index + 1) % segments; - float uSize = MathHelper.sin((pi / (float) segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); - float vSize = MathHelper.cos((pi / (float) segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); - float uSize1 = MathHelper.sin((pi / (float) segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); - float vSize1 = MathHelper.cos((pi / (float) segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); - vert = new PositionTextureVertex[3]; - - vert[0] = tempVerts[0].setTexturePosition(uStart + 0.5F * uCircle, vStart + 0.5F * vCircle); - vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + 0.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); - vert[2] = tempVerts[1 + index].setTexturePosition(uStart + 0.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); - - poly[index] = new TexturedPolygon(vert); - if (mirror ^ flip) - poly[index].flipFace(); - - if (!coneBase && !coneTop) - { - vert = new PositionTextureVertex[4]; - - vert[0] = tempVerts[1 + index].setTexturePosition(uStart + uOffset + uWidth * (float) index, vStart + vOffset + vCircle); - vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + uOffset + uWidth * (float) (index + 1), vStart + vOffset + vCircle); - vert[2] = tempVerts[1 + segments + index2].setTexturePosition(uStart + uOffset + uWidth * (float) (index + 1), vStart + vOffset + vCircle + vHeight); - vert[3] = tempVerts[1 + segments + index].setTexturePosition(uStart + uOffset + uWidth * (float) index, vStart + vOffset + vCircle + vHeight); - poly[index + segments] = new TexturedPolygon(vert); - if (mirror ^ flip) - poly[index + segments].flipFace(); - } - - vert = new PositionTextureVertex[3]; - - vert[0] = tempVerts[tempVerts.length - 1].setTexturePosition(uStart + 1.5F * uCircle, vStart + 0.5F * vCircle); - vert[1] = tempVerts[tempVerts.length - 2 - index].setTexturePosition(uStart + 1.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); - vert[2] = tempVerts[tempVerts.length - (1 + segments) + ((segments - index) % segments)].setTexturePosition(uStart + 1.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); - - poly[poly.length - segments + index] = new TexturedPolygon(vert); - if (mirror ^ flip) - poly[poly.length - segments + index].flipFace(); - } - copyTo(tempVerts, poly); - } - - /** - * Adds a Waveform .obj file as a model. Model files use the entire texture file. - * @param file the location of the .obj file. The location is relative to the base directories, - * which are either resources/models or resources/mods/models. - */ - public void addObj (String file) - { - addModel(file, ModelPool.OBJ); - } - - /** - * Adds model format support. Model files use the entire texture file. - * @param file the location of the model file. The location is relative to the base directories, - * which are either resources/models or resources/mods/models. - * @param modelFormat the class of the model format interpreter - */ - public void addModel (String file, Class modelFormat) - { - ModelPoolEntry entry = ModelPool.addFile(file, modelFormat, transformGroup, textureGroup); - if (entry == null) - return; - PositionTextureVertex[] verts = Arrays.copyOf(entry.vertices, entry.vertices.length); - TexturedPolygon[] poly = Arrays.copyOf(entry.faces, entry.faces.length); - if (flip) - { - for (int l = 0; l < faces.length; l++) - { - faces[l].flipFace(); - } - } - - copyTo(verts, poly, false); - } - - /** - * Sets a new position for the texture offset. - * @param x the x-coordinate of the texture start - * @param y the y-coordinate of the texture start - */ - public ModelRendererTurbo setTextureOffset (int x, int y) - { - textureOffsetX = x; - textureOffsetY = y; - return this; - } - - /** - * Sets the position of the shape, relative to the model's origins. Note that changing - * the offsets will not change the pivot of the model. - * @param x the x-position of the shape - * @param y the y-position of the shape - * @param z the z-position of the shape - */ - public void setPosition (float x, float y, float z) - { - rotationPointX = x; - rotationPointY = y; - rotationPointZ = z; - } - - /** - * Mirrors the model in any direction. - * @param x whether the model should be mirrored in the x-direction - * @param y whether the model should be mirrored in the y-direction - * @param z whether the model should be mirrored in the z-direction - */ - public void doMirror (boolean x, boolean y, boolean z) - { - for (int i = 0; i < faces.length; i++) - { - PositionTextureVertex[] verts = faces[i].vertexPositions; - for (int j = 0; j < verts.length; j++) - { - verts[j].vector3D.xCoord *= (x ? -1 : 1); - verts[j].vector3D.yCoord *= (y ? -1 : 1); - verts[j].vector3D.zCoord *= (z ? -1 : 1); - } - if (x ^ y ^ z) - faces[i].flipFace(); - } - } - - /** - * Sets whether the shape is mirrored or not. This has effect on the way the textures - * get displayed. When working with addSprite, addPixel and addObj, it will be ignored. - * @param isMirrored a boolean to define whether the shape is mirrored - */ - public void setMirrored (boolean isMirrored) - { - mirror = isMirrored; - } - - /** - * Sets whether the shape's faces are flipped or not. When GL_CULL_FACE is enabled, - * it won't render the back faces, effectively giving you the possibility to make - * "hollow" shapes. When working with addSprite and addPixel, it will be ignored. - * @param isFlipped a boolean to define whether the shape is flipped - */ - public void setFlipped (boolean isFlipped) - { - flip = isFlipped; - } - - /** - * Clears the current shape. Since all shapes are stacked into one shape, you can't - * just replace a shape by overwriting the shape with another one. In this case you - * would need to clear the shape first. - */ - public void clear () - { - vertices = new PositionTextureVertex[0]; - faces = new TexturedPolygon[0]; - transformGroup.clear(); - transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D)); - currentGroup = transformGroup.get("0"); - } - - /** - * Copies an array of vertices and polygons to the current shape. This mainly is - * used to copy each shape to the main class, but you can just use it to copy - * your own shapes, for example from other classes, into the current class. - * @param verts the array of vertices you want to copy - * @param poly the array of polygons you want to copy - */ - public void copyTo (PositionTextureVertex[] verts, TexturedPolygon[] poly) - { - copyTo(verts, poly, true); - } - - public void copyTo (PositionTextureVertex[] verts, TexturedPolygon[] poly, boolean copyGroup) - { - vertices = Arrays.copyOf(vertices, vertices.length + verts.length); - faces = Arrays.copyOf(faces, faces.length + poly.length); - - for (int idx = 0; idx < verts.length; idx++) - { - vertices[vertices.length - verts.length + idx] = verts[idx]; - if (copyGroup && verts[idx] instanceof PositionTransformVertex) - ((PositionTransformVertex) verts[idx]).addGroup(currentGroup); - } - - for (int idx = 0; idx < poly.length; idx++) - { - faces[faces.length - poly.length + idx] = poly[idx]; - if (copyGroup) - currentTextureGroup.addPoly(poly[idx]); - } - } - - /** - * Copies an array of vertices and quads to the current shape. This method - * converts quads to polygons and then calls the main copyTo method. - * @param verts the array of vertices you want to copy - * @param quad the array of quads you want to copy - */ - public void copyTo (PositionTextureVertex[] verts, TexturedQuad[] quad) - { - TexturedPolygon[] poly = new TexturedPolygon[quad.length]; - for (int idx = 0; idx < quad.length; idx++) - { - poly[idx] = new TexturedPolygon(quad[idx].vertexPositions); - } - - copyTo(verts, poly); - } - - /** - * Sets the current transformation group. The transformation group is used - * to allow for vertex transformation. If a transformation group does not exist, - * a new one will be created. - * @param groupName the name of the transformation group you want to switch to - */ - public void setGroup (String groupName) - { - setGroup(groupName, new Bone(0, 0, 0, 0), 1D); - } - - /** - * Sets the current transformation group. The transformation group is used - * to allow for vertex transformation. If a transformation group does not exist, - * a new one will be created. - * @param groupName the name of the transformation group you want to switch to - * @param bone the Bone this transformation group is attached to - * @param weight the weight of the transformation group - */ - public void setGroup (String groupName, Bone bone, double weight) - { - if (!transformGroup.containsKey(groupName)) - transformGroup.put(groupName, new TransformGroupBone(bone, weight)); - currentGroup = transformGroup.get(groupName); - } - - /** - * Gets the current transformation group. - * @return the current PositionTransformGroup. - */ - public TransformGroup getGroup () - { - return currentGroup; - } - - /** - * Gets the transformation group with a given group name. - * @return the current PositionTransformGroup. - */ - public TransformGroup getGroup (String groupName) - { - if (!transformGroup.containsKey(groupName)) - return null; - return transformGroup.get(groupName); - } - - /** - * Sets the current texture group, which is used to switch the - * textures on a per-model base. Do note that any model that is - * rendered afterwards will use the same texture. To counter it, - * set a default texture, either at initialization or before - * rendering. - * @param groupName The name of the texture group. If the texture - * group doesn't exist, it creates a new group automatically. - */ - public void setTextureGroup (String groupName) - { - if (!textureGroup.containsKey(groupName)) - { - textureGroup.put(groupName, new TextureGroup()); - } - currentTextureGroup = textureGroup.get(groupName); - } - - /** - * Gets the current texture group. - * @return a TextureGroup object. - */ - public TextureGroup getTextureGroup () - { - return currentTextureGroup; - } - - /** - * Gets the texture group with the given name. - * @param groupName the name of the texture group to return - * @return a TextureGroup object. - */ - public TextureGroup getTextureGroup (String groupName) - { - if (!textureGroup.containsKey(groupName)) - return null; - return textureGroup.get(groupName); - } - - /** - * Sets the texture of the current texture group. - * @param s the filename - */ - public void setGroupTexture (String s) - { - currentTextureGroup.texture = s; - } - - /** - * Sets the default texture. When left as an empty string, - * it will use the texture that has been set previously. - * Note that this will also move on to other rendered models - * of the same entity. - * @param s the filename - */ - public void setDefaultTexture (String s) - { - defaultTexture = s; - } - - /** - * Renders the shape. - * @param worldScale the scale of the shape. Usually is 0.0625. - */ - public void render (float worldScale) - { - if (field_1402_i) - { - return; - } - if (!showModel) - { - return; - } - if (!compiled || forcedRecompile) - { - compileDisplayList(worldScale); - } - if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) - { - GL11.glPushMatrix(); - GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale); - if (rotateAngleZ != 0.0F) - { - GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); - } - if (rotateAngleY != 0.0F) - { - GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); - } - if (rotateAngleX != 0.0F) - { - GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); - } - callDisplayList(); - if (childModels != null) - { - for (int i = 0; i < childModels.size(); i++) - { - ((ModelRenderer) childModels.get(i)).render(worldScale); - } - - } - GL11.glPopMatrix(); - } - else if (rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) - { - GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale); - callDisplayList(); - if (childModels != null) - { - for (int i = 0; i < childModels.size(); i++) - { - ((ModelRenderer) childModels.get(i)).render(worldScale); - } - - } - GL11.glTranslatef(-rotationPointX * worldScale, -rotationPointY * worldScale, -rotationPointZ * worldScale); - } - else - { - callDisplayList(); - if (childModels != null) - { - for (int i = 0; i < childModels.size(); i++) - { - ((ModelRenderer) childModels.get(i)).render(worldScale); - } - - } - } - } - - public void renderWithRotation (float f) - { - if (field_1402_i) - { - return; - } - if (!showModel) - { - return; - } - if (!compiled) - { - compileDisplayList(f); - } - GL11.glPushMatrix(); - GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); - if (rotateAngleY != 0.0F) - { - GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); - } - if (rotateAngleX != 0.0F) - { - GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); - } - if (rotateAngleZ != 0.0F) - { - GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); - } - callDisplayList(); - GL11.glPopMatrix(); - } - - public void postRender (float f) - { - if (field_1402_i) - { - return; - } - if (!showModel) - { - return; - } - if (!compiled || forcedRecompile) - { - compileDisplayList(f); - } - if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) - { - GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); - if (rotateAngleZ != 0.0F) - { - GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); - } - if (rotateAngleY != 0.0F) - { - GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); - } - if (rotateAngleX != 0.0F) - { - GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); - } - } - else if (rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) - { - GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); - } - } - - private void callDisplayList () - { - if (useLegacyCompiler) - GL11.glCallList(displayList); - else - { - RenderEngine renderEngine = RenderManager.instance.renderEngine; - - Collection textures = textureGroup.values(); - - Iterator itr = textures.iterator(); - for (int i = 0; itr.hasNext(); i++) - { - TextureGroup curTexGroup = (TextureGroup) itr.next(); - curTexGroup.loadTexture(); - GL11.glCallList(displayListArray[i]); - if (!defaultTexture.equals("")) - renderEngine.bindTexture(defaultTexture); - } - } - } - - private void compileDisplayList (float worldScale) - { - if (useLegacyCompiler) - compileLegacyDisplayList(worldScale); - else - { - Collection textures = textureGroup.values(); - - Iterator itr = textures.iterator(); - displayListArray = new int[textureGroup.size()]; - for (int i = 0; itr.hasNext(); i++) - { - displayListArray[i] = GLAllocation.generateDisplayLists(1); - GL11.glNewList(displayListArray[i], 4864); - Tessellator tessellator = Tessellator.instance; - - TextureGroup usedGroup = (TextureGroup) itr.next(); - for (int j = 0; j < usedGroup.poly.size(); j++) - { - usedGroup.poly.get(j).draw(tessellator, worldScale); - } - - GL11.glEndList(); - } - } - - compiled = true; - } - - private void compileLegacyDisplayList (float worldScale) - { - displayList = GLAllocation.generateDisplayLists(1); - GL11.glNewList(displayList, 4864 /*GL_COMPILE*/); - Tessellator tessellator = Tessellator.instance; - for (int i = 0; i < faces.length; i++) - { - faces[i].draw(tessellator, worldScale); - } - - GL11.glEndList(); - } - - private PositionTextureVertex vertices[]; - private TexturedPolygon faces[]; - private int textureOffsetX; - private int textureOffsetY; - private boolean compiled; - private int displayList; - private int displayListArray[]; - private Map transformGroup; - private Map textureGroup; - private TransformGroup currentGroup; - private TextureGroup currentTextureGroup; - public boolean mirror; - public boolean flip; - public boolean showModel; - public boolean field_1402_i; - public boolean forcedRecompile; - public boolean useLegacyCompiler; - public List cubeList; - public List childModels; - public final String boxName; - - private String defaultTexture; - - public static final int MR_FRONT = 0; - public static final int MR_BACK = 1; - public static final int MR_LEFT = 2; - public static final int MR_RIGHT = 3; - public static final int MR_TOP = 4; - public static final int MR_BOTTOM = 5; - - private static final float pi = (float) Math.PI; -} diff --git a/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java b/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java deleted file mode 100644 index 0dd1b92d..00000000 --- a/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java +++ /dev/null @@ -1,78 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.util.ArrayList; - -import net.minecraft.client.model.PositionTextureVertex; -import net.minecraft.util.Vec3; - -public class PositionTransformVertex extends PositionTextureVertex -{ - public PositionTransformVertex(float x, float y, float z, float u, float v) - { - this(Vec3.createVectorHelper((double) x, (double) y, (double) z), u, v); - } - - public PositionTransformVertex(PositionTextureVertex vertex, float u, float v) - { - super(vertex, u, v); - if (vertex instanceof PositionTransformVertex) - neutralVector = ((PositionTransformVertex) vertex).neutralVector; - else - neutralVector = Vec3.createVectorHelper(vertex.vector3D.xCoord, vertex.vector3D.yCoord, vertex.vector3D.zCoord); - } - - public PositionTransformVertex(PositionTextureVertex vertex) - { - this(vertex, vertex.texturePositionX, vertex.texturePositionY); - } - - public PositionTransformVertex(Vec3 vector, float u, float v) - { - super(vector, u, v); - neutralVector = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); - } - - public void setTransformation () - { - if (transformGroups.size() == 0) - { - vector3D.xCoord = neutralVector.xCoord; - vector3D.yCoord = neutralVector.yCoord; - vector3D.zCoord = neutralVector.zCoord; - return; - } - double weight = 0D; - for (int i = 0; i < transformGroups.size(); i++) - { - weight += transformGroups.get(i).getWeight(); - } - vector3D.xCoord = 0; - vector3D.yCoord = 0; - vector3D.zCoord = 0; - - for (int i = 0; i < transformGroups.size(); i++) - { - TransformGroup group = transformGroups.get(i); - double cWeight = group.getWeight() / weight; - Vec3 vector = group.doTransformation(this); - - vector3D.xCoord += cWeight * vector.xCoord; - vector3D.yCoord += cWeight * vector.yCoord; - vector3D.zCoord += cWeight * vector.zCoord; - } - } - - public void addGroup (TransformGroup group) - { - transformGroups.add(group); - } - - public void removeGroup (TransformGroup group) - { - transformGroups.remove(group); - } - - public Vec3 neutralVector; - public ArrayList transformGroups = new ArrayList(); - -} diff --git a/mods/tinker/tconstruct/client/tmt/Shape2D.java b/mods/tinker/tconstruct/client/tmt/Shape2D.java deleted file mode 100644 index b6dfac72..00000000 --- a/mods/tinker/tconstruct/client/tmt/Shape2D.java +++ /dev/null @@ -1,147 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.util.ArrayList; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; - -public class Shape2D -{ - public Shape2D() - { - coords = new ArrayList(); - } - - public Shape2D(Coord2D[] coordArray) - { - coords = new ArrayList(); - - for (int idx = 0; idx < coordArray.length; idx++) - { - coords.add(coordArray[idx]); - } - } - - public Shape2D(ArrayList coordList) - { - coords = coordList; - } - - public Coord2D[] getCoordArray () - { - return (Coord2D[]) coords.toArray(); - } - - public Shape3D extrude (float x, float y, float z, float rotX, float rotY, float rotZ, float depth, int u, int v, float textureWidth, float textureHeight, int shapeTextureWidth, - int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float[] faceLengths) - { - PositionTransformVertex[] verts = new PositionTransformVertex[coords.size() * 2]; - PositionTransformVertex[] vertsTop = new PositionTransformVertex[coords.size()]; - PositionTransformVertex[] vertsBottom = new PositionTransformVertex[coords.size()]; - TexturedPolygon[] poly = new TexturedPolygon[coords.size() + 2]; - - Vec3 extrudeVector = Vec3.createVectorHelper(0, 0, depth); - - setVectorRotations(extrudeVector, rotX, rotY, rotZ); - - if (faceLengths != null && faceLengths.length < coords.size()) - faceLengths = null; - - float totalLength = 0; - - for (int idx = 0; idx < coords.size(); idx++) - { - Coord2D curCoord = coords.get(idx); - Coord2D nextCoord = coords.get((idx + 1) % coords.size()); - float texU1 = ((float) (curCoord.uCoord + u) / (float) textureWidth); - float texU2 = ((float) (shapeTextureWidth * 2 - curCoord.uCoord + u) / (float) textureWidth); - float texV = ((float) (curCoord.vCoord + v) / (float) textureHeight); - - Vec3 vecCoord = Vec3.createVectorHelper(curCoord.xCoord, curCoord.yCoord, 0); - - setVectorRotations(vecCoord, rotX, rotY, rotZ); - - verts[idx] = new PositionTransformVertex(x + (float) vecCoord.xCoord, y + (float) vecCoord.yCoord, z + (float) vecCoord.zCoord, texU1, texV); - verts[idx + coords.size()] = new PositionTransformVertex(x + (float) vecCoord.xCoord - (float) extrudeVector.xCoord, y + (float) vecCoord.yCoord - (float) extrudeVector.yCoord, z - + (float) vecCoord.zCoord - (float) extrudeVector.zCoord, texU2, texV); - - vertsTop[idx] = new PositionTransformVertex(verts[idx]); - vertsBottom[coords.size() - idx - 1] = new PositionTransformVertex(verts[idx + coords.size()]); - - if (faceLengths != null) - totalLength += faceLengths[idx]; - else - totalLength += Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); - } - - poly[coords.size()] = new TexturedPolygon(vertsTop); - poly[coords.size() + 1] = new TexturedPolygon(vertsBottom); - - float currentLengthPosition = totalLength; - - for (int idx = 0; idx < coords.size(); idx++) - { - Coord2D curCoord = coords.get(idx); - Coord2D nextCoord = coords.get((idx + 1) % coords.size()); - float currentLength = (float) Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); - if (faceLengths != null) - currentLength = faceLengths[faceLengths.length - idx - 1]; - float ratioPosition = currentLengthPosition / totalLength; - float ratioLength = (currentLengthPosition - currentLength) / totalLength; - - float texU1 = ((float) (ratioLength * (float) sideTextureWidth + u) / (float) textureWidth); - float texU2 = ((float) (ratioPosition * (float) sideTextureWidth + u) / (float) textureWidth); - float texV1 = (((float) v + (float) shapeTextureHeight) / (float) textureHeight); - float texV2 = (((float) v + (float) shapeTextureHeight + (float) sideTextureHeight) / (float) textureHeight); - - PositionTransformVertex[] polySide = new PositionTransformVertex[4]; - - polySide[0] = new PositionTransformVertex(verts[idx], texU2, texV1); - polySide[1] = new PositionTransformVertex(verts[coords.size() + idx], texU2, texV2); - polySide[2] = new PositionTransformVertex(verts[coords.size() + ((idx + 1) % coords.size())], texU1, texV2); - polySide[3] = new PositionTransformVertex(verts[(idx + 1) % coords.size()], texU1, texV1); - - poly[idx] = new TexturedPolygon(polySide); - currentLengthPosition -= currentLength; - } - - return new Shape3D(verts, poly); - } - - protected void setVectorRotations (Vec3 vector, float xRot, float yRot, float zRot) - { - float x = xRot; - float y = yRot; - float z = zRot; - float xC = MathHelper.cos(x); - float xS = MathHelper.sin(x); - float yC = MathHelper.cos(y); - float yS = MathHelper.sin(y); - float zC = MathHelper.cos(z); - float zS = MathHelper.sin(z); - - double xVec = vector.xCoord; - double yVec = vector.yCoord; - double zVec = vector.zCoord; - - // rotation around x - double xy = xC * yVec - xS * zVec; - double xz = xC * zVec + xS * yVec; - // rotation around y - double yz = yC * xz - yS * xVec; - double yx = yC * xVec + yS * xz; - // rotation around z - double zx = zC * yx - zS * xy; - double zy = zC * xy + zS * yx; - - xVec = zx; - yVec = zy; - zVec = yz; - - vector.xCoord = xVec; - vector.yCoord = yVec; - vector.zCoord = zVec; - } - - public ArrayList coords; -} diff --git a/mods/tinker/tconstruct/client/tmt/Shape3D.java b/mods/tinker/tconstruct/client/tmt/Shape3D.java deleted file mode 100644 index 6855c664..00000000 --- a/mods/tinker/tconstruct/client/tmt/Shape3D.java +++ /dev/null @@ -1,13 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -public class Shape3D -{ - public Shape3D(PositionTransformVertex[] verts, TexturedPolygon[] poly) - { - vertices = verts; - faces = poly; - } - - public PositionTransformVertex[] vertices; - public TexturedPolygon[] faces; -} diff --git a/mods/tinker/tconstruct/client/tmt/TextureGroup.java b/mods/tinker/tconstruct/client/tmt/TextureGroup.java deleted file mode 100644 index 79e85aeb..00000000 --- a/mods/tinker/tconstruct/client/tmt/TextureGroup.java +++ /dev/null @@ -1,42 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.util.ArrayList; - -import net.minecraft.client.model.TexturedQuad; -import net.minecraft.client.renderer.RenderEngine; -import net.minecraft.client.renderer.entity.RenderManager; - -public class TextureGroup -{ - public TextureGroup() - { - poly = new ArrayList(); - texture = ""; - } - - public void addPoly (TexturedQuad quad) - { - poly.add(quad); - } - - public void loadTexture () - { - loadTexture(-1); - } - - public void loadTexture (int defaultTexture) - { - if (!texture.equals("")) - { - RenderEngine renderengine = RenderManager.instance.renderEngine; - renderengine.bindTexture(texture); - } - /*else if(defaultTexture > -1) - { - RenderManager.instance.renderEngine.bindTexture(defaultTexture); - }*/ - } - - public ArrayList poly; - public String texture; -} diff --git a/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java b/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java deleted file mode 100644 index 9873561d..00000000 --- a/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java +++ /dev/null @@ -1,106 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import java.util.ArrayList; - -import net.minecraft.client.model.PositionTextureVertex; -import net.minecraft.client.model.TexturedQuad; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.Vec3; - -import org.lwjgl.opengl.GL11; - -public class TexturedPolygon extends TexturedQuad -{ - public TexturedPolygon(PositionTextureVertex apositionTexturevertex[]) - { - super(apositionTexturevertex); - invertNormal = false; - normals = new float[0]; - iNormals = new ArrayList(); - } - - public void setInvertNormal (boolean isSet) - { - invertNormal = isSet; - } - - public void setNormals (float x, float y, float z) - { - normals = new float[] { x, y, z }; - } - - public void setNormals (ArrayList vec) - { - iNormals = vec; - } - - public void draw (Tessellator tessellator, float f) - { - - if (nVertices == 3) - tessellator.startDrawing(GL11.GL_TRIANGLES); - else if (nVertices == 4) - tessellator.startDrawingQuads(); - else - tessellator.startDrawing(GL11.GL_POLYGON); - - if (iNormals.size() == 0) - { - if (normals.length == 3) - { - if (invertNormal) - { - tessellator.setNormal(-normals[0], -normals[1], -normals[2]); - } - else - { - tessellator.setNormal(normals[0], normals[1], normals[2]); - } - } - else if (vertexPositions.length >= 3) - { - Vec3 Vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D); - Vec3 Vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D); - Vec3 Vec32 = Vec31.crossProduct(Vec3).normalize(); - - if (invertNormal) - { - tessellator.setNormal(-(float) Vec32.xCoord, -(float) Vec32.yCoord, -(float) Vec32.zCoord); - } - else - { - tessellator.setNormal((float) Vec32.xCoord, (float) Vec32.yCoord, (float) Vec32.zCoord); - } - } - else - { - return; - } - } - for (int i = 0; i < nVertices; i++) - { - PositionTextureVertex positionTexturevertex = vertexPositions[i]; - if (positionTexturevertex instanceof PositionTransformVertex) - ((PositionTransformVertex) positionTexturevertex).setTransformation(); - if (i < iNormals.size()) - { - if (invertNormal) - { - tessellator.setNormal(-(float) iNormals.get(i).xCoord, -(float) iNormals.get(i).yCoord, -(float) iNormals.get(i).zCoord); - } - else - { - tessellator.setNormal((float) iNormals.get(i).xCoord, (float) iNormals.get(i).yCoord, (float) iNormals.get(i).zCoord); - } - } - tessellator.addVertexWithUV((float) positionTexturevertex.vector3D.xCoord * f, (float) positionTexturevertex.vector3D.yCoord * f, (float) positionTexturevertex.vector3D.zCoord * f, - positionTexturevertex.texturePositionX, positionTexturevertex.texturePositionY); - } - - tessellator.draw(); - } - - private boolean invertNormal; - private float[] normals; - private ArrayList iNormals; -} diff --git a/mods/tinker/tconstruct/client/tmt/TransformGroup.java b/mods/tinker/tconstruct/client/tmt/TransformGroup.java deleted file mode 100644 index 28e76241..00000000 --- a/mods/tinker/tconstruct/client/tmt/TransformGroup.java +++ /dev/null @@ -1,10 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import net.minecraft.util.Vec3; - -public abstract class TransformGroup -{ - public abstract double getWeight (); - - public abstract Vec3 doTransformation (PositionTransformVertex vertex); -} diff --git a/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java b/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java deleted file mode 100644 index a5467671..00000000 --- a/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java +++ /dev/null @@ -1,111 +0,0 @@ -package mods.tinker.tconstruct.client.tmt; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; - -/** - * The PositionTransformGroup class adds a class which allows for vertex transformations. - * @author GaryCXJk - * - */ -public class TransformGroupBone extends TransformGroup -{ - public TransformGroupBone(Bone bone, double wght) - { - baseVector = bone.getPosition(); - baseAngles = bone.getAbsoluteAngle(); - attachedBone = bone; - weight = wght; - } - - public Angle3D getBaseAngles () - { - return baseAngles.copy(); - } - - public Angle3D getTransformAngle () - { - Angle3D returnAngle = attachedBone.getAbsoluteAngle().copy(); - returnAngle.angleX -= baseAngles.angleX; - returnAngle.angleY -= baseAngles.angleY; - returnAngle.angleZ -= baseAngles.angleZ; - return returnAngle; - } - - public Vec3 getBaseVector () - { - return Vec3.createVectorHelper(baseVector.xCoord, baseVector.yCoord, baseVector.zCoord); - } - - public Vec3 getTransformVector () - { - return baseVector.subtract(attachedBone.getPosition()); - } - - public Vec3 getCurrentVector () - { - return attachedBone.getPosition(); - } - - public double getWeight () - { - return weight; - } - - public void attachBone (Bone bone) - { - baseVector = bone.getPosition(); - baseAngles = bone.getAbsoluteAngle(); - attachedBone = bone; - } - - public Vec3 doTransformation (PositionTransformVertex vertex) - { - Vec3 vector = Vec3.createVectorHelper(vertex.neutralVector.xCoord, vertex.neutralVector.yCoord, vertex.neutralVector.zCoord); - vector = getBaseVector().subtract(vector); - Angle3D angle = getTransformAngle(); - setVectorRotations(vector, angle.angleX, angle.angleY, angle.angleZ); - - return vector; - } - - protected void setVectorRotations (Vec3 vector, float xRot, float yRot, float zRot) - { - float x = xRot; - float y = yRot; - float z = zRot; - float xC = MathHelper.cos(x); - float xS = MathHelper.sin(x); - float yC = MathHelper.cos(y); - float yS = MathHelper.sin(y); - float zC = MathHelper.cos(z); - float zS = MathHelper.sin(z); - - double xVec = vector.xCoord; - double yVec = vector.yCoord; - double zVec = vector.zCoord; - - // rotation around x - double xy = xC * yVec - xS * zVec; - double xz = xC * zVec + xS * yVec; - // rotation around y - double yz = yC * xz - yS * xVec; - double yx = yC * xVec + yS * xz; - // rotation around z - double zx = zC * yx - zS * xy; - double zy = zC * xy + zS * yx; - - xVec = zx; - yVec = zy; - zVec = yz; - - vector.xCoord = xVec; - vector.yCoord = yVec; - vector.zCoord = zVec; - } - - protected Angle3D baseAngles; - protected Vec3 baseVector; - protected Bone attachedBone; - protected double weight; -} diff --git a/mods/tinker/tconstruct/common/TContent.java b/mods/tinker/tconstruct/common/TContent.java index 18dc55ae..e1381d73 100644 --- a/mods/tinker/tconstruct/common/TContent.java +++ b/mods/tinker/tconstruct/common/TContent.java @@ -4,21 +4,154 @@ import java.lang.reflect.Field; import java.util.Collection; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.blocks.*; -import mods.tinker.tconstruct.blocks.logic.*; -import mods.tinker.tconstruct.entity.*; -import mods.tinker.tconstruct.entity.projectile.*; -import mods.tinker.tconstruct.items.*; -import mods.tinker.tconstruct.items.armor.*; -import mods.tinker.tconstruct.items.blocks.*; -import mods.tinker.tconstruct.items.tools.*; -import mods.tinker.tconstruct.library.*; -import mods.tinker.tconstruct.library.client.*; -import mods.tinker.tconstruct.library.crafting.*; -import mods.tinker.tconstruct.library.tools.*; -import mods.tinker.tconstruct.library.util.*; -import mods.tinker.tconstruct.modifiers.*; -import mods.tinker.tconstruct.util.*; +import mods.tinker.tconstruct.blocks.Aggregator; +import mods.tinker.tconstruct.blocks.DryingRack; +import mods.tinker.tconstruct.blocks.EquipBlock; +import mods.tinker.tconstruct.blocks.GlassBlock; +import mods.tinker.tconstruct.blocks.GlassBlockStained; +import mods.tinker.tconstruct.blocks.GlassPane; +import mods.tinker.tconstruct.blocks.GlassPaneStained; +import mods.tinker.tconstruct.blocks.GravelOre; +import mods.tinker.tconstruct.blocks.LavaTankBlock; +import mods.tinker.tconstruct.blocks.LightCrystalBase; +import mods.tinker.tconstruct.blocks.LiquidMetalFlowing; +import mods.tinker.tconstruct.blocks.LiquidMetalStill; +import mods.tinker.tconstruct.blocks.MetalOre; +import mods.tinker.tconstruct.blocks.MultiBrick; +import mods.tinker.tconstruct.blocks.MultiBrickFancy; +import mods.tinker.tconstruct.blocks.OreberryBush; +import mods.tinker.tconstruct.blocks.OreberryBushEssence; +import mods.tinker.tconstruct.blocks.RedstoneMachine; +import mods.tinker.tconstruct.blocks.SearedBlock; +import mods.tinker.tconstruct.blocks.SearedSlab; +import mods.tinker.tconstruct.blocks.SmelteryBlock; +import mods.tinker.tconstruct.blocks.SoilBlock; +import mods.tinker.tconstruct.blocks.SpeedBlock; +import mods.tinker.tconstruct.blocks.SpeedSlab; +import mods.tinker.tconstruct.blocks.StoneTorch; +import mods.tinker.tconstruct.blocks.TMetalBlock; +import mods.tinker.tconstruct.blocks.ToolForgeBlock; +import mods.tinker.tconstruct.blocks.ToolStationBlock; +import mods.tinker.tconstruct.blocks.logic.CastingBasinLogic; +import mods.tinker.tconstruct.blocks.logic.CastingTableLogic; +import mods.tinker.tconstruct.blocks.logic.DrawbridgeLogic; +import mods.tinker.tconstruct.blocks.logic.DryingRackLogic; +import mods.tinker.tconstruct.blocks.logic.FaucetLogic; +import mods.tinker.tconstruct.blocks.logic.FirestarterLogic; +import mods.tinker.tconstruct.blocks.logic.FrypanLogic; +import mods.tinker.tconstruct.blocks.logic.GlowstoneAggregator; +import mods.tinker.tconstruct.blocks.logic.LavaTankLogic; +import mods.tinker.tconstruct.blocks.logic.LiquidTextureLogic; +import mods.tinker.tconstruct.blocks.logic.MultiServantLogic; +import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic; +import mods.tinker.tconstruct.blocks.logic.PatternChestLogic; +import mods.tinker.tconstruct.blocks.logic.SmelteryDrainLogic; +import mods.tinker.tconstruct.blocks.logic.SmelteryLogic; +import mods.tinker.tconstruct.blocks.logic.StencilTableLogic; +import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic; +import mods.tinker.tconstruct.blocks.logic.ToolStationLogic; +import mods.tinker.tconstruct.entity.Automaton; +import mods.tinker.tconstruct.entity.BlueSlime; +import mods.tinker.tconstruct.entity.Crystal; +import mods.tinker.tconstruct.entity.FancyEntityItem; +import mods.tinker.tconstruct.entity.MiniGardy; +import mods.tinker.tconstruct.entity.SlimeClone; +import mods.tinker.tconstruct.entity.projectile.ArrowEntity; +import mods.tinker.tconstruct.entity.projectile.DaggerEntity; +import mods.tinker.tconstruct.entity.projectile.LaunchedPotion; +import mods.tinker.tconstruct.items.Bowstring; +import mods.tinker.tconstruct.items.CraftingItem; +import mods.tinker.tconstruct.items.DiamondApple; +import mods.tinker.tconstruct.items.FilledBucket; +import mods.tinker.tconstruct.items.Fletching; +import mods.tinker.tconstruct.items.GoldenHead; +import mods.tinker.tconstruct.items.Manual; +import mods.tinker.tconstruct.items.MaterialItem; +import mods.tinker.tconstruct.items.MetalPattern; +import mods.tinker.tconstruct.items.OreBerries; +import mods.tinker.tconstruct.items.Pattern; +import mods.tinker.tconstruct.items.StrangeFood; +import mods.tinker.tconstruct.items.TitleIcon; +import mods.tinker.tconstruct.items.ToolPart; +import mods.tinker.tconstruct.items.ToolPartHidden; +import mods.tinker.tconstruct.items.ToolShard; +import mods.tinker.tconstruct.items.armor.Glove; +import mods.tinker.tconstruct.items.armor.HeartCanister; +import mods.tinker.tconstruct.items.armor.Knapsack; +import mods.tinker.tconstruct.items.armor.TArmorBase; +import mods.tinker.tconstruct.items.blocks.CraftedSoilItemBlock; +import mods.tinker.tconstruct.items.blocks.GlassBlockItem; +import mods.tinker.tconstruct.items.blocks.GlassPaneItem; +import mods.tinker.tconstruct.items.blocks.GravelOreItem; +import mods.tinker.tconstruct.items.blocks.LavaTankItemBlock; +import mods.tinker.tconstruct.items.blocks.LightCrystalItem; +import mods.tinker.tconstruct.items.blocks.LiquidItemBlock; +import mods.tinker.tconstruct.items.blocks.MetalItemBlock; +import mods.tinker.tconstruct.items.blocks.MetalOreItemBlock; +import mods.tinker.tconstruct.items.blocks.MultiBrickFancyItem; +import mods.tinker.tconstruct.items.blocks.MultiBrickItem; +import mods.tinker.tconstruct.items.blocks.OreberryBushItem; +import mods.tinker.tconstruct.items.blocks.OreberryBushSecondItem; +import mods.tinker.tconstruct.items.blocks.RedstoneMachineItem; +import mods.tinker.tconstruct.items.blocks.SearedSlabItem; +import mods.tinker.tconstruct.items.blocks.SearedTableItemBlock; +import mods.tinker.tconstruct.items.blocks.SmelteryItemBlock; +import mods.tinker.tconstruct.items.blocks.SpeedBlockItem; +import mods.tinker.tconstruct.items.blocks.SpeedSlabItem; +import mods.tinker.tconstruct.items.blocks.StainedGlassClearItem; +import mods.tinker.tconstruct.items.blocks.StainedGlassClearPaneItem; +import mods.tinker.tconstruct.items.blocks.ToolForgeItemBlock; +import mods.tinker.tconstruct.items.blocks.ToolStationItemBlock; +import mods.tinker.tconstruct.items.tools.Arrow; +import mods.tinker.tconstruct.items.tools.BattleSign; +import mods.tinker.tconstruct.items.tools.Battleaxe; +import mods.tinker.tconstruct.items.tools.Broadsword; +import mods.tinker.tconstruct.items.tools.Chisel; +import mods.tinker.tconstruct.items.tools.Cleaver; +import mods.tinker.tconstruct.items.tools.Cutlass; +import mods.tinker.tconstruct.items.tools.Dagger; +import mods.tinker.tconstruct.items.tools.Excavator; +import mods.tinker.tconstruct.items.tools.FryingPan; +import mods.tinker.tconstruct.items.tools.Hammer; +import mods.tinker.tconstruct.items.tools.Hatchet; +import mods.tinker.tconstruct.items.tools.Longsword; +import mods.tinker.tconstruct.items.tools.LumberAxe; +import mods.tinker.tconstruct.items.tools.Mattock; +import mods.tinker.tconstruct.items.tools.Pickaxe; +import mods.tinker.tconstruct.items.tools.PotionLauncher; +import mods.tinker.tconstruct.items.tools.Rapier; +import mods.tinker.tconstruct.items.tools.Scythe; +import mods.tinker.tconstruct.items.tools.Shortbow; +import mods.tinker.tconstruct.items.tools.Shovel; +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.client.TConstructClientRegistry; +import mods.tinker.tconstruct.library.crafting.Detailing; +import mods.tinker.tconstruct.library.crafting.DryingRackRecipes; +import mods.tinker.tconstruct.library.crafting.LiquidCasting; +import mods.tinker.tconstruct.library.crafting.PatternBuilder; +import mods.tinker.tconstruct.library.crafting.Smeltery; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.library.util.IPattern; +import mods.tinker.tconstruct.modifiers.ModAntiSpider; +import mods.tinker.tconstruct.modifiers.ModAttack; +import mods.tinker.tconstruct.modifiers.ModAutoSmelt; +import mods.tinker.tconstruct.modifiers.ModBlaze; +import mods.tinker.tconstruct.modifiers.ModButtertouch; +import mods.tinker.tconstruct.modifiers.ModDurability; +import mods.tinker.tconstruct.modifiers.ModElectric; +import mods.tinker.tconstruct.modifiers.ModExtraModifier; +import mods.tinker.tconstruct.modifiers.ModInteger; +import mods.tinker.tconstruct.modifiers.ModLapis; +import mods.tinker.tconstruct.modifiers.ModPiston; +import mods.tinker.tconstruct.modifiers.ModRedstone; +import mods.tinker.tconstruct.modifiers.ModReinforced; +import mods.tinker.tconstruct.modifiers.ModRepair; +import mods.tinker.tconstruct.modifiers.ModSmite; +import mods.tinker.tconstruct.modifiers.TActiveOmniMod; +import mods.tinker.tconstruct.util.PHConstruct; +import mods.tinker.tconstruct.util.RecipeRemover; +import mods.tinker.tconstruct.util.TDispenserBehaviorSpawnEgg; import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; import net.minecraft.block.material.MapColor; @@ -35,10 +168,6 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.liquids.LiquidContainerData; -import net.minecraftforge.liquids.LiquidContainerRegistry; -import net.minecraftforge.liquids.LiquidDictionary; -import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; diff --git a/mods/tinker/tconstruct/common/TProxyCommon.java b/mods/tinker/tconstruct/common/TProxyCommon.java index 2c865b59..620469db 100644 --- a/mods/tinker/tconstruct/common/TProxyCommon.java +++ b/mods/tinker/tconstruct/common/TProxyCommon.java @@ -2,7 +2,9 @@ package mods.tinker.tconstruct.common; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.entity.MiniGardy; -import mods.tinker.tconstruct.inventory.*; +import mods.tinker.tconstruct.inventory.ArmorExtendedContainer; +import mods.tinker.tconstruct.inventory.KnapsackContainer; +import mods.tinker.tconstruct.inventory.MiniGardyContainer; import mods.tinker.tconstruct.library.blocks.InventoryLogic; import mods.tinker.tconstruct.util.player.TPlayerStats; import net.minecraft.entity.Entity; diff --git a/mods/tinker/tconstruct/crystal/TheftValueTracker.java b/mods/tinker/tconstruct/crystal/TheftValueTracker.java index d66e86e6..02250b3c 100644 --- a/mods/tinker/tconstruct/crystal/TheftValueTracker.java +++ b/mods/tinker/tconstruct/crystal/TheftValueTracker.java @@ -1,10 +1,8 @@ package mods.tinker.tconstruct.crystal; -import java.util.ArrayList; import java.util.HashMap; import mods.tinker.tconstruct.library.util.ValueCoordTuple; -import mods.tinker.tconstruct.library.util.CoordTuple; public class TheftValueTracker { diff --git a/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java b/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java index 5bdd0fa3..947a12e3 100644 --- a/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java +++ b/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.dimension; -import net.minecraft.util.Vec3; import net.minecraft.world.WorldProvider; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; diff --git a/mods/tinker/tconstruct/entity/Automaton.java b/mods/tinker/tconstruct/entity/Automaton.java index 8d5f6d86..27d52383 100644 --- a/mods/tinker/tconstruct/entity/Automaton.java +++ b/mods/tinker/tconstruct/entity/Automaton.java @@ -1,8 +1,9 @@ package mods.tinker.tconstruct.entity; -import mods.tinker.tconstruct.entity.ai.*; +import mods.tinker.tconstruct.entity.ai.GAIAttackTarget; +import mods.tinker.tconstruct.entity.ai.GAIFindTarget; +import mods.tinker.tconstruct.entity.ai.GAIFollowOwner; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.world.World; public class Automaton extends GolemBase @@ -16,7 +17,7 @@ public class Automaton extends GolemBase { super(world); this.setSize(0.9F, 2.42F); - this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; + //this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; this.tasks.addTask(1, new GAIAttackTarget(this)); this.tasks.addTask(2, new GAIFindTarget(this)); this.tasks.addTask(3, new GAIFollowOwner(this)); diff --git a/mods/tinker/tconstruct/entity/BlueSlime.java b/mods/tinker/tconstruct/entity/BlueSlime.java index 1e8406b5..5b2fa37d 100644 --- a/mods/tinker/tconstruct/entity/BlueSlime.java +++ b/mods/tinker/tconstruct/entity/BlueSlime.java @@ -5,7 +5,6 @@ import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.crafting.ToolBuilder; import mods.tinker.tconstruct.library.tools.ToolCore; -import net.minecraft.block.material.Material; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.boss.IBossDisplayData; @@ -37,7 +36,7 @@ public class BlueSlime extends EntityLiving implements IMob, IBossDisplayData public BlueSlime(World world) { super(world); - this.texture = "/mods/tinker/textures/mob/slimeedible.png"; + //this.texture = "/mods/tinker/textures/mob/slimeedible.png"; int offset = this.rand.nextInt(299); if (offset < 149) offset = 1; diff --git a/mods/tinker/tconstruct/entity/CartEntity.java b/mods/tinker/tconstruct/entity/CartEntity.java index 90c831cf..0504bd6d 100644 --- a/mods/tinker/tconstruct/entity/CartEntity.java +++ b/mods/tinker/tconstruct/entity/CartEntity.java @@ -1448,7 +1448,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS } @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) + public boolean isItemValidForSlot (int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; diff --git a/mods/tinker/tconstruct/entity/Crystal.java b/mods/tinker/tconstruct/entity/Crystal.java index 9b5ab8cc..5d97b55e 100644 --- a/mods/tinker/tconstruct/entity/Crystal.java +++ b/mods/tinker/tconstruct/entity/Crystal.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.entity; import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; public class Crystal extends EntityCreeper @@ -10,7 +9,7 @@ public class Crystal extends EntityCreeper public Crystal(World par1World) { super(par1World); - texture = "/mods/tinker/textures/mob/crystalwater.png"; + //texture = "/mods/tinker/textures/mob/crystalwater.png"; } } diff --git a/mods/tinker/tconstruct/entity/CrystalGuardian.java b/mods/tinker/tconstruct/entity/CrystalGuardian.java index d0ba40b1..5975f2d0 100644 --- a/mods/tinker/tconstruct/entity/CrystalGuardian.java +++ b/mods/tinker/tconstruct/entity/CrystalGuardian.java @@ -9,13 +9,13 @@ public class CrystalGuardian extends EntityLiving public CrystalGuardian(World par1World) { super(par1World); - this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; + //this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; } - @Override + /*@Override public int getMaxHealth () { return 100; - } + }*/ } diff --git a/mods/tinker/tconstruct/entity/GolemBase.java b/mods/tinker/tconstruct/entity/GolemBase.java index 09d535cc..28cc1c17 100644 --- a/mods/tinker/tconstruct/entity/GolemBase.java +++ b/mods/tinker/tconstruct/entity/GolemBase.java @@ -5,12 +5,12 @@ import java.util.Random; import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.ToolCore; -import mods.tinker.tconstruct.library.util.CoordTuple; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentThorns; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityMultiPart; import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.player.EntityPlayer; @@ -79,7 +79,7 @@ public class GolemBase extends EntityCreature implements IInventory return leader.get(); } - public void setOwner (EntityLiving living) + public void setOwner (EntityLivingBase living) { if (living instanceof EntityPlayer) ownerName = ((EntityPlayer) living).username; @@ -407,7 +407,7 @@ public class GolemBase extends EntityCreature implements IInventory } @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) + public boolean isItemValidForSlot (int i, ItemStack itemstack) { return true; } diff --git a/mods/tinker/tconstruct/entity/MetalSlime.java b/mods/tinker/tconstruct/entity/MetalSlime.java index ec3199d9..df6303ad 100644 --- a/mods/tinker/tconstruct/entity/MetalSlime.java +++ b/mods/tinker/tconstruct/entity/MetalSlime.java @@ -1,9 +1,6 @@ package mods.tinker.tconstruct.entity; -import mods.tinker.tconstruct.common.TContent; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.world.World; diff --git a/mods/tinker/tconstruct/entity/MiniGardy.java b/mods/tinker/tconstruct/entity/MiniGardy.java index 77f192a3..ea619b5c 100644 --- a/mods/tinker/tconstruct/entity/MiniGardy.java +++ b/mods/tinker/tconstruct/entity/MiniGardy.java @@ -16,7 +16,7 @@ public class MiniGardy extends GolemBase public MiniGardy(World world) { super(world); - this.texture = "/mods/tinker/textures/mob/googirl.png"; + //this.texture = "/mods/tinker/textures/mob/googirl.png"; this.setSize(0.375F, 0.875F); this.tasks.addTask(1, new GAISwim(this)); this.tasks.addTask(8, new GAIFellTree(this)); diff --git a/mods/tinker/tconstruct/entity/Skyla.java b/mods/tinker/tconstruct/entity/Skyla.java index 8556b070..49da07dd 100644 --- a/mods/tinker/tconstruct/entity/Skyla.java +++ b/mods/tinker/tconstruct/entity/Skyla.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.entity; import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; public class Skyla extends EntityCreeper @@ -11,7 +10,7 @@ public class Skyla extends EntityCreeper { super(par1World); //username = "Skyla"; - texture = "/mods/tinker/textures/mob/skyla.png"; + //texture = "/mods/tinker/textures/mob/skyla.png"; } /*@Override diff --git a/mods/tinker/tconstruct/entity/SlimeClone.java b/mods/tinker/tconstruct/entity/SlimeClone.java index 01d59406..e5ffbfff 100644 --- a/mods/tinker/tconstruct/entity/SlimeClone.java +++ b/mods/tinker/tconstruct/entity/SlimeClone.java @@ -1,9 +1,7 @@ package mods.tinker.tconstruct.entity; import mods.tinker.tconstruct.TConstruct; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.potion.Potion; import net.minecraft.util.MathHelper; import net.minecraft.world.World; diff --git a/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java b/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java index b5fdaee7..2a8e1002 100644 --- a/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java +++ b/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java @@ -8,6 +8,7 @@ import net.minecraft.crash.CrashReportCategory; import net.minecraft.enchantment.EnchantmentThorns; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -40,7 +41,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa super(par1World); } - public ArrowEntity(World world, EntityLiving living, float baseSpeed, ItemStack stack) + public ArrowEntity(World world, EntityLivingBase living, float baseSpeed, ItemStack stack) { super(world, living, baseSpeed); this.returnStack = stack; @@ -222,9 +223,9 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (movingobjectposition.entityHit.attackEntityFrom(damagesource, damageInflicted)) { - if (movingobjectposition.entityHit instanceof EntityLiving) + if (movingobjectposition.entityHit instanceof EntityLivingBase) { - EntityLiving entityliving = (EntityLiving) movingobjectposition.entityHit; + EntityLivingBase entityliving = (EntityLivingBase) movingobjectposition.entityHit; if (!this.worldObj.isRemote) { @@ -267,9 +268,9 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (player.inventory.addItemStackToInventory(returnStack)) this.setDead(); } - else if (movingobjectposition.entityHit instanceof EntityLiving) + else if (movingobjectposition.entityHit instanceof EntityLivingBase) { - EntityLiving living = (EntityLiving) movingobjectposition.entityHit; + EntityLivingBase living = (EntityLivingBase) movingobjectposition.entityHit; if (addItemStackToInventory(returnStack, living)) this.setDead(); } @@ -373,7 +374,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa } } - public boolean addItemStackToInventory (ItemStack par1ItemStack, EntityLiving living) + public boolean addItemStackToInventory (ItemStack par1ItemStack, EntityLivingBase living) { if (par1ItemStack == null) { @@ -424,7 +425,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa } } - public int getFirstEmptyStack (EntityLiving living) + public int getFirstEmptyStack (EntityLivingBase living) { for (int i = 0; i < 5; ++i) { @@ -437,7 +438,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa return -1; } - private int storePartialItemStack (ItemStack par1ItemStack, EntityLiving living) + private int storePartialItemStack (ItemStack par1ItemStack, EntityLivingBase living) { int i = par1ItemStack.itemID; int j = par1ItemStack.stackSize; @@ -460,7 +461,8 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (living.getCurrentItemOrArmor(slotID) == null) { living.setCurrentItemOrArmor(slotID, par1ItemStack); - living.func_96120_a(slotID, 2.0f); + if (living instanceof EntityLiving) + ((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f); } return 0; @@ -485,14 +487,9 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (stack == null) { living.setCurrentItemOrArmor(slotID, par1ItemStack); - living.func_96120_a(slotID, 2.0f); + if (living instanceof EntityLiving) + ((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f); return par1ItemStack.stackSize; - /*this.mainInventory[slotID] = new ItemStack(i, 0, par1ItemStack.getItemDamage()); - - if (par1ItemStack.hasTagCompound()) - { - this.mainInventory[slotID].setTagCompound((NBTTagCompound) par1ItemStack.getTagCompound().copy()); - }*/ } else { @@ -518,9 +515,8 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa j -= l; stack.stackSize++; living.setCurrentItemOrArmor(slotID, stack); - living.func_96120_a(slotID, 2.0f); - //this.mainInventory[slotID].stackSize += l; - //this.mainInventory[slotID].animationsToGo = 5; + if (living instanceof EntityLiving) + ((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f); return j; } } @@ -528,7 +524,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa } } - private int storeItemStack (ItemStack par1ItemStack, EntityLiving living) + private int storeItemStack (ItemStack par1ItemStack, EntityLivingBase living) { for (int slotID = 0; slotID < 5; ++slotID) { diff --git a/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java b/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java index 0936e75c..8102af9c 100644 --- a/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java +++ b/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java @@ -3,7 +3,7 @@ package mods.tinker.tconstruct.entity.projectile; import java.util.Iterator; import java.util.List; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -28,12 +28,12 @@ public class LaunchedPotion extends EntityThrowable super(par1World); } - public LaunchedPotion(World par1World, EntityLiving par2EntityLiving, int par3) + public LaunchedPotion(World par1World, EntityLivingBase par2EntityLiving, int par3) { this(par1World, par2EntityLiving, new ItemStack(Item.potion, 1, par3)); } - public LaunchedPotion(World par1World, EntityLiving par2EntityLiving, ItemStack par3ItemStack) + public LaunchedPotion(World par1World, EntityLivingBase par2EntityLiving, ItemStack par3ItemStack) { super(par1World, par2EntityLiving); this.potionDamage = par3ItemStack; @@ -104,7 +104,7 @@ public class LaunchedPotion extends EntityThrowable if (list != null && !list.isEmpty()) { AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - List list1 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, axisalignedbb); + List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); if (list1 != null && !list1.isEmpty()) { @@ -112,7 +112,7 @@ public class LaunchedPotion extends EntityThrowable while (iterator.hasNext()) { - EntityLiving entityliving = (EntityLiving) iterator.next(); + EntityLivingBase entityliving = (EntityLivingBase) iterator.next(); double d0 = this.getDistanceSqToEntity(entityliving); if (d0 < 16.0D) diff --git a/mods/tinker/tconstruct/entity/projectile/RotatingBase.java b/mods/tinker/tconstruct/entity/projectile/RotatingBase.java index ad0227d2..a74b8464 100644 --- a/mods/tinker/tconstruct/entity/projectile/RotatingBase.java +++ b/mods/tinker/tconstruct/entity/projectile/RotatingBase.java @@ -2,12 +2,8 @@ package mods.tinker.tconstruct.entity.projectile; import java.util.List; -import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteArrayDataOutput; - import mods.tinker.tconstruct.library.tools.AbilityHelper; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -16,6 +12,10 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; + import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; public class RotatingBase extends Entity implements IEntityAdditionalSpawnData diff --git a/mods/tinker/tconstruct/inventory/ActiveContainer.java b/mods/tinker/tconstruct/inventory/ActiveContainer.java index d81397b5..649af32b 100644 --- a/mods/tinker/tconstruct/inventory/ActiveContainer.java +++ b/mods/tinker/tconstruct/inventory/ActiveContainer.java @@ -3,11 +3,8 @@ package mods.tinker.tconstruct.inventory; import java.util.ArrayList; import java.util.List; -import mods.tinker.tconstruct.blocks.logic.SmelteryLogic; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; public class ActiveContainer extends Container { diff --git a/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java b/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java index 31ad1691..0b0a6dba 100644 --- a/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java +++ b/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.inventory; import mods.tinker.tconstruct.util.player.ArmorExtended; -import mods.tinker.tconstruct.util.player.TPlayerStats; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; diff --git a/mods/tinker/tconstruct/inventory/KnapsackContainer.java b/mods/tinker/tconstruct/inventory/KnapsackContainer.java index 6b0aa248..beeafaba 100644 --- a/mods/tinker/tconstruct/inventory/KnapsackContainer.java +++ b/mods/tinker/tconstruct/inventory/KnapsackContainer.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.inventory; -import mods.tinker.tconstruct.library.util.IPattern; import mods.tinker.tconstruct.util.player.KnapsackInventory; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/mods/tinker/tconstruct/inventory/MiniGardyContainer.java b/mods/tinker/tconstruct/inventory/MiniGardyContainer.java index ca63e92f..e66ee53d 100644 --- a/mods/tinker/tconstruct/inventory/MiniGardyContainer.java +++ b/mods/tinker/tconstruct/inventory/MiniGardyContainer.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.inventory; import mods.tinker.tconstruct.entity.MiniGardy; -import mods.tinker.tconstruct.library.util.IPattern; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; diff --git a/mods/tinker/tconstruct/inventory/PartCrafterContainer.java b/mods/tinker/tconstruct/inventory/PartCrafterContainer.java index 1dd8224e..46994cf9 100644 --- a/mods/tinker/tconstruct/inventory/PartCrafterContainer.java +++ b/mods/tinker/tconstruct/inventory/PartCrafterContainer.java @@ -4,7 +4,6 @@ import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic; import mods.tinker.tconstruct.library.util.IPattern; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/inventory/PatternShaperContainer.java b/mods/tinker/tconstruct/inventory/PatternShaperContainer.java index 2b0b048b..667b64d1 100644 --- a/mods/tinker/tconstruct/inventory/PatternShaperContainer.java +++ b/mods/tinker/tconstruct/inventory/PatternShaperContainer.java @@ -45,9 +45,9 @@ public class PatternShaperContainer extends Container }*/ /*@Override - public void onCraftGuiClosed(EntityPlayer entityplayer) + public void onContainerClosed(EntityPlayer entityplayer) { - super.onCraftGuiClosed(entityplayer); + super.onContainerClosed(entityplayer); if (logic.worldObj.isRemote) { return; diff --git a/mods/tinker/tconstruct/inventory/SlotToolForge.java b/mods/tinker/tconstruct/inventory/SlotToolForge.java index 687f0f34..ee137f1d 100644 --- a/mods/tinker/tconstruct/inventory/SlotToolForge.java +++ b/mods/tinker/tconstruct/inventory/SlotToolForge.java @@ -5,7 +5,6 @@ import java.util.Random; import mods.tinker.tconstruct.library.tools.ToolCore; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/mods/tinker/tconstruct/inventory/SmelteryContainer.java b/mods/tinker/tconstruct/inventory/SmelteryContainer.java index a2248fb9..c59a79af 100644 --- a/mods/tinker/tconstruct/inventory/SmelteryContainer.java +++ b/mods/tinker/tconstruct/inventory/SmelteryContainer.java @@ -1,12 +1,8 @@ package mods.tinker.tconstruct.inventory; -import java.util.ArrayList; -import java.util.List; - import mods.tinker.tconstruct.blocks.logic.SmelteryLogic; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/inventory/ToolForgeContainer.java b/mods/tinker/tconstruct/inventory/ToolForgeContainer.java index dbdca0ad..e1ceae1d 100644 --- a/mods/tinker/tconstruct/inventory/ToolForgeContainer.java +++ b/mods/tinker/tconstruct/inventory/ToolForgeContainer.java @@ -2,7 +2,6 @@ package mods.tinker.tconstruct.inventory; import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic; import mods.tinker.tconstruct.blocks.logic.ToolStationLogic; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/inventory/ToolStationContainer.java b/mods/tinker/tconstruct/inventory/ToolStationContainer.java index 02143168..f4036dae 100644 --- a/mods/tinker/tconstruct/inventory/ToolStationContainer.java +++ b/mods/tinker/tconstruct/inventory/ToolStationContainer.java @@ -6,7 +6,6 @@ import mods.tinker.tconstruct.blocks.logic.ToolStationLogic; import mods.tinker.tconstruct.library.tools.ToolCore; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/mods/tinker/tconstruct/items/Bowstring.java b/mods/tinker/tconstruct/items/Bowstring.java index 8dbaff69..79eccfdc 100644 --- a/mods/tinker/tconstruct/items/Bowstring.java +++ b/mods/tinker/tconstruct/items/Bowstring.java @@ -2,16 +2,10 @@ package mods.tinker.tconstruct.items; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.util.IToolPart; -import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; public class Bowstring extends CraftingItem implements IToolPart { diff --git a/mods/tinker/tconstruct/items/Fletching.java b/mods/tinker/tconstruct/items/Fletching.java index 59891e61..51e0b9e4 100644 --- a/mods/tinker/tconstruct/items/Fletching.java +++ b/mods/tinker/tconstruct/items/Fletching.java @@ -1,16 +1,7 @@ package mods.tinker.tconstruct.items; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.library.util.IToolPart; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; public class Fletching extends CraftingItem implements IToolPart { diff --git a/mods/tinker/tconstruct/items/GoldenHead.java b/mods/tinker/tconstruct/items/GoldenHead.java index 720375d2..54a889e3 100644 --- a/mods/tinker/tconstruct/items/GoldenHead.java +++ b/mods/tinker/tconstruct/items/GoldenHead.java @@ -10,7 +10,6 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.Icon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java b/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java index 35947c31..cc6040fb 100644 --- a/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java +++ b/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import mods.tinker.tconstruct.common.TContent; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; @@ -9,8 +7,9 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class RedstoneBallRepeaterItem extends Item { diff --git a/mods/tinker/tconstruct/items/SpecialFood.java b/mods/tinker/tconstruct/items/SpecialFood.java index ec171dbc..dc6421d4 100644 --- a/mods/tinker/tconstruct/items/SpecialFood.java +++ b/mods/tinker/tconstruct/items/SpecialFood.java @@ -2,9 +2,6 @@ package mods.tinker.tconstruct.items; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import mods.tinker.tconstruct.TConstruct; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -13,6 +10,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class SpecialFood extends ItemFood { diff --git a/mods/tinker/tconstruct/items/TitleIcon.java b/mods/tinker/tconstruct/items/TitleIcon.java index a07b33ed..5d35a780 100644 --- a/mods/tinker/tconstruct/items/TitleIcon.java +++ b/mods/tinker/tconstruct/items/TitleIcon.java @@ -2,10 +2,6 @@ package mods.tinker.tconstruct.items; import java.util.List; -import mods.natura.entity.FlameSpider; -import mods.natura.entity.FlameSpiderBaby; -import mods.natura.entity.ImpEntity; -import mods.natura.entity.NitroCreeper; import mods.tinker.tconstruct.client.TProxyClient; import mods.tinker.tconstruct.entity.BlueSlime; import mods.tinker.tconstruct.library.tools.ToolCore; diff --git a/mods/tinker/tconstruct/items/ToolShard.java b/mods/tinker/tconstruct/items/ToolShard.java index 87d9b427..78b00756 100644 --- a/mods/tinker/tconstruct/items/ToolShard.java +++ b/mods/tinker/tconstruct/items/ToolShard.java @@ -2,14 +2,13 @@ package mods.tinker.tconstruct.items; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.common.TContent; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ToolShard extends ToolPart { diff --git a/mods/tinker/tconstruct/items/armor/Knapsack.java b/mods/tinker/tconstruct/items/armor/Knapsack.java index b5eb53b3..139e7b97 100644 --- a/mods/tinker/tconstruct/items/armor/Knapsack.java +++ b/mods/tinker/tconstruct/items/armor/Knapsack.java @@ -2,13 +2,9 @@ package mods.tinker.tconstruct.items.armor; import java.util.List; -import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.items.CraftingItem; -import mods.tinker.tconstruct.util.player.ArmorExtended; -import mods.tinker.tconstruct.util.player.TPlayerStats; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/mods/tinker/tconstruct/items/armor/TArmorBase.java b/mods/tinker/tconstruct/items/armor/TArmorBase.java index 0f388f73..dbf6b9fd 100644 --- a/mods/tinker/tconstruct/items/armor/TArmorBase.java +++ b/mods/tinker/tconstruct/items/armor/TArmorBase.java @@ -1,14 +1,10 @@ package mods.tinker.tconstruct.items.armor; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; @@ -75,7 +71,7 @@ public class TArmorBase extends ItemArmor */ @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel (EntityLiving par1EntityLiving, ItemStack itemStack, int armorSlot) + public ModelBiped getArmorModel (EntityLivingBase par1EntityLiving, ItemStack itemStack, int armorSlot) { return null; } diff --git a/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java b/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java index acd65b49..41e9f5a4 100644 --- a/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java @@ -2,12 +2,12 @@ package mods.tinker.tconstruct.items.blocks; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class CraftedSoilItemBlock extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java b/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java index d5b6368d..06dae219 100644 --- a/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java +++ b/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java @@ -1,10 +1,5 @@ package mods.tinker.tconstruct.items.blocks; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; diff --git a/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java b/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java index ef7ee6b4..b720ee0e 100644 --- a/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java +++ b/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java @@ -1,10 +1,5 @@ package mods.tinker.tconstruct.items.blocks; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; diff --git a/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java b/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java index 0c0aa256..62443405 100644 --- a/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java +++ b/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java @@ -1,8 +1,6 @@ package mods.tinker.tconstruct.items.blocks; import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; public class LightCrystalItem extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java b/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java index eededab8..e42f729f 100644 --- a/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java @@ -1,12 +1,12 @@ package mods.tinker.tconstruct.items.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import mods.tinker.tconstruct.common.TContent; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class LiquidItemBlock extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java b/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java index c2a96a4d..09197e86 100644 --- a/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java +++ b/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java @@ -2,12 +2,12 @@ package mods.tinker.tconstruct.items.blocks; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class MultiBrickFancyItem extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java b/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java index 0616529c..d47b512c 100644 --- a/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java +++ b/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java @@ -2,12 +2,12 @@ package mods.tinker.tconstruct.items.blocks; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class MultiBrickItem extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/blocks/SearedSlabItem.java b/mods/tinker/tconstruct/items/blocks/SearedSlabItem.java index 5ad76a47..370f71f7 100644 --- a/mods/tinker/tconstruct/items/blocks/SearedSlabItem.java +++ b/mods/tinker/tconstruct/items/blocks/SearedSlabItem.java @@ -1,10 +1,5 @@ package mods.tinker.tconstruct.items.blocks; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; diff --git a/mods/tinker/tconstruct/items/blocks/SoilSlabItem.java b/mods/tinker/tconstruct/items/blocks/SoilSlabItem.java index 03f4c02a..61ef6f8d 100644 --- a/mods/tinker/tconstruct/items/blocks/SoilSlabItem.java +++ b/mods/tinker/tconstruct/items/blocks/SoilSlabItem.java @@ -2,12 +2,12 @@ package mods.tinker.tconstruct.items.blocks; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class SoilSlabItem extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/blocks/StainedGlassClearItem.java b/mods/tinker/tconstruct/items/blocks/StainedGlassClearItem.java index 2a134e48..898b871f 100644 --- a/mods/tinker/tconstruct/items/blocks/StainedGlassClearItem.java +++ b/mods/tinker/tconstruct/items/blocks/StainedGlassClearItem.java @@ -1,10 +1,5 @@ package mods.tinker.tconstruct.items.blocks; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; diff --git a/mods/tinker/tconstruct/items/blocks/StainedGlassClearPaneItem.java b/mods/tinker/tconstruct/items/blocks/StainedGlassClearPaneItem.java index 1a211af2..dfb1be3b 100644 --- a/mods/tinker/tconstruct/items/blocks/StainedGlassClearPaneItem.java +++ b/mods/tinker/tconstruct/items/blocks/StainedGlassClearPaneItem.java @@ -1,10 +1,5 @@ package mods.tinker.tconstruct.items.blocks; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; diff --git a/mods/tinker/tconstruct/items/blocks/ToolForgeItemBlock.java b/mods/tinker/tconstruct/items/blocks/ToolForgeItemBlock.java index a07294b8..3927e856 100644 --- a/mods/tinker/tconstruct/items/blocks/ToolForgeItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/ToolForgeItemBlock.java @@ -1,8 +1,6 @@ package mods.tinker.tconstruct.items.blocks; import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; public class ToolForgeItemBlock extends ItemBlock { diff --git a/mods/tinker/tconstruct/items/tools/Arrow.java b/mods/tinker/tconstruct/items/tools/Arrow.java index 19cf96ef..dba54830 100644 --- a/mods/tinker/tconstruct/items/tools/Arrow.java +++ b/mods/tinker/tconstruct/items/tools/Arrow.java @@ -2,9 +2,6 @@ package mods.tinker.tconstruct.items.tools; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.crafting.ToolBuilder; import mods.tinker.tconstruct.library.tools.ToolCore; @@ -14,6 +11,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class Arrow extends ToolCore { diff --git a/mods/tinker/tconstruct/items/tools/Broadsword.java b/mods/tinker/tconstruct/items/tools/Broadsword.java index 1b71d737..fc483d32 100644 --- a/mods/tinker/tconstruct/items/tools/Broadsword.java +++ b/mods/tinker/tconstruct/items/tools/Broadsword.java @@ -2,13 +2,7 @@ package mods.tinker.tconstruct.items.tools; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.tools.Weapon; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.entity.Entity; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class Broadsword extends Weapon { diff --git a/mods/tinker/tconstruct/items/tools/Cleaver.java b/mods/tinker/tconstruct/items/tools/Cleaver.java index 06c04652..3cee75e4 100644 --- a/mods/tinker/tconstruct/items/tools/Cleaver.java +++ b/mods/tinker/tconstruct/items/tools/Cleaver.java @@ -129,14 +129,14 @@ public class Cleaver extends Weapon { entity.hurtResistantTime += 7; - if (entity instanceof EntityLiving) + /*if (entity instanceof EntityLiving) { EntityLiving living = (EntityLiving) entity; if (living.getHealth() <= 0) { } - } + }*/ //if (entity.getHealth() <= 0) } return true; diff --git a/mods/tinker/tconstruct/items/tools/Dagger.java b/mods/tinker/tconstruct/items/tools/Dagger.java index 2f0ce83f..41978e1a 100644 --- a/mods/tinker/tconstruct/items/tools/Dagger.java +++ b/mods/tinker/tconstruct/items/tools/Dagger.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.items.tools; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.entity.projectile.DaggerEntity; import mods.tinker.tconstruct.library.tools.Weapon; diff --git a/mods/tinker/tconstruct/items/tools/Excavator.java b/mods/tinker/tconstruct/items/tools/Excavator.java index 8136a3c7..9c05d3b4 100644 --- a/mods/tinker/tconstruct/items/tools/Excavator.java +++ b/mods/tinker/tconstruct/items/tools/Excavator.java @@ -7,13 +7,10 @@ import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.HarvestTool; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; diff --git a/mods/tinker/tconstruct/items/tools/Hammer.java b/mods/tinker/tconstruct/items/tools/Hammer.java index 0a483f5f..62ff7365 100644 --- a/mods/tinker/tconstruct/items/tools/Hammer.java +++ b/mods/tinker/tconstruct/items/tools/Hammer.java @@ -9,14 +9,10 @@ import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.HarvestTool; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; import net.minecraft.util.Icon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; diff --git a/mods/tinker/tconstruct/items/tools/Longsword.java b/mods/tinker/tconstruct/items/tools/Longsword.java index 27108e40..9fcf71f0 100644 --- a/mods/tinker/tconstruct/items/tools/Longsword.java +++ b/mods/tinker/tconstruct/items/tools/Longsword.java @@ -1,9 +1,6 @@ package mods.tinker.tconstruct.items.tools; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.Weapon; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; @@ -11,9 +8,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class Longsword extends Weapon { diff --git a/mods/tinker/tconstruct/items/tools/LumberAxe.java b/mods/tinker/tconstruct/items/tools/LumberAxe.java index 32108f73..9d7ce8ab 100644 --- a/mods/tinker/tconstruct/items/tools/LumberAxe.java +++ b/mods/tinker/tconstruct/items/tools/LumberAxe.java @@ -1,10 +1,5 @@ package mods.tinker.tconstruct.items.tools; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.ActiveToolMod; import mods.tinker.tconstruct.library.TConstructRegistry; @@ -12,17 +7,15 @@ import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.HarvestTool; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class LumberAxe extends HarvestTool { diff --git a/mods/tinker/tconstruct/items/tools/PotionLauncher.java b/mods/tinker/tconstruct/items/tools/PotionLauncher.java index c95cbb00..0de58f1c 100644 --- a/mods/tinker/tconstruct/items/tools/PotionLauncher.java +++ b/mods/tinker/tconstruct/items/tools/PotionLauncher.java @@ -5,8 +5,7 @@ import java.util.List; import mods.tinker.tconstruct.entity.projectile.LaunchedPotion; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.EnumAction; @@ -124,7 +123,7 @@ public class PotionLauncher extends Item } @Override - public boolean onEntitySwing (EntityLiving player, ItemStack stack) + public boolean onEntitySwing (EntityLivingBase player, ItemStack stack) { NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); if (tags.getBoolean("Loaded")) @@ -148,7 +147,7 @@ public class PotionLauncher extends Item return false; } - ItemStack findPotion (EntityLiving living) + ItemStack findPotion (EntityLivingBase living) { if (living instanceof EntityPlayer) { diff --git a/mods/tinker/tconstruct/items/tools/Rapier.java b/mods/tinker/tconstruct/items/tools/Rapier.java index bdb35f05..8003510f 100644 --- a/mods/tinker/tconstruct/items/tools/Rapier.java +++ b/mods/tinker/tconstruct/items/tools/Rapier.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.items.tools; import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.Weapon; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLiving; diff --git a/mods/tinker/tconstruct/items/tools/Shortbow.java b/mods/tinker/tconstruct/items/tools/Shortbow.java index af7f78a7..7abab96c 100644 --- a/mods/tinker/tconstruct/items/tools/Shortbow.java +++ b/mods/tinker/tconstruct/items/tools/Shortbow.java @@ -2,10 +2,7 @@ package mods.tinker.tconstruct.items.tools; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.tools.BowBase; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; @@ -14,6 +11,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class Shortbow extends BowBase { diff --git a/mods/tinker/tconstruct/library/ActiveToolMod.java b/mods/tinker/tconstruct/library/ActiveToolMod.java index 41d44849..cfb68bd2 100644 --- a/mods/tinker/tconstruct/library/ActiveToolMod.java +++ b/mods/tinker/tconstruct/library/ActiveToolMod.java @@ -2,8 +2,7 @@ package mods.tinker.tconstruct.library; import mods.tinker.tconstruct.library.tools.ToolCore; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -17,7 +16,7 @@ public class ActiveToolMod } /* Harvesting */ - public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLiving entity) + public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLivingBase entity) { return false; } @@ -29,18 +28,18 @@ public class ActiveToolMod /* Attacking */ - public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { return 0; } //Calculated after sprinting and enchant bonuses - public float knockback (float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public float knockback (float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { return 0f; } - public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { return 0; } @@ -51,12 +50,12 @@ public class ActiveToolMod } /* Damage tool */ - public boolean damageTool (ItemStack stack, int damage, EntityLiving entity) + public boolean damageTool (ItemStack stack, int damage, EntityLivingBase entity) { return false; } - public boolean doesCriticalHit (ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public boolean doesCriticalHit (ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { return false; } diff --git a/mods/tinker/tconstruct/library/TConstructRegistry.java b/mods/tinker/tconstruct/library/TConstructRegistry.java index 4ea9a545..fb2db1a6 100644 --- a/mods/tinker/tconstruct/library/TConstructRegistry.java +++ b/mods/tinker/tconstruct/library/TConstructRegistry.java @@ -6,8 +6,16 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import mods.tinker.tconstruct.library.crafting.*; -import mods.tinker.tconstruct.library.tools.*; +import mods.tinker.tconstruct.library.crafting.Detailing; +import mods.tinker.tconstruct.library.crafting.LiquidCasting; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ArrowMaterial; +import mods.tinker.tconstruct.library.tools.BowMaterial; +import mods.tinker.tconstruct.library.tools.BowstringMaterial; +import mods.tinker.tconstruct.library.tools.CustomMaterial; +import mods.tinker.tconstruct.library.tools.FletchingMaterial; +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.library.tools.ToolMaterial; import mods.tinker.tconstruct.library.util.TabTools; import net.minecraft.block.Block; import net.minecraft.item.Item; diff --git a/mods/tinker/tconstruct/library/blocks/InventoryBlock.java b/mods/tinker/tconstruct/library/blocks/InventoryBlock.java index 7a96f64b..3cbd0f48 100644 --- a/mods/tinker/tconstruct/library/blocks/InventoryBlock.java +++ b/mods/tinker/tconstruct/library/blocks/InventoryBlock.java @@ -7,7 +7,7 @@ import mods.tinker.tconstruct.library.util.IFacingLogic; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -122,7 +122,7 @@ public abstract class InventoryBlock extends BlockContainer } @Override - public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving entityliving, ItemStack stack) + public void onBlockPlacedBy (World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack stack) { TileEntity logic = world.getBlockTileEntity(x, y, z); if (logic instanceof IFacingLogic) diff --git a/mods/tinker/tconstruct/library/blocks/InventoryLogic.java b/mods/tinker/tconstruct/library/blocks/InventoryLogic.java index d83a565a..bf1115a6 100644 --- a/mods/tinker/tconstruct/library/blocks/InventoryLogic.java +++ b/mods/tinker/tconstruct/library/blocks/InventoryLogic.java @@ -170,7 +170,7 @@ public abstract class InventoryLogic extends TileEntity implements IInventory } @Override - public boolean isStackValidForSlot (int slot, ItemStack itemstack) + public boolean isItemValidForSlot (int slot, ItemStack itemstack) { if (slot < getSizeInventory()) { diff --git a/mods/tinker/tconstruct/library/crafting/AlloyMix.java b/mods/tinker/tconstruct/library/crafting/AlloyMix.java index a7bc1580..760e9fd9 100644 --- a/mods/tinker/tconstruct/library/crafting/AlloyMix.java +++ b/mods/tinker/tconstruct/library/crafting/AlloyMix.java @@ -4,8 +4,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import net.minecraftforge.liquids.LiquidStack; - public class AlloyMix { public final LiquidStack result; diff --git a/mods/tinker/tconstruct/library/crafting/CastingRecipe.java b/mods/tinker/tconstruct/library/crafting/CastingRecipe.java index b3dcfea8..44b61890 100644 --- a/mods/tinker/tconstruct/library/crafting/CastingRecipe.java +++ b/mods/tinker/tconstruct/library/crafting/CastingRecipe.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.library.crafting; import net.minecraft.item.ItemStack; -import net.minecraftforge.liquids.LiquidStack; public class CastingRecipe { diff --git a/mods/tinker/tconstruct/library/crafting/Detailing.java b/mods/tinker/tconstruct/library/crafting/Detailing.java index aa3b426a..821086a4 100644 --- a/mods/tinker/tconstruct/library/crafting/Detailing.java +++ b/mods/tinker/tconstruct/library/crafting/Detailing.java @@ -7,7 +7,6 @@ import mods.tinker.tconstruct.library.tools.ToolCore; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.registry.GameRegistry; diff --git a/mods/tinker/tconstruct/library/crafting/LiquidCasting.java b/mods/tinker/tconstruct/library/crafting/LiquidCasting.java index 2024cd9e..b6c3bbe2 100644 --- a/mods/tinker/tconstruct/library/crafting/LiquidCasting.java +++ b/mods/tinker/tconstruct/library/crafting/LiquidCasting.java @@ -1,12 +1,8 @@ package mods.tinker.tconstruct.library.crafting; import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; import net.minecraft.item.ItemStack; -import net.minecraftforge.liquids.LiquidStack; /* Melting becomes hardened */ public class LiquidCasting diff --git a/mods/tinker/tconstruct/library/crafting/PatternBuilder.java b/mods/tinker/tconstruct/library/crafting/PatternBuilder.java index c73e51c3..7c7fe0fa 100644 --- a/mods/tinker/tconstruct/library/crafting/PatternBuilder.java +++ b/mods/tinker/tconstruct/library/crafting/PatternBuilder.java @@ -7,7 +7,6 @@ import java.util.List; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.event.PartBuilderEvent; -import mods.tinker.tconstruct.library.tools.BowstringMaterial; import mods.tinker.tconstruct.library.tools.CustomMaterial; import mods.tinker.tconstruct.library.util.IPattern; import net.minecraft.block.Block; diff --git a/mods/tinker/tconstruct/library/crafting/Smeltery.java b/mods/tinker/tconstruct/library/crafting/Smeltery.java index e7fc321b..a1e9fcdb 100644 --- a/mods/tinker/tconstruct/library/crafting/Smeltery.java +++ b/mods/tinker/tconstruct/library/crafting/Smeltery.java @@ -7,7 +7,6 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraftforge.liquids.LiquidStack; /** Melting and hacking, churn and burn */ public class Smeltery diff --git a/mods/tinker/tconstruct/library/event/PartBuilderEvent.java b/mods/tinker/tconstruct/library/event/PartBuilderEvent.java index 0ef113fc..571a4b8c 100644 --- a/mods/tinker/tconstruct/library/event/PartBuilderEvent.java +++ b/mods/tinker/tconstruct/library/event/PartBuilderEvent.java @@ -1,9 +1,6 @@ package mods.tinker.tconstruct.library.event; -import mods.tinker.tconstruct.library.tools.ToolCore; -import mods.tinker.tconstruct.library.tools.ToolMaterial; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.event.Event; /* This event fires after all of the other construction. The resulting nbttag is added to the tool diff --git a/mods/tinker/tconstruct/library/tools/AbilityHelper.java b/mods/tinker/tconstruct/library/tools/AbilityHelper.java index 38d6f3d1..09e8bc02 100644 --- a/mods/tinker/tconstruct/library/tools/AbilityHelper.java +++ b/mods/tinker/tconstruct/library/tools/AbilityHelper.java @@ -14,7 +14,7 @@ import net.minecraft.block.Block; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentThorns; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; @@ -43,7 +43,7 @@ public class AbilityHelper public static Random random = new Random(); /* Normal interactions */ - public static boolean onBlockChanged (ItemStack stack, World world, int bID, int x, int y, int z, EntityLiving player, Random random) + public static boolean onBlockChanged (ItemStack stack, World world, int bID, int x, int y, int z, EntityLivingBase player, Random random) { if (!stack.hasTagCompound()) return false; @@ -62,12 +62,12 @@ public class AbilityHelper return true; } - public static boolean onLeftClickEntity (ItemStack stack, EntityLiving player, Entity entity, ToolCore tool) + public static boolean onLeftClickEntity (ItemStack stack, EntityLivingBase player, Entity entity, ToolCore tool) { return onLeftClickEntity(stack, player, entity, tool, 0); } - public static boolean onLeftClickEntity (ItemStack stack, EntityLiving player, Entity entity, ToolCore tool, int baseDamage) + public static boolean onLeftClickEntity (ItemStack stack, EntityLivingBase player, Entity entity, ToolCore tool, int baseDamage) { if (entity.canAttackWithItem() && stack.hasTagCompound()) { @@ -103,10 +103,10 @@ public class AbilityHelper float knockback = 0; int enchantDamage = 0; - if (entity instanceof EntityLiving) + if (entity instanceof EntityLivingBase) { - enchantDamage = EnchantmentHelper.getEnchantmentModifierLiving(player, (EntityLiving) entity); - knockback += EnchantmentHelper.getKnockbackModifier(player, (EntityLiving) entity); + enchantDamage = EnchantmentHelper.getEnchantmentModifierLiving(player, (EntityLivingBase) entity); + knockback += EnchantmentHelper.getKnockbackModifier(player, (EntityLivingBase) entity); } damage += stoneboundDamage; @@ -141,7 +141,7 @@ public class AbilityHelper if (damage > 0 || enchantDamage > 0) { boolean criticalHit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) - && player.ridingEntity == null && entity instanceof EntityLiving; + && player.ridingEntity == null && entity instanceof EntityLivingBase; for (ActiveToolMod mod : TConstructRegistry.activeModifiers) { @@ -163,7 +163,7 @@ public class AbilityHelper boolean var6 = false; int fireAspect = EnchantmentHelper.getFireAspectModifier(player); - if (entity instanceof EntityLiving && fireAspect > 0 && !entity.isBurning()) + if (entity instanceof EntityLivingBase && fireAspect > 0 && !entity.isBurning()) { var6 = true; entity.setFire(1); @@ -237,27 +237,27 @@ public class AbilityHelper player.setLastAttackingEntity(entity); - if (entity instanceof EntityLiving) + if (entity instanceof EntityLivingBase) { - EnchantmentThorns.func_92096_a(player, (EntityLiving) entity, random); + EnchantmentThorns.func_92096_a(player, (EntityLivingBase) entity, random); } } - if (entity instanceof EntityLiving) + if (entity instanceof EntityLivingBase) { if (entity instanceof EntityPlayer) { - stack.hitEntity((EntityLiving) entity, (EntityPlayer) player); + stack.hitEntity((EntityLivingBase) entity, (EntityPlayer) player); if (entity.isEntityAlive()) { - alertPlayerWolves((EntityPlayer) player, (EntityLiving) entity, true); + alertPlayerWolves((EntityPlayer) player, (EntityLivingBase) entity, true); } ((EntityPlayer) player).addStat(StatList.damageDealtStat, damage); } else { - Item.itemsList[stack.itemID].hitEntity(stack, (EntityLiving) entity, player); + Item.itemsList[stack.itemID].hitEntity(stack, (EntityLivingBase) entity, player); } if ((fireAspect > 0 || toolTags.hasKey("Fiery") || toolTags.hasKey("Lava")) && causedDamage) @@ -289,7 +289,7 @@ public class AbilityHelper return false; } - static void alertPlayerWolves (EntityPlayer player, EntityLiving living, boolean par2) + static void alertPlayerWolves (EntityPlayer player, EntityLivingBase living, boolean par2) { if (!(living instanceof EntityCreeper) && !(living instanceof EntityGhast)) { @@ -324,19 +324,19 @@ public class AbilityHelper } /* Tool specific */ - public static void damageTool (ItemStack stack, int dam, EntityLiving entity, boolean ignoreCharge) + public static void damageTool (ItemStack stack, int dam, EntityLivingBase entity, boolean ignoreCharge) { NBTTagCompound tags = stack.getTagCompound(); damageTool(stack, dam, tags, entity, ignoreCharge); } - public static void healTool (ItemStack stack, int dam, EntityLiving entity, boolean ignoreCharge) + public static void healTool (ItemStack stack, int dam, EntityLivingBase entity, boolean ignoreCharge) { NBTTagCompound tags = stack.getTagCompound(); damageTool(stack, -dam, tags, entity, ignoreCharge); } - public static void damageTool (ItemStack stack, int dam, NBTTagCompound tags, EntityLiving entity, boolean ignoreCharge) + public static void damageTool (ItemStack stack, int dam, NBTTagCompound tags, EntityLivingBase entity, boolean ignoreCharge) { if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode || tags == null) return; @@ -541,7 +541,7 @@ public class AbilityHelper tags.getCompoundTag("InfiTool").setInteger("Damage", 0); } - public static DamageSource causePiercingDamage (EntityLiving mob) + public static DamageSource causePiercingDamage (EntityLivingBase mob) { return new PiercingEntityDamage("mob", mob); } @@ -551,7 +551,7 @@ public class AbilityHelper return new PiercingEntityDamage("player", player); } - public static void knockbackEntity (EntityLiving living, double boost) + public static void knockbackEntity (EntityLivingBase living, double boost) { living.motionX *= boost; //living.motionY *= boost/2; diff --git a/mods/tinker/tconstruct/library/tools/ToolCore.java b/mods/tinker/tconstruct/library/tools/ToolCore.java index dbd3bf76..bb07dd44 100644 --- a/mods/tinker/tconstruct/library/tools/ToolCore.java +++ b/mods/tinker/tconstruct/library/tools/ToolCore.java @@ -17,6 +17,7 @@ import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; @@ -583,7 +584,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox } @Override - public boolean onBlockDestroyed (ItemStack itemstack, World world, int blockID, int x, int y, int z, EntityLiving player) + public boolean onBlockDestroyed (ItemStack itemstack, World world, int blockID, int x, int y, int z, EntityLivingBase player) { Block block = Block.blocksList[blockID]; if (block != null && (double) block.getBlockHardness(world, x, y, z) != 0.0D) @@ -611,7 +612,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox } @Override - public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player) + public boolean hitEntity (ItemStack stack, EntityLivingBase mob, EntityLivingBase player) { return true; } diff --git a/mods/tinker/tconstruct/library/tools/ToolMod.java b/mods/tinker/tconstruct/library/tools/ToolMod.java index 31dbc356..c6d8c472 100644 --- a/mods/tinker/tconstruct/library/tools/ToolMod.java +++ b/mods/tinker/tconstruct/library/tools/ToolMod.java @@ -1,7 +1,6 @@ package mods.tinker.tconstruct.library.tools; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Random; diff --git a/mods/tinker/tconstruct/library/tools/Weapon.java b/mods/tinker/tconstruct/library/tools/Weapon.java index 0caa3cad..e19b99f6 100644 --- a/mods/tinker/tconstruct/library/tools/Weapon.java +++ b/mods/tinker/tconstruct/library/tools/Weapon.java @@ -1,7 +1,5 @@ package mods.tinker.tconstruct.library.tools; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.entity.EntityPlayerSP; @@ -10,6 +8,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class Weapon extends ToolCore { diff --git a/mods/tinker/tconstruct/library/util/IFacingLogic.java b/mods/tinker/tconstruct/library/util/IFacingLogic.java index 19461283..90c068b3 100644 --- a/mods/tinker/tconstruct/library/util/IFacingLogic.java +++ b/mods/tinker/tconstruct/library/util/IFacingLogic.java @@ -1,6 +1,6 @@ package mods.tinker.tconstruct.library.util; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraftforge.common.ForgeDirection; public interface IFacingLogic @@ -11,5 +11,5 @@ public interface IFacingLogic public void setDirection (int side); - public void setDirection (float yaw, float pitch, EntityLiving player); + public void setDirection (float yaw, float pitch, EntityLivingBase player); } \ No newline at end of file diff --git a/mods/tinker/tconstruct/modifiers/ModAntiSpider.java b/mods/tinker/tconstruct/modifiers/ModAntiSpider.java index f3aa1c40..fe4fc229 100644 --- a/mods/tinker/tconstruct/modifiers/ModAntiSpider.java +++ b/mods/tinker/tconstruct/modifiers/ModAntiSpider.java @@ -1,9 +1,5 @@ package mods.tinker.tconstruct.modifiers; -import java.util.Arrays; -import java.util.List; - -import mods.tinker.tconstruct.library.tools.ToolCore; import mods.tinker.tconstruct.library.tools.ToolMod; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/mods/tinker/tconstruct/modifiers/ModButtertouch.java b/mods/tinker/tconstruct/modifiers/ModButtertouch.java index 45291370..3013af0f 100644 --- a/mods/tinker/tconstruct/modifiers/ModButtertouch.java +++ b/mods/tinker/tconstruct/modifiers/ModButtertouch.java @@ -6,8 +6,6 @@ import java.util.List; import java.util.Map; import mods.tinker.tconstruct.library.tools.ToolCore; -import mods.tinker.tconstruct.library.tools.ToolMod; -import mods.tinker.tconstruct.library.tools.Weapon; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.ItemStack; diff --git a/mods/tinker/tconstruct/modifiers/ModExtraModifier.java b/mods/tinker/tconstruct/modifiers/ModExtraModifier.java index afe8c210..50a82e5a 100644 --- a/mods/tinker/tconstruct/modifiers/ModExtraModifier.java +++ b/mods/tinker/tconstruct/modifiers/ModExtraModifier.java @@ -1,9 +1,8 @@ package mods.tinker.tconstruct.modifiers; +import mods.tinker.tconstruct.library.tools.ToolMod; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import mods.tinker.tconstruct.library.crafting.PatternBuilder; -import mods.tinker.tconstruct.library.tools.ToolMod; public class ModExtraModifier extends ToolMod { diff --git a/mods/tinker/tconstruct/modifiers/ModSmite.java b/mods/tinker/tconstruct/modifiers/ModSmite.java index b36d71bc..2748b153 100644 --- a/mods/tinker/tconstruct/modifiers/ModSmite.java +++ b/mods/tinker/tconstruct/modifiers/ModSmite.java @@ -1,9 +1,5 @@ package mods.tinker.tconstruct.modifiers; -import java.util.Arrays; -import java.util.List; - -import mods.tinker.tconstruct.library.tools.ToolCore; import mods.tinker.tconstruct.library.tools.ToolMod; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/mods/tinker/tconstruct/modifiers/TActiveOmniMod.java b/mods/tinker/tconstruct/modifiers/TActiveOmniMod.java index c8d06c4d..b695477f 100644 --- a/mods/tinker/tconstruct/modifiers/TActiveOmniMod.java +++ b/mods/tinker/tconstruct/modifiers/TActiveOmniMod.java @@ -7,15 +7,13 @@ import java.util.Random; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.library.ActiveToolMod; import mods.tinker.tconstruct.library.tools.AbilityHelper; -import mods.tinker.tconstruct.library.tools.HarvestTool; import mods.tinker.tconstruct.library.tools.ToolCore; -import mods.tinker.tconstruct.library.tools.Weapon; import mods.tinker.tconstruct.util.PHConstruct; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; @@ -35,7 +33,7 @@ public class TActiveOmniMod extends ActiveToolMod @Override public void updateTool (ToolCore tool, ItemStack stack, World world, Entity entity) { - if (!world.isRemote && entity instanceof EntityLiving && !((EntityLiving) entity).isSwingInProgress && stack.getTagCompound() != null) + if (!world.isRemote && entity instanceof EntityLivingBase && !((EntityLivingBase) entity).isSwingInProgress && stack.getTagCompound() != null) { NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); if (tags.hasKey("Moss")) @@ -44,7 +42,7 @@ public class TActiveOmniMod extends ActiveToolMod int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 350 : 1150; if (random.nextInt(check) < chance) { - AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true); + AbilityHelper.healTool(stack, 1, (EntityLivingBase) entity, true); } } } @@ -52,7 +50,7 @@ public class TActiveOmniMod extends ActiveToolMod /* Harvesting */ @Override - public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLiving entity) + public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLivingBase entity) { if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode) return false; @@ -153,7 +151,7 @@ public class TActiveOmniMod extends ActiveToolMod /* Attacking */ @Override - public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { List list = Arrays.asList(tool.toolCategories()); if (list.contains("weapon")) @@ -162,12 +160,12 @@ public class TActiveOmniMod extends ActiveToolMod } @Override - public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { int bonus = 0; - if (entity instanceof EntityLiving) + if (entity instanceof EntityLivingBase) { - EnumCreatureAttribute attribute = ((EntityLiving) entity).getCreatureAttribute(); + EnumCreatureAttribute attribute = ((EntityLivingBase) entity).getCreatureAttribute(); if (attribute == EnumCreatureAttribute.UNDEAD) { if (tool == TContent.hammer) @@ -196,7 +194,7 @@ public class TActiveOmniMod extends ActiveToolMod } @Override - public float knockback (float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public float knockback (float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { float bonus = 0f; if (toolTags.hasKey("Knockback")) @@ -207,7 +205,7 @@ public class TActiveOmniMod extends ActiveToolMod return bonus; } - public boolean doesCriticalHit (ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public boolean doesCriticalHit (ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { if (tool == TContent.cutlass && random.nextInt(10) == 0) return true; diff --git a/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java b/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java index 10cb56ca..d602c748 100644 --- a/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java +++ b/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java @@ -7,7 +7,6 @@ import java.util.Random; import net.minecraft.entity.EntityLiving; import net.minecraft.item.ItemStack; import net.minecraft.world.World; - import powercrystals.minefactoryreloaded.api.IFactoryGrindable; import powercrystals.minefactoryreloaded.api.MobDrop; diff --git a/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java b/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java index 27f487f9..6d664a6b 100644 --- a/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java +++ b/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java @@ -7,7 +7,6 @@ import java.util.Random; import net.minecraft.item.ItemStack; import net.minecraft.world.World; - import powercrystals.minefactoryreloaded.api.HarvestType; import powercrystals.minefactoryreloaded.api.IFactoryHarvestable; diff --git a/mods/tinker/tconstruct/skill/Jump.java b/mods/tinker/tconstruct/skill/Jump.java index 49513333..dade07bc 100644 --- a/mods/tinker/tconstruct/skill/Jump.java +++ b/mods/tinker/tconstruct/skill/Jump.java @@ -1,6 +1,5 @@ package mods.tinker.tconstruct.skill; -import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.world.World; diff --git a/mods/tinker/tconstruct/skill/Skill.java b/mods/tinker/tconstruct/skill/Skill.java index 81008657..4910de32 100644 --- a/mods/tinker/tconstruct/skill/Skill.java +++ b/mods/tinker/tconstruct/skill/Skill.java @@ -1,10 +1,7 @@ package mods.tinker.tconstruct.skill; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; /* Base skill diff --git a/mods/tinker/tconstruct/skill/WallBuilding.java b/mods/tinker/tconstruct/skill/WallBuilding.java index 4b25cf61..eb0ffc2b 100644 --- a/mods/tinker/tconstruct/skill/WallBuilding.java +++ b/mods/tinker/tconstruct/skill/WallBuilding.java @@ -6,11 +6,9 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; public class WallBuilding extends Skill { diff --git a/mods/tinker/tconstruct/util/PHConstruct.java b/mods/tinker/tconstruct/util/PHConstruct.java index 919c2f25..b9831979 100644 --- a/mods/tinker/tconstruct/util/PHConstruct.java +++ b/mods/tinker/tconstruct/util/PHConstruct.java @@ -3,10 +3,6 @@ package mods.tinker.tconstruct.util; import java.io.File; import java.io.IOException; -import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.items.Fletching; -import mods.tinker.tconstruct.items.ToolPart; -import net.minecraft.block.Block; import net.minecraftforge.common.Configuration; public class PHConstruct diff --git a/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java b/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java index 7e7f2fd0..9ee1b67e 100644 --- a/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java +++ b/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java @@ -23,7 +23,7 @@ public class TDispenserBehaviorSpawnEgg extends BehaviorDefaultDispenseItem if (par2ItemStack.hasDisplayName()) { - ((EntityLiving) entity).func_94058_c(par2ItemStack.getDisplayName()); + ((EntityLiving) entity).setCustomNameTag(par2ItemStack.getDisplayName()); } par2ItemStack.splitStack(1); diff --git a/mods/tinker/tconstruct/util/TEventHandler.java b/mods/tinker/tconstruct/util/TEventHandler.java index 81f1572a..893b9f12 100644 --- a/mods/tinker/tconstruct/util/TEventHandler.java +++ b/mods/tinker/tconstruct/util/TEventHandler.java @@ -47,7 +47,6 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.event.entity.player.FillBucketEvent; import net.minecraftforge.event.world.ChunkDataEvent; -import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent; diff --git a/mods/tinker/tconstruct/util/player/ArmorExtended.java b/mods/tinker/tconstruct/util/player/ArmorExtended.java index 7c57e569..d92d2700 100644 --- a/mods/tinker/tconstruct/util/player/ArmorExtended.java +++ b/mods/tinker/tconstruct/util/player/ArmorExtended.java @@ -4,13 +4,11 @@ import java.lang.ref.WeakReference; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.skill.SkillRegistry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import cpw.mods.fml.common.FMLCommonHandler; public class ArmorExtended implements IInventory { @@ -179,7 +177,7 @@ public class ArmorExtended implements IInventory } @Override - public boolean isStackValidForSlot (int slot, ItemStack itemstack) + public boolean isItemValidForSlot (int slot, ItemStack itemstack) { return false; } diff --git a/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java b/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java index 02619721..3032259e 100644 --- a/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java +++ b/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java @@ -1,9 +1,5 @@ package mods.tinker.tconstruct.util.player; -import mods.tinker.tconstruct.client.TProxyClient; -import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.skill.SkillRegistry; -import net.minecraft.entity.player.EntityPlayer; public class ArmorExtendedClient extends ArmorExtended { diff --git a/mods/tinker/tconstruct/util/player/KnapsackInventory.java b/mods/tinker/tconstruct/util/player/KnapsackInventory.java index 25a8385c..f286c242 100644 --- a/mods/tinker/tconstruct/util/player/KnapsackInventory.java +++ b/mods/tinker/tconstruct/util/player/KnapsackInventory.java @@ -114,7 +114,7 @@ public class KnapsackInventory implements IInventory } @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) + public boolean isItemValidForSlot (int i, ItemStack itemstack) { return true; } diff --git a/mods/tinker/tconstruct/util/player/TFoodStats.java b/mods/tinker/tconstruct/util/player/TFoodStats.java deleted file mode 100644 index 036fbecb..00000000 --- a/mods/tinker/tconstruct/util/player/TFoodStats.java +++ /dev/null @@ -1,185 +0,0 @@ -package mods.tinker.tconstruct.util.player; - -import mods.tinker.tconstruct.util.PHConstruct; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemFood; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.FoodStats; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TFoodStats extends FoodStats -{ - /** The player's food level. */ - public int foodLevel = 20; - - /** The player's food saturation. */ - public float foodSaturationLevel = 5.0F; - - /** The player's food exhaustion. */ - public float foodExhaustionLevel; - - /** The player's food timer value. */ - public int foodTimer = 0; - public int prevFoodLevel = 20; - - /** - * Args: int foodLevel, float foodSaturationModifier - */ - public void addStats (int par1, float par2) - { - this.foodLevel = Math.min(par1 + this.foodLevel, 20); - this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float) par1 * par2 * 2.0F, (float) this.foodLevel); - } - - /** - * Eat some food. - */ - public void addStats (ItemFood par1ItemFood) - { - this.addStats(par1ItemFood.getHealAmount(), par1ItemFood.getSaturationModifier()); - } - - /** - * Handles the food game logic. - */ - public void onUpdate (EntityPlayer player) - { - int difficulty = player.worldObj.difficultySetting; - this.prevFoodLevel = this.foodLevel; - - if (this.foodExhaustionLevel > 6.0F) - { - this.foodExhaustionLevel -= 6.0F; - - if (this.foodSaturationLevel > 0.0F) - { - this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); - } - else if (difficulty > 0) - { - this.foodLevel = Math.max(this.foodLevel - 1, 0); - } - } - - if (this.foodLevel >= 12 + 2 * difficulty && player.shouldHeal() && PHConstruct.enableHealthRegen) - { - ++this.foodTimer; - - if (this.foodTimer >= 80) - { - player.heal(1); - this.foodTimer = 0; - } - } - else if (this.foodLevel <= 0) - { - ++this.foodTimer; - - if (this.foodTimer >= 80) - { - if (player.getHealth() > 10 || difficulty >= 3 || player.getHealth() > 1 && difficulty >= 2) - { - player.attackEntityFrom(DamageSource.starve, 1); - } - - this.foodTimer = 0; - } - } - else - { - this.foodTimer = 0; - } - } - - public void readStats (FoodStats stats) - { - this.foodLevel = stats.foodLevel; - - /** The player's food saturation. */ - this.foodSaturationLevel = stats.foodSaturationLevel; - - /** The player's food exhaustion. */ - this.foodExhaustionLevel = stats.foodExhaustionLevel; - - /** The player's food timer value. */ - this.foodTimer = stats.foodTimer; - this.prevFoodLevel = stats.prevFoodLevel; - } - - /** - * Reads food stats from an NBT object. - */ - public void readNBT (NBTTagCompound par1NBTTagCompound) - { - if (par1NBTTagCompound.hasKey("foodLevel")) - { - this.foodLevel = par1NBTTagCompound.getInteger("foodLevel"); - this.foodTimer = par1NBTTagCompound.getInteger("foodTickTimer"); - this.foodSaturationLevel = par1NBTTagCompound.getFloat("foodSaturationLevel"); - this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel"); - } - } - - /** - * Writes food stats to an NBT object. - */ - public void writeNBT (NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setInteger("foodLevel", this.foodLevel); - par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer); - par1NBTTagCompound.setFloat("foodSaturationLevel", this.foodSaturationLevel); - par1NBTTagCompound.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); - } - - /** - * Get the player's food level. - */ - public int getFoodLevel () - { - return this.foodLevel; - } - - @SideOnly(Side.CLIENT) - public int getPrevFoodLevel () - { - return this.prevFoodLevel; - } - - /** - * If foodLevel is not max. - */ - public boolean needFood () - { - return this.foodLevel < 20; - } - - /** - * adds input to foodExhaustionLevel to a max of 40 - */ - public void addExhaustion (float par1) - { - this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + par1, 40.0F); - } - - /** - * Get the player's food saturation level. - */ - public float getSaturationLevel () - { - return this.foodSaturationLevel; - } - - @SideOnly(Side.CLIENT) - public void setFoodLevel (int par1) - { - this.foodLevel = par1; - } - - @SideOnly(Side.CLIENT) - public void setFoodSaturationLevel (float par1) - { - this.foodSaturationLevel = par1; - } -} diff --git a/mods/tinker/tconstruct/util/player/TPlayerHandler.java b/mods/tinker/tconstruct/util/player/TPlayerHandler.java index a1f8250c..caefa3d9 100644 --- a/mods/tinker/tconstruct/util/player/TPlayerHandler.java +++ b/mods/tinker/tconstruct/util/player/TPlayerHandler.java @@ -38,9 +38,9 @@ public class TPlayerHandler implements IPlayerTracker { //System.out.println("Player: "+entityplayer); //Lookup player - TFoodStats food = new TFoodStats(); + /*TFoodStats food = new TFoodStats(); food.readStats(entityplayer.foodStats); - entityplayer.foodStats = food; + entityplayer.foodStats = food*/; NBTTagCompound tags = entityplayer.getEntityData(); if (!tags.hasKey("TConstruct")) { @@ -189,8 +189,8 @@ public class TPlayerHandler implements IPlayerTracker stats.player = new WeakReference(entityplayer); stats.armor.recalculateHealth(entityplayer, stats); - TFoodStats food = new TFoodStats(); - entityplayer.foodStats = food; + /*TFoodStats food = new TFoodStats(); + entityplayer.foodStats = food;*/ if (PHConstruct.keepLevels) entityplayer.experienceLevel = stats.level; diff --git a/mods/tinker/tconstruct/worldgen/OreberryBushGen.java b/mods/tinker/tconstruct/worldgen/OreberryBushGen.java index 616b61e6..563b8a4e 100644 --- a/mods/tinker/tconstruct/worldgen/OreberryBushGen.java +++ b/mods/tinker/tconstruct/worldgen/OreberryBushGen.java @@ -2,7 +2,6 @@ package mods.tinker.tconstruct.worldgen; import java.util.Random; -import mods.tinker.tconstruct.util.PHConstruct; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; diff --git a/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java b/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java index 7d9efae9..680aaad6 100644 --- a/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java +++ b/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java @@ -1,19 +1,20 @@ package mods.tinker.tconstruct.worldgen; -import java.util.Random; +import static net.minecraft.world.biome.BiomeGenBase.extremeHills; +import static net.minecraft.world.biome.BiomeGenBase.extremeHillsEdge; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND; -import com.google.common.collect.ImmutableCollection; -import com.google.common.collect.ImmutableList; +import java.util.Random; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.util.PHConstruct; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.event.ForgeSubscribe; -import static net.minecraft.world.biome.BiomeGenBase.extremeHills; -import static net.minecraft.world.biome.BiomeGenBase.extremeHillsEdge; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate; + +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableList; public class TerrainGenEventHandler { diff --git a/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java b/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java index 28f54295..ef0744e7 100644 --- a/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java +++ b/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java @@ -3,9 +3,7 @@ package mods.tinker.tconstruct.worldgen.village; import java.util.List; import java.util.Random; -import mods.tinker.tconstruct.blocks.logic.SmelteryLogic; import mods.tinker.tconstruct.common.TContent; -import mods.tinker.tconstruct.library.util.CoordTuple; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.gen.structure.ComponentVillage; diff --git a/test/XinStick.java b/test/XinStick.java index b9e82387..e1a60c25 100644 --- a/test/XinStick.java +++ b/test/XinStick.java @@ -1,10 +1,11 @@ package test; -import mods.tinker.tconstruct.entity.*; +import mods.tinker.tconstruct.entity.MiniGardy; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -38,9 +39,11 @@ public class XinStick extends Item //clearInventoryExeptHotbar(player); MiniGardy entity = new MiniGardy(world); entity.setOwner(player); - //entity.func_94058_c("Cutie"); - //entity.username = "NekoGloop"; + //entity.setCustomNameTag("Cutie"); spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player); + EntityChicken chicken = new EntityChicken(world); + spawnEntity(player.posX, player.posY + 1, player.posZ, chicken, world, player); + entity.mountEntity(chicken); //healPlayer(player); //removeChunk(world, player.posX, player.posZ); return stack;