In Control!

In Control!

72M Downloads

Lost Cities Compat / InSphere doesn't seem to work.

Closed this issue ยท 2 comments

commented

I've run into a bit of an issue with using InControl to limit mob spawns within spheres generated by Lost Cities when using the following rule.

{
	"insphere": true,
	"mob": "techguns:tgdummyspawn",
	"result": "deny"
}

When using the "insphere": true rule, the mobs never spawn, in or out of spheres. When setting the rule to false, they instead spawn everywhere. In and out of spheres.

I think this problem stems from how the 'insphere' check is handled.
https://github.com/McJty/InControl/blob/c9b8bc24b3abb29f69f93ef0672eaf29a6bb9267/src/main/java/mcjty/incontrol/compat/LostCitySupport.java#L52-L64
The problem is on line 61 return chunkInfo.getSphere() != null; I believe that value always returns true as getSphere, which eventually leads to CitySphere.getCitySphere, returns an 'empty' sphere if one is not found, not a null value.

    /**
     * Given a chunk coordinate return the nearest city sphere that affects this chunk. This can return city
     * spheres that are disabled so always test for that! If this returns EMPTY there is no sphere at all
     */   

As a test I've compiled a local version of InControl with the return value of inSphere replaced with return chunkInfo.getSphere().isEnabled(); and the spawns work as expected.
Matching entities that would spawn in the sphere do not spawn if they match the rule but will spawn outside the sphere.

commented

I will check it out soon

commented

Fixed in the next release of Lost Cities (2.0.6)