mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
IO fixes, some arty work
This commit is contained in:
parent
86a531cebe
commit
e1b75a315e
@ -91,20 +91,31 @@ public class ItemAssemblyTemplate extends Item {
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
|
||||
//NEW
|
||||
ComparableStack comp = readType(stack);
|
||||
//LEGACY
|
||||
if(comp == null) comp = AssemblerRecipes.recipeList.get(stack.getItemDamage());
|
||||
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
ItemStack out = comp != null ? comp.toStack() : null;
|
||||
String s1 = ("" + StatCollector.translateToLocal((out != null ? out.getUnlocalizedName() : "") + ".name")).trim();
|
||||
|
||||
if(s1 != null) {
|
||||
s = s + " " + s1;
|
||||
try {
|
||||
//NEW
|
||||
ComparableStack comp = readType(stack);
|
||||
//LEGACY
|
||||
if(comp == null) comp = AssemblerRecipes.recipeList.get(stack.getItemDamage());
|
||||
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
ItemStack out = comp != null ? comp.toStack() : null;
|
||||
if(out.getItem() == null) {
|
||||
out = null;
|
||||
}
|
||||
if(out == null) {
|
||||
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
String s1 = ("" + StatCollector.translateToLocal(out.getUnlocalizedName() + ".name")).trim();
|
||||
|
||||
if(s1 != null) {
|
||||
s = s + " " + s1;
|
||||
}
|
||||
|
||||
return s;
|
||||
} catch(Exception ex) {
|
||||
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -18,7 +17,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
@ -35,9 +33,7 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
|
||||
//3: 2
|
||||
//4: 3
|
||||
//5: b
|
||||
private static final int[] slots_top = new int[] {0, 2, 3, 4, 5};
|
||||
private static final int[] slots_bottom = new int[] {1, 2, 3, 4, 5};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
private static final int[] slots_io = new int[] {0, 1, 2, 3, 4, 5};
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -114,18 +110,11 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
|
||||
if(i == 1)
|
||||
return false;
|
||||
|
||||
if(i == 5)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 2 || i == 3 || i == 4)
|
||||
return itemStack.getItem() == ModItems.arc_electrode || itemStack.getItem() == ModItems.arc_electrode_desh;
|
||||
|
||||
if(i == 0)
|
||||
return true;
|
||||
return FurnaceRecipes.smelting().getSmeltingResult(itemStack) != null;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -193,10 +182,9 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slots_io;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
@ -205,9 +193,6 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 5)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
return true;
|
||||
|
||||
@ -251,7 +251,7 @@ public class TileEntityMachineAutocrafter extends TileEntityMachineBase implemen
|
||||
if(i == 19)
|
||||
return true;
|
||||
|
||||
if(i > 9 && i < 18) {
|
||||
if(i > 9 && i < 19) {
|
||||
ItemStack filter = slots[i - 10];
|
||||
String mode = modes[i - 10];
|
||||
|
||||
|
||||
@ -37,10 +37,6 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
public FluidTank[] tanks;
|
||||
|
||||
private static final int[] slots_top = new int[] {4};
|
||||
private static final int[] slots_bottom = new int[] {6};
|
||||
private static final int[] slots_side = new int[] {4};
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineBoiler() {
|
||||
@ -118,12 +114,7 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 4)
|
||||
if(TileEntityFurnace.getItemBurnTime(stack) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return i == 4 && TileEntityFurnace.getItemBurnTime(stack) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -193,10 +184,9 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] { 4 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
@ -205,7 +195,7 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return false;
|
||||
return i == 4 && !this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
public int getHeatScaled(int i) {
|
||||
|
||||
@ -43,10 +43,6 @@ public class TileEntityMachineBoilerElectric extends TileEntityLoadedBase implem
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
public FluidTank[] tanks;
|
||||
|
||||
private static final int[] slots_top = new int[] {4};
|
||||
private static final int[] slots_bottom = new int[] {6};
|
||||
private static final int[] slots_side = new int[] {4};
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineBoilerElectric() {
|
||||
@ -199,14 +195,13 @@ public class TileEntityMachineBoilerElectric extends TileEntityLoadedBase implem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -8,15 +8,20 @@ import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.inventory.container.ContainerTurretBase;
|
||||
import com.hbm.inventory.gui.GUITurretArty;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -103,14 +108,18 @@ public class TileEntityTurretArty extends TileEntityTurretBaseNT implements IGUI
|
||||
|
||||
@Override
|
||||
protected void seekNewTarget() {
|
||||
super.seekNewTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean entityInLOS(Entity e) {
|
||||
|
||||
if(this.mode == MODE_CANNON) {
|
||||
super.seekNewTarget();
|
||||
return;
|
||||
if(this.mode == this.MODE_CANNON) {
|
||||
return super.entityInLOS(e);
|
||||
} else {
|
||||
int height = worldObj.getHeightValue((int) Math.floor(e.posX), (int) Math.floor(e.posZ));
|
||||
return height < (e.posY + e.height);
|
||||
}
|
||||
|
||||
|
||||
/* TODO: large field artillery target search */
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -169,7 +178,6 @@ public class TileEntityTurretArty extends TileEntityTurretBaseNT implements IGUI
|
||||
|
||||
if(this.didJustShoot) {
|
||||
this.retracting = true;
|
||||
System.out.println("beb");
|
||||
}
|
||||
|
||||
if(this.retracting) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user