Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
+36
-23
@@ -43,10 +43,12 @@ import appeng.core.features.ItemStackSrc;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.LookDirection;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.SettingsFrom;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -157,6 +159,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
|
||||
}
|
||||
|
||||
public IIcon unmappedGetIcon(IBlockAccess w, int x, int y, int z, int s)
|
||||
{
|
||||
return super.getIcon( w, x, y, z, s );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s)
|
||||
{
|
||||
@@ -168,6 +175,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
|
||||
GameRegistry.registerTileEntity( tileEntityType = c, FeatureFullname );
|
||||
isInventory = IInventory.class.isAssignableFrom( c );
|
||||
setTileProvider( hasBlockTileEntity() );
|
||||
}
|
||||
|
||||
protected void setfeature(EnumSet<AEFeature> f)
|
||||
@@ -180,6 +188,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
setLightOpacity( 15 );
|
||||
setLightLevel( 0 );
|
||||
setHardness( 1.2F );
|
||||
setTileProvider( false );
|
||||
}
|
||||
|
||||
// update Block value.
|
||||
private void setTileProvider(boolean b)
|
||||
{
|
||||
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
|
||||
}
|
||||
|
||||
protected AEBaseBlock(Class<?> c, Material mat, String subname) {
|
||||
@@ -230,12 +245,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return tileEntityType != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
final public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return hasBlockTileEntity();
|
||||
}
|
||||
|
||||
public Class<? extends TileEntity> getTileEntityClass()
|
||||
{
|
||||
return tileEntityType;
|
||||
@@ -266,14 +275,18 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@Override
|
||||
final public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
try
|
||||
if ( hasBlockTileEntity() )
|
||||
{
|
||||
return tileEntityType.newInstance();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException( e );
|
||||
try
|
||||
{
|
||||
return tileEntityType.newInstance();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
final public <T extends TileEntity> T getTileEntity(IBlockAccess w, int x, int y, int z)
|
||||
@@ -293,7 +306,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void customRotateBlock(IOrientable rotateable, ForgeDirection axis)
|
||||
protected void customRotateBlock(IOrientable rotatable, ForgeDirection axis)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -301,28 +314,28 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@Override
|
||||
final public boolean rotateBlock(World w, int x, int y, int z, ForgeDirection axis)
|
||||
{
|
||||
IOrientable rotateable = null;
|
||||
IOrientable rotatable = null;
|
||||
|
||||
if ( hasBlockTileEntity() )
|
||||
{
|
||||
rotateable = (AEBaseTile) getTileEntity( w, x, y, z );
|
||||
rotatable = (AEBaseTile) getTileEntity( w, x, y, z );
|
||||
}
|
||||
else if ( this instanceof IOrientableBlock )
|
||||
{
|
||||
rotateable = ((IOrientableBlock) this).getOrientable( w, x, y, z );
|
||||
rotatable = ((IOrientableBlock) this).getOrientable( w, x, y, z );
|
||||
}
|
||||
|
||||
if ( rotateable != null && rotateable.canBeRotated() )
|
||||
if ( rotatable != null && rotatable.canBeRotated() )
|
||||
{
|
||||
if ( hasCustomRotation() )
|
||||
{
|
||||
customRotateBlock( rotateable, axis );
|
||||
customRotateBlock( rotatable, axis );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForgeDirection forward = rotateable.getForward();
|
||||
ForgeDirection up = rotateable.getUp();
|
||||
ForgeDirection forward = rotatable.getForward();
|
||||
ForgeDirection up = rotatable.getUp();
|
||||
|
||||
for (int rs = 0; rs < 4; rs++)
|
||||
{
|
||||
@@ -331,14 +344,14 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
|
||||
if ( this.isValidOrientation( w, x, y, z, forward, up ) )
|
||||
{
|
||||
rotateable.setOrientation( forward, up );
|
||||
rotatable.setOrientation( forward, up );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return super.rotateBlock( w, x, y, z, axis );
|
||||
}
|
||||
|
||||
public ForgeDirection mapRotation(IOrientable ori, ForgeDirection dir)
|
||||
@@ -641,7 +654,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
if ( tile == null )
|
||||
return false;
|
||||
|
||||
if ( tile instanceof TileCableBus )
|
||||
if ( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
||||
return false;
|
||||
|
||||
ItemStack op = new ItemStack( this );
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package appeng.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class AEDecorativeBlock extends AEBaseBlock
|
||||
{
|
||||
|
||||
protected AEDecorativeBlock(Class<?> c, Material mat) {
|
||||
super( c, mat );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s)
|
||||
{
|
||||
return super.unmappedGetIcon( w, x, y, z, s );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,11 +37,11 @@ public class BlockInterface extends AEBaseBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customRotateBlock(IOrientable rotateable, ForgeDirection axis)
|
||||
protected void customRotateBlock(IOrientable rotatable, ForgeDirection axis)
|
||||
{
|
||||
if ( rotateable instanceof TileInterface )
|
||||
if ( rotatable instanceof TileInterface )
|
||||
{
|
||||
((TileInterface) rotateable).setSide( axis );
|
||||
((TileInterface) rotatable).setSide( axis );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RendererSecurity;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileSecurity;
|
||||
import appeng.util.Platform;
|
||||
@@ -39,15 +38,10 @@ public class BlockSecurity extends AEBaseBlock
|
||||
TileSecurity tg = getTileEntity( w, x, y, z );
|
||||
if ( tg != null )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
if ( tg.isPowered() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SECURITY );
|
||||
}
|
||||
else
|
||||
p.addChatMessage( PlayerMessages.MachineNotPowered.get() );
|
||||
}
|
||||
if ( Platform.isClient() )
|
||||
return true;
|
||||
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SECURITY );
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@@ -57,10 +57,15 @@ public class BlockCableBus extends AEBaseBlock
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
|
||||
{
|
||||
return recolourBlock( world, x, y, z, side, colour, null );
|
||||
}
|
||||
|
||||
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who)
|
||||
{
|
||||
try
|
||||
{
|
||||
return cb( world, x, y, z ).recolourBlock( side, colour );
|
||||
return cb( world, x, y, z ).recolourBlock( side, colour, who );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
|
||||
@@ -3,14 +3,10 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
|
||||
public class BlockFluix extends AEBaseBlock implements IOrientableBlock
|
||||
public class BlockFluix extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockFluix() {
|
||||
@@ -18,10 +14,4 @@ public class BlockFluix extends AEBaseBlock implements IOrientableBlock
|
||||
setfeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
return new LocationRotation( w, x, y, z );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockQuartz extends AEBaseBlock
|
||||
public class BlockQuartz extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartz() {
|
||||
|
||||
@@ -3,10 +3,10 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockQuartzChiseled extends AEBaseBlock
|
||||
public class BlockQuartzChiseled extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartzChiseled() {
|
||||
|
||||
@@ -9,23 +9,28 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import rblocks.api.RotatableBlockEnable;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
import appeng.helpers.NullRotation;
|
||||
import appeng.integration.abstraction.IRB;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@RotatableBlockEnable
|
||||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
@@ -41,7 +46,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
@SubscribeEvent
|
||||
public void breakFaster(PlayerEvent.BreakSpeed Ev)
|
||||
{
|
||||
if ( Ev.block == this && Ev.originalSpeed > 7 || Ev.metadata > 0 )
|
||||
if ( Ev.block == this && (Ev.originalSpeed > 7 || Ev.metadata > 0) )
|
||||
Ev.newSpeed /= 0.1;
|
||||
}
|
||||
|
||||
@@ -79,8 +84,20 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
if ( AppEng.instance.isIntegrationEnabled( "RB" ) )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
if ( te != null )
|
||||
{
|
||||
IOrientable out = ((IRB) AppEng.instance.getIntegration( "RB" )).getOrientable( te );
|
||||
if ( out != null )
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
if ( w.getBlockMetadata( x, y, z ) == 0 )
|
||||
return new LocationRotation( w, x, y, z );
|
||||
|
||||
return new NullRotation();
|
||||
}
|
||||
|
||||
@@ -145,4 +162,10 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
|
||||
}
|
||||
|
||||
// use AE2's enderer, no rotatable blocks.
|
||||
int getRealRenderType()
|
||||
{
|
||||
return getRenderType();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,20 +46,18 @@ public class BlockChest extends AEBaseBlock
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CHEST );
|
||||
}
|
||||
else if ( tg.isPowered() )
|
||||
else
|
||||
{
|
||||
ItemStack cell = tg.getStackInSlot( 1 );
|
||||
if ( cell != null )
|
||||
{
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHander( cell );
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
|
||||
tg.openGui( p, ch, cell, side );
|
||||
}
|
||||
else
|
||||
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
|
||||
}
|
||||
else
|
||||
p.addChatMessage( PlayerMessages.MachineNotPowered.get() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata) {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
@@ -94,7 +99,20 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxsFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
||||
{
|
||||
return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) } );
|
||||
TileSkyChest sk = getTileEntity( w, x, y, z );
|
||||
double sc = 0.06;
|
||||
ForgeDirection o = ForgeDirection.UNKNOWN;
|
||||
|
||||
if ( sk != null )
|
||||
o = sk.getUp();
|
||||
|
||||
double X = o.offsetX == 0 ? 0.06 : 0.0;
|
||||
double Y = o.offsetY == 0 ? 0.06 : 0.0;
|
||||
double Z = o.offsetZ == 0 ? 0.06 : 0.0;
|
||||
|
||||
return Arrays.asList( new AxisAlignedBB[] { AxisAlignedBB.getBoundingBox( Math.max( 0.0, X - o.offsetX * sc ), Math.max( 0.0, Y - o.offsetY * sc ),
|
||||
Math.max( 0.0, Z - o.offsetZ * sc ), Math.min( 1.0, (1.0 - X) - o.offsetX * sc ), Math.min( 1.0, (1.0 - Y) - o.offsetY * sc ),
|
||||
Math.min( 1.0, (1.0 - Z) - o.offsetZ * sc ) ) } );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,8 +46,10 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
@@ -271,6 +273,56 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
super.handleMouseClick( slot, slotIdx, ctrlDown, key );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int p_146983_1_)
|
||||
{
|
||||
Slot theSlot;
|
||||
|
||||
try
|
||||
{
|
||||
theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( this.mc.thePlayer.inventory.getItemStack() == null && theSlot != null )
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
if ( p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
|
||||
{
|
||||
if ( theSlot.getSlotStackLimit() == 64 )
|
||||
{
|
||||
this.handleMouseClick( theSlot, theSlot.slotNumber, j, 2 );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
for (Slot s : (List<Slot>) inventorySlots.inventorySlots)
|
||||
{
|
||||
if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) inventorySlots).getPlayerInv() )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouse_x, int mouse_y, float btn)
|
||||
{
|
||||
@@ -526,7 +578,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
AppEngRenderItem aeri = new AppEngRenderItem();
|
||||
|
||||
private boolean isPowered()
|
||||
protected boolean isPowered()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.api.implementations.tiles.IMEChest;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
@@ -55,13 +56,15 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
int rows = 0;
|
||||
int maxRows = Integer.MAX_VALUE;
|
||||
|
||||
int standardSize;
|
||||
|
||||
IConfigManager configSrc;
|
||||
|
||||
GuiImgButton ViewBox;
|
||||
GuiImgButton SortByBox;
|
||||
GuiImgButton SortDirBox;
|
||||
|
||||
GuiImgButton searchBoxSettings;
|
||||
GuiImgButton searchBoxSettings, terminalStyleBox;
|
||||
boolean viewCell;
|
||||
|
||||
ItemStack myCurrentViewCells[] = new ItemStack[5];
|
||||
@@ -76,12 +79,15 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
super( c );
|
||||
myScrollBar = new GuiScrollbar();
|
||||
repo = new ItemRepo( myScrollBar, this );
|
||||
|
||||
xSize = 195;
|
||||
ySize = 204;
|
||||
|
||||
if ( te instanceof IViewCellStorage )
|
||||
xSize += 33;
|
||||
|
||||
standardSize = xSize;
|
||||
|
||||
configSrc = ((IConfigureableObject) inventorySlots).getConfigManager();
|
||||
(mecontainer = (ContainerMEMonitorable) inventorySlots).gui = this;
|
||||
|
||||
@@ -123,6 +129,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
maxRows = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
|
||||
perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ((width - standardSize) / 18);
|
||||
|
||||
int NEI = 0;
|
||||
int top = 4;
|
||||
int magicNumber = 114 + 1;
|
||||
@@ -144,6 +153,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
}
|
||||
|
||||
if ( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
|
||||
this.xSize = standardSize + ((perRow - 9) * 18);
|
||||
else
|
||||
this.xSize = standardSize;
|
||||
|
||||
super.initGui();
|
||||
// full size : 204
|
||||
// extra slots : 72
|
||||
@@ -165,6 +179,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
buttonList.add( searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings
|
||||
.getSetting( Settings.SEARCH_MODE ) ) );
|
||||
offset += 20;
|
||||
|
||||
buttonList.add( terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings
|
||||
.getSetting( Settings.TERMINAL_STYLE ) ) );
|
||||
|
||||
searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, xoffset ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT );
|
||||
searchField.setEnableBackgroundDrawing( false );
|
||||
@@ -201,7 +219,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
Enum cv = iBtn.getCurrentValue();
|
||||
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
||||
|
||||
if ( btn == searchBoxSettings )
|
||||
if ( btn == terminalStyleBox )
|
||||
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
else if ( btn == searchBoxSettings )
|
||||
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
else
|
||||
{
|
||||
@@ -217,7 +237,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
iBtn.set( next );
|
||||
|
||||
if ( next.getClass() == SearchBoxMode.class )
|
||||
if ( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
|
||||
re_init();
|
||||
}
|
||||
}
|
||||
@@ -261,6 +281,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
repo.setPower( mecontainer.hasPower );
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
|
||||
{
|
||||
@@ -335,4 +362,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
repo.updateView();
|
||||
}
|
||||
|
||||
protected boolean isPowered()
|
||||
{
|
||||
return repo.hasPower();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.texture.ExtraTextures;
|
||||
@@ -140,6 +141,10 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
||||
registerApp( 16 * 5 + 3, Settings.LEVEL_TYPE, LevelType.ENERGY_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Energy );
|
||||
registerApp( 16 * 4 + 3, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Item );
|
||||
|
||||
registerApp( 16 * 13 + 0, Settings.TERMINAL_STYLE, TerminalStyle.TALL, ButtonToolTips.TerminalStyle, ButtonToolTips.TerminalStyle_Tall );
|
||||
registerApp( 16 * 13 + 1, Settings.TERMINAL_STYLE, TerminalStyle.SMALL, ButtonToolTips.TerminalStyle, ButtonToolTips.TerminalStyle_Small );
|
||||
registerApp( 16 * 13 + 2, Settings.TERMINAL_STYLE, TerminalStyle.FULL, ButtonToolTips.TerminalStyle, ButtonToolTips.TerminalStyle_Full );
|
||||
|
||||
registerApp( 64, Settings.SORT_BY, SortOrder.NAME, ButtonToolTips.SortBy, ButtonToolTips.ItemName );
|
||||
registerApp( 65, Settings.SORT_BY, SortOrder.AMOUNT, ButtonToolTips.SortBy, ButtonToolTips.NumberOfItems );
|
||||
registerApp( 68, Settings.SORT_BY, SortOrder.INVTWEAKS, ButtonToolTips.SortBy, ButtonToolTips.InventoryTweaks );
|
||||
|
||||
@@ -28,4 +28,9 @@ public class InternalSlotME
|
||||
{
|
||||
return repo.getRefrenceItem( offset );
|
||||
}
|
||||
|
||||
public boolean hasPower()
|
||||
{
|
||||
return repo.hasPower();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,4 +241,16 @@ public class ItemRepo
|
||||
list.resetStatus();
|
||||
}
|
||||
|
||||
private boolean hasPower;
|
||||
|
||||
public boolean hasPower()
|
||||
{
|
||||
return hasPower;
|
||||
}
|
||||
|
||||
public void setPower(boolean hasPower)
|
||||
{
|
||||
this.hasPower = hasPower;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,12 +19,16 @@ public class SlotME extends Slot
|
||||
@Override
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return mySlot.getStack();
|
||||
if ( mySlot.hasPower() )
|
||||
return mySlot.getStack();
|
||||
return null;
|
||||
}
|
||||
|
||||
public IAEItemStack getAEStack()
|
||||
{
|
||||
return mySlot.getAEStack();
|
||||
if ( mySlot.hasPower() )
|
||||
return mySlot.getAEStack();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +52,9 @@ public class SlotME extends Slot
|
||||
@Override
|
||||
public boolean getHasStack()
|
||||
{
|
||||
return getStack() != null;
|
||||
if ( mySlot.hasPower() )
|
||||
return getStack() != null;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,7 +104,7 @@ public class RenderBlockSkyChest extends BaseBlockRender
|
||||
lidangle = 1.0F - lidangle;
|
||||
lidangle = 1.0F - lidangle * lidangle * lidangle;
|
||||
|
||||
model.chestLid.offsetY = -(0.9f / 16.0f);
|
||||
model.chestLid.offsetY = -(1.01f / 16.0f);
|
||||
model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F);
|
||||
model.renderAll();
|
||||
|
||||
|
||||
@@ -65,11 +65,12 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY || type == ItemRenderType.EQUIPPED )
|
||||
{
|
||||
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
|
||||
float rYaw = p.rotationYaw;
|
||||
|
||||
if ( type == ItemRenderType.EQUIPPED )
|
||||
{
|
||||
p = (EntityPlayer) obj[1];
|
||||
p.rotationYaw = p.renderYawOffset;
|
||||
rYaw = p.renderYawOffset;
|
||||
}
|
||||
|
||||
int x = (int) p.posX;
|
||||
@@ -92,13 +93,13 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
{
|
||||
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
{
|
||||
float offRads = p.rotationYaw / 180.0f * (float) Math.PI;
|
||||
float offRads = rYaw / 180.0f * (float) Math.PI;
|
||||
float adjustment = (float) Math.PI * 0.74f;
|
||||
model.renderAll( (float) flipidiy( cr.rad + offRads + adjustment ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
float offRads = p.rotationYaw / 180.0f * (float) Math.PI;
|
||||
float offRads = rYaw / 180.0f * (float) Math.PI;
|
||||
float adjustment = (float) Math.PI * -0.74f;
|
||||
model.renderAll( (float) flipidiy( cr.rad + offRads + adjustment ) );
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
|
||||
|
||||
r = CableBusTextures.PartMonitorSides.getIcon();
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(), ExtraTextures.BlockChargerInside.getIcon(), r, r );
|
||||
r = CableBusTextures.PartWirelessSides.getIcon();
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockWirelessInside.getIcon(), ExtraTextures.BlockWirelessInside.getIcon(), r, r );
|
||||
renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
super.postRenderInWorld( renderer );
|
||||
tess.draw();
|
||||
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(), ExtraTextures.BlockChargerInside.getIcon(), r, r );
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockWirelessInside.getIcon(), ExtraTextures.BlockWirelessInside.getIcon(), r, r );
|
||||
|
||||
ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
|
||||
|
||||
@@ -113,8 +113,8 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );
|
||||
super.renderInWorld( blk, world, x, y, z, renderer );
|
||||
|
||||
r = CableBusTextures.PartMonitorSides.getIcon();
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(), ExtraTextures.BlockChargerInside.getIcon(), r, r );
|
||||
r = CableBusTextures.PartWirelessSides.getIcon();
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockWirelessInside.getIcon(), ExtraTextures.BlockWirelessInside.getIcon(), r, r );
|
||||
renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, fdx, fdy, fdz );
|
||||
super.renderInWorld( blk, world, x, y, z, renderer );
|
||||
|
||||
@@ -126,7 +126,7 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
renderTorchAtAngle( renderer, fdx, fdy, fdz );
|
||||
super.postRenderInWorld( renderer );
|
||||
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(), ExtraTextures.BlockChargerInside.getIcon(), r, r );
|
||||
ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockWirelessInside.getIcon(), ExtraTextures.BlockWirelessInside.getIcon(), r, r );
|
||||
|
||||
ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public class RenderMEChest extends BaseBlockRender
|
||||
Tessellator.instance.setColorOpaque_I( 0xffffff );
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHander( sp.getStorageType() );
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHandler( sp.getStorageType() );
|
||||
IIcon ico = ch == null ? null : ch.getTopTexture();
|
||||
renderFace( x, y, z, imb, ico == null ? ExtraTextures.MEChest.getIcon() : ico, renderer, up );
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import appeng.api.implementations.parts.IPartStorageMonitor;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.core.AELog;
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
||||
public class RenderStorageMonitor extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderStorageMonitor() {
|
||||
super( true, 30 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks rinstance)
|
||||
{
|
||||
IPartStorageMonitor monitor = (IPartStorageMonitor) tile;
|
||||
IAEItemStack is = ((IAEItemStack) monitor.getDisplayed());
|
||||
|
||||
if ( is != null && monitor.isPowered() )
|
||||
{
|
||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
// applyTESRRotation( x, y, z, monitor.getForward(), monitor.getUp()
|
||||
// );
|
||||
|
||||
GL11.glPushMatrix();
|
||||
try
|
||||
{
|
||||
ItemStack sis = is.getItemStack();
|
||||
sis.stackSize = 1;
|
||||
|
||||
GL11.glTranslatef( 0.0f, -0.05f, -0.25f );
|
||||
GL11.glScalef( 1.0f / 1.5f, 1.0f / 1.5f, 1.0f / 1.5f );
|
||||
GL11.glScalef( 1.0f, -1.0f, 0.005f );
|
||||
|
||||
Block block = Block.getBlockFromItem( sis.getItem() );
|
||||
if ( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( block.getRenderType() ) )
|
||||
{
|
||||
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
|
||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
||||
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
|
||||
}
|
||||
int br = 16 << 20 | 16 << 4;
|
||||
int var11 = br % 65536;
|
||||
int var12 = br / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11 * 0.8F, var12 * 0.8F );
|
||||
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
GL11.glDisable( GL11.GL_LIGHTING );
|
||||
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
||||
tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
||||
|
||||
doRenderItem( sis, tile );
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glTranslatef( 0.0f, 0.14f, -0.24f );
|
||||
GL11.glScalef( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
|
||||
|
||||
long qty = is.getStackSize();
|
||||
if ( qty > 999999999999L )
|
||||
qty = 999999999999L;
|
||||
|
||||
String msg = Long.toString( qty );
|
||||
if ( qty > 1000000000 )
|
||||
msg = Long.toString( qty / 1000000000 ) + "B";
|
||||
else if ( qty > 1000000 )
|
||||
msg = Long.toString( qty / 1000000 ) + "M";
|
||||
else if ( qty > 9999 )
|
||||
msg = Long.toString( qty / 1000 ) + "K";
|
||||
|
||||
int width = fr.getStringWidth( msg );
|
||||
GL11.glTranslatef( -0.5f * width, 0.0f, -1.0f );
|
||||
fr.drawString( msg, 0, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,11 @@ public enum CableBusTextures
|
||||
|
||||
BlockFormPlaneOn("BlockFormPlaneOn"),
|
||||
|
||||
ItemPartLevelEmitterOn("ItemPart.LevelEmitterOn"), PartTransitionPlaneBack("PartTransitionPlaneBack");
|
||||
ItemPartLevelEmitterOn("ItemPart.LevelEmitterOn"), PartTransitionPlaneBack("PartTransitionPlaneBack"),
|
||||
|
||||
PartTunnelSides("PartTunnelSides"), PartPlaneSides("PartPlaneSides"), PartExportSides("PartExportSides"), PartImportSides("PartImportSides"),
|
||||
|
||||
PartWirelessSides("PartWirelessSides"), PartStorageSides("PartStorageSides"), PartStorageBack("PartStorageBack");
|
||||
|
||||
final private String name;
|
||||
public IIcon IIcon;
|
||||
|
||||
@@ -50,7 +50,9 @@ public enum ExtraTextures
|
||||
|
||||
BlockMESecurityOn("BlockMESecurityOn"), BlockInscriberInside("BlockInscriberInside"),
|
||||
|
||||
BlockQuartzGrowthAcceleratorOn("BlockQuartzGrowthAcceleratorOn"), BlockQuartzGrowthAcceleratorSideOn("BlockQuartzGrowthAcceleratorSideOn");
|
||||
BlockQuartzGrowthAcceleratorOn("BlockQuartzGrowthAcceleratorOn"), BlockQuartzGrowthAcceleratorSideOn("BlockQuartzGrowthAcceleratorSideOn"),
|
||||
|
||||
BlockWirelessInside("BlockWirelessInside");
|
||||
|
||||
final private String name;
|
||||
public IIcon IIcon;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class TaughtIcon implements IIcon
|
||||
|
||||
public TaughtIcon(IIcon o, float tightness) {
|
||||
p = o;
|
||||
this.tightness = tightness;
|
||||
this.tightness = tightness * 0.4f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -115,8 +115,8 @@ public abstract class AEBaseContainer extends Container
|
||||
public ContainerOpenContext openContext;
|
||||
|
||||
protected IMEInventoryHandler<IAEItemStack> cellInv;
|
||||
protected IEnergySource powerSrc;
|
||||
protected HashSet<Integer> locked = new HashSet();
|
||||
protected IEnergySource powerSrc;
|
||||
|
||||
public void lockPlayerInventorySlot(int idx)
|
||||
{
|
||||
@@ -756,4 +756,67 @@ public abstract class AEBaseContainer extends Container
|
||||
}
|
||||
}
|
||||
|
||||
public void swapSlotContents(int slotA, int slotB)
|
||||
{
|
||||
Slot a = getSlot( slotA );
|
||||
Slot b = getSlot( slotB );
|
||||
|
||||
// NPE protection...
|
||||
if ( a == null || b == null )
|
||||
return;
|
||||
|
||||
ItemStack isA = a.getStack();
|
||||
ItemStack isB = b.getStack();
|
||||
|
||||
// something to do?
|
||||
if ( isA == null && isB == null )
|
||||
return;
|
||||
|
||||
// can take?
|
||||
|
||||
if ( isA != null && !a.canTakeStack( invPlayer.player ) )
|
||||
return;
|
||||
|
||||
if ( isB != null && !b.canTakeStack( invPlayer.player ) )
|
||||
return;
|
||||
|
||||
// swap valid?
|
||||
|
||||
if ( isB != null && !a.isItemValid( isB ) )
|
||||
return;
|
||||
|
||||
if ( isA != null && !b.isItemValid( isA ) )
|
||||
return;
|
||||
|
||||
ItemStack testA = isB == null ? null : isB.copy();
|
||||
ItemStack testB = isA == null ? null : isA.copy();
|
||||
|
||||
// can put some back?
|
||||
if ( testA != null && testA.stackSize > a.getSlotStackLimit() )
|
||||
{
|
||||
if ( testB != null )
|
||||
return;
|
||||
|
||||
int totalA = testA.stackSize;
|
||||
testA.stackSize = a.getSlotStackLimit();
|
||||
testB = testA.copy();
|
||||
|
||||
testB.stackSize = totalA - testA.stackSize;
|
||||
}
|
||||
|
||||
if ( testB != null && testB.stackSize > b.getSlotStackLimit() )
|
||||
{
|
||||
if ( testA != null )
|
||||
return;
|
||||
|
||||
int totalB = testB.stackSize;
|
||||
testB.stackSize = b.getSlotStackLimit();
|
||||
testA = testB.copy();
|
||||
|
||||
testA.stackSize = totalB - testA.stackSize;
|
||||
}
|
||||
|
||||
a.putStack( testA );
|
||||
b.putStack( testB );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
@@ -38,6 +40,7 @@ import appeng.core.AELog;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketMEInventoryUpdate;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.me.helpers.ChannelPowerSrc;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
@@ -52,9 +55,12 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
IConfigManager clientCM;
|
||||
|
||||
public boolean canAccessViewCells = false;
|
||||
public boolean hasPower = false;
|
||||
|
||||
public SlotRestrictedInput cellView[] = new SlotRestrictedInput[5];
|
||||
|
||||
public IConfigManagerHost gui;
|
||||
private IGridNode networkNode;
|
||||
|
||||
protected ContainerMEMonitorable(InventoryPlayer ip, ITerminalHost montiorable, boolean bindInventory) {
|
||||
super( ip, montiorable instanceof TileEntity ? (TileEntity) montiorable : null, montiorable instanceof IPart ? (IPart) montiorable : null );
|
||||
@@ -85,9 +91,10 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
IGridNode node = ((IGridHost) montiorable).getGridNode( ForgeDirection.UNKNOWN );
|
||||
if ( node != null )
|
||||
{
|
||||
networkNode = node;
|
||||
IGrid g = node.getGrid();
|
||||
if ( g != null )
|
||||
powerSrc = g.getCache( IEnergyGrid.class );
|
||||
powerSrc = new ChannelPowerSrc( networkNode, (IEnergyGrid) g.getCache( IEnergyGrid.class ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,6 +187,8 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
}
|
||||
|
||||
updatePowerStatus();
|
||||
|
||||
boolean oldCanAccessViewCells = canAccessViewCells;
|
||||
canAccessViewCells = hasAccess( SecurityPermissions.BUILD, false );
|
||||
if ( canAccessViewCells != oldCanAccessViewCells )
|
||||
@@ -201,11 +210,46 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
}
|
||||
|
||||
protected void updatePowerStatus()
|
||||
{
|
||||
boolean oldHasPower = hasPower;
|
||||
try
|
||||
{
|
||||
if ( networkNode != null )
|
||||
hasPower = networkNode.isActive();
|
||||
else if ( powerSrc instanceof IEnergyGrid )
|
||||
hasPower = ((IEnergyGrid) powerSrc).isNetworkPowered();
|
||||
else
|
||||
hasPower = powerSrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8;
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
if ( hasPower != oldHasPower )
|
||||
{
|
||||
for (Object c : this.crafters)
|
||||
{
|
||||
if ( c instanceof ICrafting )
|
||||
{
|
||||
ICrafting cr = (ICrafting) c;
|
||||
cr.sendProgressBarUpdate( this, 98, hasPower ? 1 : 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting c)
|
||||
{
|
||||
super.addCraftingToCrafters( c );
|
||||
queueInventory( c );
|
||||
}
|
||||
|
||||
public void queueInventory(ICrafting c)
|
||||
{
|
||||
if ( Platform.isServer() && c instanceof EntityPlayer && monitor != null )
|
||||
{
|
||||
try
|
||||
@@ -238,11 +282,27 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListUpdate()
|
||||
{
|
||||
for (Object c : this.crafters)
|
||||
{
|
||||
if ( c instanceof ICrafting )
|
||||
{
|
||||
ICrafting cr = (ICrafting) c;
|
||||
queueInventory( cr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int idx, int value)
|
||||
{
|
||||
super.updateProgressBar( idx, value );
|
||||
|
||||
if ( idx == 98 )
|
||||
hasPower = value == 1;
|
||||
|
||||
if ( idx == 99 )
|
||||
canAccessViewCells = value == 1;
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
@Override
|
||||
public void updateProgressBar(int key, int value)
|
||||
{
|
||||
super.updateProgressBar( key, value );
|
||||
|
||||
if ( key == 0 )
|
||||
security = value;
|
||||
}
|
||||
@@ -92,7 +94,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
verifyPermissions( SecurityPermissions.SECURITY, true );
|
||||
verifyPermissions( SecurityPermissions.SECURITY, false );
|
||||
|
||||
int newSecurity = 0;
|
||||
|
||||
@@ -105,6 +107,8 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
newSecurity = newSecurity | (1 << sp.ordinal());
|
||||
}
|
||||
|
||||
updatePowerStatus();
|
||||
|
||||
if ( newSecurity != security )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
@@ -138,14 +142,14 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
{
|
||||
ItemStack term = wirelessIn.getStack().copy();
|
||||
INetworkEncodable netEncodeable = null;
|
||||
|
||||
|
||||
if ( term.getItem() instanceof INetworkEncodable )
|
||||
netEncodeable = (INetworkEncodable) term.getItem();
|
||||
|
||||
|
||||
IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term );
|
||||
if ( wTermHandler != null )
|
||||
netEncodeable = wTermHandler;
|
||||
|
||||
|
||||
if ( netEncodeable != null )
|
||||
{
|
||||
netEncodeable.setEncryptionKey( term, "" + securityBox.securityKey, "" );
|
||||
|
||||
+7
-5
@@ -10,6 +10,7 @@ import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
@@ -121,9 +122,10 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList();
|
||||
oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage );
|
||||
enableEffects = get( "Client", "enableEffects", true ).getBoolean( true );
|
||||
useLargeFonts= get( "Client", "useTerminalUseLargeFont", true ).getBoolean( true );
|
||||
|
||||
useLargeFonts = get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
|
||||
|
||||
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||
settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL );
|
||||
settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
|
||||
|
||||
spawnChargedChance = (float) (1.0 - get( "worldGen", "spawnChargedChance", 1.0 - spawnChargedChance ).getDouble( 1.0 - spawnChargedChance ));
|
||||
@@ -176,11 +178,11 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
selectedPowerUnit = PowerUnits.AE;
|
||||
}
|
||||
|
||||
for (TickRates tr: TickRates.values() )
|
||||
for (TickRates tr : TickRates.values())
|
||||
{
|
||||
tr.Load(this);
|
||||
tr.Load( this );
|
||||
}
|
||||
|
||||
|
||||
if ( isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||
{
|
||||
storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID );
|
||||
|
||||
+20
-5
@@ -1,6 +1,7 @@
|
||||
package appeng.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import appeng.core.crash.CrashEnhancement;
|
||||
import appeng.core.crash.CrashInfo;
|
||||
@@ -14,12 +15,16 @@ import appeng.server.AECommand;
|
||||
import appeng.services.Profiler;
|
||||
import appeng.services.VersionChecker;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
@@ -82,6 +87,7 @@ public class AppEng
|
||||
// IntegrationSide.BOTH, "Forestry", "Forestry", "Forestry", // Forestry
|
||||
// IntegrationSide.BOTH, "Mekanism", "Mekanism", "Mekanism", // MeK
|
||||
IntegrationSide.CLIENT, "Waila", "Waila", "Waila", // Waila
|
||||
IntegrationSide.BOTH, "Rotatable Blocks", "RotatableBlocks", "RB", // RB
|
||||
IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks", "InvTweaks", // INV
|
||||
IntegrationSide.CLIENT, "Not Enough Items", "NotEnoughItems", "NEI", // NEI
|
||||
IntegrationSide.CLIENT, "Craft Guide", "craftguide", "CraftGuide", // CraftGuide
|
||||
@@ -108,6 +114,7 @@ public class AppEng
|
||||
@EventHandler
|
||||
void PreInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
configPath = event.getModConfigurationDirectory().getPath() + File.separator + "AppliedEnergistics2" + File.separator;
|
||||
|
||||
AEConfig.instance = new AEConfig( configPath );
|
||||
@@ -118,7 +125,8 @@ public class AppEng
|
||||
if ( Platform.isClient() )
|
||||
{
|
||||
CreativeTab.init();
|
||||
CreativeTabFacade.init();
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) )
|
||||
CreativeTabFacade.init();
|
||||
CommonHelper.proxy.init();
|
||||
}
|
||||
|
||||
@@ -136,23 +144,25 @@ public class AppEng
|
||||
startService( "AE2 VersionChecker", new Thread( VersionChecker.instance = new VersionChecker() ) );
|
||||
}
|
||||
|
||||
AELog.info( "PreInit ( end )" );
|
||||
AELog.info( "PreInit ( end " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
void Init(FMLInitializationEvent event)
|
||||
{
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
AELog.info( "Init" );
|
||||
|
||||
Registration.instance.Init( event );
|
||||
integrationModules.init();
|
||||
|
||||
AELog.info( "Init ( end )" );
|
||||
AELog.info( "Init ( end " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
void PostInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
AELog.info( "PostInit" );
|
||||
|
||||
Registration.instance.PostInit( event );
|
||||
@@ -163,7 +173,7 @@ public class AppEng
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler );
|
||||
NetworkHandler.instance = new NetworkHandler( "AE2" );
|
||||
|
||||
AELog.info( "PostInit ( end )" );
|
||||
AELog.info( "PostInit ( end " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -174,9 +184,14 @@ public class AppEng
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent evt)
|
||||
public void serverStarting(FMLServerAboutToStartEvent evt)
|
||||
{
|
||||
WorldSettings.getInstance().init();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent evt)
|
||||
{
|
||||
evt.registerServerCommand( new AECommand( evt.getServer() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CellRegistry implements ICellRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICellHandler getHander(ItemStack is)
|
||||
public ICellHandler getHandler(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return null;
|
||||
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
@@ -58,7 +60,7 @@ public class BasicCellHandler implements ICellHandler
|
||||
@Override
|
||||
public double cellIdleDrain(ItemStack is, IMEInventory handler)
|
||||
{
|
||||
CellInventory inv = ((CellInventoryHandler) handler).getCellInv();
|
||||
ICellInventory inv = ((ICellInventoryHandler) handler).getCellInv();
|
||||
return inv.getIdleDrain();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public enum ButtonToolTips
|
||||
|
||||
Blocking, NonBlocking, Craft, DontCraft,
|
||||
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks;
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small;
|
||||
|
||||
String root;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import appeng.core.sync.packets.PacketMultiPart;
|
||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||
import appeng.core.sync.packets.PacketPartPlacement;
|
||||
import appeng.core.sync.packets.PacketProgressBar;
|
||||
import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketTransitionEffect;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
@@ -61,7 +62,9 @@ public class AppEngPacketHandlerBase
|
||||
|
||||
PACKET_NEW_STORAGE_DIMENSION(PacketNewStorageDimension.class),
|
||||
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class);
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class),
|
||||
|
||||
PACKET_SWAP_SLOTS(PacketSwapSlots.class);
|
||||
|
||||
final public Class pc;
|
||||
final public Constructor con;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
public class PacketSwapSlots extends AppEngPacket
|
||||
{
|
||||
|
||||
int slotA, slotB;
|
||||
|
||||
// automatic.
|
||||
public PacketSwapSlots(ByteBuf stream) throws IOException {
|
||||
slotA = stream.readInt();
|
||||
slotB = stream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
if ( player != null && player.openContainer instanceof AEBaseContainer )
|
||||
{
|
||||
((AEBaseContainer) player.openContainer).swapSlotContents( slotA, slotB );
|
||||
}
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketSwapSlots(int slotA, int slotB) throws IOException {
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( getPacketID() );
|
||||
data.writeInt( this.slotA = slotA );
|
||||
data.writeInt( this.slotB = slotB );
|
||||
|
||||
configureWrite( data );
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,6 @@ public class LocationRotation implements IOrientable
|
||||
@Override
|
||||
public boolean canBeRotated()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package appeng.hooks;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,7 +45,6 @@ final public class MeteoriteWorldGen implements IWorldGenerator
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
future.get();
|
||||
|
||||
if ( obj.distance > AEConfig.instance.minMeteoriteDistanceSq )
|
||||
@@ -67,11 +65,7 @@ final public class MeteoriteWorldGen implements IWorldGenerator
|
||||
}
|
||||
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
catch (ExecutionException e)
|
||||
catch (Throwable e)
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.util.IOrientable;
|
||||
|
||||
public interface IRB
|
||||
{
|
||||
|
||||
IOrientable getOrientable(TileEntity te);
|
||||
|
||||
}
|
||||
@@ -35,7 +35,8 @@ public class BC extends BaseModule implements IBC
|
||||
@Override
|
||||
public void addFacade(ItemStack item)
|
||||
{
|
||||
FMLInterModComms.sendMessage( "BuildCraft|Transport", "add-facade", item );
|
||||
if ( item != null )
|
||||
FMLInterModComms.sendMessage( "BuildCraft|Transport", "add-facade", item );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,6 +187,15 @@ public class BC extends BaseModule implements IBC
|
||||
addFacade( b.blockQuartz.stack( 1 ) );
|
||||
addFacade( b.blockQuartzChiseled.stack( 1 ) );
|
||||
addFacade( b.blockQuartzPiller.stack( 1 ) );
|
||||
|
||||
Block skyStone = b.blockSkyStone.block();
|
||||
if ( skyStone != null )
|
||||
{
|
||||
addFacade( new ItemStack( skyStone, 1, 0 ) );
|
||||
addFacade( new ItemStack( skyStone, 1, 1 ) );
|
||||
addFacade( new ItemStack( skyStone, 1, 2 ) );
|
||||
addFacade( new ItemStack( skyStone, 1, 3 ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package appeng.integration.modules.dead;
|
||||
package appeng.integration.modules;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.modules.helpers.NEIQuartzShapedRecipeHandler;
|
||||
import appeng.integration.modules.helpers.NEIAEShapedRecipeHandler;
|
||||
import appeng.integration.modules.helpers.NEIAEShapelessRecipeHandler;
|
||||
|
||||
public class NEI implements IIntegrationModule
|
||||
{
|
||||
@@ -14,11 +15,15 @@ public class NEI implements IIntegrationModule
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
Class API = Class.forName( "codechicken.nei.api.API" );
|
||||
|
||||
Method registerRecipeHandler = API.getDeclaredMethod( "registerRecipeHandler", new Class[] { codechicken.nei.recipe.ICraftingHandler.class } );
|
||||
Method registerUsageHandler = API.getDeclaredMethod( "registerUsageHandler", new Class[] { codechicken.nei.recipe.IUsageHandler.class } );
|
||||
|
||||
registerRecipeHandler.invoke( API, new NEIQuartzShapedRecipeHandler() );
|
||||
registerUsageHandler.invoke( API, new NEIQuartzShapedRecipeHandler() );
|
||||
registerRecipeHandler.invoke( API, new NEIAEShapedRecipeHandler() );
|
||||
registerUsageHandler.invoke( API, new NEIAEShapedRecipeHandler() );
|
||||
|
||||
registerRecipeHandler.invoke( API, new NEIAEShapelessRecipeHandler() );
|
||||
registerUsageHandler.invoke( API, new NEIAEShapelessRecipeHandler() );
|
||||
|
||||
/*
|
||||
* Method registerGuiOverlay = API.getDeclaredMethod( "registerGuiOverlay", new Class[] { Class.class,
|
||||
@@ -0,0 +1,69 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import rblocks.api.IOrientable;
|
||||
import appeng.integration.BaseModule;
|
||||
import appeng.integration.abstraction.IRB;
|
||||
|
||||
public class RB extends BaseModule implements IRB
|
||||
{
|
||||
|
||||
private class RBWrapper implements appeng.api.util.IOrientable
|
||||
{
|
||||
|
||||
final private IOrientable internal;
|
||||
|
||||
public RBWrapper(IOrientable ww) {
|
||||
internal = ww;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeRotated()
|
||||
{
|
||||
return internal.canBeRotated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getForward()
|
||||
{
|
||||
return internal.getForward();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getUp()
|
||||
{
|
||||
return internal.getUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrientation(ForgeDirection Forward, ForgeDirection Up)
|
||||
{
|
||||
internal.setOrientation( Forward, Up );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public static RB instance;
|
||||
|
||||
@Override
|
||||
public void Init() throws Throwable
|
||||
{
|
||||
TestClass( IOrientable.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit() throws Throwable
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public appeng.api.util.IOrientable getOrientable(TileEntity te)
|
||||
{
|
||||
if ( te instanceof IOrientable )
|
||||
return new RBWrapper( (IOrientable) te );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+12
-12
@@ -1,4 +1,4 @@
|
||||
package appeng.integration.modules.helpers.dead;
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import appeng.recipes.AEShapedQuartzRecipe;
|
||||
import appeng.recipes.game.ShapedRecipe;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
@@ -21,7 +21,7 @@ import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
|
||||
{
|
||||
|
||||
public void loadTransferRects()
|
||||
@@ -43,14 +43,14 @@ public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object[] results)
|
||||
{
|
||||
if ( (outputId.equals( "crafting" )) && (getClass() == NEIQuartzShapedRecipeHandler.class) )
|
||||
if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapedRecipeHandler.class) )
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
if ( (irecipe instanceof ShapedRecipe) )
|
||||
recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
@@ -73,8 +73,8 @@ public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) )
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
if ( (irecipe instanceof ShapedRecipe) )
|
||||
recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
@@ -91,10 +91,10 @@ public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapedRecipe recipe = null;
|
||||
if ( (irecipe instanceof AEShapedQuartzRecipe) )
|
||||
recipe = new CachedShapedRecipe( (AEShapedQuartzRecipe) irecipe );
|
||||
if ( (irecipe instanceof ShapedRecipe) )
|
||||
recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe );
|
||||
|
||||
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.itemID )) )
|
||||
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.getItem() )) )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
if ( recipe.contains( recipe.ingredients, ingredient ) )
|
||||
@@ -163,7 +163,7 @@ public class NEIQuartzShapedRecipeHandler extends TemplateRecipeHandler
|
||||
public ArrayList<PositionedStack> ingredients;
|
||||
public PositionedStack result;
|
||||
|
||||
public CachedShapedRecipe(AEShapedQuartzRecipe irecipe) {
|
||||
public CachedShapedRecipe(ShapedRecipe irecipe) {
|
||||
result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 );
|
||||
ingredients = new ArrayList<PositionedStack>();
|
||||
setIngredients( irecipe.getWidth(), irecipe.getHeight(), irecipe.getIngredients() );
|
||||
@@ -0,0 +1,209 @@
|
||||
package appeng.integration.modules.helpers;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiCrafting;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import appeng.recipes.game.ShapelessRecipe;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.api.DefaultOverlayRenderer;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
|
||||
{
|
||||
|
||||
public void loadTransferRects()
|
||||
{
|
||||
this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting", new Object[0] ) );
|
||||
}
|
||||
|
||||
public Class<? extends GuiContainer> getGuiClass()
|
||||
{
|
||||
return GuiCrafting.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName()
|
||||
{
|
||||
return NEIClientUtils.translate( "recipe.shapeless", new Object[0] );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object[] results)
|
||||
{
|
||||
if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapelessRecipeHandler.class) )
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapelessRecipe recipe = null;
|
||||
if ( (irecipe instanceof ShapelessRecipe) )
|
||||
recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.loadCraftingRecipes( outputId, results );
|
||||
}
|
||||
}
|
||||
|
||||
public void loadCraftingRecipes(ItemStack result)
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) )
|
||||
{
|
||||
CachedShapelessRecipe recipe = null;
|
||||
if ( (irecipe instanceof ShapelessRecipe) )
|
||||
recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe );
|
||||
|
||||
if ( recipe != null )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadUsageRecipes(ItemStack ingredient)
|
||||
{
|
||||
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedShapelessRecipe recipe = null;
|
||||
if ( (irecipe instanceof ShapelessRecipe) )
|
||||
recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe );
|
||||
|
||||
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.getItem() )) )
|
||||
{
|
||||
recipe.computeVisuals();
|
||||
if ( recipe.contains( recipe.ingredients, ingredient ) )
|
||||
{
|
||||
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
|
||||
this.arecipes.add( recipe );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "textures/gui/container/crafting_table.png";
|
||||
}
|
||||
|
||||
public String getOverlayIdentifier()
|
||||
{
|
||||
return "crafting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlay(GuiContainer gui, Container container, int recipe)
|
||||
{
|
||||
return (super.hasOverlay( gui, container, recipe )) || ((isRecipe2x2( recipe )) && (RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" )));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe)
|
||||
{
|
||||
IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
|
||||
if ( renderer != null )
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
|
||||
if ( positioner == null )
|
||||
return null;
|
||||
return new DefaultOverlayRenderer( getIngredientStacks( recipe ), positioner );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe)
|
||||
{
|
||||
IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
|
||||
if ( handler != null )
|
||||
{
|
||||
return handler;
|
||||
}
|
||||
return RecipeInfo.getOverlayHandler( gui, "crafting2x2" );
|
||||
}
|
||||
|
||||
public boolean isRecipe2x2(int recipe)
|
||||
{
|
||||
for (PositionedStack stack : getIngredientStacks( recipe ))
|
||||
{
|
||||
if ( (stack.relx > 43) || (stack.rely > 24) )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public class CachedShapelessRecipe extends TemplateRecipeHandler.CachedRecipe
|
||||
{
|
||||
|
||||
public ArrayList<PositionedStack> ingredients;
|
||||
public PositionedStack result;
|
||||
|
||||
public CachedShapelessRecipe(ShapelessRecipe irecipe) {
|
||||
result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 );
|
||||
ingredients = new ArrayList<PositionedStack>();
|
||||
setIngredients( irecipe.getInput().toArray() );
|
||||
}
|
||||
|
||||
public void setIngredients(Object[] items)
|
||||
{
|
||||
for (int x = 0; x < 3; x++)
|
||||
{
|
||||
for (int y = 0; y < 3; y++)
|
||||
{
|
||||
if ( items.length > (y * 3 + x) )
|
||||
{
|
||||
PositionedStack stack = new PositionedStack( items[(y * 3 + x)], 25 + x * 18, 6 + y * 18, false );
|
||||
stack.setMaxSize( 1 );
|
||||
this.ingredients.add( stack );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients()
|
||||
{
|
||||
return getCycledIngredients( cycleticks / 20, this.ingredients );
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult()
|
||||
{
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void computeVisuals()
|
||||
{
|
||||
for (PositionedStack p : this.ingredients)
|
||||
{
|
||||
p.generatePermutations();
|
||||
}
|
||||
this.result.generatePermutations();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -89,12 +90,20 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
int progress = stack.getItemDamage() % 200;
|
||||
l.add( Math.floor( (float) progress / 2.0f ) + "%" );
|
||||
super.addInformation( stack, p, l, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDamaged(ItemStack stack)
|
||||
{
|
||||
if ( stack.getItemDamage() % 200 == 0 )
|
||||
return false;
|
||||
return true;
|
||||
// if ( stack.getItemDamage() % 200 == 0 )
|
||||
// return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,8 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -23,7 +25,6 @@ import appeng.items.AEBaseItem;
|
||||
import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.items.materials.MaterialType;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
@@ -68,11 +69,11 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
CellInventory cd = ((CellInventoryHandler) cdi).getCellInv();
|
||||
ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
|
||||
if ( cd != null )
|
||||
{
|
||||
l.add( cd.usedBytes() + " " + GuiText.Of.getLocal() + " " + cd.totalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
l.add( cd.storedItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
|
||||
l.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
l.add( cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
|
||||
/*
|
||||
* if ( cd.isPreformatted() ) { String List = StatCollector.translateToLocal( cd.getListMode() ==
|
||||
* ListMode.WHITELIST ? "AppEng.Gui.Whitelisted" : "AppEng.Gui.Blacklisted" ); if (
|
||||
|
||||
@@ -24,6 +24,8 @@ import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.networking.security.PlayerSource;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -40,7 +42,6 @@ import appeng.hooks.DispenserMatterCannon;
|
||||
import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -69,11 +70,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
CellInventory cd = ((CellInventoryHandler) cdi).getCellInv();
|
||||
ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
|
||||
if ( cd != null )
|
||||
{
|
||||
lines.add( cd.usedBytes() + " " + GuiText.Of.getLocal() + " " + cd.totalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
lines.add( cd.storedItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
|
||||
lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
lines.add( cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import appeng.api.implementations.guiobjects.IGuiItem;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -25,7 +27,6 @@ import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.items.contents.PortableCellViewer;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -54,11 +55,11 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
CellInventory cd = ((CellInventoryHandler) cdi).getCellInv();
|
||||
ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
|
||||
if ( cd != null )
|
||||
{
|
||||
lines.add( cd.usedBytes() + " " + GuiText.Of.getLocal() + " " + cd.totalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
lines.add( cd.storedItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
|
||||
lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
lines.add( cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.implementations.items.IAEWrench;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
|
||||
@@ -29,8 +30,10 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren
|
||||
Block b = world.getBlock( x, y, z );
|
||||
if ( b != null && !player.isSneaking() )
|
||||
{
|
||||
if ( b.rotateBlock( world, x, y, z, ForgeDirection.getOrientation( side ) ) )
|
||||
ForgeDirection mySide = ForgeDirection.getOrientation( side );
|
||||
if ( b.rotateBlock( world, x, y, z, mySide ) )
|
||||
{
|
||||
b.onNeighborBlockChange( world, x, y, z, Platform.air );
|
||||
player.swingItem();
|
||||
return !world.isRemote;
|
||||
}
|
||||
|
||||
Vendored
+6
-2
@@ -241,10 +241,14 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
double max = ps.getAEMaxPower();
|
||||
double current = ps.getAECurrentPower();
|
||||
|
||||
if ( current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE )
|
||||
if ( ps.getPowerFlow() != AccessRestriction.WRITE )
|
||||
{
|
||||
globalMaxPower += ps.getAEMaxPower();
|
||||
globalAvailablePower += ((IAEPowerStorage) machine).getAECurrentPower();
|
||||
}
|
||||
|
||||
if ( current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE )
|
||||
{
|
||||
globalAvailablePower += current;
|
||||
providers.add( ps );
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
@@ -27,6 +27,7 @@ import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.me.storage.ItemWatcher;
|
||||
import appeng.me.storage.NetworkInventoryHandler;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
|
||||
|
||||
Vendored
+15
@@ -1,11 +1,14 @@
|
||||
package appeng.me.cache;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import appeng.api.networking.events.MENetworkStorageEvent;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitorHandlerReceiver;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
@@ -23,6 +26,18 @@ public class NetworkMonitor<T extends IAEStack<T>> extends MEMonitorHandler<T>
|
||||
public void forceUpdate()
|
||||
{
|
||||
hasChanged = true;
|
||||
|
||||
Iterator<Entry<IMEMonitorHandlerReceiver<T>, Object>> i = getListeners();
|
||||
while (i.hasNext())
|
||||
{
|
||||
Entry<IMEMonitorHandlerReceiver<T>, Object> o = i.next();
|
||||
IMEMonitorHandlerReceiver<T> recv = o.getKey();
|
||||
|
||||
if ( recv.isValid( o.getValue() ) )
|
||||
recv.onListUpdate();
|
||||
else
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
|
||||
public NetworkMonitor(GridStorageCache cache, StorageChannel chan) {
|
||||
|
||||
Vendored
+1
-1
@@ -56,7 +56,7 @@ public class SecurityCache implements IGridCache, ISecurityGrid
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player, SecurityPermissions perm)
|
||||
{
|
||||
return hasPermission( WorldSettings.getInstance().getPlayerID( player.getCommandSenderName() ), perm );
|
||||
return hasPermission( player == null ? -1 : WorldSettings.getInstance().getPlayerID( player.getCommandSenderName() ), perm );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package appeng.me.helpers;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
|
||||
public class ChannelPowerSrc implements IEnergySource
|
||||
{
|
||||
|
||||
IGridNode node;
|
||||
IEnergySource realSrc;
|
||||
|
||||
public ChannelPowerSrc(IGridNode networkNode, IEnergySource src) {
|
||||
node = networkNode;
|
||||
realSrc = src;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier)
|
||||
{
|
||||
if ( node.isActive() )
|
||||
return realSrc.extractAEPower( amt, mode, usePowerMultiplier );
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.exceptions.AppEngException;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
@@ -23,7 +24,7 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
public class CellInventory implements ICellInventory
|
||||
{
|
||||
|
||||
static final String ITEM_TYPE_TAG = "it";
|
||||
@@ -58,7 +59,7 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
cellItems.resetStatus(); // clears totals and stuff.
|
||||
|
||||
int types = (int) storedItemTypes();
|
||||
int types = (int) getStoredItemTypes();
|
||||
|
||||
for (int x = 0; x < types; x++)
|
||||
{
|
||||
@@ -192,15 +193,17 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
return cellItems;
|
||||
}
|
||||
|
||||
public int BytesPerType()
|
||||
@Override
|
||||
public int getBytesPerType()
|
||||
{
|
||||
return CellType.BytePerType( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHoldNewItem()
|
||||
{
|
||||
long bytesFree = freeBytes();
|
||||
return (bytesFree > BytesPerType() || (bytesFree == BytesPerType() && unusedItemCount() > 0)) && remainingItemTypes() > 0;
|
||||
long bytesFree = getFreeBytes();
|
||||
return (bytesFree > getBytesPerType() || (bytesFree == getBytesPerType() && getUnusedItemCount() > 0)) && getRemainingItemTypes() > 0;
|
||||
}
|
||||
|
||||
public static IMEInventoryHandler getCell(ItemStack o)
|
||||
@@ -254,33 +257,39 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
return false;
|
||||
}
|
||||
|
||||
public long totalBytes()
|
||||
@Override
|
||||
public long getTotalBytes()
|
||||
{
|
||||
return CellType.getBytes( i );
|
||||
}
|
||||
|
||||
public long freeBytes()
|
||||
@Override
|
||||
public long getFreeBytes()
|
||||
{
|
||||
return totalBytes() - usedBytes();
|
||||
return getTotalBytes() - getUsedBytes();
|
||||
}
|
||||
|
||||
public long usedBytes()
|
||||
@Override
|
||||
public long getUsedBytes()
|
||||
{
|
||||
long bytesForItemCount = (storedItemCount() + unusedItemCount()) / 8;
|
||||
return storedItemTypes() * BytesPerType() + bytesForItemCount;
|
||||
long bytesForItemCount = (getStoredItemCount() + getUnusedItemCount()) / 8;
|
||||
return getStoredItemTypes() * getBytesPerType() + bytesForItemCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTotalItemTypes()
|
||||
{
|
||||
return MAX_ITEM_TYPES;
|
||||
}
|
||||
|
||||
public long storedItemTypes()
|
||||
@Override
|
||||
public long getStoredItemTypes()
|
||||
{
|
||||
return storedItems;
|
||||
}
|
||||
|
||||
public long storedItemCount()
|
||||
@Override
|
||||
public long getStoredItemCount()
|
||||
{
|
||||
return storedItemCount;
|
||||
}
|
||||
@@ -290,24 +299,25 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
tagCompound.setInteger( ITEM_COUNT_TAG, storedItemCount = (int) (storedItemCount + delta) );
|
||||
}
|
||||
|
||||
public long remainingItemTypes()
|
||||
@Override
|
||||
public long getRemainingItemTypes()
|
||||
{
|
||||
long basedOnStorage = freeBytes() / BytesPerType();
|
||||
long baseOnTotal = getTotalItemTypes() - storedItemTypes();
|
||||
long basedOnStorage = getFreeBytes() / getBytesPerType();
|
||||
long baseOnTotal = getTotalItemTypes() - getStoredItemTypes();
|
||||
return basedOnStorage > baseOnTotal ? baseOnTotal : basedOnStorage;
|
||||
}
|
||||
|
||||
public long remainingItemCount()
|
||||
@Override
|
||||
public long getRemainingItemCount()
|
||||
{
|
||||
long remaining = freeBytes() * 8 + unusedItemCount();
|
||||
long remaining = getFreeBytes() * 8 + getUnusedItemCount();
|
||||
return remaining > 0 ? remaining : 0;
|
||||
}
|
||||
|
||||
// returns the number of items that can be added without using an additional
|
||||
// byte!
|
||||
public int unusedItemCount()
|
||||
@Override
|
||||
public int getUnusedItemCount()
|
||||
{
|
||||
int div = (int) (storedItemCount() % 8);
|
||||
int div = (int) (getStoredItemCount() % 8);
|
||||
|
||||
if ( div == 0 )
|
||||
{
|
||||
@@ -359,7 +369,7 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
IAEItemStack l = getCellItems().findPrecise( input );
|
||||
if ( l != null )
|
||||
{
|
||||
long remainingItemSlots = remainingItemCount();
|
||||
long remainingItemSlots = getRemainingItemCount();
|
||||
if ( remainingItemSlots < 0 )
|
||||
return input;
|
||||
|
||||
@@ -389,7 +399,7 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
|
||||
if ( canHoldNewItem() ) // room for new type, and for at least one item!
|
||||
{
|
||||
int remainingItemCount = (int) remainingItemCount() - BytesPerType() * 8;
|
||||
int remainingItemCount = (int) getRemainingItemCount() - getBytesPerType() * 8;
|
||||
if ( remainingItemCount > 0 )
|
||||
{
|
||||
if ( input.getStackSize() > remainingItemCount )
|
||||
@@ -479,33 +489,44 @@ public class CellInventory implements IMEInventory<IAEItemStack>
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain()
|
||||
{
|
||||
return CellType.getIdleDrain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode()
|
||||
{
|
||||
return CellType.getFuzzyMode( this.i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory()
|
||||
{
|
||||
return CellType.getConfigInventory( this.i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory()
|
||||
{
|
||||
return CellType.getUpgradesInventory( this.i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatusForCell()
|
||||
{
|
||||
if ( canHoldNewItem() )
|
||||
return 1;
|
||||
if ( remainingItemCount() > 0 )
|
||||
if ( getRemainingItemCount() > 0 )
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
@@ -16,28 +18,29 @@ import appeng.util.item.AEItemStack;
|
||||
import appeng.util.prioitylist.FuzzyPriorityList;
|
||||
import appeng.util.prioitylist.PrecisePriorityList;
|
||||
|
||||
public class CellInventoryHandler extends MEInventoryHandler<IAEItemStack>
|
||||
public class CellInventoryHandler extends MEInventoryHandler<IAEItemStack> implements ICellInventoryHandler
|
||||
{
|
||||
|
||||
NBTTagCompound openNbtData()
|
||||
{
|
||||
return Platform.openNbtData( getCellInv().i );
|
||||
return Platform.openNbtData( getCellInv().getItemStack() );
|
||||
}
|
||||
|
||||
public CellInventory getCellInv()
|
||||
@Override
|
||||
public ICellInventory getCellInv()
|
||||
{
|
||||
Object o = this.internal;
|
||||
|
||||
if ( o instanceof MEPassthru )
|
||||
o = ((MEPassthru) o).getInternal();
|
||||
|
||||
return (CellInventory) (o instanceof CellInventory ? o : null);
|
||||
return (ICellInventory) (o instanceof ICellInventory ? o : null);
|
||||
}
|
||||
|
||||
CellInventoryHandler(IMEInventory c) {
|
||||
super( c, IAEItemStack.class );
|
||||
|
||||
CellInventory ci = getCellInv();
|
||||
ICellInventory ci = getCellInv();
|
||||
if ( ci != null )
|
||||
{
|
||||
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
public BaseActionSource changeSource;
|
||||
|
||||
public MEMonitorPassthu(IMEInventory<T> i, Class<? extends IAEStack> cla) {
|
||||
super( i,cla );
|
||||
super( i, cla );
|
||||
if ( i instanceof IMEMonitor )
|
||||
monitor = (IMEMonitor<T>) i;
|
||||
}
|
||||
@@ -34,13 +34,13 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
monitor.removeListener( this );
|
||||
|
||||
monitor = null;
|
||||
IItemList<T> before = getInternal() == null ? new ItemList(clz) : getInternal().getAvailableItems( new ItemList(clz) );
|
||||
IItemList<T> before = getInternal() == null ? new ItemList( clz ) : getInternal().getAvailableItems( new ItemList( clz ) );
|
||||
|
||||
super.setInternal( i );
|
||||
if ( i instanceof IMEMonitor )
|
||||
monitor = (IMEMonitor<T>) i;
|
||||
|
||||
IItemList<T> after = getInternal() == null ? new ItemList(clz) : getInternal().getAvailableItems( new ItemList(clz) );
|
||||
IItemList<T> after = getInternal() == null ? new ItemList( clz ) : getInternal().getAvailableItems( new ItemList( clz ) );
|
||||
|
||||
if ( monitor != null )
|
||||
monitor.addListener( this, monitor );
|
||||
@@ -64,7 +64,7 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
public IItemList<T> getStorageList()
|
||||
{
|
||||
if ( monitor == null )
|
||||
return getInternal().getAvailableItems( new ItemList<T>(clz) );
|
||||
return getInternal().getAvailableItems( new ItemList<T>( clz ) );
|
||||
return monitor.getStorageList();
|
||||
}
|
||||
|
||||
@@ -88,4 +88,19 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListUpdate()
|
||||
{
|
||||
Iterator<Entry<IMEMonitorHandlerReceiver<T>, Object>> i = listeners.entrySet().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
Entry<IMEMonitorHandlerReceiver<T>, Object> e = i.next();
|
||||
IMEMonitorHandlerReceiver<T> recv = e.getKey();
|
||||
if ( recv.isValid( e.getValue() ) )
|
||||
recv.onListUpdate();
|
||||
else
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,7 +782,8 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
||||
return light;
|
||||
}
|
||||
|
||||
public boolean recolourBlock(ForgeDirection side, int colour)
|
||||
@Override
|
||||
public boolean recolourBlock(ForgeDirection side, int colour, EntityPlayer who)
|
||||
{
|
||||
IPart cable = getPart( ForgeDirection.UNKNOWN );
|
||||
if ( cable != null )
|
||||
@@ -791,7 +792,7 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
||||
|
||||
AEColor colors[] = AEColor.values();
|
||||
if ( colors.length > colour )
|
||||
return pc.changeColor( colors[colour] );
|
||||
return pc.changeColor( colors[colour], who );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface ICableBusContainer
|
||||
|
||||
SelectedPart selectPart(Vec3 v3);
|
||||
|
||||
boolean recolourBlock(ForgeDirection side, int colour);
|
||||
boolean recolourBlock(ForgeDirection side, int colour, EntityPlayer who);
|
||||
|
||||
boolean isLadder(EntityLivingBase entity);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class NullCableBusContainer implements ICableBusContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock(ForgeDirection side, int colour)
|
||||
public boolean recolourBlock(ForgeDirection side, int colour, EntityPlayer who)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,9 +58,9 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(),
|
||||
CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(),
|
||||
CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
|
||||
CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(),
|
||||
CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
rh.setBounds( 1, 1, 15, 15, 15, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -98,9 +98,9 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
|
||||
|
||||
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(),
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
|
||||
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : is.getIconIndex(),
|
||||
CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
rh.setBounds( minX, minY, 15, maxX, maxY, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
@@ -62,8 +62,8 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 4, 4, 12, 12, 12, 14 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -80,8 +80,8 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable
|
||||
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 4, 4, 12, 12, 12, 14 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
@@ -238,6 +238,6 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable
|
||||
@Override
|
||||
public TickingRequest getTickingRequest(IGridNode node)
|
||||
{
|
||||
return new TickingRequest( TickRates.ExportBus.min,TickRates.ExportBus.max, isSleeping(), false );
|
||||
return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, isSleeping(), false );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,9 +124,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(),
|
||||
CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(),
|
||||
CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
|
||||
CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(),
|
||||
CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
rh.setBounds( 1, 1, 15, 15, 15, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -164,9 +164,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
|
||||
|
||||
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(),
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
|
||||
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : is.getIconIndex(),
|
||||
CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
rh.setBounds( minX, minY, 15, maxX, maxY, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
@@ -82,8 +82,8 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -100,8 +100,8 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I
|
||||
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 4, 4, 14, 12, 12, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
@@ -576,4 +576,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
return super.getInventoryByName( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
updateReportingValue( proxy.getStorage().getItemInventory() );
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
// ;P
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ public class PartCableAnchor implements IPart
|
||||
@Override
|
||||
public boolean isLadder(EntityLivingBase entity)
|
||||
{
|
||||
return mySide.offsetY == 0;
|
||||
return mySide.offsetY == 0 && entity.isCollidedHorizontally;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -279,8 +279,8 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -297,8 +297,8 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
|
||||
{
|
||||
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
@@ -306,8 +306,8 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 15 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 12, 11, 11, 13 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
@@ -411,4 +411,10 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return type == PipeType.ITEM && with == side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListUpdate()
|
||||
{
|
||||
// not used here.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -15,6 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.implementations.parts.IPartCable;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
@@ -879,13 +881,41 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean changeColor(AEColor newColor)
|
||||
public boolean changeColor(AEColor newColor, EntityPlayer who)
|
||||
{
|
||||
if ( getCableColor() != newColor )
|
||||
{
|
||||
is.setItemDamage( newColor.ordinal() );
|
||||
markForUpdate();
|
||||
return true;
|
||||
ItemStack newPart = null;
|
||||
|
||||
if ( getCableConnectionType() == AECableType.GLASS )
|
||||
newPart = AEApi.instance().parts().partCableGlass.stack( newColor, 1 );
|
||||
else if ( getCableConnectionType() == AECableType.COVERED )
|
||||
newPart = AEApi.instance().parts().partCableCovered.stack( newColor, 1 );
|
||||
else if ( getCableConnectionType() == AECableType.SMART )
|
||||
newPart = AEApi.instance().parts().partCableSmart.stack( newColor, 1 );
|
||||
else if ( getCableConnectionType() == AECableType.DENSE )
|
||||
newPart = AEApi.instance().parts().partCableDense.stack( newColor, 1 );
|
||||
|
||||
boolean hasPermission = true;
|
||||
|
||||
try
|
||||
{
|
||||
hasPermission = proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD );
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
if ( newPart != null && hasPermission )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
return true;
|
||||
|
||||
getHost().removePart( ForgeDirection.UNKNOWN, false );
|
||||
getHost().addPart( newPart, ForgeDirection.UNKNOWN, who );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -275,8 +275,8 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -297,8 +297,8 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
|
||||
is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
@@ -14,7 +14,6 @@ import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
@@ -79,15 +78,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
|
||||
if ( Platform.isClient() )
|
||||
return true;
|
||||
|
||||
if ( proxy.isActive() )
|
||||
Platform.openGUI( player, getHost().getTile(), side, getGui() );
|
||||
else
|
||||
{
|
||||
if ( proxy.isPowered() )
|
||||
player.addChatMessage( PlayerMessages.CommunicationError.get() );
|
||||
else
|
||||
player.addChatMessage( PlayerMessages.MachineNotPowered.get() );
|
||||
}
|
||||
Platform.openGUI( player, getHost().getTile(), side, getGui() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,8 @@ public class AEItemResolver implements ISubItemResolver
|
||||
String materialName = itemName.substring( itemName.indexOf( "." ) + 1 );
|
||||
MaterialType mt = MaterialType.valueOf( materialName );
|
||||
itemName = itemName.substring( 0, itemName.indexOf( "." ) );
|
||||
return new ResolverResult( itemName, mt.damageValue );
|
||||
if ( mt.damageValue >= 0 )
|
||||
return new ResolverResult( itemName, mt.damageValue );
|
||||
}
|
||||
|
||||
if ( itemName.startsWith( "ItemPart." ) )
|
||||
@@ -87,7 +88,9 @@ public class AEItemResolver implements ISubItemResolver
|
||||
String partName = itemName.substring( itemName.indexOf( "." ) + 1 );
|
||||
PartType pt = PartType.valueOf( partName );
|
||||
itemName = itemName.substring( 0, itemName.indexOf( "." ) );
|
||||
return new ResolverResult( itemName, ItemPart.instance.getDamageByType( pt ) );
|
||||
int dVal = ItemPart.instance.getDamageByType( pt );
|
||||
if ( dVal >= 0 )
|
||||
return new ResolverResult( itemName, dVal );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -254,4 +254,20 @@ public class ShapedRecipe implements IRecipe
|
||||
{
|
||||
return this.input;
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return height;
|
||||
}
|
||||
|
||||
public Object[] getIngredients()
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -140,4 +140,5 @@ public class ShapelessRecipe implements IRecipe
|
||||
{
|
||||
return this.input;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable
|
||||
{
|
||||
|
||||
public TileInscriberHandler() {
|
||||
super( TileEventType.TICK, TileEventType.WORLD_NBT, TileEventType.NETWORK );
|
||||
super( TileEventType.WORLD_NBT, TileEventType.NETWORK );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,12 +123,6 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Tick()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -238,13 +232,22 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable
|
||||
{
|
||||
ItemStack PlateA = getStackInSlot( 0 );
|
||||
ItemStack PlateB = getStackInSlot( 1 );
|
||||
ItemStack renamedItem = getStackInSlot( 2 );
|
||||
|
||||
if ( PlateA != null && PlateA.stackSize > 1 )
|
||||
return null;
|
||||
|
||||
if ( PlateB != null && PlateB.stackSize > 1 )
|
||||
return null;
|
||||
|
||||
if ( renamedItem != null && renamedItem.stackSize > 1 )
|
||||
return null;
|
||||
|
||||
boolean isNameA = AEApi.instance().materials().materialNamePress.sameAs( PlateA );
|
||||
boolean isNameB = AEApi.instance().materials().materialNamePress.sameAs( PlateB );
|
||||
|
||||
if ( (isNameA || isNameB) && (isNameA || PlateA == null) && (isNameB || PlateB == null) )
|
||||
{
|
||||
ItemStack renamedItem = getStackInSlot( 2 );
|
||||
if ( renamedItem != null )
|
||||
{
|
||||
String name = "";
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.EnumSet;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
import appeng.api.implementations.tiles.IWirelessAccessPoint;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -23,8 +24,9 @@ import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.grid.AENetworkInvTile;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoint
|
||||
public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoint, IPowerChannelState
|
||||
{
|
||||
|
||||
public static final int POWERED_FLAG = 1;
|
||||
@@ -148,23 +150,29 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
|
||||
{
|
||||
return AEConfig.instance.wireless_getMaxRange( getBoosters() );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
return isPowered() && (CHANNEL_FLAG == (clientFlags & CHANNEL_FLAG));
|
||||
|
||||
return gridProxy.isActive();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IGrid getGrid()
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
return gridProxy.getGrid();
|
||||
} catch (GridAccessException e) {
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int getBoosters()
|
||||
{
|
||||
ItemStack boosters = inv.getStackInSlot( 0 );
|
||||
@@ -177,4 +185,10 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
|
||||
// :P
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPowered()
|
||||
{
|
||||
return POWERED_FLAG == (clientFlags & POWERED_FLAG);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -319,6 +319,12 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListUpdate()
|
||||
{
|
||||
// not used here
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class ChestMonitorHandler<T extends IAEStack> extends MEMonitorHandler<T>
|
||||
@@ -363,7 +369,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
if ( is != null )
|
||||
{
|
||||
isCached = true;
|
||||
cellHandler = AEApi.instance().registries().cell().getHander( is );
|
||||
cellHandler = AEApi.instance().registries().cell().getHandler( is );
|
||||
if ( cellHandler != null )
|
||||
{
|
||||
double power = 1.0;
|
||||
@@ -553,7 +559,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return (state >> (slot * 3)) & 3;
|
||||
|
||||
ItemStack cell = inv.getStackInSlot( 1 );
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHander( cell );
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
|
||||
if ( ch != null )
|
||||
{
|
||||
|
||||
@@ -214,7 +214,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
|
||||
if ( is != null )
|
||||
{
|
||||
handlersBySlot[x] = AEApi.instance().registries().cell().getHander( is );
|
||||
handlersBySlot[x] = AEApi.instance().registries().cell().getHandler( is );
|
||||
|
||||
if ( handlersBySlot[x] != null )
|
||||
{
|
||||
|
||||
@@ -240,7 +240,7 @@ public class AdaptorIInventory extends InventoryAdaptor
|
||||
}
|
||||
else if ( is != null )
|
||||
{
|
||||
if ( Platform.isSameItem( is, left ) )
|
||||
if ( Platform.isSameItemPrecise( is, left ) )
|
||||
{
|
||||
if ( is.stackSize < stack_limit )
|
||||
{
|
||||
@@ -303,7 +303,7 @@ public class AdaptorIInventory extends InventoryAdaptor
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Platform.isSameItem( is, left ) )
|
||||
if ( Platform.isSameItemPrecise( is, left ) )
|
||||
{
|
||||
if ( is.stackSize < stack_limit )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user