Merge pull request #1535 from BallOfEnergy1/OC_bugfix

worlds smallest PR
This commit is contained in:
HbmMods 2024-06-09 10:55:56 +02:00 committed by GitHub
commit 458dd79b3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@ -136,9 +137,19 @@ public class TileEntityRBMKControlManual extends TileEntityRBMKControl implement
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getColor(Context context, Arguments args) {
return new Object[] {this.color};
return new Object[] {this.color.ordinal()};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] setColor(Context context, Arguments args) {
int colorI = args.checkInteger(0);
colorI = MathHelper.clamp_int(colorI, 0, 4);
this.color = RBMKColor.values()[colorI];
return new Object[] {true};
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerRBMKControl(player.inventory, this);

View File

@ -241,7 +241,7 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getGasType(Context context, Arguments args) {
return new Object[] {gas.getTankType().getID()};
return new Object[] {gas.getTankType().getName()};
}
@Callback(direct = true)