Container-Stuff

This commit is contained in:
Sebastian Hartte
2020-06-02 02:33:05 +02:00
parent 9f63859769
commit fc300745cd
43 changed files with 197 additions and 202 deletions
@@ -39,18 +39,18 @@ public class ContainerFluidFormationPlane extends ContainerFluidConfigurable
protected void setupConfig()
{
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) )
.setNotDraggable() );
}
@@ -24,7 +24,6 @@ import java.util.Iterator;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.AccessRestriction;
import appeng.api.config.FuzzyMode;
import appeng.api.config.SecurityPermissions;
@@ -75,18 +74,18 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable
protected void setupConfig()
{
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
.setNotDraggable() );
this.addSlotToContainer(
this.addSlot(
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) )
.setNotDraggable() );
}
@@ -25,7 +25,7 @@ import java.nio.BufferOverflowException;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.item.ItemStack;
@@ -207,14 +207,14 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
}
catch( final BufferOverflowException boe )
{
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
piu = new PacketMEFluidInventoryUpdate();
piu.appendFluid( send );
}
}
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
}
catch( final IOException e )
{
@@ -281,11 +281,11 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
this.clientCM.putSetting( set, sideLocal );
for( final IContainerListener crafter : this.listeners )
{
if( crafter instanceof PlayerEntityMP )
if( crafter instanceof ServerPlayerEntity )
{
try
{
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (PlayerEntityMP) crafter );
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (ServerPlayerEntity) crafter );
}
catch( final IOException e )
{
@@ -326,7 +326,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
{
if( c instanceof PlayerEntity )
{
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
}
}
}
@@ -343,7 +343,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
}
@Override
public void doAction( PlayerEntityMP player, InventoryAction action, int slot, long id )
public void doAction( ServerPlayerEntity player, InventoryAction action, int slot, long id )
{
if( action != InventoryAction.FILL_ITEM && action != InventoryAction.EMPTY_ITEM )
{
@@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.IContainerListener;
import appeng.api.storage.data.IAEFluidStack;
@@ -59,9 +59,9 @@ public class FluidSyncHelper
for( final IContainerListener l : listeners )
{
if( l instanceof PlayerEntityMP )
if( l instanceof ServerPlayerEntity )
{
NetworkHandler.instance().sendTo( new PacketFluidSlot( data ), (PlayerEntityMP) l );
NetworkHandler.instance().sendTo( new PacketFluidSlot( data ), (ServerPlayerEntity) l );
}
}
}