Title says it all. I'm pretty much making a magma block from 1.10, but turning it into a 1.7.10 one. Now, as much as I would love to look at the code for magma, I can't because gradlew commands fail there. I looked at block code, and the closest thing I found is also in entities, I guess. I've tried to use isBurning, as well as the code for the cactus(but that is only if you're *in* the block). Any people who are more experienced in modding have the solution as to what I'm doing wrong? Much appreciated if so.
The isFlammable method is used in AI pathfinders. If you want to set the entity on fire you override the blocks onEntityCollideWithBlock in newer versions. If it doesn't exist in 1.7 you can look for something similar in the Block class.
Rollback Post to RevisionRollBack
Teleporting XP, for when you want to improve performance with XP farms
Looking through the classes, I found that onEntityCollidedWithBlock is *enters* (Triggered whenever an entity collides with this block(enters into the block)), as well as retried isBurning, but still no luck. I think it would be pretty handy if I could get into the code for magma, though. For now, I'm gonna say I've been defeated, though.
You set an entity on fire using the Entity#setFire() method where you can specify the number of seconds it should burn. If you look at the call hierarchy for that method you can see that blocks set entities on fire by the following code in the Entity#move() method:
if (this.fire == 0)
else if (this.fire <= 0)
this.fire = -this.getFireImmuneTicks();
If you look at the isFlammableWithin() method you'll see that it is hard-coded for fire and lava as well as any block that is burning.
So the first thing to try is to make sure the isBurning() method in your block returns a value of TRUE. I think that should work, but it might cause the flames to render as well (which you probably don't want).
If there are flames that you don't want then you'd have to do the following instead: Handle the server tick event and take the loaded entity list and then use code that is copied from the Entity#move() method to check for your block within the AABB and setFire() accordingly.