Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void putStack(ItemStack stack) {

@Override
public boolean isVisible() {
return parent != null ? parent.xDisplayPosition >= 0 && parent.yDisplayPosition >= 0 : super.isVisible();
return parent != null ? parent.xDisplayPosition >= 0 && parent.yDisplayPosition >= 0 && !parent.getHasStack() && super.isVisible() : super.isVisible();
}

}
}
26 changes: 22 additions & 4 deletions src/main/java/com/enderio/core/common/ContainerEnder.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class ContainerEnder<T extends IInventory> extends Container {

protected Map<Slot, Point> playerSlotLocations = Maps.newLinkedHashMap();

protected final int startPlayerSlot;
protected final int endPlayerSlot;
protected final int startHotBarSlot;
protected final int endHotBarSlot;
protected int startPlayerSlot;
protected int endPlayerSlot;
protected int startHotBarSlot;
protected int endHotBarSlot;

private final @Nonnull T inv;
private final @Nonnull InventoryPlayer playerInv;
Expand All @@ -38,6 +38,24 @@ public ContainerEnder(InventoryPlayer playerInv, T inv) {
this.inv = checkNotNull(inv);
this.playerInv = checkNotNull(playerInv);

init();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not dupe code, just call this(false, playerInv, inv);

}

/**
* Use this constructor if you need a fully initialized object for your
* addSlots(), e.g. because you need to pass your slots on to your
* createGhostSlots(). You <b>must</b> call init() in your constructor.
*/
public ContainerEnder(boolean iPromiseToCallInitInTheImplementationClassConstructor, InventoryPlayer playerInv, T inv) {
this.inv = checkNotNull(inv);
this.playerInv = checkNotNull(playerInv);

if (!iPromiseToCallInitInTheImplementationClassConstructor) {
init();
}
}

protected void init() {
addSlots(playerInv);

int x = getPlayerInventoryOffset().x;
Expand Down