Swap to new ore natural API (#102)

Co-authored-by: Ethryan <3237986+Ethryan@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
authored and GitHub committed 2025-10-12 12:22:12 +00:00
1 parent 8bb7b1dd9b
commit 28d7b599f8
2 files changed
+16 -9

No files matched your search

+4 -4
View File
@@ -24,15 +24,15 @@
dependencies {
api("com.github.GTNewHorizons:waila:1.9.0:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.8.0-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.8.9-GTNH:dev")
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.02:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.31:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.13.0-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.13.3-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.17:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.8:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.16.13-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.17.0-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.2:dev") {transitive = false }
@@ -10,14 +10,16 @@ import java.util.Random;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.gtnewhorizon.gtnhlib.util.data.ImmutableBlockMeta;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.common.blocks.TileEntityOres;
import gregtech.common.ores.OreInfo;
import gregtech.common.ores.OreManager;
public class Meteor {
@@ -230,9 +232,14 @@ public class Meteor {
@Optional.Method(modid = "gregtech")
private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) {
final TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityOres) {
((TileEntityOres) tileEntity).mNatural = true;
try (OreInfo<?> info = OreManager.getOreInfo(world, x, y, z)) {
if (info == null) return;
info.isNatural = true;
ImmutableBlockMeta bm = OreManager.getAdapter(info).getBlock(info);
world.setBlock(x, y, z, bm.getBlock(), bm.getBlockMeta(), 2);
}
}
}