Fixed Oraxen, and custom dimension height.

This commit is contained in:
Vatuu 2022-05-14 18:29:57 +02:00
parent 192538a741
commit 5658d6709c
No known key found for this signature in database
GPG Key ID: C6F07B79B2ED9150
4 changed files with 26 additions and 24 deletions

View File

@ -45,14 +45,15 @@ public class OraxenDataProvider extends BlockDataProvider {
public OraxenDataProvider() {
super("Oraxen");
try {
Field f = MechanicsManager.class.getDeclaredField(FIELD_FACTORIES_MAP);
f.setAccessible(true);
factories = (Map<String, MechanicFactory>) f.get(null);
} catch(NoSuchFieldException | IllegalAccessException e) {
Iris.error("Failed to set up Oraxen Link:");
Iris.error("\t" + e.getClass().getSimpleName());
if(getPlugin() != null) {
try {
Field f = MechanicsManager.class.getDeclaredField(FIELD_FACTORIES_MAP);
f.setAccessible(true);
factories = (Map<String, MechanicFactory>) f.get(null);
} catch(NoSuchFieldException | IllegalAccessException e) {
Iris.error("Failed to set up Oraxen Link:");
Iris.error("\t" + e.getClass().getSimpleName());
}
}
}

View File

@ -62,7 +62,7 @@ public class CustomBlockDataSVC implements IrisService {
public NamespacedKey[] getAllIdentifiers() {
KList<NamespacedKey> names = new KList<>();
providers.forEach(p -> names.add(p.getBlockTypes()));
providers.stream().filter(BlockDataProvider::isPresent).forEach(p -> names.add(p.getBlockTypes()));
return names.toArray(new NamespacedKey[0]);
}
}

View File

@ -74,6 +74,7 @@ public class IrisDimension extends IrisRegistrant {
@MaxNumber(2032)
@Desc("Maximum height at which players can be teleported to through gameplay.")
private int logicalHeight = 256;
@RegistryListResource(IrisJigsawStructure.class)
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
private String stronghold;
@ -405,19 +406,20 @@ public class IrisDimension extends IrisRegistrant {
}
}
/* if(!dimensionHeight.equals(new IrisRange(-64, 320))) {
File dimType = new File(datapacks, "iris/data/minecraft/dimension_type/" + getLoadKey().toLowerCase() + ".json");
if(!dimType.exists())
changed = true;
if(!dimensionHeight.equals(new IrisRange(-64, 320)) && this.name.equalsIgnoreCase("overworld")) {
File dimType = new File(datapacks, "iris/data/minecraft/dimension_type/overworld.json");
if(!dimType.exists())
changed = true;
Iris.verbose(" Installing Data Pack Dimension Type: " + dimType.getPath());
dimType.getParentFile().mkdirs();
try {
IO.writeAll(dimType, generateDatapackJson());
} catch(IOException e) {
Iris.reportError(e);
e.printStackTrace();
}*/
Iris.verbose(" Installing Data Pack Dimension Type: " + dimType.getPath());
dimType.getParentFile().mkdirs();
try {
IO.writeAll(dimType, generateDatapackJson());
} catch(IOException e) {
Iris.reportError(e);
e.printStackTrace();
}
}
if(write) {
File mcm = new File(datapacks, "iris/pack.mcmeta");
@ -465,19 +467,17 @@ public class IrisDimension extends IrisRegistrant {
private static final String DP_OVERWORLD_DEFAULT = """
{
"name": "minecraft:overworld",
"ultrawarm": false,
"natural": true,
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0,
"fixed_time": false,
"piglin_safe": false,
"bed_works": true,
"respawn_anchor_works": false,
"has_raids": true,
"infiniburn": "infiniburn_overworld",
"infiniburn": "#minecraft:infiniburn_overworld",
"effects": "minecraft:overworld"
}""";
}

View File

@ -165,6 +165,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
continue;
}
Iris.warn("Min: " + world.getMinHeight() + " | Max: " + world.getMaxHeight());
c.getBlock(xx, yy + (finalI << 4) + world.getMinHeight(), zz)
.setBlockData(tc.getBlockData(xx, yy + (finalI << 4) + world.getMinHeight(), zz), false);
}