reformatted all src files (#141)
This commit is contained in:
@@ -19,76 +19,65 @@
|
||||
package appeng.container.slot;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class OptionalSlotFake extends SlotFake implements IOptionalSlot
|
||||
{
|
||||
|
||||
private final int srcX;
|
||||
private final int srcY;
|
||||
private final int groupNum;
|
||||
private final IOptionalSlotHost host;
|
||||
private boolean renderDisabled = true;
|
||||
public class OptionalSlotFake extends SlotFake implements IOptionalSlot {
|
||||
|
||||
public OptionalSlotFake( final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
|
||||
{
|
||||
super( inv, idx, x + offX * 18, y + offY * 18 );
|
||||
this.srcX = x;
|
||||
this.srcY = y;
|
||||
this.groupNum = groupNum;
|
||||
this.host = containerBus;
|
||||
}
|
||||
private final int srcX;
|
||||
private final int srcY;
|
||||
private final int groupNum;
|
||||
private final IOptionalSlotHost host;
|
||||
private boolean renderDisabled = true;
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack()
|
||||
{
|
||||
if( !this.isSlotEnabled() )
|
||||
{
|
||||
if( !this.getDisplayStack().isEmpty() )
|
||||
{
|
||||
this.clearStack();
|
||||
}
|
||||
}
|
||||
public OptionalSlotFake(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, idx, x + offX * 18, y + offY * 18);
|
||||
this.srcX = x;
|
||||
this.srcY = y;
|
||||
this.groupNum = groupNum;
|
||||
this.host = containerBus;
|
||||
}
|
||||
|
||||
return super.getStack();
|
||||
}
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack() {
|
||||
if (!this.isSlotEnabled()) {
|
||||
if (!this.getDisplayStack().isEmpty()) {
|
||||
this.clearStack();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled()
|
||||
{
|
||||
if( this.host == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return super.getStack();
|
||||
}
|
||||
|
||||
return this.host.isSlotEnabled( this.groupNum );
|
||||
}
|
||||
@Override
|
||||
public boolean isSlotEnabled() {
|
||||
if (this.host == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRenderDisabled()
|
||||
{
|
||||
return this.renderDisabled;
|
||||
}
|
||||
return this.host.isSlotEnabled(this.groupNum);
|
||||
}
|
||||
|
||||
public void setRenderDisabled( final boolean renderDisabled )
|
||||
{
|
||||
this.renderDisabled = renderDisabled;
|
||||
}
|
||||
@Override
|
||||
public boolean isRenderDisabled() {
|
||||
return this.renderDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSourceX()
|
||||
{
|
||||
return this.srcX;
|
||||
}
|
||||
public void setRenderDisabled(final boolean renderDisabled) {
|
||||
this.renderDisabled = renderDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSourceY()
|
||||
{
|
||||
return this.srcY;
|
||||
}
|
||||
@Override
|
||||
public int getSourceX() {
|
||||
return this.srcX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSourceY() {
|
||||
return this.srcY;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user