mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
Initial fixes, still a long ways to go
This commit is contained in:
1 parent
35d495260a
commit
8dcffe3d5c
195 files changed
+930
-5179
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* 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<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
public void doRender (Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
@@ -557,7 +586,6 @@ public class FancyItemRender extends Render
|
||||
|
||||
/**
|
||||
* Items should spread out when rendered in 3d?
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldSpreadItems ()
|
||||
@@ -567,7 +595,6 @@ public class FancyItemRender extends Render
|
||||
|
||||
/**
|
||||
* Items should have a bob effect
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldBob ()
|
||||
@@ -592,7 +619,6 @@ public class FancyItemRender extends Render
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
*
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,419 +0,0 @@
|
||||
package mods.tinker.tconstruct.client.entity;
|
||||
|
||||
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
|
||||
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
|
||||
import mods.tinker.tconstruct.entity.GolemBase;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.model.ModelSnowMan;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GolemRender extends RenderLiving
|
||||
{
|
||||
public static final float kon = -57.29578F;
|
||||
public static final float scale = 0.7F;
|
||||
|
||||
public GolemRender(float f)
|
||||
{
|
||||
super(new ModelSnowMan(), f);
|
||||
}
|
||||
|
||||
protected void preRenderScale (EntityLiving entityliving, float f)
|
||||
{
|
||||
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||
GolemBase entitygenericgolem = (GolemBase) entityliving;
|
||||
/*if (entitygenericgolem.isSlime())
|
||||
{
|
||||
int i = 1;
|
||||
float f1 = (entitygenericgolem.slimeB + (entitygenericgolem.slimeC - entitygenericgolem.slimeB) * f) / 1.5F;
|
||||
float f2 = 0.8F / (f1 + 1.0F);
|
||||
float f3 = i;
|
||||
GL11.glScalef(f2 * f3, (1.0F / f2) * f3, f2 * f3);
|
||||
}*/
|
||||
}
|
||||
|
||||
public void renderBeam (Entity entity, double d, double d1, double d2, double d3, double d4, double d5)
|
||||
{
|
||||
float f = (float) (d3 - d);
|
||||
float f1 = (float) (d4 - 1.0D - d1);
|
||||
float f2 = (float) (d5 - d2);
|
||||
float f3 = MathHelper.sqrt_float(f * f + f2 * f2);
|
||||
float f4 = MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d, (float) d1 + 2.0F, (float) d2);
|
||||
GL11.glRotatef(((float) (-Math.atan2(f2, f)) * 180F) / 3.141593F - 90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(((float) (-Math.atan2(f3, f1)) * 180F) / 3.141593F - 90F, 1.0F, 0.0F, 0.0F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(2884 /*GL_CULL_FACE*/);
|
||||
loadTexture("/mob/enderdragon/beam.png");
|
||||
GL11.glShadeModel(7425 /*GL_SMOOTH*/);
|
||||
float f5 = 0.0F - (float) entity.ticksExisted * 0.01F;
|
||||
float f6 = MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2) / 32F - (float) entity.ticksExisted * 0.01F;
|
||||
tessellator.startDrawing(5);
|
||||
int i = 8;
|
||||
for (int j = 0; j <= i; j++)
|
||||
{
|
||||
float f7 = MathHelper.sin(((float) (j % i) * 3.141593F * 2.0F) / (float) i) * 0.75F;
|
||||
float f8 = MathHelper.cos(((float) (j % i) * 3.141593F * 2.0F) / (float) i) * 0.75F;
|
||||
float f9 = ((float) (j % i) * 1.0F) / (float) i;
|
||||
tessellator.setColorOpaque_I(0);
|
||||
tessellator.addVertexWithUV(f7 * 0.2F, f8 * 0.2F, 0.0D, f9, f6);
|
||||
tessellator.setColorOpaque_I(0xffffff);
|
||||
tessellator.addVertexWithUV(f7, f8, f4, f9, f5);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
GL11.glEnable(2884 /*GL_CULL_FACE*/);
|
||||
GL11.glShadeModel(7424 /*GL_FLAT*/);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderGolem (EntityLiving entityliving, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
super.doRenderLiving(entityliving, d, d1, d2, f, f1);
|
||||
}
|
||||
|
||||
public void renderCow (EntityMob entitymob, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
super.doRenderLiving(entitymob, d, d1, d2, f, f1);
|
||||
}
|
||||
|
||||
public void doRenderLiving (EntityLiving entityliving, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
/*loadTexture("/terrain.png");
|
||||
renderBlocks.renderNorthFace(Block.brick, d, d1 + 5D, d2, 1);
|
||||
renderBlocks.renderSouthFace(Block.brick, d, d1 + 5D, d2, 1);
|
||||
renderBlocks.renderEastFace(Block.brick, d, d1 + 5D, d2, 1);
|
||||
renderBlocks.renderWestFace(Block.brick, d, d1 + 5D, d2, 1);*/
|
||||
}
|
||||
|
||||
protected void renderSnowmanPumpkin (GolemBase par1EntitySnowman, float par2)
|
||||
{
|
||||
super.renderEquippedItems(par1EntitySnowman, par2);
|
||||
ItemStack itemstack = new ItemStack(Block.pumpkin, 1);
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
//this.snowmanModel.head.postRender(0.0625F);
|
||||
|
||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
|
||||
if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
float f1 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(f1, -f1, f1);
|
||||
}
|
||||
|
||||
this.renderManager.itemRenderer.renderItem(par1EntitySnowman, itemstack, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderEquippedItems (EntityLiving par1EntityLiving, float par2)
|
||||
{
|
||||
this.renderSnowmanPumpkin((GolemBase) par1EntityLiving, par2);
|
||||
}
|
||||
|
||||
public void doRender (Entity entity, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
ItemStack itemstack = new ItemStack(Block.pumpkin, 1);
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
//this.snowmanModel.head.postRender(0.0625F);
|
||||
|
||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
|
||||
if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
float swipe = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(swipe, -swipe, swipe);
|
||||
}
|
||||
|
||||
//this.renderManager.itemRenderer.renderItem((EntityLiving) entity, itemstack, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
boolean flag = false;
|
||||
float f2 = 1.0F;
|
||||
float f3 = 0.0F;
|
||||
float f4 = 0.0F;
|
||||
GolemBase golembase = (GolemBase) entity;
|
||||
ModelSnowMan modelgenericgolem = (ModelSnowMan) mainModel;
|
||||
/*if (golembase == null || golembase.body == null)
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
int i = -1;
|
||||
int j = 0;
|
||||
/*do
|
||||
{
|
||||
if (j >= 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();
|
||||
}*/
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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.
|
||||
* <br /><br />
|
||||
* 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.
|
||||
* <br /><br />
|
||||
* 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.
|
||||
* <br /><br />
|
||||
* 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.
|
||||
* <br /><br />
|
||||
* 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.
|
||||
* <pre>
|
||||
* // 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);
|
||||
* </pre>
|
||||
* <br /><br />
|
||||
* 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.
|
||||
* <br /><br />
|
||||
* <pre>
|
||||
* 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;
|
||||
* </pre>
|
||||
* <br /><br />
|
||||
* Finally, in the render method, you could use the following code.
|
||||
* <br /><br />
|
||||
* <pre>
|
||||
* setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
* skeletonOrigin.prepareDraw();
|
||||
* skeletonOrigin.setAnglesToModels();
|
||||
* </pre>
|
||||
* <br /><br />
|
||||
* 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.
|
||||
* <br /><br />
|
||||
* @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<Bone>();
|
||||
models = new ArrayList<ModelRenderer>();
|
||||
modelBaseRot = new HashMap<ModelRenderer, Angle3D>();
|
||||
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<Bone> childNodes;
|
||||
private ArrayList<ModelRenderer> models;
|
||||
private Map<ModelRenderer, Angle3D> modelBaseRot;
|
||||
private float offsetX;
|
||||
private float offsetY;
|
||||
private float offsetZ;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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<String, TransformGroup> group, Map<String, TextureGroup> 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<String, TransformGroupBone>();
|
||||
entry.textures = new HashMap<String, TextureGroup>();
|
||||
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<String, ModelPoolEntry> modelMap = new HashMap<String, ModelPoolEntry>();
|
||||
private static String[] resourceDir = new String[] { "minecraft/resources/models/", "minecraft/resources/mod/models/" };
|
||||
public static final Class OBJ = ModelPoolObjEntry.class;
|
||||
}
|
||||
@@ -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<String, TransformGroup> groupsMap, Map<String, TextureGroup> texturesMap)
|
||||
{
|
||||
Set<String> groupsCol = groups.keySet();
|
||||
Collection<String> texturesCol = textures.keySet();
|
||||
|
||||
Iterator<String> groupsItr = groupsCol.iterator();
|
||||
Iterator<String> 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<String, TransformGroupBone> groups;
|
||||
public Map<String, TextureGroup> textures;
|
||||
protected TransformGroupBone group;
|
||||
protected TextureGroup texture;
|
||||
protected String[] fileExtensions;
|
||||
}
|
||||
@@ -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<PositionTransformVertex> verts = new ArrayList<PositionTransformVertex>();
|
||||
ArrayList<float[]> uvs = new ArrayList<float[]>();
|
||||
ArrayList<float[]> normals = new ArrayList<float[]>();
|
||||
ArrayList<TexturedPolygon> face = new ArrayList<TexturedPolygon>();
|
||||
|
||||
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<PositionTextureVertex> v = new ArrayList<PositionTextureVertex>();
|
||||
String s1;
|
||||
int finalPhase = 0;
|
||||
float[] normal = new float[] { 0F, 0F, 0F };
|
||||
ArrayList<Vec3> iNormal = new ArrayList<Vec3>();
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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<TransformGroup> transformGroups = new ArrayList<TransformGroup>();
|
||||
|
||||
}
|
||||
@@ -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<Coord2D>();
|
||||
}
|
||||
|
||||
public Shape2D(Coord2D[] coordArray)
|
||||
{
|
||||
coords = new ArrayList<Coord2D>();
|
||||
|
||||
for (int idx = 0; idx < coordArray.length; idx++)
|
||||
{
|
||||
coords.add(coordArray[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
public Shape2D(ArrayList<Coord2D> 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<Coord2D> coords;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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<TexturedQuad>();
|
||||
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<TexturedQuad> poly;
|
||||
public String texture;
|
||||
}
|
||||
@@ -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<Vec3>();
|
||||
}
|
||||
|
||||
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<Vec3> 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<Vec3> iNormals;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Loaded 100 of 195 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user