Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump gt, fix rename #53

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ dependencies {
shadowImplementation('com.github.GTNewHorizons:Enklume:2.1.0:dev')

api('com.github.GTNewHorizons:Navigator:1.0.6:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.117:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.57:dev')

// For debugging
runtimeOnlyNonPublishable('com.github.GTNewHorizons:DetravScannerMod:1.8.1:dev')
runtimeOnlyNonPublishable(rfg.deobf('maven.modrinth:journeymap:5.2.5'))

}
4 changes: 2 additions & 2 deletions src/main/java/com/sinthoras/visualprospecting/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.sinthoras.visualprospecting.hooks.HooksClient;

import cpw.mods.fml.common.Loader;
import gregtech.common.GT_Worldgenerator;
import gregtech.common.GTWorldgenerator;

public class Utils {

Expand Down Expand Up @@ -70,7 +70,7 @@ public static long chunkCoordsToKey(int chunkX, int chunkZ) {
}

public static int mapToCenterOreChunkCoord(final int chunkCoord) {
if (GT_Worldgenerator.oregenPattern == GT_Worldgenerator.OregenPattern.EQUAL_SPACING) {
if (GTWorldgenerator.oregenPattern == GTWorldgenerator.OregenPattern.EQUAL_SPACING) {
// new evenly spaced ore pattern
return chunkCoord - Math.floorMod(chunkCoord, 3) + 1;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/sinthoras/visualprospecting/VPMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import gregtech.crossmod.visualprospecting.GT_VisualProspecting_Database;
import gregtech.crossmod.visualprospecting.VisualProspectingDatabase;

@Mod(
modid = Tags.MODID,
Expand Down Expand Up @@ -47,7 +47,7 @@ public void fmlLifeCycleEvent(FMLInitializationEvent event) {
public void fmlLifeCycle(FMLPostInitializationEvent event) {
VP.debug("postInit()");
VP.debug("Registering with the GT5U ore vein database");
GT_VisualProspecting_Database.registerDatabase(new VeinDatabase());
VisualProspectingDatabase.registerDatabase(new VeinDatabase());
proxy.fmlLifeCycleEvent(event);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sinthoras.visualprospecting.hooks.ProspectingNotificationEvent;
import com.sinthoras.visualprospecting.network.ProspectingRequest;

import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.common.blocks.TileEntityOres;

public class ClientCache extends WorldCache {

Expand Down Expand Up @@ -130,8 +130,8 @@ public void putUndergroundFluids(List<UndergroundFluidPosition> undergroundFluid
public void onOreInteracted(World world, int blockX, int blockY, int blockZ, EntityPlayer entityPlayer) {
if (world.isRemote && Config.enableProspecting && Minecraft.getMinecraft().thePlayer == entityPlayer) {
final TileEntity tTileEntity = world.getTileEntity(blockX, blockY, blockZ);
if (tTileEntity instanceof GT_TileEntity_Ores) {
final short oreMetaData = ((GT_TileEntity_Ores) tTileEntity).mMetaData;
if (tTileEntity instanceof TileEntityOres) {
final short oreMetaData = ((TileEntityOres) tTileEntity).mMetaData;
if (Utils.isSmallOreId(oreMetaData) == false && oreMetaData != 0) {
final int chunkX = Utils.coordBlockToChunk(blockX);
final int chunkZ = Utils.coordBlockToChunk(blockZ);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.sinthoras.visualprospecting.database.veintypes;

import static com.github.bartimaeusnek.bartworks.util.BW_ColorUtil.getColorFromRGBArray;
import static bartworks.util.BWColorUtil.getColorFromRGBArray;

import net.minecraft.util.IIcon;

import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;

import bartworks.system.material.Werkstoff;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.OrePrefixes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import com.sinthoras.visualprospecting.Tags;

import gregtech.api.GregTech_API;
import gregtech.api.GregTechAPI;

public class VeinType {

Expand Down Expand Up @@ -83,7 +83,7 @@ public boolean containsOre(short oreMetaData) {
}

public List<String> getOreMaterialNames() {
return oresAsSet.stream().map(metaData -> GregTech_API.sGeneratedMaterials[metaData]).filter(Objects::nonNull)
return oresAsSet.stream().map(metaData -> GregTechAPI.sGeneratedMaterials[metaData]).filter(Objects::nonNull)
.map(material -> EnumChatFormatting.GRAY + material.mLocalizedName).collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
import net.minecraft.client.resources.I18n;
import net.minecraft.util.EnumChatFormatting;

import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.sinthoras.visualprospecting.Tags;
import com.sinthoras.visualprospecting.Utils;

import bartworks.system.material.Werkstoff;
import bartworks.system.oregen.BWOreLayer;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.SearchField;
import gregtech.api.GregTech_API;
import gregtech.api.GregTechAPI;
import gregtech.api.enums.Materials;
import gregtech.common.GT_Worldgen_GT_Ore_Layer;
import gregtech.common.WorldgenGTOreLayer;

public class VeinTypeCaching implements Runnable {

Expand All @@ -47,7 +47,7 @@ public void run() {
largeVeinOres = new HashSet<>();
veinTypes.add(VeinType.NO_VEIN);

for (GT_Worldgen_GT_Ore_Layer vein : GT_Worldgen_GT_Ore_Layer.sList) {
for (WorldgenGTOreLayer vein : WorldgenGTOreLayer.sList) {
if (vein.mWorldGenName.equals(Tags.ORE_MIX_NONE_NAME)) {
break;
}
Expand All @@ -69,7 +69,7 @@ public void run() {
}

if (isBartworksInstalled()) {
for (BW_OreLayer vein : BW_OreLayer.sList) {
for (BWOreLayer vein : BWOreLayer.sList) {
final IOreMaterialProvider oreMaterialProvider = (vein.bwOres & 0b1000) == 0
? new GregTechOreMaterialProvider(getGregTechMaterial((short) vein.mPrimaryMeta))
: new BartworksOreMaterialProvider(Werkstoff.werkstoffHashMap.get((short) vein.mPrimaryMeta));
Expand Down Expand Up @@ -126,7 +126,7 @@ public void run() {
}

private Materials getGregTechMaterial(short metaId) {
final Materials material = GregTech_API.sGeneratedMaterials[metaId];
final Materials material = GregTechAPI.sGeneratedMaterials[metaId];
if (material == null) {
// Some materials are not registered in dev when their usage mod is not available.
return Materials.getAll().stream().filter(m -> m.mMetaItemSubID == metaId).findAny().get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import gregtech.api.GregTech_API;
import gregtech.api.GregTechAPI;

public class HooksShared {

Expand Down Expand Up @@ -79,7 +79,7 @@ public void fmlLifeCycleEvent(FMLInitializationEvent event) {

// postInit "Handle interaction with other mods, complete your setup based on this."
public void fmlLifeCycleEvent(FMLPostInitializationEvent event) {
GregTech_API.sAfterGTPostload.add(new VeinTypeCaching());
GregTechAPI.sAfterGTPostload.add(new VeinTypeCaching());
}

public void fmlLifeCycleEvent(FMLServerAboutToStartEvent event) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.sinthoras.visualprospecting.integration.gregtech;

import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
import static gregtech.common.GT_Proxy.*;
import static gregtech.common.GT_Proxy.GTOIL;
import static gregtech.common.GT_UndergroundOil.undergroundOil;
import static gregtech.common.GTProxy.*;
import static gregtech.common.GTProxy.GTOIL;
import static gregtech.common.UndergroundOil.undergroundOil;

import java.util.HashMap;
import java.util.Map;
Expand All @@ -13,11 +13,11 @@
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;

import gregtech.GT_Mod;
import gregtech.api.objects.GT_UO_Dimension;
import gregtech.api.objects.GT_UO_Fluid;
import gregtech.GTMod;
import gregtech.api.objects.GTUODimension;
import gregtech.api.objects.GTUOFluid;
import gregtech.api.objects.XSTR;
import gregtech.common.GT_UndergroundOil;
import gregtech.common.UndergroundOil;

public class UndergroundFluidsWrapper {

Expand All @@ -27,7 +27,7 @@ public class UndergroundFluidsWrapper {
static {
boolean foundMethod;
try {
GT_UndergroundOil.class.getDeclaredMethod("undergroundOil", World.class, int.class, int.class, float.class);
UndergroundOil.class.getDeclaredMethod("undergroundOil", World.class, int.class, int.class, float.class);
foundMethod = true;
} catch (NoSuchMethodException e) {
foundMethod = false;
Expand All @@ -49,7 +49,7 @@ public static FluidStack prospectFluid(World world, int chunkX, int chunkZ) {
private static FluidStack vanillaProspectFluid(World world, int chunkX, int chunkZ) {
final ChunkCoordIntPair chunkCoordinate = new ChunkCoordIntPair(chunkX, chunkZ);
int dimensionId = world.provider.dimensionId;
GT_UO_Dimension dimension = GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(dimensionId);
GTUODimension dimension = GTMod.gregtechproxy.mUndergroundOil.GetDimension(dimensionId);
if (dimension == null) {
return null;
}
Expand All @@ -67,7 +67,7 @@ private static FluidStack vanillaProspectFluid(World world, int chunkX, int chun

final XSTR tRandom = new XSTR(world.getSeed() + dimensionId * 2L + (chunkX >> 3) + 8267L * (chunkZ >> 3));

GT_UO_Fluid uoFluid = dimension.getRandomFluid(tRandom);
GTUOFluid uoFluid = dimension.getRandomFluid(tRandom);

FluidStack fluidInChunk;

Expand All @@ -92,11 +92,11 @@ private static FluidStack vanillaProspectFluid(World world, int chunkX, int chun
tInts[GTOILFLUID] = fluidInChunk.getFluidID();
}

if (fluidInChunk.amount <= GT_UndergroundOil.DIVIDER) {
if (fluidInChunk.amount <= UndergroundOil.DIVIDER) {
fluidInChunk.amount = 0; // return informative stack
tInts[GTOIL] = 0; // so in next access it will stop way above
} else {
fluidInChunk.amount = fluidInChunk.amount / GT_UndergroundOil.DIVIDER; // give moderate extraction speed
fluidInChunk.amount = fluidInChunk.amount / UndergroundOil.DIVIDER; // give moderate extraction speed
}

chunkData.put(chunkCoordinate, tInts); // update hash map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.sinthoras.visualprospecting.hooks.ProspectingNotificationEvent;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.GregTech_API;
import gregtech.api.GregTechAPI;

public class VoxelMapEventHandler {

Expand All @@ -26,7 +26,7 @@ public void onVeinProspected(ProspectingNotificationEvent.OreVein event) {
}

OreVeinPosition pos = event.getPosition();
short[] color = GregTech_API.sGeneratedMaterials[pos.veinType.primaryOreMeta].getRGBA();
short[] color = GregTechAPI.sGeneratedMaterials[pos.veinType.primaryOreMeta].getRGBA();
TreeSet<Integer> dim = new TreeSet<>();
dim.add(pos.dimensionId);
VoxelMapWaypointManager.addVoxelMapWaypoint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.sinthoras.visualprospecting.task.SnapshotUploadTask;
import com.sinthoras.visualprospecting.task.TaskManager;

import gregtech.api.GregTech_API;
import gregtech.api.GregTechAPI;

public class ProspectorsLog extends Item {

Expand All @@ -29,7 +29,7 @@ public class ProspectorsLog extends Item {
public ProspectorsLog() {
maxStackSize = 1;
setUnlocalizedName("visualprospecting.prospectorslog");
setCreativeTab(GregTech_API.TAB_GREGTECH);
setCreativeTab(GregTechAPI.TAB_GREGTECH);
setTextureName(Tags.MODID + ":prospectorslog");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator;
import com.sinthoras.visualprospecting.Utils;
import com.sinthoras.visualprospecting.database.ServerCache;

@Mixin(BW_WordGenerator.WorldGenContainer.class)
import bartworks.system.oregen.BWOreLayer;
import bartworks.system.oregen.BWWordGenerator;

@Mixin(BWWordGenerator.WorldGenContainer.class)
public class WorldGenContainerMixin {

@Redirect(
method = "run",
at = @At(
value = "INVOKE",
target = "Lcom/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer;executeWorldgen(Lnet/minecraft/world/World;Ljava/util/Random;Ljava/lang/String;IIILnet/minecraft/world/chunk/IChunkProvider;Lnet/minecraft/world/chunk/IChunkProvider;)Z"),
target = "Lbartworks/system/oregen/BWOreLayer;executeWorldgen(Lnet/minecraft/world/World;Ljava/util/Random;Ljava/lang/String;IIILnet/minecraft/world/chunk/IChunkProvider;Lnet/minecraft/world/chunk/IChunkProvider;)Z"),
remap = false,
require = 1)
private boolean visualprospecting$onOreVeinGenerationAttempt(BW_OreLayer worldGen, World world, Random random,
private boolean visualprospecting$onOreVeinGenerationAttempt(BWOreLayer worldGen, World world, Random random,
String biome, int dimensionType, int blockX, int blockZ, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
final boolean oreVeinPlaced = worldGen.executeWorldgen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
import com.sinthoras.visualprospecting.Utils;
import com.sinthoras.visualprospecting.database.ServerCache;

import bloodasp.galacticgreg.GT_Worldgenerator_Space;
import gregtech.api.world.GT_Worldgen;
import galacticgreg.WorldGeneratorSpace;
import gregtech.api.world.GTWorldgen;

@Mixin(GT_Worldgenerator_Space.class)
@Mixin(WorldGeneratorSpace.class)
public class GT_Worldgenerator_SpaceMixin {

@Redirect(
method = "Generate_OreVeins",
at = @At(
value = "INVOKE",
target = "Lgregtech/api/world/GT_Worldgen;executeWorldgen(Lnet/minecraft/world/World;Ljava/util/Random;Ljava/lang/String;IIILnet/minecraft/world/chunk/IChunkProvider;Lnet/minecraft/world/chunk/IChunkProvider;)Z"),
target = "Lgregtech/api/world/GTWorldgen;executeWorldgen(Lnet/minecraft/world/World;Ljava/util/Random;Ljava/lang/String;IIILnet/minecraft/world/chunk/IChunkProvider;Lnet/minecraft/world/chunk/IChunkProvider;)Z"),
remap = false,
require = 1)
private boolean visualprospecting$onOreVeinGenerated(GT_Worldgen worldGen, World world, Random random, String biome,
private boolean visualprospecting$onOreVeinGenerated(GTWorldgen worldGen, World world, Random random, String biome,
int dimensionType, int blockX, int blockZ, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
final boolean oreVeinPlaced = worldGen.executeWorldgen(
world,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import com.sinthoras.visualprospecting.database.ClientCache;

import gregtech.api.items.GT_Generic_Block;
import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.api.items.GTGenericBlock;
import gregtech.common.blocks.BlockOresAbstract;

@Mixin(value = GT_Block_Ores_Abstract.class, remap = false)
public class GT_Block_Ores_AbstractMixin extends GT_Generic_Block {
@Mixin(value = BlockOresAbstract.class, remap = false)
public class GT_Block_Ores_AbstractMixin extends GTGenericBlock {

protected GT_Block_Ores_AbstractMixin() {
super(null, null, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sinthoras.visualprospecting.mixins.late.gregtech;

import static gregtech.api.util.GT_Utility.ItemNBT.getNBT;
import static gregtech.api.util.GT_Utility.ItemNBT.setNBT;
import static gregtech.api.util.GTUtility.ItemNBT.getNBT;
import static gregtech.api.util.GTUtility.ItemNBT.setNBT;

import java.util.List;

Expand All @@ -25,13 +25,13 @@
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_AdvSeismicProspector;
import gregtech.api.metatileentity.implementations.MTEBasicMachine;
import gregtech.api.util.GTUtility;
import gregtech.common.tileentities.machines.basic.MTEAdvSeismicProspector;
import ic2.core.Ic2Items;

@Mixin(value = GT_MetaTileEntity_AdvSeismicProspector.class, remap = false)
public abstract class GT_MetaTileEntity_AdvSeismicProspectorMixin extends GT_MetaTileEntity_BasicMachine {
@Mixin(value = MTEAdvSeismicProspector.class, remap = false)
public abstract class GT_MetaTileEntity_AdvSeismicProspectorMixin extends MTEBasicMachine {

@Shadow(remap = false)
boolean ready = false;
Expand All @@ -53,10 +53,10 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye
if (aBaseMetaTileEntity.isServerSide()) {
ItemStack aStack = aPlayer.getCurrentEquippedItem();

if (!ready && (GT_Utility.consumeItems(aPlayer, aStack, Item.getItemFromBlock(Blocks.tnt), 16)
|| GT_Utility.consumeItems(aPlayer, aStack, Ic2Items.industrialTnt.getItem(), 8)
|| GT_Utility.consumeItems(aPlayer, aStack, Materials.Glyceryl, 4)
|| GT_Utility.consumeItems(aPlayer, aStack, ItemList.Block_Powderbarrel.getItem(), 2))) {
if (!ready && (GTUtility.consumeItems(aPlayer, aStack, Item.getItemFromBlock(Blocks.tnt), 16)
|| GTUtility.consumeItems(aPlayer, aStack, Ic2Items.industrialTnt.getItem(), 8)
|| GTUtility.consumeItems(aPlayer, aStack, Materials.Glyceryl, 4)
|| GTUtility.consumeItems(aPlayer, aStack, ItemList.Block_Powderbarrel.getItem(), 2))) {

this.ready = true;
this.mMaxProgresstime = (aPlayer.capabilities.isCreativeMode ? 20 : 800);
Expand Down
Loading