This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
louitzie's profile picture

[SOLVED] operator panel mod

Started by louitzie, 29 April 2012 - 09:50 AM
louitzie #1
Posted 29 April 2012 - 11:50 AM
i have a few questions

package net.minecraft.src;
import dan200.computer.api.IComputerAccess;
import dan200.computer.api.IPeripheral;
public class mod_Controller extends BaseMod
{
public static int frontOff = ModLoader.addOverride("/terrain.png", "/frontOff.png");
public static int frontOn = ModLoader.addOverride("/terrain.png", "/frontOn.png");
public static int sideOff = ModLoader.addOverride("/terrain.png", "/sideOff.png");
public static int sideOn = ModLoader.addOverride("/terrain.png", "/sideOn.png");
@MLProp public static int recipeOn = 1;
@MLProp public static int controllerBlockID = 210;
public static final Block controller = new BlockController(controllerBlockID, 0).setBlockName("controller").setHardness(3F).setResistance(4F);
public void load()
{
ModLoader.registerBlock(controller);
ModLoader.addName(controller, "Controller");
if (recipeOn == 1)
{
ModLoader.addRecipe(new ItemStack(controller, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
ModLoader.registerTileEntity(TileEntityController.class, "name");
}
public String getVersion()
{
return "1.2.5";
}
}

the blockID config doesn't work but the recipe config does

please help
Xtansia #2
Posted 29 April 2012 - 01:04 PM
For your config problem:

@MLProp(name="blockID", info="Panel Block ID", min=0, max=255)
	 public static int blockID = 210; // This is the default value
@MLProp(name="recipeEnabled", info="Recipe Enabled(0=off|1=on)", min=0, max=1)
	 public static int recipeEnabled = 1; // Once again default value
Also for MC1.2.5 with the new forge it has to be forge build #100 ->

About the texture wouldn't know without looking at block code.
louitzie #3
Posted 29 April 2012 - 09:23 PM
i am sorry but that solution doesn't work :)/>/>
Cloudy #4
Posted 30 April 2012 - 11:10 PM
I hate to be unhelpful, but this isn't the place for general modding questions. This is more about minecraft modding in general, and nothing to do with with the peripheral API.

You'd find much better help on #minecraftforge or #risucraft or on the Minecraft Forums.
louitzie #5
Posted 01 May 2012 - 02:04 PM
yes you are right, I shall search somewhere else
Cloudy #6
Posted 01 May 2012 - 04:24 PM
yes you are right, I shall search somewhere else

This once, I'll save you the issue as I believe I have found it.

Move your "new BlockController" etc, into the load() method - it is being assigned the default ID before it has had chance to be set to the ID read in the config.
louitzie #7
Posted 02 May 2012 - 03:30 PM
thaks Cloudy that worked.