From 2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Fri, 27 Jan 2017 11:32:28 +0300 Subject: License, readme and stuff --- ihl/collector/ChargerEjectorContainer.java | 5 +-- ihl/collector/ChargerEjectorGui.java | 4 +- ihl/collector/ChargerEjectorTileEntity.java | 7 ++-- ihl/collector/CollectorEntity.java | 61 ++++++----------------------- ihl/collector/CollectorItem.java | 6 ++- ihl/collector/GlassBoxContainer.java | 2 +- ihl/collector/GlassBoxGui.java | 11 ------ ihl/collector/GlassBoxRender.java | 2 - ihl/collector/GlassBoxTileEntity.java | 7 ++-- 9 files changed, 27 insertions(+), 78 deletions(-) (limited to 'ihl/collector') diff --git a/ihl/collector/ChargerEjectorContainer.java b/ihl/collector/ChargerEjectorContainer.java index 8d18998..372f4c5 100644 --- a/ihl/collector/ChargerEjectorContainer.java +++ b/ihl/collector/ChargerEjectorContainer.java @@ -7,13 +7,13 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class ChargerEjectorContainer extends ContainerBase { +public class ChargerEjectorContainer extends ContainerBase { protected ChargerEjectorTileEntity tileEntity; public int lastStorage = -1; private final static int height=166; - public ChargerEjectorContainer(EntityPlayer entityPlayer, ChargerEjectorTileEntity tileEntity1){ + public ChargerEjectorContainer(EntityPlayer entityPlayer, ChargerEjectorTileEntity tileEntity1){ super(tileEntity1); this.tileEntity = tileEntity1; int col; @@ -55,7 +55,6 @@ public class ChargerEjectorContainer extends ContainerBase { icrafting.sendProgressBarUpdate(this, 0, (this.tileEntity.getStored()>>15) & Short.MAX_VALUE); icrafting.sendProgressBarUpdate(this, 1, (short)(this.tileEntity.getStored() & Short.MAX_VALUE)); } - short st = Short.MAX_VALUE; } this.lastStorage = this.tileEntity.getStored(); diff --git a/ihl/collector/ChargerEjectorGui.java b/ihl/collector/ChargerEjectorGui.java index 79a0c0c..1836dc9 100644 --- a/ihl/collector/ChargerEjectorGui.java +++ b/ihl/collector/ChargerEjectorGui.java @@ -10,7 +10,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ic2.core.util.GuiTooltipHelper; @SideOnly(Side.CLIENT) @@ -30,7 +29,8 @@ public class ChargerEjectorGui extends GuiContainer { this.container=container1; } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { super.initGui(); diff --git a/ihl/collector/ChargerEjectorTileEntity.java b/ihl/collector/ChargerEjectorTileEntity.java index fdb18ed..cda75f4 100644 --- a/ihl/collector/ChargerEjectorTileEntity.java +++ b/ihl/collector/ChargerEjectorTileEntity.java @@ -26,7 +26,6 @@ import ic2.core.IHasGui; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.IHLMod; import ihl.utils.IHLInvSlotDischarge; @@ -184,7 +183,7 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn List eItemsList = this.getEItemsList(); if(eItemsList!=null && eItemsList.size()>0) { - Iterator ei = eItemsList.iterator(); + Iterator ei = eItemsList.iterator(); while(ei.hasNext()) { EntityItem entity=(EntityItem) ei.next(); @@ -413,7 +412,8 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn } } - protected List getEItemsList() + @SuppressWarnings("unchecked") + protected List getEItemsList() { double range = 0.2D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.xCoord-range,this.yCoord,this.zCoord-range,this.xCoord+1.0D+range,this.yCoord+1.0D+range,this.zCoord+1.0D+range); @@ -477,6 +477,7 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn } } + @SuppressWarnings("unchecked") private void callCollectors() { double range = 64D; diff --git a/ihl/collector/CollectorEntity.java b/ihl/collector/CollectorEntity.java index ed0a163..55e89c8 100644 --- a/ihl/collector/CollectorEntity.java +++ b/ihl/collector/CollectorEntity.java @@ -44,14 +44,13 @@ public class CollectorEntity extends EntityFlying { public double waypointY; public double waypointZ; private IHL3dPathFinder pathFinder3D; - private int stuckCooldown=0; private boolean clientSideNeedEnergyUpdate = true; public int hopperx; public int hoppery; public int hopperz; protected int energyConsume=1; protected Item thisItem=IHLMod.collectorItem; - protected List eItemIgnoreList = new ArrayList(); + protected List eItemIgnoreList = new ArrayList(); public Tasks currentTask=Tasks.IDLE; private int teUpdateTimer = 0; private double[] last5TickPosX = new double[5]; @@ -145,7 +144,8 @@ public class CollectorEntity extends EntityFlying { return !this.isDead; } - @Override + @SuppressWarnings("unchecked") + @Override public void onUpdate() { super.onUpdate(); @@ -186,7 +186,7 @@ public class CollectorEntity extends EntityFlying { if(this.charger==null && teUpdateTimer==20) { List teList = this.worldObj.loadedTileEntityList; - Iterator teIterator=teList.iterator(); + Iterator teIterator=teList.iterator(); while(teIterator.hasNext()) { TileEntity te = (TileEntity) teIterator.next(); @@ -283,7 +283,7 @@ public class CollectorEntity extends EntityFlying { if(this.hopper==null && teUpdateTimer==10) { List teList = this.worldObj.loadedTileEntityList; - Iterator teIterator=teList.iterator(); + Iterator teIterator=teList.iterator(); while(teIterator.hasNext()) { TileEntity te = (TileEntity) teIterator.next(); @@ -450,7 +450,7 @@ public class CollectorEntity extends EntityFlying { } else { - Iterator ei = eItemsList.iterator(); + Iterator ei = eItemsList.iterator(); while(ei.hasNext()) { EntityItem newTarget=(EntityItem) ei.next(); @@ -583,30 +583,6 @@ public class CollectorEntity extends EntityFlying { return false; } - /** - * True if the ghast has an unobstructed line of travel to the waypoint. - */ - private boolean isCourseTraversable(double par1, double par3, double par5, double par7) - { - double var9 = (par1 - this.posX) / par7; - double var11 = (par3 - this.posY) / par7; - double var13 = (par5 - this.posZ) / par7; - AxisAlignedBB var15 = this.boundingBox.copy(); - - for (int var16 = 1; var16 < par7; ++var16) - { - var15.offset(var9, var11, var13); - - if (!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) - { - return false; - } - } - - return true; - } - - public int getStored() { return this.energy; @@ -616,37 +592,21 @@ public class CollectorEntity extends EntityFlying { { this.energy=value; } - - private double mov(double motion) - { - double max=0.1D; - if(motion>max) - { - return max; - } - else if(motion<-max) - { - return -max; - } - else - { - return 0D; - } - } public ItemStack getVisibleItemStack() { return this.dataWatcher.getWatchableObjectItemStack(18); } - private void harvest() + @SuppressWarnings("unchecked") + private void harvest() { double range = 1D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.posX-range,this.posY-range-1D,this.posZ-range,this.posX+range,this.posY+range,this.posZ+range); List eItemsList = this.worldObj.getEntitiesWithinAABB(EntityItem.class, searchArea); if(eItemsList!=null && eItemsList.size()>0) { - Iterator itemIterator = eItemsList.iterator(); + Iterator itemIterator = eItemsList.iterator(); while(itemIterator.hasNext()) { EntityItem eItem = (EntityItem) itemIterator.next(); @@ -937,7 +897,8 @@ public class CollectorEntity extends EntityFlying { this.setDead(); } - protected List getEItemsList() + @SuppressWarnings("unchecked") + protected List getEItemsList() { double range = 32D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.lastItemX-range,this.lastItemY-range,this.lastItemZ-range,this.lastItemX+range,this.lastItemY+range,this.lastItemZ+range); diff --git a/ihl/collector/CollectorItem.java b/ihl/collector/CollectorItem.java index 67d7914..b4496fa 100644 --- a/ihl/collector/CollectorItem.java +++ b/ihl/collector/CollectorItem.java @@ -163,13 +163,14 @@ public class CollectorItem extends Item implements IElectricItem, IItemHudInfo { @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); info.add(ElectricItem.manager.getToolTip(itemStack)); info.add("Power Tier: " + this.tier); return info; } - @Override + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add("PowerTier: " + this.tier); @@ -177,6 +178,7 @@ public class CollectorItem extends Item implements IElectricItem, IItemHudInfo { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void getSubItems(Item item, CreativeTabs tabs, List itemList) { itemList.add(this.getItemStack(this.maxCharge)); diff --git a/ihl/collector/GlassBoxContainer.java b/ihl/collector/GlassBoxContainer.java index 1ad7be7..8f6e52a 100644 --- a/ihl/collector/GlassBoxContainer.java +++ b/ihl/collector/GlassBoxContainer.java @@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -public class GlassBoxContainer extends ContainerBase { +public class GlassBoxContainer extends ContainerBase { protected GlassBoxTileEntity tileEntity; public int lastStorage = -1; diff --git a/ihl/collector/GlassBoxGui.java b/ihl/collector/GlassBoxGui.java index 4e09187..2210d06 100644 --- a/ihl/collector/GlassBoxGui.java +++ b/ihl/collector/GlassBoxGui.java @@ -5,15 +5,12 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GlassBoxGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGlassBox.png"); private GlassBoxContainer container; - private String title = StatCollector.translateToLocal("ihl.gui.charger_ejector"); public GlassBoxGui (GlassBoxContainer container1) { //the container is instanciated and passed to the superclass for handling @@ -21,14 +18,6 @@ public class GlassBoxGui extends GuiContainer { this.container=container1; } - @Override - public void initGui() - { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - } - @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/ihl/collector/GlassBoxRender.java b/ihl/collector/GlassBoxRender.java index 764314d..305c6bd 100644 --- a/ihl/collector/GlassBoxRender.java +++ b/ihl/collector/GlassBoxRender.java @@ -24,12 +24,10 @@ public class GlassBoxRender extends TileEntitySpecialRenderer { double x, double y, double z, float par8) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y+0.5F, (float)z + 0.5F); - float rotation=0F; for(int i=0;i eItemList = new ArrayList(); + List eItemList = new ArrayList(); for(int i=0;i getEItemsList() + @SuppressWarnings("unchecked") + protected List getEItemsList() { double range = 0.2D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.xCoord,this.yCoord,this.zCoord,this.xCoord+1.0D,this.yCoord+1.0D+range,this.zCoord+1.0D); -- cgit v1.2.3