Skip to content

Commit

Permalink
Removed OreDict tooltip and moved tooltips to clientside-only
Browse files Browse the repository at this point in the history
Fixed degrading electrodes, closes #263
Added additional bounding box blocks to Arc Furance, will require the
furnace to be rebuilt, closes #263
fixed Electrodes not rendering, closes #262
  • Loading branch information
BluSunrize committed Aug 4, 2015
1 parent 1948ef7 commit aae0fca
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
Expand All @@ -30,16 +31,19 @@
import net.minecraftforge.client.model.obj.GroupObject;
import net.minecraftforge.client.model.obj.TextureCoordinate;
import net.minecraftforge.client.model.obj.WavefrontObject;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;

import org.lwjgl.opengl.GL11;

import blusunrize.immersiveengineering.api.crafting.BlastFurnaceRecipe;
import blusunrize.immersiveengineering.api.energy.IImmersiveConnectable;
import blusunrize.immersiveengineering.api.energy.ImmersiveNetHandler;
import blusunrize.immersiveengineering.api.energy.WireType;
import blusunrize.immersiveengineering.api.energy.ImmersiveNetHandler.Connection;
import blusunrize.immersiveengineering.api.tool.IDrillHead;
import blusunrize.immersiveengineering.client.gui.GuiBlastFurnace;
import blusunrize.immersiveengineering.client.models.ModelIEObj;
import blusunrize.immersiveengineering.common.Config;
import blusunrize.immersiveengineering.common.IEContent;
Expand All @@ -54,8 +58,10 @@
import blusunrize.immersiveengineering.common.util.Lib;
import blusunrize.immersiveengineering.common.util.Utils;
import blusunrize.immersiveengineering.common.util.SkylineHelper;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;

public class ClientEventHandler
{
Expand Down Expand Up @@ -171,6 +177,16 @@ public void onPlayerTick(TickEvent.PlayerTickEvent event)
}
}

@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event)
{
if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT
&& ClientUtils.mc().currentScreen != null
&& ClientUtils.mc().currentScreen instanceof GuiBlastFurnace
&& BlastFurnaceRecipe.isValidBlastFuel(event.itemStack))
event.toolTip.add(EnumChatFormatting.GRAY+StatCollector.translateToLocalFormatted("desc.ImmersiveEngineering.info.blastFuelTime", BlastFurnaceRecipe.getBlastFuelTime(event.itemStack)));
}

@SubscribeEvent()
public void lastWorldRender(RenderWorldLastEvent event)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,26 @@
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.api.event.TeleposeEvent;
import blusunrize.immersiveengineering.api.crafting.BlastFurnaceRecipe;
import blusunrize.immersiveengineering.api.energy.ImmersiveNetHandler;
import blusunrize.immersiveengineering.api.tool.IDrillHead;
import blusunrize.immersiveengineering.client.ClientUtils;
import blusunrize.immersiveengineering.client.gui.GuiBlastFurnace;
import blusunrize.immersiveengineering.common.blocks.BlockIEBase;
import blusunrize.immersiveengineering.common.blocks.TileEntityImmersiveConnectable;
import blusunrize.immersiveengineering.common.blocks.metal.TileEntityCrusher;
import blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockPart;
import blusunrize.immersiveengineering.common.items.ItemDrill;
import blusunrize.immersiveengineering.common.util.Lib;
import blusunrize.immersiveengineering.common.util.Utils;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import cpw.mods.fml.relauncher.Side;

public class EventHandler
{
Expand Down Expand Up @@ -180,43 +172,4 @@ else if (!event.name.equals(event.left.getDisplayName()))
}
}
}


