mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Supposedly fix a bug with item interfaces ignoring whitelisting
This commit is contained in:
parent
622cfef3ee
commit
d24a09ad67
1 changed files with 17 additions and 13 deletions
|
@ -40,28 +40,32 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{
|
||||||
@Override
|
@Override
|
||||||
protected void getInvWrappers(SidedInvWrapper[] wrappers){
|
protected void getInvWrappers(SidedInvWrapper[] wrappers){
|
||||||
for(int i = 0; i < wrappers.length; i++){
|
for(int i = 0; i < wrappers.length; i++){
|
||||||
wrappers[i] = new SidedInvWrapper(this, EnumFacing.values()[i]){
|
final EnumFacing direction = EnumFacing.values()[i];
|
||||||
|
wrappers[i] = new SidedInvWrapper(this, direction){
|
||||||
@Override
|
@Override
|
||||||
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate){
|
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate){
|
||||||
|
if(TileEntityItemViewer.this.canInsertItem(slot, stack, direction)){
|
||||||
SpecificItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
SpecificItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
||||||
if(info != null){
|
if(info != null){
|
||||||
return info.handler.insertItem(info.switchedIndex, stack, simulate);
|
return info.handler.insertItem(info.switchedIndex, stack, simulate);
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
return super.insertItem(slot, stack, simulate);
|
|
||||||
}
|
}
|
||||||
|
return super.insertItem(slot, stack, simulate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack extractItem(int slot, int amount, boolean simulate){
|
public ItemStack extractItem(int slot, int amount, boolean simulate){
|
||||||
|
ItemStack stackIn = TileEntityItemViewer.this.getStackInSlot(slot);
|
||||||
|
if(stackIn != null){
|
||||||
|
if(TileEntityItemViewer.this.canExtractItem(slot, stackIn, direction)){
|
||||||
SpecificItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
SpecificItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
||||||
if(info != null){
|
if(info != null){
|
||||||
return info.handler.extractItem(info.switchedIndex, amount, simulate);
|
return info.handler.extractItem(info.switchedIndex, amount, simulate);
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
return super.extractItem(slot, amount, simulate);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return super.extractItem(slot, amount, simulate);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue