Skip to content

Commit

Permalink
Merge branch 'master' into solarfactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Feb 5, 2025
2 parents adcd451 + e632173 commit 0b69697
Show file tree
Hide file tree
Showing 55 changed files with 404 additions and 752 deletions.
14 changes: 7 additions & 7 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ dependencies {
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.27-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.8:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.10:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
api("com.github.GTNewHorizons:ModularUI2:2.2.3-1.7.10:dev")
api("com.github.GTNewHorizons:ModularUI2:2.2.4-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.2:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-533-GTNH:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-536-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.28-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")
Expand All @@ -56,12 +56,12 @@ dependencies {

devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.10.0-GTNH:dev")

compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.59:dev")
compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.61:dev")

compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta32:api') { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.4:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.42:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.9.2:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.9.3:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.10.1:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.11.1-GTNH:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.16.3:dev") { transitive = false }
Expand All @@ -85,7 +85,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:HoloInventory:2.5.0-GTNH:dev') { transitive = false }
compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384")
compileOnly rfg.deobf('curse.maven:minefactory-reloaded-66672:2366150')
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.5-GTNH:dev") {transitive = false}
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.6-GTNH:dev") {transitive = false}
// https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels
compileOnlyApi rfg.deobf('curse.maven:advsolar-362768:2885953')
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.5-GTNH:dev') {transitive = false}
Expand Down Expand Up @@ -119,7 +119,7 @@ dependencies {
functionalTestImplementation('org.junit.platform:junit-platform-reporting')

runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.9.2:dev')
runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.9.3:dev')

// For testing
//runtimeOnlyNonPublishable('com.github.GTNewHorizons:TCNEIAdditions:1.4.2:dev')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import bartworks.system.material.WerkstoffLoader;
import bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable;
import bartworks.util.BWColorUtil;
import gregtech.api.GregTechAPI;
import gregtech.api.covers.CoverRegistry;
import gregtech.api.enums.GTValues;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
Expand Down Expand Up @@ -201,7 +201,7 @@ public void run(Werkstoff werkstoff) {
final ITexture texture = TextureFactory.of(
Textures.BlockIcons.MACHINE_CASINGS[2][0],
TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false));
GregTechAPI.registerCover(
CoverRegistry.registerCover(
werkstoff.get(lens),
texture,
new CoverLens(BWColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex, texture));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import bartworks.system.material.Werkstoff;
import bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable;
import gregtech.api.GregTechAPI;
import gregtech.api.covers.CoverRegistry;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GTRecipe;
Expand All @@ -47,7 +47,7 @@ public void run(Werkstoff werkstoff) {
1L),
60,
0));
GregTechAPI.registerCover(
CoverRegistry.registerCover(
werkstoff.get(plateDouble),
TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false),
null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import bartworks.system.material.Werkstoff;
import bartworks.system.material.WerkstoffLoader;
import bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable;
import gregtech.api.GregTechAPI;
import gregtech.api.covers.CoverRegistry;
import gregtech.api.enums.GTValues;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.TextureSet;
Expand Down Expand Up @@ -87,7 +87,7 @@ public void run(Werkstoff werkstoff) {
texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)],
werkstoff.getRGBA(),
false) : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false);
GregTechAPI.registerCover(werkstoff.get(plate), texture, null);
CoverRegistry.registerCover(werkstoff.get(plate), texture, null);

