Fixed a Laser Amplifier & Laser Tractor Beam inventory crash, fixed missing sounds for Chargepad, Chemical Crystallzer, Chemical Washer & Metallurgic Infuser
This commit is contained in:
parent
c3ef938166
commit
8d83ada60f
8 changed files with 104 additions and 9 deletions
|
@ -210,7 +210,7 @@ public class ClientTickHandler
|
|||
}
|
||||
}
|
||||
|
||||
if(isFlamethrowerOn(mc.thePlayer) != Mekanism.flamethrowerActive.contains(mc.thePlayer.getCommandSenderName()))
|
||||
if(Mekanism.flamethrowerActive.contains(mc.thePlayer.getCommandSenderName()) != isFlamethrowerOn(mc.thePlayer))
|
||||
{
|
||||
if(isFlamethrowerOn(mc.thePlayer))
|
||||
{
|
||||
|
|
|
@ -47,6 +47,8 @@ public class CommonPlayerTracker
|
|||
public void onPlayerDimChangedEvent(PlayerChangedDimensionEvent event)
|
||||
{
|
||||
Mekanism.jetpackOn.remove(event.player);
|
||||
Mekanism.gasmaskOn.remove(event.player);
|
||||
Mekanism.flamethrowerActive.remove(event.player);
|
||||
|
||||
if(!event.player.worldObj.isRemote)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package mekanism.common.inventory.container;
|
||||
|
||||
import mekanism.common.tile.TileEntityLaserAmplifier;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerLaserAmplifier extends Container
|
||||
{
|
||||
|
@ -48,4 +48,55 @@ public class ContainerLaserAmplifier extends Container
|
|||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
Slot currentSlot = (Slot)inventorySlots.get(slotID);
|
||||
|
||||
if(currentSlot != null && currentSlot.getHasStack())
|
||||
{
|
||||
ItemStack slotStack = currentSlot.getStack();
|
||||
stack = slotStack.copy();
|
||||
|
||||
if(slotID >= 0 && slotID <= 26)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 27, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 26)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 0, 26, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 0, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == 0)
|
||||
{
|
||||
currentSlot.putStack((ItemStack)null);
|
||||
}
|
||||
else {
|
||||
currentSlot.onSlotChanged();
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == stack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
currentSlot.onPickupFromSlot(player, slotStack);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package mekanism.common.inventory.container;
|
||||
|
||||
import mekanism.common.tile.TileEntityLaserTractorBeam;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerLaserTractorBeam extends Container
|
||||
{
|
||||
|
@ -16,9 +16,9 @@ public class ContainerLaserTractorBeam extends Container
|
|||
tileEntity = tentity;
|
||||
int slotX;
|
||||
|
||||
for (slotX = 0; slotX < 9; slotX++)
|
||||
for(slotX = 0; slotX < 9; slotX++)
|
||||
{
|
||||
for (int slotY = 0; slotY < 3; slotY++)
|
||||
for(int slotY = 0; slotY < 3; slotY++)
|
||||
{
|
||||
addSlotToContainer(new Slot(tentity, slotX + slotY * 9, 8 + slotX * 18, 16 + slotY * 18));
|
||||
}
|
||||
|
@ -55,4 +55,46 @@ public class ContainerLaserTractorBeam extends Container
|
|||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
Slot currentSlot = (Slot)inventorySlots.get(slotID);
|
||||
|
||||
if(currentSlot != null && currentSlot.getHasStack())
|
||||
{
|
||||
ItemStack slotStack = currentSlot.getStack();
|
||||
stack = slotStack.copy();
|
||||
|
||||
if(slotID < 27)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 27, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(!mergeItemStack(slotStack, 0, 27, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == 0)
|
||||
{
|
||||
currentSlot.putStack((ItemStack)null);
|
||||
}
|
||||
else {
|
||||
currentSlot.onSlotChanged();
|
||||
}
|
||||
|
||||
if(slotStack.stackSize == stack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
currentSlot.onPickupFromSlot(player, slotStack);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
|||
|
||||
public TileEntityChargepad()
|
||||
{
|
||||
super("chargepad", "Chargepad", MachineType.CHARGEPAD.baseEnergy);
|
||||
super("machine.chargepad", "Chargepad", MachineType.CHARGEPAD.baseEnergy);
|
||||
inventory = new ItemStack[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
|||
|
||||
public TileEntityChemicalCrystallizer()
|
||||
{
|
||||
super("crystallizer", "ChemicalCrystallizer", MachineType.CHEMICAL_CRYSTALLIZER.baseEnergy);
|
||||
super("machine.crystallizer", "ChemicalCrystallizer", MachineType.CHEMICAL_CRYSTALLIZER.baseEnergy);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY, TransmissionType.GAS);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
|||
|
||||
public TileEntityChemicalWasher()
|
||||
{
|
||||
super("washer", "ChemicalWasher", MachineType.CHEMICAL_WASHER.baseEnergy);
|
||||
super("machine.washer", "ChemicalWasher", MachineType.CHEMICAL_WASHER.baseEnergy);
|
||||
inventory = new ItemStack[5];
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
|||
|
||||
public TileEntityMetallurgicInfuser()
|
||||
{
|
||||
super("metalinfuser", "MetallurgicInfuser", MachineType.METALLURGIC_INFUSER.baseEnergy);
|
||||
super("machine.metalinfuser", "MetallurgicInfuser", MachineType.METALLURGIC_INFUSER.baseEnergy);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY);
|
||||
|
||||
|
|
Loading…
Reference in a new issue