@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event)
{
for(int oid : OreDictionary.getOreIDs(event.itemStack))
event.toolTip.add(OreDictionary.getOreName(oid));
// if(FluidContainerRegistry.getFluidForFilledItem(event.itemStack)!=null)
// event.toolTip.add(FluidContainerRegistry.getFluidForFilledItem(event.itemStack).getUnlocalizedName());
// if(event.itemStack.getItem() instanceof ItemTool && event.showAdvancedItemTooltips)
// {
// String mat = ((ItemTool)event.itemStack.getItem()).getToolMaterialName();
// String speed = "?";
// String level = "?";
// String enchantability = "?";
// try{
// speed = ""+ToolMaterial.valueOf(((ItemTool)event.itemStack.getItem()).getToolMaterialName()).getEfficiencyOnProperMaterial();
// level = ""+ToolMaterial.valueOf(((ItemTool)event.itemStack.getItem()).getToolMaterialName()).getHarvestLevel();
// enchantability = ""+ToolMaterial.valueOf(((ItemTool)event.itemStack.getItem()).getToolMaterialName()).getEnchantability();
// }catch(Exception e)
// {
// try{
// speed = ""+ToolMaterial.valueOf("TF:"+((ItemTool)event.itemStack.getItem()).getToolMaterialName()).getEfficiencyOnProperMaterial();
// level = ""+ToolMaterial.valueOf("TF:"+((ItemTool)event.itemStack.getItem()).getToolMaterialName()).getHarvestLevel();
// enchantability = ""+ToolMaterial.valueOf("TF:"+((ItemTool)event.itemStack.getItem()).getToolMaterialName()).getEnchantability();
// }catch(Exception e2){}
// }
// event.toolTip.add("Tool Material: "+Utils.toCamelCase(mat));
// event.toolTip.add(" Speed: "+speed);
// event.toolTip.add(" MiningLevel: "+level);
// event.toolTip.add(" Enchantability: "+enchantability);
// }

if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT
&& ClientUtils.mc().currentScreen != null
&& ClientUtils.mc().currentScreen instanceof GuiBlastFurnace
&& BlastFurnaceRecipe.isValidBlastFuel(event.itemStack))
event.toolTip.add(EnumChatFormatting.GRAY+StatCollector.translateToLocalFormatted("desc.ImmersiveEngineering.info.blastFuelTime", BlastFurnaceRecipe.getBlastFuelTime(event.itemStack)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ public void updateEntity()
boolean hasElectrodes = true;
for(int i=0; i<3; i++)
{
electrodes[i] = this.getStackInSlot(23+i)!=null;
boolean b = this.getStackInSlot(23+i)!=null;
if(electrodes[i]!=b)
update = true;
electrodes[i] = b;
if(!electrodes[i])
{
hasElectrodes = false;
Expand All @@ -90,6 +93,7 @@ public void updateEntity()
ItemStack[] additives = new ItemStack[4];
for(int i=0; i<4; i++)
additives[i] = (inventory[12+i]!=null?inventory[12+i].copy():null);
boolean damageElectrodes = false;
for(int i=0; i<12; i++)
{
ArcFurnaceRecipe recipe = ArcFurnaceRecipe.findRecipe(this.getStackInSlot(i), additives);
Expand Down Expand Up @@ -119,8 +123,6 @@ public void updateEntity()
processMax[i]=recipe.time;
process[i]=0;
update = true;
if(!active)
active = true;
}
else
{
Expand All @@ -129,6 +131,7 @@ public void updateEntity()
{
this.energyStorage.extractEnergy(energy, false);
process[i]++;
damageElectrodes=true;
if(!active)
active = true;
}
Expand Down Expand Up @@ -174,7 +177,7 @@ else if(inventory[22]==null)
else if(process[i]>0)
process[i]=0;
}
if(active)
if(damageElectrodes)
{
for(int i=23; i<26; i++)
if(this.getStackInSlot(i).attemptDamageItem(1, worldObj.rand))
Expand All @@ -183,6 +186,11 @@ else if(process[i]>0)
update = true;
}
}
else if(active)
{
active = false;
update = true;
}
}

if(worldObj.getTotalWorldTime()%8==0)
Expand Down Expand Up @@ -314,8 +322,10 @@ else if(pos%5==4)
}
else if(pos<75)
{
if(pos==52)
return new float[]{fl<4?-.5f:0,0,fl>3?-.5f:0, fl<4?1.5f:1,1,fl>3?1.5f:1};
if(pos==51)
return new float[]{fw==3?.5f:0,0,fw==4?.5f:0, fw==2?.5f:1,1,fw==5?.5f:1};
else if(pos==53)
return new float[]{fw==2?.5f:0,0,fw==5?.5f:0, fw==3?.5f:1,1,fw==4?.5f:1};
else if(pos==60)
return new float[]{fw==3?.125f:0,0,fw==4?.125f:0, fw==2?.875f:1,1,fw==5?.875f:1};
else if(pos==64)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else if(h==2)
{
if(l==4)
m = BlockMetalDecoration.META_lightEngineering;
else if((l==0&&w==2)|| (l>0&&w>0&&w<4)||l==2)
else if((l==0&&(w>=1&&w<=3))|| (l>0&&w>0&&w<4)||l==2)
structure[h][w][l] = new ItemStack(IEContent.blockStorage,1,7);
}
else if(h==3)
Expand Down Expand Up @@ -233,7 +233,7 @@ public ItemStack[] getTotalMaterials()
return new ItemStack[]{
new ItemStack(Items.cauldron),
new ItemStack(IEContent.blockStorageSlabs,14,7),
new ItemStack(IEContent.blockStorage,23,7),
new ItemStack(IEContent.blockStorage,25,7),
new ItemStack(IEContent.blockMetalDecoration,13,BlockMetalDecoration.META_lightEngineering),
new ItemStack(IEContent.blockMetalDecoration,9,BlockMetalDecoration.META_heavyEngineering),
new ItemStack(IEContent.blockMetalDecoration,9,BlockMetalDecoration.META_scaffolding)};
Expand Down

0 comments on commit aae0fca

Please sign in to comment.