Added 4 View Cell Slots.
Multiple View Cells now sum together to allow more customization. View Cells are now protected by Build Security. Meteorite Compass now renders correctly in other peoples hands.
This commit is contained in:
parent
4536189042
commit
929efa5597
30 changed files with 228 additions and 102 deletions
|
@ -64,7 +64,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||||
GuiImgButton searchBoxSettings;
|
GuiImgButton searchBoxSettings;
|
||||||
boolean viewCell;
|
boolean viewCell;
|
||||||
|
|
||||||
ItemStack currentViewCell;
|
ItemStack myCurrentViewCells[] = new ItemStack[5];
|
||||||
ContainerMEMonitorable mecontainer;
|
ContainerMEMonitorable mecontainer;
|
||||||
|
|
||||||
public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
||||||
|
@ -277,11 +277,19 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||||
|
|
||||||
if ( viewCell )
|
if ( viewCell )
|
||||||
{
|
{
|
||||||
if ( currentViewCell != mecontainer.cellView.getStack() )
|
boolean update = false;
|
||||||
|
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
currentViewCell = mecontainer.cellView.getStack();
|
if ( myCurrentViewCells[i] != mecontainer.cellView[i].getStack() )
|
||||||
repo.setViewCell( currentViewCell );
|
{
|
||||||
|
update = true;
|
||||||
|
myCurrentViewCells[i] = mecontainer.cellView[i].getStack();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( update )
|
||||||
|
repo.setViewCell( myCurrentViewCells );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( searchField != null )
|
if ( searchField != null )
|
||||||
|
|
|
@ -24,6 +24,7 @@ import appeng.util.Platform;
|
||||||
import appeng.util.item.AEItemStack;
|
import appeng.util.item.AEItemStack;
|
||||||
import appeng.util.prioitylist.FuzzyPriorityList;
|
import appeng.util.prioitylist.FuzzyPriorityList;
|
||||||
import appeng.util.prioitylist.IPartitionList;
|
import appeng.util.prioitylist.IPartitionList;
|
||||||
|
import appeng.util.prioitylist.MergedPriorityList;
|
||||||
import appeng.util.prioitylist.PrecisePriorityList;
|
import appeng.util.prioitylist.PrecisePriorityList;
|
||||||
|
|
||||||
public class ItemRepo
|
public class ItemRepo
|
||||||
|
@ -80,65 +81,73 @@ public class ItemRepo
|
||||||
list.add( is );
|
list.add( is );
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasInverter = false;
|
|
||||||
boolean hasFuzzy = false;
|
|
||||||
IPartitionList<IAEItemStack> myPartitionList;
|
IPartitionList<IAEItemStack> myPartitionList;
|
||||||
|
|
||||||
public void setViewCell(ItemStack currentViewCell)
|
public void setViewCell(ItemStack[] list)
|
||||||
{
|
{
|
||||||
if ( currentViewCell == null || !(currentViewCell.getItem() instanceof ItemViewCell) )
|
myPartitionList = null;
|
||||||
myPartitionList = null;
|
MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
|
||||||
else
|
|
||||||
|
for (ItemStack currentViewCell : list)
|
||||||
{
|
{
|
||||||
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
if ( currentViewCell == null )
|
||||||
|
continue;
|
||||||
|
|
||||||
ItemViewCell vc = (ItemViewCell) currentViewCell.getItem();
|
if ( (currentViewCell.getItem() instanceof ItemViewCell) )
|
||||||
IInventory upgrades = vc.getUpgradesInventory( currentViewCell );
|
|
||||||
IInventory config = vc.getConfigInventory( currentViewCell );
|
|
||||||
FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell );
|
|
||||||
|
|
||||||
hasInverter = false;
|
|
||||||
hasFuzzy = false;
|
|
||||||
|
|
||||||
for (int x = 0; x < upgrades.getSizeInventory(); x++)
|
|
||||||
{
|
{
|
||||||
ItemStack is = upgrades.getStackInSlot( x );
|
boolean hasInverter = false;
|
||||||
if ( is != null && is.getItem() instanceof IUpgradeModule )
|
boolean hasFuzzy = false;
|
||||||
|
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||||
|
|
||||||
|
ItemViewCell vc = (ItemViewCell) currentViewCell.getItem();
|
||||||
|
IInventory upgrades = vc.getUpgradesInventory( currentViewCell );
|
||||||
|
IInventory config = vc.getConfigInventory( currentViewCell );
|
||||||
|
FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell );
|
||||||
|
|
||||||
|
hasInverter = false;
|
||||||
|
hasFuzzy = false;
|
||||||
|
|
||||||
|
for (int x = 0; x < upgrades.getSizeInventory(); x++)
|
||||||
{
|
{
|
||||||
Upgrades u = ((IUpgradeModule) is.getItem()).getType( is );
|
ItemStack is = upgrades.getStackInSlot( x );
|
||||||
if ( u != null )
|
if ( is != null && is.getItem() instanceof IUpgradeModule )
|
||||||
{
|
{
|
||||||
switch (u)
|
Upgrades u = ((IUpgradeModule) is.getItem()).getType( is );
|
||||||
|
if ( u != null )
|
||||||
{
|
{
|
||||||
case FUZZY:
|
switch (u)
|
||||||
hasFuzzy = true;
|
{
|
||||||
break;
|
case FUZZY:
|
||||||
case INVERTER:
|
hasFuzzy = true;
|
||||||
hasInverter = true;
|
break;
|
||||||
break;
|
case INVERTER:
|
||||||
default:
|
hasInverter = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (int x = 0; x < config.getSizeInventory(); x++)
|
for (int x = 0; x < config.getSizeInventory(); x++)
|
||||||
{
|
{
|
||||||
ItemStack is = config.getStackInSlot( x );
|
ItemStack is = config.getStackInSlot( x );
|
||||||
if ( is != null )
|
if ( is != null )
|
||||||
priorityList.add( AEItemStack.create( is ) );
|
priorityList.add( AEItemStack.create( is ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// myWhitelist = hasInverter ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST;
|
if ( !priorityList.isEmpty() )
|
||||||
|
{
|
||||||
|
if ( hasFuzzy )
|
||||||
|
myMergedList.addNewList( new FuzzyPriorityList<IAEItemStack>( priorityList, fzMode ), !hasInverter );
|
||||||
|
else
|
||||||
|
myMergedList.addNewList( new PrecisePriorityList<IAEItemStack>( priorityList ), !hasInverter );
|
||||||
|
|
||||||
if ( !priorityList.isEmpty() )
|
myPartitionList = myMergedList;
|
||||||
{
|
}
|
||||||
if ( hasFuzzy )
|
|
||||||
myPartitionList = new FuzzyPriorityList<IAEItemStack>( priorityList, fzMode );
|
|
||||||
else
|
|
||||||
myPartitionList = new PrecisePriorityList<IAEItemStack>( priorityList );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +184,7 @@ public class ItemRepo
|
||||||
{
|
{
|
||||||
if ( myPartitionList != null )
|
if ( myPartitionList != null )
|
||||||
{
|
{
|
||||||
if ( hasInverter == myPartitionList.isListed( is ) )
|
if ( !myPartitionList.isListed( is ) )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -357,7 +357,7 @@ public class BaseBlockRender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] data)
|
||||||
{
|
{
|
||||||
Tessellator tess = Tessellator.instance;
|
Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class ItemRenderer implements IItemRenderer
|
||||||
if ( type == ItemRenderType.INVENTORY )
|
if ( type == ItemRenderType.INVENTORY )
|
||||||
GL11.glTranslatef( 0.0f, -0.1f, 0.0f );
|
GL11.glTranslatef( 0.0f, -0.1f, 0.0f );
|
||||||
|
|
||||||
WorldRender.instance.renderItemBlock( item, type );
|
WorldRender.instance.renderItemBlock( item, type, data );
|
||||||
|
|
||||||
GL11.glPopAttrib();
|
GL11.glPopAttrib();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler
|
||||||
return renderID;
|
return renderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderItemBlock(ItemStack item, ItemRenderType type)
|
public void renderItemBlock(ItemStack item, ItemRenderType type, Object[] data)
|
||||||
{
|
{
|
||||||
Block blk = Block.getBlockFromItem( item.getItem() );
|
Block blk = Block.getBlockFromItem( item.getItem() );
|
||||||
if ( blk instanceof AEBaseBlock )
|
if ( blk instanceof AEBaseBlock )
|
||||||
|
@ -67,7 +67,7 @@ public class WorldRender implements ISimpleBlockRenderingHandler
|
||||||
renderer.setRenderBoundsFromBlock( block );
|
renderer.setRenderBoundsFromBlock( block );
|
||||||
|
|
||||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||||
getRender( block ).renderInventory( block, item, renderer, type );
|
getRender( block ).renderInventory( block, item, renderer, type, data );
|
||||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
Tessellator tess = Tessellator.instance;
|
Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
|
|
|
@ -25,15 +25,15 @@ public class RenderBlockCrank extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.renderAllFaces = true;
|
renderer.renderAllFaces = true;
|
||||||
|
|
||||||
renderer.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.3, 0.5D + 0.05 );
|
renderer.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.3, 0.5D + 0.05 );
|
||||||
super.renderInventory( blk, is, renderer, type );
|
super.renderInventory( blk, is, renderer, type, obj );
|
||||||
|
|
||||||
renderer.setRenderBounds( 0.70D - 0.15, 0.75D - 0.05, 0.5D - 0.05, 0.70D + 0.28, 0.75D + 0.05, 0.5D + 0.05 );
|
renderer.setRenderBounds( 0.70D - 0.15, 0.75D - 0.05, 0.5D - 0.05, 0.70D + 0.28, 0.75D + 0.05, 0.5D + 0.05 );
|
||||||
super.renderInventory( blk, is, renderer, type );
|
super.renderInventory( blk, is, renderer, type, obj );
|
||||||
|
|
||||||
renderer.renderAllFaces = false;
|
renderer.renderAllFaces = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class RenderBlockEnergyCube extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
IAEItemPowerStorage myItem = (IAEItemPowerStorage) is.getItem();
|
IAEItemPowerStorage myItem = (IAEItemPowerStorage) is.getItem();
|
||||||
double internalCurrentPower = myItem.getAECurrentPower( is );
|
double internalCurrentPower = myItem.getAECurrentPower( is );
|
||||||
|
@ -30,7 +30,7 @@ public class RenderBlockEnergyCube extends BaseBlockRender
|
||||||
meta = 0;
|
meta = 0;
|
||||||
|
|
||||||
renderer.setOverrideBlockTexture( blk.getIcon( 0, meta ) );
|
renderer.setOverrideBlockTexture( blk.getIcon( 0, meta ) );
|
||||||
super.renderInventory( blk, is, renderer, type );
|
super.renderInventory( blk, is, renderer, type, obj );
|
||||||
renderer.setOverrideBlockTexture( null );
|
renderer.setOverrideBlockTexture( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class RenderBlockSkyChest extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
@ -62,10 +62,16 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY )
|
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY || type == ItemRenderType.EQUIPPED )
|
||||||
{
|
{
|
||||||
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
|
||||||
|
|
||||||
|
if ( type == ItemRenderType.EQUIPPED )
|
||||||
|
{
|
||||||
|
p = (EntityPlayer) obj[1];
|
||||||
|
p.rotationYaw = p.renderYawOffset;
|
||||||
|
}
|
||||||
|
|
||||||
int x = (int) p.posX;
|
int x = (int) p.posX;
|
||||||
int y = (int) p.posY;
|
int y = (int) p.posY;
|
||||||
int z = (int) p.posZ;
|
int z = (int) p.posZ;
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
this.blk = blk;
|
this.blk = blk;
|
||||||
cenx = 0;
|
cenx = 0;
|
||||||
|
|
|
@ -23,13 +23,13 @@ public class RenderDrive extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.overrideBlockTexture = ExtraTextures.getMissing();
|
renderer.overrideBlockTexture = ExtraTextures.getMissing();
|
||||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||||
|
|
||||||
renderer.overrideBlockTexture = null;
|
renderer.overrideBlockTexture = null;
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class RenderMEChest extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.overrideBlockTexture = ExtraTextures.getMissing();
|
renderer.overrideBlockTexture = ExtraTextures.getMissing();
|
||||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||||
|
@ -36,7 +36,7 @@ public class RenderMEChest extends BaseBlockRender
|
||||||
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, 0xffffff, renderer );
|
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, 0xffffff, renderer );
|
||||||
|
|
||||||
renderer.overrideBlockTexture = null;
|
renderer.overrideBlockTexture = null;
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class RenderNull extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,13 +72,13 @@ public class RenderQNB extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
float px = 2.0f / 16.0f;
|
float px = 2.0f / 16.0f;
|
||||||
float maxpx = 14.0f / 16.0f;
|
float maxpx = 14.0f / 16.0f;
|
||||||
renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx );
|
renderer.setRenderBounds( px, px, px, maxpx, maxpx, maxpx );
|
||||||
|
|
||||||
super.renderInventory( block, item, renderer, type );
|
super.renderInventory( block, item, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -114,12 +114,12 @@ public class RenderQuartzGlass extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.overrideBlockTexture = ExtraTextures.GlassFrame.getIcon();
|
renderer.overrideBlockTexture = ExtraTextures.GlassFrame.getIcon();
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
renderer.overrideBlockTexture = null;
|
renderer.overrideBlockTexture = null;
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,11 +17,11 @@ public class RenderQuartzOre extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
super.renderInventory( blk, is, renderer, type );
|
super.renderInventory( blk, is, renderer, type, obj );
|
||||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraTextures.OreQuartzStone.getIcon() );
|
blk.getRendererInstance().setTemporaryRenderIcon( ExtraTextures.OreQuartzStone.getIcon() );
|
||||||
super.renderInventory( blk, is, renderer, type );
|
super.renderInventory( blk, is, renderer, type, obj );
|
||||||
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class RenderQuartzTorch extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
Tessellator tess = Tessellator.instance;
|
Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,12 @@ public class RenderSpatialPylon extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.overrideBlockTexture = ExtraTextures.BlockSpatialPylon_dim.getIcon();
|
renderer.overrideBlockTexture = ExtraTextures.BlockSpatialPylon_dim.getIcon();
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
renderer.overrideBlockTexture = null;
|
renderer.overrideBlockTexture = null;
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,10 +15,10 @@ public class RenderTinyTNT extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class RendererCableBus extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
// nothin.
|
// nothin.
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class RendererSecurity extends BaseBlockRender
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type)
|
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||||
{
|
{
|
||||||
renderer.overrideBlockTexture = ExtraTextures.getMissing();
|
renderer.overrideBlockTexture = ExtraTextures.getMissing();
|
||||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||||
|
@ -31,7 +31,7 @@ public class RendererSecurity extends BaseBlockRender
|
||||||
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, 0xffffff, renderer );
|
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, 0xffffff, renderer );
|
||||||
|
|
||||||
renderer.overrideBlockTexture = null;
|
renderer.overrideBlockTexture = null;
|
||||||
super.renderInventory( block, is, renderer, type );
|
super.renderInventory( block, is, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -70,6 +70,11 @@ public abstract class AEBaseContainer extends Container
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ticksSinceCheck = 0;
|
ticksSinceCheck = 0;
|
||||||
|
isContainerValid = isContainerValid && hasAccess( security, requirePower );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean hasAccess(SecurityPermissions perm, boolean requirePower)
|
||||||
|
{
|
||||||
IActionHost host = null;
|
IActionHost host = null;
|
||||||
|
|
||||||
if ( tileEntity instanceof IActionHost )
|
if ( tileEntity instanceof IActionHost )
|
||||||
|
@ -77,11 +82,7 @@ public abstract class AEBaseContainer extends Container
|
||||||
if ( part instanceof IActionHost )
|
if ( part instanceof IActionHost )
|
||||||
host = (IActionHost) part;
|
host = (IActionHost) part;
|
||||||
|
|
||||||
if ( host == null )
|
if ( host != null )
|
||||||
{
|
|
||||||
isContainerValid = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
IGridNode gn = host.getActionableNode();
|
IGridNode gn = host.getActionableNode();
|
||||||
if ( gn != null )
|
if ( gn != null )
|
||||||
|
@ -93,18 +94,17 @@ public abstract class AEBaseContainer extends Container
|
||||||
{
|
{
|
||||||
IEnergyGrid eg = g.getCache( IEnergyGrid.class );
|
IEnergyGrid eg = g.getCache( IEnergyGrid.class );
|
||||||
if ( !eg.isNetworkPowered() )
|
if ( !eg.isNetworkPowered() )
|
||||||
{
|
return false;
|
||||||
isContainerValid = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ISecurityGrid sg = g.getCache( ISecurityGrid.class );
|
ISecurityGrid sg = g.getCache( ISecurityGrid.class );
|
||||||
if ( !sg.hasPermission( invPlayer.player, security ) )
|
if ( sg.hasPermission( invPlayer.player, perm ) )
|
||||||
isContainerValid = false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContainerOpenContext openContext;
|
public ContainerOpenContext openContext;
|
||||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
|
import appeng.api.config.SecurityPermissions;
|
||||||
import appeng.api.config.Settings;
|
import appeng.api.config.Settings;
|
||||||
import appeng.api.config.SortDir;
|
import appeng.api.config.SortDir;
|
||||||
import appeng.api.config.SortOrder;
|
import appeng.api.config.SortOrder;
|
||||||
|
@ -31,7 +32,6 @@ import appeng.api.storage.data.IItemList;
|
||||||
import appeng.api.util.IConfigManager;
|
import appeng.api.util.IConfigManager;
|
||||||
import appeng.api.util.IConfigureableObject;
|
import appeng.api.util.IConfigureableObject;
|
||||||
import appeng.container.AEBaseContainer;
|
import appeng.container.AEBaseContainer;
|
||||||
import appeng.container.slot.AppEngSlot;
|
|
||||||
import appeng.container.slot.SlotRestrictedInput;
|
import appeng.container.slot.SlotRestrictedInput;
|
||||||
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
|
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
|
||||||
import appeng.core.AELog;
|
import appeng.core.AELog;
|
||||||
|
@ -51,7 +51,8 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||||
IConfigManager serverCM;
|
IConfigManager serverCM;
|
||||||
IConfigManager clientCM;
|
IConfigManager clientCM;
|
||||||
|
|
||||||
public AppEngSlot cellView;
|
public boolean canAccessViewCells = false;
|
||||||
|
public SlotRestrictedInput cellView[] = new SlotRestrictedInput[5];
|
||||||
|
|
||||||
public IConfigManagerHost gui;
|
public IConfigManagerHost gui;
|
||||||
|
|
||||||
|
@ -96,8 +97,16 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||||
else
|
else
|
||||||
monitor = null;
|
monitor = null;
|
||||||
|
|
||||||
|
canAccessViewCells = false;
|
||||||
if ( montiorable instanceof IViewCellStorage )
|
if ( montiorable instanceof IViewCellStorage )
|
||||||
addSlotToContainer( cellView = new SlotRestrictedInput( PlaceableItemType.VIEWCELL, ((IViewCellStorage) montiorable).getViewCellStorage(), 0, 205, 7 ) );
|
{
|
||||||
|
for (int y = 0; y < 5; y++)
|
||||||
|
{
|
||||||
|
cellView[y] = new SlotRestrictedInput( PlaceableItemType.VIEWCELL, ((IViewCellStorage) montiorable).getViewCellStorage(), y, 206, y * 18 + 8 );
|
||||||
|
cellView[y].allowEdit = canAccessViewCells;
|
||||||
|
addSlotToContainer( cellView[y] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( bindInventory )
|
if ( bindInventory )
|
||||||
bindPlayerInventory( ip, 0, 0 );
|
bindPlayerInventory( ip, 0, 0 );
|
||||||
|
@ -171,6 +180,23 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean oldCanAccessViewCells = canAccessViewCells;
|
||||||
|
canAccessViewCells = hasAccess( SecurityPermissions.BUILD, false );
|
||||||
|
if ( canAccessViewCells != oldCanAccessViewCells )
|
||||||
|
{
|
||||||
|
for (int y = 0; y < 5; y++)
|
||||||
|
{
|
||||||
|
if ( cellView[y] != null )
|
||||||
|
cellView[y].allowEdit = canAccessViewCells;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object c : this.crafters)
|
||||||
|
{
|
||||||
|
if ( c instanceof ICrafting )
|
||||||
|
((ICrafting) c).sendProgressBarUpdate( this, 99, canAccessViewCells ? 1 : 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
super.detectAndSendChanges();
|
super.detectAndSendChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,6 +238,19 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgressBar(int idx, int value)
|
||||||
|
{
|
||||||
|
super.updateProgressBar( idx, value );
|
||||||
|
|
||||||
|
if ( idx == 99 )
|
||||||
|
canAccessViewCells = value == 1;
|
||||||
|
|
||||||
|
for (int y = 0; y < 5; y++)
|
||||||
|
if ( cellView[y] != null )
|
||||||
|
cellView[y].allowEdit = canAccessViewCells;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onContainerClosed(EntityPlayer player)
|
public void onContainerClosed(EntityPlayer player)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package appeng.container.slot;
|
package appeng.container.slot;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -54,8 +55,15 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlaceableItemType which;
|
public PlaceableItemType which;
|
||||||
|
public boolean allowEdit = true;
|
||||||
public int stackLimit = -1;
|
public int stackLimit = -1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
||||||
|
{
|
||||||
|
return allowEdit;
|
||||||
|
}
|
||||||
|
|
||||||
public Slot setStackLimit(int i)
|
public Slot setStackLimit(int i)
|
||||||
{
|
{
|
||||||
stackLimit = i;
|
stackLimit = i;
|
||||||
|
@ -98,6 +106,10 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
IAppEngApi api = AEApi.instance();
|
IAppEngApi api = AEApi.instance();
|
||||||
|
|
||||||
|
if ( !allowEdit )
|
||||||
|
return false;
|
||||||
|
|
||||||
switch (which)
|
switch (which)
|
||||||
{
|
{
|
||||||
case VALID_ENCODED_PATTERN_W_OUPUT:
|
case VALID_ENCODED_PATTERN_W_OUPUT:
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
|
||||||
talkBackTo = player;
|
talkBackTo = player;
|
||||||
|
|
||||||
DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 );
|
DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 );
|
||||||
WorldSettings.getInstance().getCompass().getCompassDirection( loc, 128, this );
|
WorldSettings.getInstance().getCompass().getCompassDirection( loc, 174, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
// api
|
// api
|
||||||
|
|
|
@ -43,7 +43,7 @@ final public class MeteoriteWorldGen implements IWorldGenerator
|
||||||
int z = r.nextInt( 16 ) + (chunkZ << 4);
|
int z = r.nextInt( 16 ) + (chunkZ << 4);
|
||||||
|
|
||||||
myGen obj = new myGen();
|
myGen obj = new myGen();
|
||||||
WorldSettings.getInstance().getCompass().getCompassDirection( new DimensionalCoord( w, x, 128, z ), 30, obj );
|
WorldSettings.getInstance().getCompass().getCompassDirection( new DimensionalCoord( w, x, 128, z ), 70, obj );
|
||||||
|
|
||||||
synchronized (obj)
|
synchronized (obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
|
||||||
{
|
{
|
||||||
|
|
||||||
IConfigManager cm = new ConfigManager( this );
|
IConfigManager cm = new ConfigManager( this );
|
||||||
AppEngInternalInventory viewCell = new AppEngInternalInventory( this, 1 );
|
AppEngInternalInventory viewCell = new AppEngInternalInventory( this, 5 );
|
||||||
|
|
||||||
public PartTerminal(Class clz, ItemStack is) {
|
public PartTerminal(Class clz, ItemStack is) {
|
||||||
super( clz, is );
|
super( clz, is );
|
||||||
|
|
|
@ -57,8 +57,8 @@ public class CompassService implements Runnable
|
||||||
private class CMDirectionRequest extends CompassMessage
|
private class CMDirectionRequest extends CompassMessage
|
||||||
{
|
{
|
||||||
|
|
||||||
public final DimensionalCoord coord;
|
|
||||||
public final int maxRange;
|
public final int maxRange;
|
||||||
|
public final DimensionalCoord coord;
|
||||||
public final ICompassCallback callback;
|
public final ICompassCallback callback;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -190,7 +190,7 @@ public class CompassService implements Runnable
|
||||||
}
|
}
|
||||||
|
|
||||||
// spiral outward...
|
// spiral outward...
|
||||||
for (int offset = 1; offset < 174; offset++)
|
for (int offset = 1; offset < req.maxRange; offset++)
|
||||||
{
|
{
|
||||||
int minx = cx - offset;
|
int minx = cx - offset;
|
||||||
int minz = cz - offset;
|
int minz = cz - offset;
|
||||||
|
|
52
util/prioitylist/MergedPriorityList.java
Normal file
52
util/prioitylist/MergedPriorityList.java
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
package appeng.util.prioitylist;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
public class MergedPriorityList<T extends IAEStack<T>> implements IPartitionList<T>
|
||||||
|
{
|
||||||
|
|
||||||
|
final List<IPartitionList<T>> positive = new ArrayList();
|
||||||
|
final List<IPartitionList<T>> negative = new ArrayList();
|
||||||
|
|
||||||
|
public void addNewList(IPartitionList<T> list, boolean isWhitelist)
|
||||||
|
{
|
||||||
|
if ( isWhitelist )
|
||||||
|
positive.add( list );
|
||||||
|
else
|
||||||
|
negative.add( list );
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isListed(T input)
|
||||||
|
{
|
||||||
|
for (IPartitionList<T> l : negative)
|
||||||
|
if ( l.isListed( input ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( !positive.isEmpty() )
|
||||||
|
{
|
||||||
|
for (IPartitionList<T> l : positive)
|
||||||
|
if ( l.isListed( input ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty()
|
||||||
|
{
|
||||||
|
return positive.isEmpty() && negative.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterable<T> getItems()
|
||||||
|
{
|
||||||
|
throw new RuntimeException( "Not Implemented" );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue