mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Split more files into parts
This commit is contained in:
1 parent
e2f0558b6f
commit
5a87c102ea
61 files changed
+1365
-1499
No files matched your search
@@ -1,43 +0,0 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class SuperSoakerRender implements IItemRenderer
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType (ItemStack item, ItemRenderType type)
|
||||
{
|
||||
return type != ItemRenderType.INVENTORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem (ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
if (type == ItemRenderType.EQUIPPED)
|
||||
renderEquippedItem(item, (RenderBlocks) data[0], (EntityLiving) data[1]);
|
||||
if (type == ItemRenderType.ENTITY)
|
||||
renderEntityItem(item, (RenderBlocks) data[0], (EntityItem) data[1]);
|
||||
}
|
||||
|
||||
void renderEquippedItem (ItemStack item, RenderBlocks renderBlocks, EntityLiving entityLiving)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void renderEntityItem (ItemStack item, RenderBlocks renderBlocks, EntityItem entityItem)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,296 +0,0 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.GuiIngameForge;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.model.WingModel;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class TClientEvents
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
/* Sounds */
|
||||
|
||||
boolean initSounds;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSound (SoundLoadEvent event)
|
||||
{
|
||||
if (!initSounds)
|
||||
{
|
||||
initSounds = true;
|
||||
try
|
||||
{
|
||||
/*
|
||||
* SoundManager soundmanager = event.manager;
|
||||
* soundmanager.addSound("tinker:frypan_hit.ogg");
|
||||
* soundmanager.addSound("tinker:little_saw.ogg");
|
||||
* soundmanager.addSound("tinker:launcher_clank.ogg");
|
||||
* TConstruct.logger.info("Successfully loaded sounds.");
|
||||
*/
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TConstruct.logger.error("Failed to register one or more sounds");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Liquids */
|
||||
|
||||
IIcon[] stillIcons = new IIcon[2];
|
||||
IIcon[] flowIcons = new IIcon[2];
|
||||
|
||||
@SubscribeEvent
|
||||
public void preStitch (TextureStitchEvent.Pre event)
|
||||
{
|
||||
TextureMap register = event.map;
|
||||
if (register.getTextureType() == 0)
|
||||
{
|
||||
stillIcons[0] = register.registerIcon("tinker:liquid_pigiron");
|
||||
flowIcons[0] = register.registerIcon("tinker:liquid_pigiron");
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postStitch (TextureStitchEvent.Post event)
|
||||
{
|
||||
if (event.map.getTextureType() == 0)
|
||||
{
|
||||
for (int i = 0; i < TinkerSmeltery.fluidBlocks.length; i++)
|
||||
{
|
||||
TinkerSmeltery.fluids[i].setIcons(TinkerSmeltery.fluidBlocks[i].getIcon(0, 0), TinkerSmeltery.fluidBlocks[i].getIcon(2, 0));
|
||||
}
|
||||
TinkerSmeltery.pigIronFluid.setIcons(stillIcons[0], flowIcons[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private static final ResourceLocation hearts = new ResourceLocation("tinker", "textures/gui/newhearts.png");
|
||||
private static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png");
|
||||
// public static int left_height = 39;
|
||||
// public static int right_height = 39;
|
||||
Random rand = new Random();
|
||||
int updateCounter = 0;
|
||||
|
||||
GameSettings gs = Minecraft.getMinecraft().gameSettings;
|
||||
|
||||
/* HUD */
|
||||
@SubscribeEvent
|
||||
public void renderHealthbar (RenderGameOverlayEvent.Pre event)
|
||||
{
|
||||
if (!Loader.isModLoaded("tukmc_Vz"))// Loader check to avoid conflicting
|
||||
// with a GUI mod (thanks Vazkii!)
|
||||
{
|
||||
if (event.type == ElementType.HEALTH)
|
||||
{
|
||||
updateCounter++;
|
||||
|
||||
ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
|
||||
int scaledWidth = scaledresolution.getScaledWidth();
|
||||
int scaledHeight = scaledresolution.getScaledHeight();
|
||||
int xBasePos = scaledWidth / 2 - 91;
|
||||
int yBasePos = scaledHeight - 39;
|
||||
|
||||
boolean highlight = mc.thePlayer.hurtResistantTime / 3 % 2 == 1;
|
||||
|
||||
if (mc.thePlayer.hurtResistantTime < 10)
|
||||
{
|
||||
highlight = false;
|
||||
}
|
||||
|
||||
IAttributeInstance attrMaxHealth = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth);
|
||||
int health = MathHelper.ceiling_float_int(mc.thePlayer.getHealth());
|
||||
int healthLast = MathHelper.ceiling_float_int(mc.thePlayer.prevHealth);
|
||||
float healthMax = (float) attrMaxHealth.getAttributeValue();
|
||||
if (healthMax > 20)
|
||||
healthMax = 20;
|
||||
float absorb = this.mc.thePlayer.getAbsorptionAmount();
|
||||
|
||||
int healthRows = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F / 10.0F);
|
||||
int rowHeight = Math.max(10 - (healthRows - 2), 3);
|
||||
|
||||
this.rand.setSeed((long) (updateCounter * 312871));
|
||||
|
||||
int left = scaledWidth / 2 - 91;
|
||||
int top = scaledHeight - GuiIngameForge.left_height;
|
||||
|
||||
int regen = -1;
|
||||
if (mc.thePlayer.isPotionActive(Potion.regeneration))
|
||||
{
|
||||
regen = updateCounter % 25;
|
||||
}
|
||||
|
||||
final int TOP = 9 * (mc.theWorld.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0);
|
||||
final int BACKGROUND = (highlight ? 25 : 16);
|
||||
int MARGIN = 16;
|
||||
if (mc.thePlayer.isPotionActive(Potion.poison))
|
||||
MARGIN += 36;
|
||||
else if (mc.thePlayer.isPotionActive(Potion.wither))
|
||||
MARGIN += 72;
|
||||
float absorbRemaining = absorb;
|
||||
|
||||
for (int i = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F) - 1; i >= 0; --i)
|
||||
{
|
||||
int b0 = (highlight ? 1 : 0);
|
||||
int row = MathHelper.ceiling_float_int((float) (i + 1) / 10.0F) - 1;
|
||||
int x = left + i % 10 * 8;
|
||||
int y = top - row * rowHeight;
|
||||
|
||||
if (health <= 4)
|
||||
y += rand.nextInt(2);
|
||||
if (i == regen)
|
||||
y -= 2;
|
||||
|
||||
drawTexturedModalRect(x, y, BACKGROUND, TOP, 9, 9);
|
||||
|
||||
if (highlight)
|
||||
{
|
||||
if (i * 2 + 1 < healthLast)
|
||||
drawTexturedModalRect(x, y, MARGIN + 54, TOP, 9, 9); // 6
|
||||
else if (i * 2 + 1 == healthLast)
|
||||
drawTexturedModalRect(x, y, MARGIN + 63, TOP, 9, 9); // 7
|
||||
}
|
||||
|
||||
if (absorbRemaining > 0.0F)
|
||||
{
|
||||
if (absorbRemaining == absorb && absorb % 2.0F == 1.0F)
|
||||
drawTexturedModalRect(x, y, MARGIN + 153, TOP, 9, 9); // 17
|
||||
else
|
||||
drawTexturedModalRect(x, y, MARGIN + 144, TOP, 9, 9); // 16
|
||||
absorbRemaining -= 2.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i * 2 + 1 < health)
|
||||
drawTexturedModalRect(x, y, MARGIN + 36, TOP, 9, 9); // 4
|
||||
else if (i * 2 + 1 == health)
|
||||
drawTexturedModalRect(x, y, MARGIN + 45, TOP, 9, 9); // 5
|
||||
}
|
||||
}
|
||||
|
||||
PotionEffect potion = mc.thePlayer.getActivePotionEffect(Potion.wither);
|
||||
if (potion != null)
|
||||
return;
|
||||
potion = mc.thePlayer.getActivePotionEffect(Potion.poison);
|
||||
if (potion != null)
|
||||
return;
|
||||
|
||||
// Extra hearts
|
||||
this.mc.getTextureManager().bindTexture(hearts);
|
||||
|
||||
int hp = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth());
|
||||
for (int iter = 0; iter < hp / 20; iter++)
|
||||
{
|
||||
int renderHearts = (hp - 20 * (iter + 1)) / 2;
|
||||
if (renderHearts > 10)
|
||||
renderHearts = 10;
|
||||
for (int i = 0; i < renderHearts; i++)
|
||||
{
|
||||
this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos, 0 + 18 * iter, 0, 8, 8);
|
||||
}
|
||||
if (hp % 2 == 1 && renderHearts < 10)
|
||||
{
|
||||
this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos, 9 + 18 * iter, 0, 8, 8);
|
||||
}
|
||||
}
|
||||
|
||||
this.mc.getTextureManager().bindTexture(icons);
|
||||
GuiIngameForge.left_height += 10;
|
||||
if (absorb > 0)
|
||||
GuiIngameForge.left_height += 10;
|
||||
|
||||
event.setCanceled(true);
|
||||
if (event.type == ElementType.CROSSHAIRS && gs.thirdPersonView != 0)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void drawTexturedModalRect (int par1, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + par6) * f1));
|
||||
tessellator.addVertexWithUV((double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + par6) * f1));
|
||||
tessellator.addVertexWithUV((double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + 0) * f1));
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + 0) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
double zLevel = 0;
|
||||
|
||||
/*
|
||||
* @SubscribeEvent public void fovModifier(FOVUpdateEvent event) { float f =
|
||||
* 1.0F;
|
||||
*
|
||||
* if (event.entity.capabilities.isFlying) { f *= 1.1F; }
|
||||
*
|
||||
* if (event.entity.isUsingItem() && event.entity.getItemInUse().getItem()
|
||||
* == Items.bow) { int i = event.entity.getItemInUseDuration(); float f1 =
|
||||
* (float) i / 20.0F;
|
||||
*
|
||||
* if (f1 > 1.0F) { f1 = 1.0F; } else { f1 *= f1; }
|
||||
*
|
||||
* f *= 1.0F - f1 * 0.15F; } event.newfov = f; }
|
||||
*/
|
||||
|
||||
/* Armor */
|
||||
ModelBiped model = new ModelBiped(5f);
|
||||
WingModel wings = new WingModel();
|
||||
|
||||
/*
|
||||
* static { model.bipedHead.showModel = false; }
|
||||
*/
|
||||
|
||||
private float interpolateRotation (float par1, float par2, float par3)
|
||||
{
|
||||
float f3;
|
||||
|
||||
for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while (f3 >= 180.0F)
|
||||
{
|
||||
f3 -= 360.0F;
|
||||
}
|
||||
|
||||
return par1 + par3 * f3;
|
||||
}
|
||||
|
||||
protected float handleRotationFloat (EntityLiving par1EntityLiving, float par2)
|
||||
{
|
||||
return (float) par1EntityLiving.ticksExisted + par2;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.init.Blocks;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TClientTickHandler
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
TControls controlInstance = ((TProxyClient) TConstruct.proxy).controlInstance;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void tickEnd (ClientTickEvent event)
|
||||
{
|
||||
TinkerWorld.oreBerry.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
TinkerWorld.oreBerrySecond.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
TinkerWorld.slimeLeaves.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
if (mc.thePlayer != null && mc.thePlayer.onGround)
|
||||
controlInstance.landOnGround();
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override public EnumSet<TickType> ticks () { return
|
||||
* EnumSet.of(TickType.RENDER); }
|
||||
*/
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.potion.Potion;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.client.event.EventCloakRender;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.util.network.packet.PacketDoubleJump;
|
||||
import tconstruct.util.network.packet.PacketExtendedInventory;
|
||||
|
||||
@@ -150,13 +150,13 @@ public class TControls extends TKeyHandler
|
||||
|
||||
public static void openArmorGui ()
|
||||
{
|
||||
AbstractPacket packet = new PacketExtendedInventory(TProxyCommon.armorGuiID);
|
||||
AbstractPacket packet = new PacketExtendedInventory(ArmorProxyCommon.armorGuiID);
|
||||
updateServer(packet);
|
||||
}
|
||||
|
||||
public static void openKnapsackGui ()
|
||||
{
|
||||
AbstractPacket packet = new PacketExtendedInventory(TProxyCommon.knapsackGuiID);
|
||||
AbstractPacket packet = new PacketExtendedInventory(ArmorProxyCommon.knapsackGuiID);
|
||||
updateServer(packet);
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user