Split more files into parts

This commit is contained in:
mDiyo committed 2014-06-06 19:46:05 -08:00
1 parent e2f0558b6f
commit 5a87c102ea
61 files changed
+1365 -1499

No files matched your search

@@ -9,7 +9,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
import mantle.client.MProxyClient;
import mantle.client.SmallFontRenderer;
import mantle.lib.client.MantleClientRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiInventory;
@@ -38,11 +37,8 @@ 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.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
@@ -56,11 +52,11 @@ import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.RenderBlockFluid;
import org.lwjgl.opengl.GL11;
import org.w3c.dom.Document;
import tconstruct.TConstruct;
import tconstruct.armor.TinkerArmor;
import tconstruct.armor.ArmorProxyCommon;
import tconstruct.armor.modelblock.DryingRackRender;
import tconstruct.armor.modelblock.DryingRackSpecialRender;
import tconstruct.blocks.logic.DryingRackLogic;
@@ -95,11 +91,13 @@ import tconstruct.library.client.TConstructClientRegistry;
import tconstruct.library.client.ToolGuiElement;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.ToolCore;
import tconstruct.mechworks.MechworksProxyCommon;
import tconstruct.mechworks.entity.item.EntityLandmineFirework;
import tconstruct.mechworks.entity.item.ExplosivePrimed;
import tconstruct.mechworks.inventory.ContainerLandmine;
import tconstruct.mechworks.logic.TileEntityLandmine;
import tconstruct.mechworks.model.CartRender;
import tconstruct.smeltery.SmelteryProxyCommon;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
import tconstruct.smeltery.logic.CastingBasinLogic;
@@ -115,6 +113,7 @@ import tconstruct.smeltery.model.SmelteryRender;
import tconstruct.smeltery.model.TankAirRender;
import tconstruct.smeltery.model.TankRender;
import tconstruct.tools.TinkerTools;
import tconstruct.tools.ToolProxyCommon;
import tconstruct.tools.entity.ArrowEntity;
import tconstruct.tools.entity.DaggerEntity;
import tconstruct.tools.entity.FancyEntityItem;
@@ -130,7 +129,7 @@ import tconstruct.tools.logic.ToolForgeLogic;
import tconstruct.tools.logic.ToolStationLogic;
import tconstruct.tools.model.FancyItemRender;
import tconstruct.tools.model.FrypanRender;
import tconstruct.tools.model.TableForgeRender;
import tconstruct.tools.model.TableRender;
import tconstruct.tools.model.TableRender;
import tconstruct.util.config.PHConstruct;
import tconstruct.util.player.ArmorExtended;
@@ -166,151 +165,12 @@ public class TProxyClient extends TProxyCommon
public static ArmorExtended armorExtended = new ArmorExtended();
public static KnapsackInventory knapsack = new KnapsackInventory();
@Override
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
{
if (ID == toolStationID)
return new ToolStationGui(player.inventory, (ToolStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == partBuilderID)
return new PartCrafterGui(player.inventory, (PartBuilderLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == patternChestID)
return new PatternChestGui(player.inventory, (PatternChestLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == frypanGuiID)
return new FrypanGui(player.inventory, (FrypanLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == smelteryGuiID)
{
if (PHConstruct.newSmeltery)
return new AdaptiveSmelteryGui(player.inventory, (AdaptiveSmelteryLogic) world.getTileEntity(x, y, z), world, x, y, z);
else
return new SmelteryGui(player.inventory, (SmelteryLogic) world.getTileEntity(x, y, z), world, x, y, z);
}
if (ID == stencilTableID)
return new StencilTableGui(player.inventory, (StencilTableLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == toolForgeID)
return new ToolForgeGui(player.inventory, (ToolForgeLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == landmineID)
return new GuiLandmine(new ContainerLandmine(player, (TileEntityLandmine) world.getTileEntity(x, y, z)));
if (ID == craftingStationID)
return new CraftingStationGui(player.inventory, (CraftingStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
if (ID == furnaceID)
return new FurnaceGui(player.inventory, (FurnaceLogic) world.getTileEntity(x, y, z));
if (ID == inventoryGui)
{
GuiInventory inventory = new GuiInventory(player);
TabRegistry.addTabsToInventory(inventory);
return inventory;
}
if (ID == armorGuiID)
{
TProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer);
return new ArmorExtendedGui(player.inventory, TProxyClient.armorExtended);
}
if (ID == knapsackGuiID)
{
TProxyClient.knapsack.init(Minecraft.getMinecraft().thePlayer);
return new KnapsackGui(player.inventory, TProxyClient.knapsack);
}
return null;
}
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(0, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(1, meta)));// block.getIcon(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(2, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(3, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(4, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(5, meta)));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
public static void renderInvBlockFace (RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glScalef(2f, 2f, 2f);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glRotatef(45, 0, 1, 0);
GL11.glRotatef(60, 1, 0, 0);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(0, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(1, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(2, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(3, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(4, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(5, meta)));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
public static boolean classMatches (Object paramObject, String paramString)
{
try
{
return paramObject.getClass().getName().equals(paramString);
}
catch (Exception localException)
{
return false;
}
}
@Override
public void registerTickHandler ()
{
FMLCommonHandler.instance().bus().register(new TClientTickHandler());
new TClientTickHandler();
// TickRegistry.registerTickHandler(new TimeTicker(), Side.CLIENT);
// TickRegistry.registerTickHandler(new TCommonTickHandler(),
// Side.CLIENT);
}
/* Registers any rendering code. */
@Override
public void registerRenderer ()
{
Minecraft mc = Minecraft.getMinecraft();
MinecraftForge.EVENT_BUS.register(new TClientEvents());
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.renderEngine, false);
RenderingRegistry.registerBlockHandler(new TableRender());
RenderingRegistry.registerBlockHandler(new TableForgeRender());
RenderingRegistry.registerBlockHandler(new FrypanRender());
RenderingRegistry.registerBlockHandler(new TankRender());
RenderingRegistry.registerBlockHandler(new TankAirRender());
@@ -368,7 +228,6 @@ public class TProxyClient extends TProxyCommon
public static Document smelter;
public static ManualInfo manualData;
@Override
public void readManuals ()
{
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
@@ -814,256 +673,9 @@ public class TProxyClient extends TProxyCommon
}
}
/* Keybindings */
public static TControls controlInstance;
@Override
public void registerKeys ()
{
controlInstance = new TControls();
uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance);
TabRegistry.registerTab(new InventoryTabVanilla());
TabRegistry.registerTab(new InventoryTabArmorExtended());
TabRegistry.registerTab(new InventoryTabKnapsack());
}
public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandler)
{
ArrayList<KeyBinding> harvestedBindings = Lists.newArrayList();
for (KeyBinding kb : keyhandler.keyBindings)
{
harvestedBindings.add(kb);
}
KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]);
KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length];
System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length);
System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length);
settings.keyBindings = allKeys;
settings.loadOptions();
}
@Override
public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
{
this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ);
}
public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
{
if (this.mc == null)
this.mc = Minecraft.getMinecraft();
if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
{
int i = this.mc.gameSettings.particleSetting;
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0)
{
i = 2;
}
double d6 = this.mc.renderViewEntity.posX - par2;
double d7 = this.mc.renderViewEntity.posY - par4;
double d8 = this.mc.renderViewEntity.posZ - par6;
EntityFX entityfx = null;
if (par1Str.equals("hugeexplosion"))
{
this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12));
}
else if (par1Str.equals("largeexplode"))
{
this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12));
}
else if (par1Str.equals("fireworksSpark"))
{
this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer));
}
if (entityfx != null)
{
return (EntityFX) entityfx;
}
else
{
double d9 = 16.0D;
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)
{
return null;
}
else if (i > 1)
{
return null;
}
else
{
if (par1Str.equals("bubble"))
{
entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("suspended"))
{
entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("depthsuspend"))
{
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("townaura"))
{
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("crit"))
{
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("smoke"))
{
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("mobSpell"))
{
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
}
else if (par1Str.equals("mobSpellAmbient"))
{
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
((EntityFX) entityfx).setAlphaF(0.15F);
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
}
else if (par1Str.equals("spell"))
{
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("instantSpell"))
{
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
}
else if (par1Str.equals("witchMagic"))
{
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F;
((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f);
}
else if (par1Str.equals("note"))
{
entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("portal"))
{
entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("enchantmenttable"))
{
entityfx = new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("explode"))
{
entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("flame"))
{
entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("lava"))
{
entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6);
}
else if (par1Str.equals("footstep"))
{
entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6);
}
else if (par1Str.equals("splash"))
{
entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("largesmoke"))
{
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F);
}
else if (par1Str.equals("cloud"))
{
entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("reddust"))
{
entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12);
}
else if (par1Str.equals("snowballpoof"))
{
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Items.snowball);
}
else if (par1Str.equals("dripWater"))
{
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water);
}
else if (par1Str.equals("dripLava"))
{
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava);
}
else if (par1Str.equals("snowshovel"))
{
entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("blueslime"))
{
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TinkerWorld.strangeFood);
}
else if (par1Str.equals("heart"))
{
entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("angryVillager"))
{
entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12);
((EntityFX) entityfx).setParticleTextureIndex(81);
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
}
else if (par1Str.equals("happyVillager"))
{
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
((EntityFX) entityfx).setParticleTextureIndex(82);
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
}
if (entityfx != null)
{
this.mc.effectRenderer.addEffect((EntityFX) entityfx);
}
return (EntityFX) entityfx;
}
}
}
else
{
return null;
}
}
@Override
public void postInit ()
{
// MinecraftForgeClient.registerItemRenderer(TRepo.armorPattern.itemID,
// new RenderArmorCast());
}
public void recalculateHealth ()
{
armorExtended.recalculateHealth(mc.thePlayer, TPlayerStats.get(mc.thePlayer));
}
private static IIcon getIcon (IIcon icon)
{
if (icon != null)
return icon;
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
}
}