Enderite Mod (for Forge/NeoForge)

Enderite Mod (for Forge/NeoForge)

956k Downloads

Alex's Caves compatability

ImpulsiveLad opened this issue ยท 3 comments

commented

Alex's Caves adds several sources of nuclear "explosions"

could you add a line of code that allows:

public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosion) { world.setBlockState(pos, EnderiteMod.CRACKED_ENDERITE_ORE.get().getDefaultState());

To work with nuclear explosions?

commented

NUCLEAR_EXPLOSION

public void onDestroyedByNUCLEAR_EXPLOSION(World world, BlockPos pos, NUCLEAR_EXPLOSION explosion) { world.setBlockState(pos, EnderiteMod.CRACKED_ENDERITE_ORE.get().getDefaultState());

Does this work?

commented

If only it was that easy. Sadly this is not really something we can easily fix on our side. You are right in that they don't really use explosions to break blocks. They basically just carve the shape of the creator out of the world by braking the block or replacing it with air. This is why the onDestroyedByExplosion method is not called if the ore is destroyed by the nuke. If you are interested here is the code that checks if a block is destroyed or not https://github.com/AlexModGuy/AlexsCaves/blob/110c27c58512a464e94786683d25a7a3fe428a44/src/main/java/com/github/alexmodguy/alexscaves/server/entity/item/NuclearExplosionEntity.java#L174
The clean way to fix this would require the guys from Alex's Caves to call the onDestroyedByExplosion method for every block they delete. However they might not be willing to do that because it would probably cause a bit more lag (this is just speculation on my part it's entirely possible they just forgot to call the method). A quick and dirty fix is adding the Enderite ore to the #alexscaves:unmovable tag. This would essentially cause the nuke to just ignore the ore. The ore wouldn't get cracked but it would survive the nuke. Keep in mind the Tag based solution is basically just a hack and the real fix is calling the onDestroyedByExplosion in the code of the nuke. It might be worth asking the Alex's Caves devs if they just forgot to call the method or if they intentionally omitted it.

commented

2023-11-01_00 57 01
Awesome, looks like alex made them count as explosions!