mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
improve hopping item interface performance
This commit is contained in:
parent
eda6fcb587
commit
49bcda43fa
1 changed files with 20 additions and 19 deletions
|
@ -50,19 +50,7 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.handlerToPushTo != null){
|
||||
outer : for(int i = 0; i < this.itemHandler.getSlots(); i++){
|
||||
if(StackUtil.isValid(this.itemHandler.getStackInSlot(i))){
|
||||
for(int j = 0; j < this.handlerToPushTo.getSlots(); j++){
|
||||
if(WorldUtil.doItemInteraction(i, j, this.itemHandler, this.handlerToPushTo, 4)){
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
if(this.world.getTotalWorldTime()%20 == 0){
|
||||
List<EntityItem> items = this.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX(), this.pos.getY()+0.5, this.pos.getZ(), this.pos.getX()+1, this.pos.getY()+2, this.pos.getZ()+1));
|
||||
if(items != null && !items.isEmpty()){
|
||||
|
@ -82,6 +70,19 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.handlerToPushTo != null){
|
||||
outer : for(int i = 0; i < this.itemHandler.getSlots(); i++){
|
||||
if(StackUtil.isValid(this.itemHandler.getStackInSlot(i))){
|
||||
for(int j = 0; j < this.handlerToPushTo.getSlots(); j++){
|
||||
if(WorldUtil.doItemInteraction(i, j, this.itemHandler, this.handlerToPushTo, 4)){
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue