fixes #486
This commit is contained in:
1 parent
8a2ddcbf2a
commit
1c1fb5eb59
5 files changed
+18
-9
No files matched your search
@@ -5,4 +5,6 @@ import net.minecraft.util.math.GravityField;
|
||||
public interface SpawnHelperInnerInterface
|
||||
{
|
||||
GravityField getPotentialCalculator();
|
||||
|
||||
int cmGetChunkCount();
|
||||
}
|
||||
@@ -31,12 +31,18 @@ public class SpawnHelperInnerMixin implements SpawnHelperInnerInterface
|
||||
cir.setReturnValue(groupToCount.getInt(entityCategory) < i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public GravityField getPotentialCalculator()
|
||||
{
|
||||
return densityField;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cmGetChunkCount() {
|
||||
return spawningChunkCount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package carpet.script.api;
|
||||
|
||||
import carpet.fakes.SpawnHelperInnerInterface;
|
||||
import carpet.script.CarpetContext;
|
||||
import carpet.script.Expression;
|
||||
import carpet.script.LazyValue;
|
||||
@@ -30,7 +31,7 @@ public class Monitoring {
|
||||
SpawnHelper.Info info = world.getChunkManager().getSpawnInfo();
|
||||
if (info == null) return LazyValue.NULL;
|
||||
Object2IntMap<SpawnGroup> mobcounts = info.getGroupToCount();
|
||||
int chunks = info.getSpawningChunkCount();
|
||||
int chunks = ((SpawnHelperInnerInterface)info).cmGetChunkCount();
|
||||
Value retVal;
|
||||
if (lv.size() == 0)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user