I'm trying to make a tile entity like the mob spawner, with different behaviors, so I'll use Mr. Spinny Pig as a point of reference.
Desired outcome: dynamic light value in a block class
Question: how do I change the block's values from the tile entity's code?
In TileEntityBlah, updateEntity() { if condition A is met, then block.lightvalue=1, else block.lightvalue=2 }. I can't figure out how to glom onto the referring block in order to run setLightValue.
Desired outcome: new items with names
Question: how do I add a name popup in my inventory?
I have both a new item and a new block, they show up just fine and behave the way I'm asking, but they have no title on mouseover. setBlockName and setItemName are both in place.
Desired outcome: new sounds
Question: how do I put new sounds in the jar?
Not that I can't, I just can't get the code to acknowledge them. sound = "/mob/lolsauce.wav" and it pretends the file doesn't exist.
Desired outcome: gimbal locks
Question: how can I make glrotatef and gltranslatef behave?
I can't use model transformations because Mr. Spinny Pig doesn't actually exist; the mob spawner just renders an instance of a pig. I want him to randomly orient his gravity to one of the six faces of that cube, so he could be standing on his side, or upside-down. Using glrotatef at any point is basically guaranteed to start wildly rotating it about an invisible point of rotation way over there outside of the block. This makes me sad.
Desired outcome: mob spawn in the right place
Question: how do I effectively put a mob where I want it?
When I break my new block, I'm trying to spawn a new mob, just like the silverfish. By default it spawns it in the space above the block. I can tell it to spawn -1 down, but then if the block is over ground, the ground telefrags the new mob.
I feel like I could solve half my problems by properly understanding bounding boxes and points of rotation/position in the model class. I'm working with a very small model...
public class ModelBoxfly extends ModelBase
{
public ModelBoxfly()
{
body = new ModelRenderer(this, 0, 0);
body.addBox(-0.5F, -0.5F, -2.0F, 2, 2, 2);
body.setRotationPoint(0.0F, 0F, 0.0F);
tail = new ModelRenderer(this, 0, 0);
tail.addBox(0.0F, 0.0F, -1.0F, 1, 1, 2);
tail.setRotationPoint(0.0F, 0F, 0.0F);
}
Desired outcome: dynamic light value in a block class
Question: how do I change the block's values from the tile entity's code?
In TileEntityBlah, updateEntity() { if condition A is met, then block.lightvalue=1, else block.lightvalue=2 }. I can't figure out how to glom onto the referring block in order to run setLightValue.
Desired outcome: new items with names
Question: how do I add a name popup in my inventory?
I have both a new item and a new block, they show up just fine and behave the way I'm asking, but they have no title on mouseover. setBlockName and setItemName are both in place.
Desired outcome: new sounds
Question: how do I put new sounds in the jar?
Not that I can't, I just can't get the code to acknowledge them. sound = "/mob/lolsauce.wav" and it pretends the file doesn't exist.
Desired outcome: gimbal locks
Question: how can I make glrotatef and gltranslatef behave?
I can't use model transformations because Mr. Spinny Pig doesn't actually exist; the mob spawner just renders an instance of a pig. I want him to randomly orient his gravity to one of the six faces of that cube, so he could be standing on his side, or upside-down. Using glrotatef at any point is basically guaranteed to start wildly rotating it about an invisible point of rotation way over there outside of the block. This makes me sad.
Desired outcome: mob spawn in the right place
Question: how do I effectively put a mob where I want it?
When I break my new block, I'm trying to spawn a new mob, just like the silverfish. By default it spawns it in the space above the block. I can tell it to spawn -1 down, but then if the block is over ground, the ground telefrags the new mob.
I feel like I could solve half my problems by properly understanding bounding boxes and points of rotation/position in the model class. I'm working with a very small model...
Can anyone help?