Update TileEntityTurretBaseNT.java

Added an OpenComputers function, getPos().
It returns the (x,y,z) coordinates of the turret in question
This commit is contained in:
Kirby7871 2025-05-29 02:06:40 +02:00 committed by GitHub
parent 087be46083
commit 65f1866e8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -995,6 +995,12 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
return new Object[] {this.aligned};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getPos(Context context, Arguments args) {
return new Object[] {xCoord, yCoord, zCoord};
}
@Override
@Optional.Method(modid = "OpenComputers")
public boolean canConnectNode(ForgeDirection side) {
@ -1016,6 +1022,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
"hasTarget",
"getAngle",
"isAligned"
"getPos"
};
}
@ -1045,6 +1052,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
return getAngle(context, args);
case "isAligned":
return isAligned(context, args);
case "getPos":
return getPos(context, args);
}
throw new NoSuchMethodException();
}