Several fixes
This commit is contained in:
parent
ac16039ecf
commit
1c42aebfec
5 changed files with 22 additions and 17 deletions
|
@ -21,15 +21,15 @@ public class ContainerGasTank extends Container
|
|||
|
||||
int slotX;
|
||||
|
||||
for(slotX = 0; slotX < 3; ++slotX)
|
||||
for(slotX = 0; slotX < 3; slotX++)
|
||||
{
|
||||
for(int slotY = 0; slotY < 9; ++slotY)
|
||||
for(int slotY = 0; slotY < 9; slotY++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 84 + slotX * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(slotX = 0; slotX < 9; ++slotX)
|
||||
for(slotX = 0; slotX < 9; slotX++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 142));
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor
|
|||
@Override
|
||||
public boolean canProvideGas(ItemStack itemstack, Gas type)
|
||||
{
|
||||
return getGas(itemstack) != null && (type == null || getGas(itemstack).getGas() == type);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -164,7 +164,7 @@ public class ItemScubaTank extends ItemArmor implements IGasItem
|
|||
@Override
|
||||
public boolean canProvideGas(ItemStack itemstack, Gas type)
|
||||
{
|
||||
return getGas(itemstack) != null && (type == null || getGas(itemstack).getGas() == type);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,6 +68,18 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void deregister()
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if(Mekanism.ic2Registered.contains(Coord4D.get(this)))
|
||||
{
|
||||
Mekanism.ic2Registered.remove(Coord4D.get(this));
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
|
@ -129,11 +141,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
|||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
Mekanism.ic2Registered.remove(Coord4D.get(this));
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
}
|
||||
deregister();
|
||||
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
@ -142,12 +150,8 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
|||
public void invalidate()
|
||||
{
|
||||
super.invalidate();
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
Mekanism.ic2Registered.remove(Coord4D.get(this));
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
}
|
||||
|
||||
deregister();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,6 +21,7 @@ import mekanism.common.network.PacketTileEntity;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -306,7 +307,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
return new int[] {1, 2};
|
||||
}
|
||||
|
||||
return new int[] {0};
|
||||
return InventoryUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue