mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Fixed Oraxen, and custom dimension height.
This commit is contained in:
parent
5658d6709c
commit
c3de8b33de
@ -23,6 +23,8 @@ public abstract class BlockDataProvider {
|
|||||||
return getPlugin() != null;
|
return getPlugin() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract void init();
|
||||||
|
|
||||||
public abstract BlockData getBlockData(NamespacedKey blockId) throws MissingResourceException;
|
public abstract BlockData getBlockData(NamespacedKey blockId) throws MissingResourceException;
|
||||||
|
|
||||||
public abstract NamespacedKey[] getBlockTypes();
|
public abstract NamespacedKey[] getBlockTypes();
|
||||||
|
@ -14,6 +14,9 @@ public class ItemAdderLink extends BlockDataProvider {
|
|||||||
super("ItemsAdder");
|
super("ItemsAdder");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() { }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockData getBlockData(NamespacedKey blockId) throws MissingResourceException {
|
public BlockData getBlockData(NamespacedKey blockId) throws MissingResourceException {
|
||||||
return CustomBlock.getBaseBlockData(blockId.toString());
|
return CustomBlock.getBaseBlockData(blockId.toString());
|
||||||
|
@ -43,17 +43,17 @@ public class OraxenDataProvider extends BlockDataProvider {
|
|||||||
|
|
||||||
private Map<String, MechanicFactory> factories;
|
private Map<String, MechanicFactory> factories;
|
||||||
|
|
||||||
public OraxenDataProvider() {
|
public OraxenDataProvider() { super("Oraxen"); }
|
||||||
super("Oraxen");
|
|
||||||
if(getPlugin() != null) {
|
@Override
|
||||||
try {
|
public void init() {
|
||||||
Field f = MechanicsManager.class.getDeclaredField(FIELD_FACTORIES_MAP);
|
try {
|
||||||
f.setAccessible(true);
|
Field f = MechanicsManager.class.getDeclaredField(FIELD_FACTORIES_MAP);
|
||||||
factories = (Map<String, MechanicFactory>) f.get(null);
|
f.setAccessible(true);
|
||||||
} catch(NoSuchFieldException | IllegalAccessException e) {
|
factories = (Map<String, MechanicFactory>) f.get(null);
|
||||||
Iris.error("Failed to set up Oraxen Link:");
|
} catch(NoSuchFieldException | IllegalAccessException e) {
|
||||||
Iris.error("\t" + e.getClass().getSimpleName());
|
Iris.error("Failed to set up Oraxen Link:");
|
||||||
}
|
Iris.error("\t" + e.getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,11 @@ public class CustomBlockDataSVC implements IrisService {
|
|||||||
public void onDisable() { }
|
public void onDisable() { }
|
||||||
|
|
||||||
public void addProvider(BlockDataProvider... provider) {
|
public void addProvider(BlockDataProvider... provider) {
|
||||||
providers.add(provider);
|
for(BlockDataProvider p : provider) {
|
||||||
|
if(p.getPlugin() != null)
|
||||||
|
providers.add(p);
|
||||||
|
p.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<BlockData> getBlockData(NamespacedKey key) {
|
public Optional<BlockData> getBlockData(NamespacedKey key) {
|
||||||
|
@ -164,8 +164,6 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
if(yy + (finalI << 4) >= engine.getHeight() || yy + (finalI << 4) < 0) {
|
if(yy + (finalI << 4) >= engine.getHeight() || yy + (finalI << 4) < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iris.warn("Min: " + world.getMinHeight() + " | Max: " + world.getMaxHeight());
|
|
||||||
c.getBlock(xx, yy + (finalI << 4) + world.getMinHeight(), zz)
|
c.getBlock(xx, yy + (finalI << 4) + world.getMinHeight(), zz)
|
||||||
.setBlockData(tc.getBlockData(xx, yy + (finalI << 4) + world.getMinHeight(), zz), false);
|
.setBlockData(tc.getBlockData(xx, yy + (finalI << 4) + world.getMinHeight(), zz), false);
|
||||||
}
|
}
|
||||||
|
@ -21,4 +21,5 @@ commands:
|
|||||||
iris:
|
iris:
|
||||||
aliases: [ ir, irs ]
|
aliases: [ ir, irs ]
|
||||||
api-version: ${apiversion}
|
api-version: ${apiversion}
|
||||||
hotload-dependencies: false
|
hotload-dependencies: false
|
||||||
|
softdepend: [ "Oraxen", "ItemsAdder", "IrisFeller"]
|
Loading…
x
Reference in New Issue
Block a user