Skip to content

Commit

Permalink
Merge branch 'master' into buff
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Dec 25, 2024
2 parents 03e69f5 + f15ecc1 commit bbf8fe6
Show file tree
Hide file tree
Showing 28 changed files with 202 additions and 39 deletions.
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
dependencies {
api("com.github.GTNewHorizons:StructureLib:1.4.0:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.2-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
api("com.github.GTNewHorizons:ModularUI2:2.1.16-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.2:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-504-GTNH:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-507-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.0-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")
Expand Down Expand Up @@ -70,7 +70,7 @@ dependencies {
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.8.0:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderCore:0.4.6:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.28:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.100-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.104-GTNH:dev") { transitive = false }

compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.8-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.13.0-GTNH:dev")
Expand All @@ -81,7 +81,7 @@ dependencies {
compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false }
implementation("com.github.GTNewHorizons:Hodgepodge:2.6.6:dev")
compileOnly('com.github.GTNewHorizons:Botania:1.12.1-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:Botania:1.12.2-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.13-GTNH:dev') { transitive = false }
compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384")
compileOnly rfg.deobf('curse.maven:minefactory-reloaded-66672:2366150')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

public enum IDDetraveMetaGeneratedTool01 {

ProspectorScannerULV(0),
ProspectorScannerLV(2),
ProspectorScannerMV(4),
ProspectorScannerHV(6),
Expand Down
18 changes: 0 additions & 18 deletions src/main/java/detrav/items/DetravMetaGeneratedTool01.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import static detrav.enums.IDDetraveMetaGeneratedTool01.ProspectorScannerLuV;
import static detrav.enums.IDDetraveMetaGeneratedTool01.ProspectorScannerMV;
import static detrav.enums.IDDetraveMetaGeneratedTool01.ProspectorScannerUHV;
import static detrav.enums.IDDetraveMetaGeneratedTool01.ProspectorScannerULV;
import static detrav.enums.IDDetraveMetaGeneratedTool01.ProspectorScannerUV;
import static detrav.enums.IDDetraveMetaGeneratedTool01.ProspectorScannerZPM;
import static gregtech.api.enums.Mods.NewHorizonsCoreMod;
Expand Down Expand Up @@ -47,15 +46,6 @@ public class DetravMetaGeneratedTool01 extends MetaGeneratedTool {
public DetravMetaGeneratedTool01() {
super("detrav.metatool.01");
INSTANCE = this;
addTool(
ProspectorScannerULV.ID,
"Prospector's Scanner(ULV)",
"",
new DetravProspector(0),
DetravToolDictNames.craftingToolProspector.toString(),
new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L),
new TCAspects.TC_AspectStack(TCAspects.METALLUM, 4L),
new TCAspects.TC_AspectStack(TCAspects.PERFODIO, 4L));
addTool(
ProspectorScannerLV.ID,
"Prospector's Scanner(LV)",
Expand Down Expand Up @@ -298,13 +288,6 @@ public void getDetravSubItems(Item item, CreativeTabs detravCreativeTab, List li
ItemStack dStack;
if (NewHorizonsCoreMod.isModLoaded()) {
// Materials at tiers
list.add(
getToolWithStats(
ProspectorScannerULV.ID,
1,
Materials.Polycaprolactam,
Materials.Polycaprolactam,
null));
list.add(getToolWithStats(ProspectorScannerLV.ID, 1, Materials.Steel, Materials.Steel, null));
list.add(getToolWithStats(ProspectorScannerLV.ID, 1, Materials.Bronze, Materials.Steel, null));
list.add(getToolWithStats(ProspectorScannerMV.ID, 1, Materials.Manyullyn, Materials.Aluminium, null));
Expand Down Expand Up @@ -346,7 +329,6 @@ public void getDetravSubItems(Item item, CreativeTabs detravCreativeTab, List li
}

// Steel for comparison
list.add(getToolWithStats(ProspectorScannerULV.ID, 1, Materials.Steel, Materials.Steel, null));
list.add(getToolWithStats(ProspectorScannerLV.ID, 1, Materials.Steel, Materials.Steel, null));
list.add(getToolWithStats(ProspectorScannerMV.ID, 1, Materials.Steel, Materials.Steel, null));
list.add(getToolWithStats(ProspectorScannerHV.ID, 1, Materials.Steel, Materials.Steel, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class ProcessingDetravToolProspector implements gregtech.api.interfaces.IOreRecipeRegistrator {

public ProcessingDetravToolProspector() {

OrePrefixes.toolHeadDrill.add(this);
}

public void registerOre(OrePrefixes aPrefix, Materials material, String aOreDictName, String aModName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public String[] getDescription() {
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
if (aBaseMetaTileEntity.getStoredEU() >= getMaxEUConsume() && aBaseMetaTileEntity.isAllowedToWork()) {
setEUVar(aBaseMetaTileEntity.getStoredEU() - getMaxEUConsume());
if (getEUVar() >= getMaxEUConsume() && aBaseMetaTileEntity.isAllowedToWork()) {
setEUVar(getEUVar() - getMaxEUConsume());
aBaseMetaTileEntity.setActive(true);
} else {
aBaseMetaTileEntity.setActive(false);
Expand Down
26 changes: 25 additions & 1 deletion src/main/java/gregtech/api/enums/ItemList.java
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,21 @@ public enum ItemList implements IItemContainer {
Wireless_Dynamo_Energy_UXV,
Wireless_Dynamo_Energy_MAX,

Cover_Wireless_Energy_LV,
Cover_Wireless_Energy_MV,
Cover_Wireless_Energy_HV,
Cover_Wireless_Energy_EV,
Cover_Wireless_Energy_IV,
Cover_Wireless_Energy_LuV,
Cover_Wireless_Energy_ZPM,
Cover_Wireless_Energy_UV,
Cover_Wireless_Energy_UHV,
Cover_Wireless_Energy_UEV,
Cover_Wireless_Energy_UIV,
Cover_Wireless_Energy_UMV,
Cover_Wireless_Energy_UXV,
Cover_Wireless_Energy_MAX,

Hatch_Input_ULV,
Hatch_Input_LV,
Hatch_Input_MV,
Expand Down Expand Up @@ -2609,7 +2624,16 @@ public enum ItemList implements IItemContainer {
Hatch_Output_Bus_EV, Hatch_Output_Bus_IV, Hatch_Output_Bus_LuV, Hatch_Output_Bus_ZPM, Hatch_Output_Bus_UV,
Hatch_Output_Bus_MAX },
HATCHES_MUFFLER = { Hatch_Muffler_LV, Hatch_Muffler_LV, Hatch_Muffler_MV, Hatch_Muffler_HV, Hatch_Muffler_EV,
Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, Hatch_Muffler_MAX };
Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, Hatch_Muffler_MAX },
WIRELESS_ENERGY_HATCHES = { Wireless_Hatch_Energy_ULV, Wireless_Hatch_Energy_LV, Wireless_Hatch_Energy_MV,
Wireless_Hatch_Energy_HV, Wireless_Hatch_Energy_EV, Wireless_Hatch_Energy_IV, Wireless_Hatch_Energy_LuV,
Wireless_Hatch_Energy_ZPM, Wireless_Hatch_Energy_UV, Wireless_Hatch_Energy_UHV, Wireless_Hatch_Energy_UEV,
Wireless_Hatch_Energy_UIV, Wireless_Hatch_Energy_UMV, Wireless_Hatch_Energy_UXV,
Wireless_Hatch_Energy_MAX },
WIRELESS_ENERGY_COVERS = { Cover_Wireless_Energy_LV, Cover_Wireless_Energy_MV, Cover_Wireless_Energy_HV,
Cover_Wireless_Energy_EV, Cover_Wireless_Energy_IV, Cover_Wireless_Energy_LuV, Cover_Wireless_Energy_ZPM,
Cover_Wireless_Energy_UV, Cover_Wireless_Energy_UHV, Cover_Wireless_Energy_UEV, Cover_Wireless_Energy_UIV,
Cover_Wireless_Energy_UMV, Cover_Wireless_Energy_UXV, Cover_Wireless_Energy_MAX };
public static Fluid sOilExtraHeavy, sEpichlorhydrin, sDrillingFluid, sBlueVitriol, sNickelSulfate, sGreenVitriol,
sToluene, sNitrationMixture, sRocketFuel, sHydricSulfur, sIndiumConcentrate, sLeadZincSolution,
sHydrochloricAcid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,10 @@ public int getMaxEnergyOutput() {
return getOutput();
}

public long getStoredEUuncapped() {
return mMetaTileEntity.getEUVar();
}

public int getOutput() {
return (int) Math.min(Integer.MAX_VALUE, oOutput);
}
Expand Down
95 changes: 95 additions & 0 deletions src/main/java/gregtech/common/covers/CoverEnergyWireless.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package gregtech.common.covers;

import static gregtech.common.misc.WirelessNetworkManager.addEUToGlobalEnergyMap;
import static java.lang.Long.min;

import java.util.UUID;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.util.ForgeDirection;

import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.CoverBehavior;
import gregtech.api.util.ISerializableObject;

public class CoverEnergyWireless extends CoverBehavior implements IWirelessEnergyHatchInformation {

private final long transferred_energy_per_operation;

public CoverEnergyWireless(int voltage) {
this.transferred_energy_per_operation = 2 * voltage * ticks_between_energy_addition;
}

@Override
public boolean isRedstoneSensitive(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
long aTimer) {
return false;
}

@Override
public boolean allowsCopyPasteTool() {
return false;
}

@Override
public boolean allowsTickRateAddition() {
return false;
}

@Override
public boolean hasCoverGUI() {
return false;
}

@Override
public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable,
ICoverable aTileEntity, long aTimer) {
if (aCoverVariable == 0 || aTimer % ticks_between_energy_addition == 0) {
tryFetchingEnergy(aTileEntity);
}
return 1;
}

private static UUID getOwner(Object te) {
if (te instanceof BaseMetaTileEntity igte) {
return igte.getOwnerUuid();
} else {
return null;
}
}

private void tryFetchingEnergy(ICoverable tileEntity) {
if (tileEntity instanceof BaseMetaTileEntity bmte) {
long currentEU = bmte.getStoredEUuncapped();
long euToTransfer = min(transferred_energy_per_operation - currentEU, transferred_energy_per_operation);
if (euToTransfer <= 0) return; // nothing to transfer
if (!addEUToGlobalEnergyMap(getOwner(tileEntity), -euToTransfer)) return;
bmte.increaseStoredEnergyUnits(euToTransfer, true);
}
}

@Override
protected boolean onCoverRightClickImpl(ForgeDirection side, int aCoverID,
ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX,
float aY, float aZ) {
return false;
}

@Override
protected boolean isGUIClickableImpl(ForgeDirection side, int aCoverID,
ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
return false;
}

@Override
public boolean alwaysLookConnected(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return true;
}

@Override
public int getTickRate(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return 20;
}
}
14 changes: 14 additions & 0 deletions src/main/java/gregtech/common/items/IDMetaItem01.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ public enum IDMetaItem01 {
Cover_Chest_Basic(380),
Cover_Chest_Good(381),
Cover_Chest_Advanced(382),
Cover_Wireless_Energy_LV(383),
Cover_Wireless_Energy_MV(384),
Cover_Wireless_Energy_HV(385),
Cover_Wireless_Energy_EV(386),
Cover_Wireless_Energy_IV(387),
Cover_Wireless_Energy_LuV(388),
Cover_Wireless_Energy_ZPM(389),
Cover_Wireless_Energy_UV(390),
Cover_Wireless_Energy_UHV(391),
Cover_Wireless_Energy_UEV(392),
Cover_Wireless_Energy_UIV(393),
Cover_Wireless_Energy_UMV(394),
Cover_Wireless_Energy_UXV(395),
Cover_Wireless_Energy_MAX(396),
Shape_Slicer_Flat(398),
Shape_Slicer_Stripes(399),
Fuel_Can_Plastic_Empty(400),
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/gregtech/common/items/MetaGeneratedItem01.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
import static gregtech.common.items.IDMetaItem01.Cover_SolarPanel_MV;
import static gregtech.common.items.IDMetaItem01.Cover_SolarPanel_UV;
import static gregtech.common.items.IDMetaItem01.Cover_SolarPanel_ZPM;
import static gregtech.common.items.IDMetaItem01.Cover_Wireless_Energy_LV;
import static gregtech.common.items.IDMetaItem01.Crate_Empty;
import static gregtech.common.items.IDMetaItem01.Duct_Tape;
import static gregtech.common.items.IDMetaItem01.Electric_Motor_EV;
Expand Down Expand Up @@ -508,6 +509,7 @@
import gregtech.common.covers.CoverDoesWork;
import gregtech.common.covers.CoverDrain;
import gregtech.common.covers.CoverEUMeter;
import gregtech.common.covers.CoverEnergyWireless;
import gregtech.common.covers.CoverFluidLimiter;
import gregtech.common.covers.CoverFluidRegulator;
import gregtech.common.covers.CoverFluidStorageMonitor;
Expand Down Expand Up @@ -2948,6 +2950,26 @@ public MetaGeneratedItem01() {
"Holds 15 item for use within machine GUI (as Cover)",
new TCAspects.TC_AspectStack(TCAspects.VACUOS, 2L)));

for (int i = 1; i < 15; i++) {
ItemList.WIRELESS_ENERGY_COVERS[i - 1].set(
addItem(
Cover_Wireless_Energy_LV.ID + i - 1,
GTValues.VN[i] + " Wireless Energy Cover",
String.join(
"/n ",
"Stores energy globally in a network, up to 2^(2^31) EU.",
"Does not connect to wires. This cover withdraws EU from the network.",
"Ignores voltage limitations (no explosions).",
"Amperage: " + EnumChatFormatting.YELLOW + "2" + EnumChatFormatting.GRAY,
"Voltage IN: " + EnumChatFormatting.GREEN
+ GTUtility.formatNumbers(GTValues.V[i])
+ " ("
+ GTUtility.getColoredTierNameFromTier((byte) (i))
+ EnumChatFormatting.GREEN
+ ")"),
new TCAspects.TC_AspectStack(TCAspects.VACUOS, 2L)));
}

ItemList.Cover_Screen.set(
addItem(
Cover_Screen.ID,
Expand Down Expand Up @@ -3954,6 +3976,14 @@ private void registerCovers() {
TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_MAINTENANCE_DETECTOR)),
new CoverNeedMaintainance(TextureFactory.of(OVERLAY_MAINTENANCE_DETECTOR)));

for (int i = 0; i < 14; i++) {
GregTechAPI.registerCover(
ItemList.WIRELESS_ENERGY_COVERS[i].get(1),
TextureFactory
.of(MACHINE_CASINGS[i + 1][0], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[0]),
new CoverEnergyWireless((int) GTValues.V[i + 1]));
}

}

private void removeRecipes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) {
}
}
}
maxParallel = (int) Math.max(Math.ceil(Math.log(numberOfNanites) / Math.log(2) + 0.00001), 1);
maxParallel = (int) Math.min(Math.max(Math.ceil(Math.pow(numberOfNanites, 0.75)), 1), 256);
mMaxParallel = maxParallel;

PCBFactoryUpgrade requiredUpgrade = recipe.getMetadata(PCBFactoryUpgradeKey.INSTANCE);
Expand Down Expand Up @@ -846,8 +846,8 @@ protected MultiblockTooltipBuilder createTooltip() {
.addInfo("Each tier and upgrade requires additional structures.")
.addInfo("Power consumption is multiplied by Sqrt(structures).")
.addInfo("Tier 2 and 3 allow parallel by using extra nanites.")
.addInfo("Every doubling of nanites adds one parallel.")
.addInfo("1x->1, 2x->2, 4x->3, 8x->4 with no limit.")
.addInfo("The formula for parallels is the amount of nanites^0.75, rounded up.")
.addInfo("Maximum parallel is 256.")
.addInfo("Recipes require a cooling upgrade to be overclocked.")
.addInfo("Liquid Cooling uses 10 L/s of distilled water and enables default overclocks.")
.addInfo("Thermosink uses 10 L/s of Super Coolant and enables perfect overclocks.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTUtility;
import gtPlusPlus.core.material.MaterialsAlloy;
import tectech.thing.CustomItemList;

public class AssemblerRecipes implements Runnable {

Expand Down Expand Up @@ -541,6 +542,20 @@ public void run() {
.duration(60 * SECONDS)
.eut(TierEU.RECIPE_UHV)
.addTo(assemblerRecipes);

for (int i = 0; i < ItemList.WIRELESS_ENERGY_COVERS.length; i++) {
GTValues.RA.stdBuilder()
.itemInputs(
GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.TranscendentMetal, 4L),
CustomItemList.Machine_Multi_Transformer.get(1),
GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.Infinity, 2L),
ItemList.WIRELESS_ENERGY_HATCHES[i + 1].get(1))
.itemOutputs(ItemList.WIRELESS_ENERGY_COVERS[i].get(1L))
.fluidInputs(MaterialsUEVplus.ExcitedDTEC.getFluid(32_000L))
.duration(10 * SECONDS)
.eut(TierEU.RECIPE_UMV)
.addTo(assemblerRecipes);
}
}

// If Cleanroom is enabled, add an assembler recipe
Expand Down
Loading

0 comments on commit bbf8fe6

Please sign in to comment.