Structure fix
This commit is contained in:
parent
bb0e54ad25
commit
5129403d89
2 changed files with 14 additions and 5 deletions
|
@ -8,7 +8,6 @@ import com.google.common.collect.Lists;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
import net.minecraft.structure.Structure;
|
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import ru.betterend.config.Configs;
|
import ru.betterend.config.Configs;
|
||||||
|
@ -146,7 +145,7 @@ public class EndBiome {
|
||||||
List<StructureInfo> list = Lists.newArrayList();
|
List<StructureInfo> list = Lists.newArrayList();
|
||||||
enties.forEach((entry) -> {
|
enties.forEach((entry) -> {
|
||||||
JsonObject e = entry.getAsJsonObject();
|
JsonObject e = entry.getAsJsonObject();
|
||||||
Structure structure = StructureHelper.readStructure(path + e.get("nbt").getAsString() + ".nbt");
|
String structure = path + e.get("nbt").getAsString() + ".nbt";
|
||||||
TerrainMerge terrainMerge = TerrainMerge.getFromString(e.get("terrainMerge").getAsString());
|
TerrainMerge terrainMerge = TerrainMerge.getFromString(e.get("terrainMerge").getAsString());
|
||||||
int offsetY = e.get("offsetY").getAsInt();
|
int offsetY = e.get("offsetY").getAsInt();
|
||||||
list.add(new StructureInfo(structure, offsetY, terrainMerge));
|
list.add(new StructureInfo(structure, offsetY, terrainMerge));
|
||||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.util.BlockRotation;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.StructureWorldAccess;
|
import net.minecraft.world.StructureWorldAccess;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
|
import ru.betterend.util.StructureHelper;
|
||||||
|
|
||||||
public class ListFeature extends NBTStructureFeature {
|
public class ListFeature extends NBTStructureFeature {
|
||||||
private final List<StructureInfo> list;
|
private final List<StructureInfo> list;
|
||||||
|
@ -57,13 +58,22 @@ public class ListFeature extends NBTStructureFeature {
|
||||||
|
|
||||||
public static final class StructureInfo {
|
public static final class StructureInfo {
|
||||||
public final TerrainMerge terrainMerge;
|
public final TerrainMerge terrainMerge;
|
||||||
public final Structure structure;
|
public final String structurePath;
|
||||||
public final int offsetY;
|
public final int offsetY;
|
||||||
|
|
||||||
public StructureInfo(Structure structure, int offsetY, TerrainMerge terrainMerge) {
|
private Structure structure;
|
||||||
|
|
||||||
|
public StructureInfo(String structurePath, int offsetY, TerrainMerge terrainMerge) {
|
||||||
this.terrainMerge = terrainMerge;
|
this.terrainMerge = terrainMerge;
|
||||||
this.structure = structure;
|
this.structurePath = structurePath;
|
||||||
this.offsetY = offsetY;
|
this.offsetY = offsetY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Structure getStructure() {
|
||||||
|
if (structure == null) {
|
||||||
|
structure = StructureHelper.readStructure(structurePath);
|
||||||
|
}
|
||||||
|
return structure;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue