Fixes and tweaks

This commit is contained in:
Daniel Mills 2021-07-04 23:40:46 -04:00
parent 1857cca081
commit d2015845e8
3 changed files with 16 additions and 7 deletions

View File

@ -14,6 +14,9 @@ import com.volmit.iris.scaffold.parallel.MultiBurst;
import com.volmit.iris.util.*;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.core.BlockPosition;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.StructureGenerator;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.block.Biome;
@ -68,8 +71,7 @@ public class IrisEngineCompound implements EngineCompound {
engineMetadata.setDimension(rootDimension.getLoadKey());
engineMetadata.setLastVersion(Iris.instance.getDescription().getVersion());
// TODO: In nms class, not here. Also it doesnt work
if(engineMetadata.getStrongholdPositions() == null || engineMetadata.getStrongholdPositions().size() == 0)
{
if(!(world instanceof FakeWorld || world instanceof HeightedFakeWorld))
@ -172,7 +174,7 @@ public class IrisEngineCompound implements EngineCompound {
Iris.instance.registerListener(this);
}
private Object getBP(Class clazz, Class clazzSG, Class clazzBP, Object nmsWorld, Object chunkGenerator) throws NoSuchFieldException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
private Object getBP(Class<?> clazz, Class<?> clazzSG, Class<?> clazzBP, Object nmsWorld, Object chunkGenerator) throws NoSuchFieldException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
return clazz.getDeclaredMethod("findNearestMapFeature",
nmsWorld.getClass(),
clazzSG,
@ -181,14 +183,14 @@ public class IrisEngineCompound implements EngineCompound {
boolean.class
).invoke(chunkGenerator,
nmsWorld,
clazzSG.getDeclaredField("STRONGHOLD").get(null),
clazzBP.getDeclaredField("ZERO").get(null),
clazzSG.getDeclaredField("k").get(null),
clazzBP.getDeclaredField("b").get(null),
100,
false
);
}
public CompletableFuture<Object> getBPSafe(Class clazz, Class clazzSG, Class clazzBP, Object nmsWorld, Object chunkGenerator) {
public CompletableFuture<Object> getBPSafe(Class<?> clazz, Class<?> clazzSG, Class<?> clazzBP, Object nmsWorld, Object chunkGenerator) {
CompletableFuture<Object> cf = new CompletableFuture<>();
Bukkit.getScheduler().runTask(Iris.instance, () -> {
try {

View File

@ -47,6 +47,11 @@ public class IrisJigsawStructure extends IrisRegistrant
private void loadPool(String p, KList<String> pools, KList<String> pieces)
{
if(p.isEmpty())
{
return;
}
IrisJigsawPool pool = getLoader().getJigsawPoolLoader().load(p);
if(pool == null)

View File

@ -18,6 +18,7 @@ import org.bukkit.Chunk;
import org.bukkit.ChunkSnapshot;
import org.bukkit.block.TileState;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_17_R1.util.CraftMagicNumbers;
import org.bukkit.util.BlockVector;
import org.bukkit.util.Consumer;
@ -638,7 +639,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
catch(Throwable e)
{
Iris.error("THIS IS THE ONE");
e.printStackTrace();
}
}