Fix 1.18.2 Biomes

This commit is contained in:
cyberpwn 2022-03-27 14:42:13 -04:00
parent 15bc964fcc
commit aa4e574eef
5 changed files with 13 additions and 2 deletions

View File

@ -54,6 +54,7 @@ public interface INMSBinding {
String getTrueBiomeBaseKey(Location location);
Object getCustomBiomeBaseFor(String mckey);
Object getCustomBiomeBaseHolderFor(String mckey);
String getKeyForBiomeBase(Object biomeBase);

View File

@ -208,6 +208,10 @@ public class NMSBinding18_2 implements INMSBinding {
public Object getCustomBiomeBaseFor(String mckey) {
return getCustomBiomeRegistry().get(new ResourceLocation(mckey));
}
@Override
public Object getCustomBiomeBaseHolderFor(String mckey) {
return getCustomBiomeRegistry().getHolder(getTrueBiomeBaseId(getCustomBiomeRegistry().get(new ResourceLocation(mckey)))).get();
}
@Override
public String getKeyForBiomeBase(Object biomeBase) {

View File

@ -112,6 +112,11 @@ public class NMSBinding1X implements INMSBinding {
return null;
}
@Override
public Object getCustomBiomeBaseHolderFor(String mckey) {
return null;
}
@Override
public String getKeyForBiomeBase(Object biomeBase) {
return null;

View File

@ -57,7 +57,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
return true;
}
} catch(Throwable e) {
e.printStackTrace();
}
return false;
@ -79,7 +79,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
if(ib.isCustom()) {
try {
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
Object biomeBase = INMS.get().getCustomBiomeBaseFor(getDimension().getLoadKey() + ":" + custom.getId());
Object biomeBase = INMS.get().getCustomBiomeBaseHolderFor(getDimension().getLoadKey() + ":" + custom.getId());
//
if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) {
throw new RuntimeException("Cant inject biome!");

View File

@ -18,6 +18,7 @@
package com.volmit.iris.engine.data.chunk;
import com.volmit.iris.Iris;
import com.volmit.iris.core.nms.BiomeBaseInjector;
import com.volmit.iris.core.nms.INMS;
import com.volmit.iris.util.data.IrisBiomeStorage;