mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
add set color function
This commit is contained in:
parent
5b77cc7697
commit
dcac56d4e2
@ -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;
|
||||
|
||||
@ -139,6 +140,16 @@ public class TileEntityRBMKControlManual extends TileEntityRBMKControl implement
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user