2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.client;
|
|
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
2014-02-05 10:28:54 -05:00
|
|
|
import java.util.ArrayList;
|
2013-12-13 23:14:46 -05:00
|
|
|
|
2014-02-05 10:28:54 -05:00
|
|
|
import javax.xml.parsers.DocumentBuilder;
|
|
|
|
|
import javax.xml.parsers.DocumentBuilderFactory;
|
2013-12-13 23:14:46 -05:00
|
|
|
|
|
|
|
|
import mantle.client.MProxyClient;
|
2014-05-10 16:50:27 -04:00
|
|
|
import mantle.client.SmallFontRenderer;
|
2013-12-13 23:14:46 -05:00
|
|
|
import mantle.lib.client.MantleClientRegistry;
|
2013-08-12 00:19:27 +10:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
|
import net.minecraft.client.Minecraft;
|
2013-08-19 09:30:01 -07:00
|
|
|
import net.minecraft.client.gui.inventory.GuiInventory;
|
2013-08-12 00:19:27 +10:00
|
|
|
import net.minecraft.client.model.ModelSlime;
|
2014-02-05 10:28:54 -05:00
|
|
|
import net.minecraft.client.particle.EntityAuraFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityBreakingFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityBubbleFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityCloudFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityCritFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityDropParticleFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityEnchantmentTableParticleFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityExplodeFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityFireworkSparkFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityFlameFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityFootStepFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityHeartFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityHugeExplodeFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityLargeExplodeFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityLavaFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityNoteFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityPortalFX;
|
|
|
|
|
import net.minecraft.client.particle.EntityReddustFX;
|
|
|
|
|
import net.minecraft.client.particle.EntitySmokeFX;
|
|
|
|
|
import net.minecraft.client.particle.EntitySnowShovelFX;
|
|
|
|
|
import net.minecraft.client.particle.EntitySpellParticleFX;
|
|
|
|
|
import net.minecraft.client.particle.EntitySplashFX;
|
|
|
|
|
import net.minecraft.client.particle.EntitySuspendFX;
|
|
|
|
|
import net.minecraft.client.renderer.entity.RenderItem;
|
|
|
|
|
import net.minecraft.client.renderer.entity.RenderSnowball;
|
|
|
|
|
import net.minecraft.client.settings.GameSettings;
|
|
|
|
|
import net.minecraft.client.settings.KeyBinding;
|
2013-08-12 00:19:27 +10:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-12-31 14:11:05 -05:00
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
|
import net.minecraft.init.Items;
|
2014-02-05 10:28:54 -05:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import net.minecraft.util.IIcon;
|
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
2013-08-12 00:19:27 +10:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
import net.minecraftforge.client.MinecraftForgeClient;
|
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2013-08-11 10:33:07 -07:00
|
|
|
import net.minecraftforge.fluids.RenderBlockFluid;
|
2013-12-13 23:14:46 -05:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
import org.w3c.dom.Document;
|
2013-12-13 23:14:46 -05:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.TConstruct;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.armor.TinkerArmor;
|
2014-06-06 19:46:05 -08:00
|
|
|
import tconstruct.armor.ArmorProxyCommon;
|
2014-07-05 21:08:58 -08:00
|
|
|
import tconstruct.armor.gui.ArmorExtendedGui;
|
|
|
|
|
import tconstruct.armor.gui.KnapsackGui;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.armor.modelblock.DryingRackRender;
|
|
|
|
|
import tconstruct.armor.modelblock.DryingRackSpecialRender;
|
2014-02-05 10:28:54 -05:00
|
|
|
import tconstruct.blocks.logic.DryingRackLogic;
|
2013-11-02 22:24:47 -07:00
|
|
|
import tconstruct.client.entity.item.ExplosiveRender;
|
2014-02-05 10:28:54 -05:00
|
|
|
import tconstruct.client.entity.projectile.ArrowRenderCustom;
|
|
|
|
|
import tconstruct.client.entity.projectile.DaggerRenderCustom;
|
|
|
|
|
import tconstruct.client.entity.projectile.LaunchedItemRender;
|
|
|
|
|
import tconstruct.client.pages.BlockCastPage;
|
|
|
|
|
import tconstruct.client.pages.MaterialPage;
|
|
|
|
|
import tconstruct.client.pages.ModifierPage;
|
|
|
|
|
import tconstruct.client.pages.ToolPage;
|
|
|
|
|
import tconstruct.client.tabs.InventoryTabArmorExtended;
|
|
|
|
|
import tconstruct.client.tabs.InventoryTabKnapsack;
|
|
|
|
|
import tconstruct.client.tabs.InventoryTabVanilla;
|
|
|
|
|
import tconstruct.client.tabs.TabRegistry;
|
|
|
|
|
import tconstruct.common.TProxyCommon;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.library.TConstructRegistry;
|
2014-02-05 10:28:54 -05:00
|
|
|
import tconstruct.library.client.TConstructClientRegistry;
|
|
|
|
|
import tconstruct.library.client.ToolGuiElement;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.library.crafting.ToolBuilder;
|
|
|
|
|
import tconstruct.library.tools.ToolCore;
|
2014-06-06 19:46:05 -08:00
|
|
|
import tconstruct.mechworks.MechworksProxyCommon;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.mechworks.entity.item.EntityLandmineFirework;
|
|
|
|
|
import tconstruct.mechworks.entity.item.ExplosivePrimed;
|
2014-07-05 21:08:58 -08:00
|
|
|
import tconstruct.mechworks.gui.GuiLandmine;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.mechworks.inventory.ContainerLandmine;
|
|
|
|
|
import tconstruct.mechworks.logic.TileEntityLandmine;
|
|
|
|
|
import tconstruct.mechworks.model.CartRender;
|
2014-06-06 19:46:05 -08:00
|
|
|
import tconstruct.smeltery.SmelteryProxyCommon;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.smeltery.TinkerSmeltery;
|
2014-07-05 21:08:58 -08:00
|
|
|
import tconstruct.smeltery.gui.AdaptiveSmelteryGui;
|
|
|
|
|
import tconstruct.smeltery.gui.SmelteryGui;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
|
|
|
|
import tconstruct.smeltery.logic.CastingBasinLogic;
|
|
|
|
|
import tconstruct.smeltery.logic.CastingTableLogic;
|
|
|
|
|
import tconstruct.smeltery.logic.SmelteryLogic;
|
|
|
|
|
import tconstruct.smeltery.model.BlockRenderCastingChannel;
|
|
|
|
|
import tconstruct.smeltery.model.CastingBasinSpecialRender;
|
|
|
|
|
import tconstruct.smeltery.model.CastingTableSpecialRenderer;
|
|
|
|
|
import tconstruct.smeltery.model.PaneConnectedRender;
|
|
|
|
|
import tconstruct.smeltery.model.PaneRender;
|
|
|
|
|
import tconstruct.smeltery.model.SearedRender;
|
|
|
|
|
import tconstruct.smeltery.model.SmelteryRender;
|
|
|
|
|
import tconstruct.smeltery.model.TankAirRender;
|
|
|
|
|
import tconstruct.smeltery.model.TankRender;
|
|
|
|
|
import tconstruct.tools.TinkerTools;
|
2014-06-06 19:46:05 -08:00
|
|
|
import tconstruct.tools.ToolProxyCommon;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.tools.entity.ArrowEntity;
|
|
|
|
|
import tconstruct.tools.entity.DaggerEntity;
|
|
|
|
|
import tconstruct.tools.entity.FancyEntityItem;
|
|
|
|
|
import tconstruct.tools.entity.LaunchedPotion;
|
2014-07-05 21:08:58 -08:00
|
|
|
import tconstruct.tools.gui.CraftingStationGui;
|
|
|
|
|
import tconstruct.tools.gui.FrypanGui;
|
|
|
|
|
import tconstruct.tools.gui.FurnaceGui;
|
|
|
|
|
import tconstruct.tools.gui.PartCrafterGui;
|
|
|
|
|
import tconstruct.tools.gui.PatternChestGui;
|
|
|
|
|
import tconstruct.tools.gui.StencilTableGui;
|
|
|
|
|
import tconstruct.tools.gui.ToolForgeGui;
|
|
|
|
|
import tconstruct.tools.gui.ToolStationGui;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.tools.items.ManualInfo;
|
|
|
|
|
import tconstruct.tools.logic.CraftingStationLogic;
|
|
|
|
|
import tconstruct.tools.logic.FrypanLogic;
|
|
|
|
|
import tconstruct.tools.logic.FurnaceLogic;
|
|
|
|
|
import tconstruct.tools.logic.PartBuilderLogic;
|
|
|
|
|
import tconstruct.tools.logic.PatternChestLogic;
|
|
|
|
|
import tconstruct.tools.logic.StencilTableLogic;
|
|
|
|
|
import tconstruct.tools.logic.ToolForgeLogic;
|
|
|
|
|
import tconstruct.tools.logic.ToolStationLogic;
|
|
|
|
|
import tconstruct.tools.model.FancyItemRender;
|
|
|
|
|
import tconstruct.tools.model.FrypanRender;
|
2014-06-06 19:46:05 -08:00
|
|
|
import tconstruct.tools.model.TableRender;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.tools.model.TableRender;
|
2013-11-04 19:28:01 -08:00
|
|
|
import tconstruct.util.config.PHConstruct;
|
2014-02-05 10:28:54 -05:00
|
|
|
import tconstruct.util.player.ArmorExtended;
|
|
|
|
|
import tconstruct.util.player.KnapsackInventory;
|
|
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
|
|
|
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
|
|
|
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
2014-02-19 21:44:45 -05:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
2014-02-05 10:28:54 -05:00
|
|
|
import cpw.mods.fml.common.registry.VillagerRegistry;
|
2014-03-06 21:55:46 +11:00
|
|
|
import tconstruct.util.player.TPlayerStats;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.world.TinkerWorld;
|
|
|
|
|
import tconstruct.world.entity.BlueSlime;
|
|
|
|
|
import tconstruct.world.entity.CartEntity;
|
|
|
|
|
import tconstruct.world.entity.Crystal;
|
|
|
|
|
import tconstruct.world.model.BarricadeRender;
|
|
|
|
|
import tconstruct.world.model.CrystalRender;
|
|
|
|
|
import tconstruct.world.model.OreberryRender;
|
|
|
|
|
import tconstruct.world.model.PunjiRender;
|
|
|
|
|
import tconstruct.world.model.RenderLandmine;
|
|
|
|
|
import tconstruct.world.model.SlimeChannelRender;
|
|
|
|
|
import tconstruct.world.model.SlimePadRender;
|
|
|
|
|
import tconstruct.world.model.SlimeRender;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2013-08-19 09:08:54 -07:00
|
|
|
public class TProxyClient extends TProxyCommon
|
|
|
|
|
{
|
2014-06-30 14:57:06 -08:00
|
|
|
/* TODO: Split this class up into its respective parts */
|
2013-08-19 09:08:54 -07:00
|
|
|
public static SmallFontRenderer smallFontRenderer;
|
2013-12-31 11:26:08 -05:00
|
|
|
public static IIcon metalBall;
|
2013-08-19 09:08:54 -07:00
|
|
|
public static Minecraft mc;
|
|
|
|
|
public static RenderItem itemRenderer = new RenderItem();
|
|
|
|
|
|
|
|
|
|
public static ArmorExtended armorExtended = new ArmorExtended();
|
|
|
|
|
public static KnapsackInventory knapsack = new KnapsackInventory();
|
2014-06-30 14:57:06 -08:00
|
|
|
|
|
|
|
|
public void initialize()
|
|
|
|
|
{
|
|
|
|
|
registerRenderer();
|
|
|
|
|
readManuals();
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-19 09:08:54 -07:00
|
|
|
/* Registers any rendering code. */
|
|
|
|
|
public void registerRenderer ()
|
|
|
|
|
{
|
|
|
|
|
Minecraft mc = Minecraft.getMinecraft();
|
2013-09-20 18:55:24 -04:00
|
|
|
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.renderEngine, false);
|
2013-08-19 09:08:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Document diary;
|
|
|
|
|
public static Document volume1;
|
|
|
|
|
public static Document volume2;
|
|
|
|
|
public static Document smelter;
|
2014-02-17 21:34:34 -05:00
|
|
|
public static ManualInfo manualData;
|
2014-02-20 15:35:34 -05:00
|
|
|
|
2013-08-19 09:08:54 -07:00
|
|
|
public void readManuals ()
|
|
|
|
|
{
|
|
|
|
|
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
|
|
|
|
diary = readManual("/assets/tinker/manuals/diary.xml", dbFactory);
|
|
|
|
|
volume1 = readManual("/assets/tinker/manuals/firstday.xml", dbFactory);
|
|
|
|
|
volume2 = readManual("/assets/tinker/manuals/materials.xml", dbFactory);
|
|
|
|
|
smelter = readManual("/assets/tinker/manuals/smeltery.xml", dbFactory);
|
|
|
|
|
initManualIcons();
|
|
|
|
|
initManualRecipes();
|
|
|
|
|
initManualPages();
|
2014-02-17 21:34:34 -05:00
|
|
|
manualData = new ManualInfo();
|
2013-08-19 09:08:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Document readManual (String location, DocumentBuilderFactory dbFactory)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
InputStream stream = TConstruct.class.getResourceAsStream(location);
|
|
|
|
|
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
|
|
|
|
|
Document doc = dBuilder.parse(stream);
|
|
|
|
|
doc.getDocumentElement().normalize();
|
|
|
|
|
return doc;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void initManualIcons ()
|
|
|
|
|
{
|
2013-12-31 14:11:05 -05:00
|
|
|
MantleClientRegistry.registerManualIcon("torch", new ItemStack(Blocks.torch));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("sapling", new ItemStack(Blocks.sapling));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("workbench", new ItemStack(Blocks.crafting_table));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("coal", new ItemStack(Items.coal));
|
2013-12-13 23:14:46 -05:00
|
|
|
|
2013-12-31 14:11:05 -05:00
|
|
|
MantleClientRegistry.registerManualIcon("woodplanks", new ItemStack(Blocks.planks));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("stoneblock", new ItemStack(Blocks.stone));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("ironingot", new ItemStack(Items.iron_ingot));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("flint", new ItemStack(Items.flint));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("cactus", new ItemStack(Blocks.cactus));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("bone", new ItemStack(Items.bone));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("obsidian", new ItemStack(Blocks.obsidian));
|
|
|
|
|
MantleClientRegistry.registerManualIcon("netherrack", new ItemStack(Blocks.netherrack));
|
2013-08-19 09:08:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void initManualRecipes ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initManualPages ()
|
|
|
|
|
{
|
2013-12-13 23:14:46 -05:00
|
|
|
|
2013-08-19 09:08:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Document getManualFromStack (ItemStack stack)
|
|
|
|
|
{
|
|
|
|
|
switch (stack.getItemDamage())
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
return volume1;
|
|
|
|
|
case 1:
|
|
|
|
|
return volume2;
|
|
|
|
|
case 2:
|
|
|
|
|
return smelter;
|
|
|
|
|
case 3:
|
|
|
|
|
return diary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-25 19:48:18 -05:00
|
|
|
public void recalculateHealth ()
|
|
|
|
|
{
|
2014-03-06 21:55:46 +11:00
|
|
|
armorExtended.recalculateHealth(mc.thePlayer, TPlayerStats.get(mc.thePlayer));
|
2014-02-25 19:48:18 -05:00
|
|
|
}
|
|
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|