return;
}
Expand Down Expand Up @@ -136,7 +136,7 @@ public void run(Werkstoff werkstoff) {
.eut(16)
.addTo(hammerRecipes);

GregTechAPI.registerCover(
CoverRegistry.registerCover(
werkstoff.get(plate),
TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false),
null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ private static void uvRecipes() {
get(cableGt16, NaquadahAlloy, 24),
getIntegratedCircuit(PUMP_CIRCUIT))
.fluidInputs(
INDALLOY_140.getFluidStack(768 * L),
INDALLOY_140.getFluidStack(432 * L),
Lubricant.getFluid(96000),
Naquadah.getMolten(576 * L),
Neutronium.getMolten(450 * L + 96),
Expand Down Expand Up @@ -1161,7 +1161,7 @@ private static void uvRecipes() {
get(wrapCircuit, UHV, 12))
.fluidInputs(
INDALLOY_140.getFluidStack(768 * L),
Neutronium.getMolten(2304 * L),
Americium.getMolten(2304 * L),
NaquadahAlloy.getMolten(768 * L),
Naquadria.getMolten(432 * L))
.duration(24 * MINUTES)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gregtech/GTMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import cpw.mods.fml.common.registry.GameRegistry;
import galacticgreg.SpaceDimRegisterer;
import gregtech.api.GregTechAPI;
import gregtech.api.covers.CoverRegistry;
import gregtech.api.enchants.EnchantmentEnderDamage;
import gregtech.api.enchants.EnchantmentHazmat;
import gregtech.api.enchants.EnchantmentRadioactivity;
Expand Down Expand Up @@ -489,7 +490,7 @@ public void onPostLoad(FMLPostInitializationEvent aEvent) {
.transform(i -> new ItemStack(i, 1, GTValues.W))
.orNull();
if (facade != null) {
GregTechAPI.registerCover(facade, null, new CoverFacadeAE());
CoverRegistry.registerCover(facade, null, new CoverFacadeAE());
}

Arrays
Expand Down
81 changes: 1 addition & 80 deletions src/main/java/gregtech/api/GregTechAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,17 @@
import gregtech.api.enums.GTValues;
import gregtech.api.enums.Materials;
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IDamagableItem;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.internal.IGTRecipeAdder;
import gregtech.api.interfaces.internal.IThaumcraftCompat;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.objects.GTCoverDefault;
import gregtech.api.objects.GTCoverNone;
import gregtech.api.objects.GTHashSet;
import gregtech.api.objects.GTItemStack;
import gregtech.api.threads.RunnableCableUpdate;
import gregtech.api.threads.RunnableMachineUpdate;
import gregtech.api.util.CircuitryBehavior;
import gregtech.api.util.CoverBehavior;
import gregtech.api.util.CoverBehaviorBase;
import gregtech.api.util.GTCreativeTab;
import gregtech.api.util.GTLog;
import gregtech.api.util.GTModHandler;
Expand Down Expand Up @@ -102,14 +96,7 @@ public class GregTechAPI {
TAB_GREGTECH_ORES = new GTCreativeTab("Ores", "Ores");

public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS];
/**
* The Icon List for Covers
*/
public static final Map<GTItemStack, ITexture> sCovers = new ConcurrentHashMap<>();
/**
* The List of Cover Behaviors for the Covers
*/
public static final Map<GTItemStack, CoverBehaviorBase<?>> sCoverBehaviors = new ConcurrentHashMap<>();

/**
* The List of Circuit Behaviors for the Redstone Circuit Block
*/
Expand Down Expand Up @@ -174,10 +161,6 @@ public class GregTechAPI {
* A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
*/
public static final Materials[] sGeneratedMaterials = new Materials[1000];
/**
* This is the generic Cover behavior. Used for the default Covers, which have no Behavior.
*/
public static final CoverBehavior sDefaultBehavior = new GTCoverDefault(), sNoBehavior = new GTCoverNone();
/**
* For the API Version check
*/
Expand Down Expand Up @@ -266,8 +249,6 @@ public class GregTechAPI {
private static final Set<Class<?>> dummyWorlds = new HashSet<>();

static {
sItemStackMappings.add(sCovers);
sItemStackMappings.add(sCoverBehaviors);
dummyWorlds.add(GTDummyWorld.class);
}

Expand Down Expand Up @@ -443,66 +424,6 @@ public static Comparator<ItemStack> getConfigurationCircuitsComparator() {
.thenComparing(ItemStack::getItemDamage);
}

public static void registerCover(ItemStack aStack, ITexture aCover, CoverBehavior aBehavior) {
registerCover(aStack, aCover, (CoverBehaviorBase<?>) aBehavior);
}

public static void registerCover(ItemStack aStack, ITexture aCover, CoverBehaviorBase<?> aBehavior) {
if (!sCovers.containsKey(new GTItemStack(aStack))) sCovers.put(
new GTItemStack(aStack),
aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover);
if (aBehavior != null) sCoverBehaviors.put(new GTItemStack(aStack), aBehavior);
}

public static void registerCoverBehavior(ItemStack aStack, CoverBehavior aBehavior) {
registerCoverBehavior(aStack, (CoverBehaviorBase<?>) aBehavior);
}

public static void registerCoverBehavior(ItemStack aStack, CoverBehaviorBase<?> aBehavior) {
sCoverBehaviors.put(new GTItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior);
}

/**
* Registers multiple Cover Items. I use that for the OreDict Functionality.
*
* @param aBehavior can be null
*/
public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, CoverBehavior aBehavior) {
registerCover(aStackList, aCover, (CoverBehaviorBase<?>) aBehavior);
}

/**
* Registers multiple Cover Items. I use that for the OreDict Functionality.
*
* @param aBehavior can be null
*/
public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover,
CoverBehaviorBase<?> aBehavior) {
if (aCover.isValidTexture()) aStackList.forEach(tStack -> GregTechAPI.registerCover(tStack, aCover, aBehavior));
}

/**
* returns a Cover behavior, guaranteed to not return null after preload
*
* @return The Cover behavior
*/
public static CoverBehaviorBase<?> getCoverBehaviorNew(ItemStack aStack) {
if (aStack == null || aStack.getItem() == null) return sNoBehavior;
CoverBehaviorBase<?> rCover = sCoverBehaviors.get(new GTItemStack(aStack));
if (rCover != null) return rCover;
rCover = sCoverBehaviors.get(new GTItemStack(aStack, true));
if (rCover != null) return rCover;
return sDefaultBehavior;
}

/**
* returns a Cover behavior, guaranteed to not return null
*/
public static CoverBehaviorBase<?> getCoverBehaviorNew(int aStack) {
if (aStack == 0) return sNoBehavior;
return getCoverBehaviorNew(GTUtility.intToStack(aStack));
}

/**
* Register a Wrench to be usable on GregTech Machines. The Wrench MUST have some kind of Durability unlike certain
* Buildcraft Wrenches.
Expand Down
78 changes: 78 additions & 0 deletions src/main/java/gregtech/api/covers/CoverRegistry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package gregtech.api.covers;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;

import gregtech.api.GregTechAPI;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GTCoverDefault;
import gregtech.api.objects.GTCoverNone;
import gregtech.api.objects.GTItemStack;
import gregtech.api.util.CoverBehaviorBase;
import gregtech.api.util.GTUtility;

public class CoverRegistry {

/**
* The Icon List for Covers
*/
private static final Map<GTItemStack, ITexture> coverTextures = new ConcurrentHashMap<>();
/**
* The List of Cover Behaviors for the Covers
*/
private static final Map<GTItemStack, CoverBehaviorBase<?>> coverBehaviors = new ConcurrentHashMap<>();
/**
* This is the generic Cover behavior. Used for the default Covers, which have no Behavior.
*/
private static final CoverBehaviorBase<?> defaultBehavior = new GTCoverDefault(), noBehavior = new GTCoverNone();

static {
GregTechAPI.sItemStackMappings.add(coverTextures);
GregTechAPI.sItemStackMappings.add(coverBehaviors);
}

public static @NotNull CoverBehaviorBase<?> getEmptyCover() {
return noBehavior;
}

public static void registerCover(ItemStack stack, ITexture cover, CoverBehaviorBase<?> behavior) {
if (!coverTextures.containsKey(new GTItemStack(stack))) coverTextures.put(
new GTItemStack(stack),
cover == null || !cover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : cover);
if (behavior != null) coverBehaviors.put(new GTItemStack(stack), behavior);
}

@NotNull
public static CoverBehaviorBase<?> getCoverBehaviorNew(ItemStack stack) {
if (stack == null || stack.getItem() == null) return noBehavior;
CoverBehaviorBase<?> behavior = coverBehaviors.get(new GTItemStack(stack));
if (behavior != null) return behavior;
behavior = coverBehaviors.get(new GTItemStack(stack, true));
if (behavior != null) return behavior;
return defaultBehavior;
}

@NotNull
public static CoverBehaviorBase<?> getCoverBehaviorNew(int coverId) {
if (coverId == 0) return noBehavior;
return getCoverBehaviorNew(GTUtility.intToStack(coverId));
}

public static boolean isCover(@NotNull ItemStack stack) {
return coverTextures.containsKey(new GTItemStack(stack));
}

public static ITexture getCoverTexture(int coverId) {
return coverTextures.get(new GTItemStack(coverId));
}

public static void reloadCoverColorOverrides() {
coverBehaviors.values()
.forEach(CoverBehaviorBase::reloadColorOverride);
}
}
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/enums/OreMixes.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public enum OreMixes {
.localize(Materials.RareEarth)),

RichNuclear(new OreMixBuilder().name("ore.mix.richnuclear")
.heightRange(55, 120)
.heightRange(5, 40)
.weight(5)
.density(2)
.size(8)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gregtech.api.interfaces.tileentity;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
Expand All @@ -25,7 +26,14 @@ default void setCoverDataAtSide(ForgeDirection side, ISerializableObject aData)

boolean setCoverIDAtSideNoUpdate(ForgeDirection side, int aID);

void setCoverItemAtSide(ForgeDirection side, ItemStack aCover);
/**
* Called when the cover is initially attached to a machine.
*
* @param player The attaching player
* @param aCover An {@link ItemStack} containing the cover
* @param side Which side the cover is attached to
*/
void attachCover(EntityPlayer player, ItemStack aCover, ForgeDirection side);

default CoverInfo getCoverInfoAtSide(ForgeDirection side) {
return null;
Expand Down
Loading

0 comments on commit 0b69697

Please sign in to comment.