Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Aug 9, 2024
1 parent fa9c24c commit 8c47656
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ catch (Exception ignored) {

// Pulls version first from the VERSION env and then git tag
String identifiedVersion = null
String versionOverride = '0.0.18p5'
String versionOverride = '0.0.18p6'
try {
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
if (versionOverride == null) {
Expand Down
33 changes: 17 additions & 16 deletions src/main/java/reobf/proghatches/block/TileIOHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import scala.Some;
import scala.Tuple2;
import li.cil.oc.util.BlockPosition;
import li.cil.oc.util.ExtendedArguments.ExtendedArguments;
import scala.collection.immutable.IndexedSeq;
import scala.collection.mutable.Buffer;
import scala.reflect.ClassTag;
Expand Down Expand Up @@ -110,7 +111,7 @@ public class TileIOHub extends TileEntity implements li.cil.oc.api.network.Envir
public TileIOHub() {

}

private int offset=0;
@Override
public Node node() {

Expand Down Expand Up @@ -563,7 +564,7 @@ public boolean mayInteract(BlockPosition arg0, ForgeDirection arg1) {

@Override
public BlockPosition position() {
return BlockPosition.apply(xCoord, yCoord, zCoord);
return BlockPosition.apply(xCoord, yCoord, zCoord,this.world());
}

@Override
Expand Down Expand Up @@ -730,18 +731,18 @@ public int optSlot(Arguments args, int n) {
return InventoryAware$class.optSlot(this, args, n);
}
public int selectedSlotIndex() {
return slotselected-1;
return slotselected-offset;
}
@Override
public int selectedSlot() {

return slotselected;
}

@Override
public void selectedSlot_$eq(int arg0) {
markDirty();
if (arg0 < 0 + 1 || arg0 >= inv.length + 1) {
if (arg0 < 0 + offset || arg0 >= inv.length + offset) {
throw new RuntimeException("invalid slot");
}
slotselected = arg0;
Expand Down Expand Up @@ -777,7 +778,7 @@ public int optTank(Arguments arg0, int arg1) {
return TankAware$class.optTank(this, arg0, arg1);
}
public int selectedTankIndex() {
return tankselected-1;
return tankselected-offset;
}
@Override
public int selectedTank() {
Expand All @@ -788,7 +789,7 @@ public int selectedTank() {
@Override
public void selectedTank_$eq(int arg0) {
markDirty();
if (arg0 < 0 + 1 || arg0 >= ft.length + 1) {
if (arg0 < 0 + offset || arg0 >= ft.length + offset) {
throw new RuntimeException("invalid slot");
}
tankselected = arg0;
Expand Down Expand Up @@ -824,9 +825,9 @@ public Object[] tankCount(final Context context, final Arguments args) {
@APIType({ "fluid" })
@Callback(doc = "function([index:number]):number -- Select a tank and/or get the number of the currently selected tank.")
public Object[] selectTank(final Context context, final Arguments args) {
int i = args.checkInteger(0);
int i = optTank(args,0);
this.selectedTank_$eq(i);
return new Object[] { i };
return new Object[] { i+1 };
}

@APIType({ "fluid" })
Expand All @@ -853,13 +854,13 @@ public Object[] transferFluidTo(final Context context, final Arguments args) {
markDirty();
return TankControl$class.transferFluidTo(this, context, args);
}

@APIType({ "item" })
@Callback(doc = "function([slot:number]):number -- Get the currently selected slot; set the selected slot if specified.")
public Object[] select(final Context context, final Arguments args) {
int i = args.checkInteger(0);
int i = optSlot(args,0);
this.selectedSlot_$eq(i);
return new Object[] { i };
return new Object[] { i+1 };
}

@APIType({ "item" })
Expand Down Expand Up @@ -1539,7 +1540,7 @@ protected void addUIWidgets(ModularWindow.Builder builder) {
public IDrawable[] getBackground() {
// System.out.println(h.getSlotIndex()+"
// "+(slotselected-1));
if (h.getSlotIndex() == slotselected - 1) {
if (h.getSlotIndex() == slotselected - offset) {
return special;
}
;
Expand All @@ -1564,7 +1565,7 @@ public IDrawable[] getBackground() {
public IDrawable[] getBackground() {
// System.out.println(h.getSlotIndex()+"
// "+(slotselected-1));
if (h == tankselected - 1) {
if (h == tankselected - offset) {
return special0;
}
;
Expand Down Expand Up @@ -1649,8 +1650,8 @@ public void setCustomName(String name) {

}

int slotselected = 1;
int tankselected = 1;
int slotselected = offset;;
int tankselected = offset;;

@Override
public IGridNode getActionableNode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import reobf.proghatches.gt.metatileentity.util.IRecipeProcessingAwareDualHatch;
import reobf.proghatches.main.registration.Registration;

public class DualInputHatchSlave<T extends MetaTileEntity & IDualInputHatch> extends GT_MetaTileEntity_Hatch_InputBus
public class DualInputHatchSlave<T extends MetaTileEntity & IDualInputHatch&IMetaTileEntity> extends GT_MetaTileEntity_Hatch_InputBus
implements IDualInputHatch , IRecipeProcessingAwareDualHatch {

private T master; // use getMaster() to access
Expand Down

0 comments on commit 8c47656

Please sign in to comment.