i'm attempting to have it light up when activated by redstone by copying and changing some code from the dispenser:
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(l > 0 && Block.blocksList[l].canProvidePower())
{
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
}
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.isBlockIndirectlyGettingPowered(i, j, k) || world.isBlockIndirectlyGettingPowered(i, j + 1, k))
{
setLightValue(1F);
}
else
{setLightValue(0f);}
}
ah, thanks, i've not been doing this for very long, only started yesterday....
i think i'll have to find a better tutorial for making something react to redstone, because the one i'm following isn't helping as seen in my previous code
help out this master noob, how/where do you set the .setlightvalue at? ive never worked with the coding before, only the actual textures. btw, would this work in a resource pack on multiplayer servers?
help out this master noob, how/where do you set the .setlightvalue at? ive never worked with the coding before, only the actual textures. btw, would this work in a resource pack on multiplayer servers?
You realize this thread was started in 2011, right? You should start a new thread for your own questions.
Anyway, if you've never coded before then honestly you need to start by reading a book on Java. Then doing tutorials on Minecraft modding.
Because to answer your question I'd have to say a bunch of stuff that you probably won't understand. But here it is: if you are making your own block you need to extend the block class and either call the setLightValue() method from your constructor or else @Override the getLightValue() method. If you want to change the vanilla blocks then you have to call the setLightValue(), which is public, from your proxy class sometime after the blocks are initialized.
is it just like this?
.setLightOpacity(1)
Close. .setLightValue(1F)
setLightOpacity takes an Integer and allows light to go through it.
Moddercraft has a description for it.
i think i'll have to find a better tutorial for making something react to redstone, because the one i'm following isn't helping as seen in my previous code
You revived a 2 year old thread for this? Athough the code hasn't changed, it's still YourBlock.setLightValue(/*Value between 0.0F and 1.0F*/);
You realize this thread was started in 2011, right? You should start a new thread for your own questions.
Anyway, if you've never coded before then honestly you need to start by reading a book on Java. Then doing tutorials on Minecraft modding.
Because to answer your question I'd have to say a bunch of stuff that you probably won't understand. But here it is: if you are making your own block you need to extend the block class and either call the setLightValue() method from your constructor or else @Override the getLightValue() method. If you want to change the vanilla blocks then you have to call the setLightValue(), which is public, from your proxy class sometime after the blocks are initialized.