Skip to content

Commit

Permalink
Merge branch 'master' into prevent-shake-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Nov 9, 2024
2 parents 517d845 + 2a214ad commit 31c84f6
Show file tree
Hide file tree
Showing 82 changed files with 877 additions and 1,036 deletions.
16 changes: 8 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ dependencies {
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.6.44-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.5.17:dev")
api("com.github.GTNewHorizons:GTNHLib:0.5.19:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.12:dev")
api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.1:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-471-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.43-gtnh:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-473-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.45-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")

Expand All @@ -58,7 +58,7 @@ dependencies {

compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.54:dev")

compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta11:api') { transitive = false }
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta18:api') { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.3:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.39:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.20:dev") { transitive = false }
Expand All @@ -67,7 +67,7 @@ dependencies {
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.15.14:dev") { transitive = false }

compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.27:deobf") {transitive = false}
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.7.5:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.7.6: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.95-GTNH:dev") { transitive = false }
Expand All @@ -80,15 +80,15 @@ dependencies {
compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751")
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.5.74:dev")
implementation("com.github.GTNewHorizons:Hodgepodge:2.5.76:dev")
compileOnly('com.github.GTNewHorizons:Botania:1.11.5-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')
compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.26-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.6.26-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.7:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.0:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.7.0-GTNH:dev") { transitive = false }
Expand Down Expand Up @@ -124,7 +124,7 @@ dependencies {
runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.8.20:dev')

// For testing
//runtimeOnlyNonPublishable('com.github.GTNewHorizons:TCNEIAdditions:1.4.1:dev')
//runtimeOnlyNonPublishable('com.github.GTNewHorizons:TCNEIAdditions:1.4.2:dev')

// Speeds up mod identification and loading in dev
runtimeOnlyNonPublishable(rfg.deobf("CoreTweaks:CoreTweaks:0.3.3.2"))
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29'
}


2 changes: 1 addition & 1 deletion src/main/java/bartworks/common/loaders/ItemRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public static void run() {
StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GTValues.VN[1],
+1).getStackForm(1L);

ItemRegistry.dehp = new MTEDeepEarthHeatingPump(DeepEarthHeatingPump.ID, 1, "DEHP", "Deep Earth Heating Pump")
ItemRegistry.dehp = new MTEDeepEarthHeatingPump(DeepEarthHeatingPump.ID, "DEHP", "Deep Earth Heating Pump")
.getStackForm(1L);
ItemRegistry.megaMachines[0] = new MTEMegaBlastFurnace(
MegaBlastFurnace.ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import bartworks.API.BorosilicateGlass;
import bartworks.API.GlassTier;
import gregtech.api.GregTechAPI;
import tectech.thing.block.BlockQuantumGlass;

// Register all your glasses here.
Expand Down Expand Up @@ -68,6 +69,11 @@ private static void registerGlassAsTiered() {
// Glass block 2 for transcendent (Really?)
GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock2(), 0, 12);

// Tinted Industrial Glass
for (int i = 0; i < 4; i++) {
GlassTier.addCustomGlass(GregTechAPI.sBlockTintedGlass, i, 4);
}

// Other mods.
GlassTier.addCustomGlass(IndustrialCraft2.ID, "blockAlloyGlass", 0, 4);
GlassTier.addCustomGlass(BlockQuantumGlass.INSTANCE, 0, 8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,76 +16,57 @@
import static bartworks.util.BWTooltipReference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS;
import static gregtech.api.enums.GTValues.VN;

import java.lang.reflect.Field;
import java.util.Arrays;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;

import gregtech.api.enums.GTValues;
import com.gtnewhorizons.modularui.api.math.Pos2d;

import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.TierEU;
import gregtech.api.gui.modularui.GTUITextures;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.MTEHatchInput;
import gregtech.api.util.GTModHandler;
import gregtech.api.util.GTUtility;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.common.tileentities.machines.multi.MTEDrillerBase;
import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric;
import gtPlusPlus.core.util.minecraft.PlayerUtils;

public class MTEDeepEarthHeatingPump extends MTEDrillerBase {

private static float nulearHeatMod = 2f;
private byte mMode;
private byte mTier;

public MTEDeepEarthHeatingPump(int aID, int tier, String aName, String aNameRegional) {
public MTEDeepEarthHeatingPump(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
this.mTier = (byte) tier;
}

public MTEDeepEarthHeatingPump(String aName, byte mTier) {
public MTEDeepEarthHeatingPump(String aName) {
super(aName);
this.mTier = mTier;
}

@Override
@SuppressWarnings("rawtypes")
public void onConfigLoad() {
try {
Class c = TileEntityNuclearReactorElectric.class;
Field f = c.getDeclaredField("huOutputModifier");
f.setAccessible(true);
MTEDeepEarthHeatingPump.nulearHeatMod = f.getFloat(f);
} catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException
| IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace();
}
super.onConfigLoad();
}

@Override
public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setByte("mTier", this.mTier);
aNBT.setByte("mMode", this.mMode);
super.saveNBTData(aNBT);
}

@Override
public void loadNBTData(NBTTagCompound aNBT) {
this.mTier = aNBT.getByte("mTier");
this.mMode = aNBT.getByte("mMode");
super.loadNBTData(aNBT);
}

@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
return new MTEDeepEarthHeatingPump(this.mName, this.mTier);
return new MTEDeepEarthHeatingPump(this.mName);
}

@Override
Expand All @@ -95,15 +76,14 @@ protected MultiblockTooltipBuilder createTooltip() {
.get(0)
.getDisplayName();
tt.addMachineType("Geothermal Heat Pump")
.addInfo("Consumes " + GTValues.V[this.mTier + 2] + "EU/t")
.addInfo("Has 3 Modes, use the Screwdriver to change them:");
.addInfo("Consumes " + TierEU.RECIPE_HV + "EU/t")
.addInfo("Has 2 Modes, use the Screwdriver to change them:");

tt.addInfo("Direct Steam, Coolant Heating, Retract")
tt.addInfo("Direct Steam and Coolant Heating")
.addInfo(
"Direct Steam Mode: Consumes Distilled Water to produce " + (long) (this.mTier * 25600 * 20)
"Direct Steam Mode: Consumes Distilled Water to produce " + (long) (25600 * 20)
+ "L/s of Superheated Steam")
.addInfo(
"Coolant Heating Mode: Converts " + (long) (this.mTier * 96 * 2 * 20) + "L/s Coolant to Hot Coolant")
.addInfo("Coolant Heating Mode: Converts " + (long) (192 * 20) + "L/s Coolant to Hot Coolant")
.addInfo("Each maintenance issue lowers output efficiency by 10%")
.addInfo("Explodes when it runs out of Distilled Water/Coolant");

Expand Down Expand Up @@ -139,9 +119,31 @@ protected int getCasingTextureIndex() {
return 11;
}

@Override
public boolean supportsMachineModeSwitch() {
return true;
}

@Override
public Pos2d getMachineModeSwitchButtonPos() {
return new Pos2d(98, 91);
}

@Override
public void setMachineModeIcons() {
machineModeIcons.clear();
machineModeIcons.add(GTUITextures.OVERLAY_BUTTON_MACHINEMODE_STEAM);
machineModeIcons.add(GTUITextures.OVERLAY_BUTTON_MACHINEMODE_LPF_FLUID);
}

@Override
public String getMachineModeName() {
return StatCollector.translateToLocal("GT5U.DEHP.mode." + machineMode);
}

@Override
protected int getMinTier() {
return 2 + this.mTier;
return 3;
}

@Override
Expand Down Expand Up @@ -178,50 +180,35 @@ private long getWaterFromHatches(boolean onlyDistilled) {
}

@Override
protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
int yHead, int oldYHead) {
if (this.mMode != 3) {
this.isPickingPipes = false;
this.workState = 0;
return true;
}
return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead);
protected void addOperatingMessages() {
// Inheritors can overwrite these to add custom operating messages.
addResultMessage(STATE_DOWNWARD, true, "deploying_pipe");
addResultMessage(STATE_DOWNWARD, false, "extracting_pipe");
addResultMessage(STATE_AT_BOTTOM, true, "circulating_fluid");
addResultMessage(STATE_AT_BOTTOM, false, "no_mining_pipe");
addResultMessage(STATE_UPWARD, true, "retracting_pipe");
addResultMessage(STATE_UPWARD, false, "drill_generic_finished");
addResultMessage(STATE_ABORT, true, "retracting_pipe");
addResultMessage(STATE_ABORT, false, "drill_retract_pipes_finished");
}

@Override
public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (this.getBaseMetaTileEntity()
.getWorld().isRemote) return;
++this.mMode;
if (this.mMode >= 3) this.mMode = 0;
if (this.mMode == 0) {
GTUtility.sendChatToPlayer(aPlayer, "Mode: Direct Steam");
} else if (this.mMode == 1) {
GTUtility.sendChatToPlayer(aPlayer, "Mode: Coolant Heating");
} else if (this.mMode == 2) {
GTUtility.sendChatToPlayer(aPlayer, "Mode: Retract");
}
super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ);
setMachineMode(nextMachineMode());
PlayerUtils.messagePlayer(
aPlayer,
String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName()));
}

@Override
protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
int yHead, int oldYHead) {
if (this.mMode == 2) {
this.isPickingPipes = true;
this.workState = 2;
if (tryLowerPipeState(true) == 0) {
workState = STATE_DOWNWARD;
return true;
}

if (this.tryLowerPipeState(false) == 0) {
return true;
}
if (this.waitForPipes()) {
return false;
}

if (this.mMode == 0) {
long steamProduced = this.mTier * 25600L * this.mEfficiency / 10000L;
if (this.machineMode == 0) {
long steamProduced = 25600L * this.mEfficiency / 10000L;
long waterConsume = (steamProduced + 160) / 160;

if (this.getWaterFromHatches(true) - waterConsume > 0) {
Expand All @@ -234,11 +221,8 @@ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int
this.explodeMultiblock();
return false;
}
} else if (this.mMode == 1) {
long coolantConverted = (long) (this.mTier * 96L
* (double) MTEDeepEarthHeatingPump.nulearHeatMod
* this.mEfficiency
/ 10000L);
} else if (this.machineMode == 1) {
long coolantConverted = (long) (192L * this.mEfficiency / 10000L);
if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) {
this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted);
this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted));
Expand Down Expand Up @@ -297,7 +281,7 @@ private boolean consumeFluid(Fluid fluid, long ammount) {
@Override
protected void setElectricityStats() {
try {
this.mEUt = this.isPickingPipes ? -60 : -1 * Math.toIntExact(GTValues.V[this.getMinTier()]);
this.mEUt = this.isPickingPipes ? -60 : -((int) TierEU.RECIPE_HV);
} catch (ArithmeticException e) {
e.printStackTrace();
this.mEUt = Integer.MAX_VALUE - 7;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,20 @@ private static class EHESpecialValueFormatter implements INEISpecialInfoFormatte
public List<String> format(RecipeDisplayInfo recipeInfo) {
FluidStack[] Inputs = recipeInfo.recipe.mFluidInputs;
FluidStack[] Outputs = recipeInfo.recipe.mFluidOutputs;
int denseMultiplier = 1;
if (Inputs[0].getUnlocalizedName()
.contains("plasma")) {
denseMultiplier = 1000;
}
int threshold = recipeInfo.recipe.mSpecialValue;
return Arrays.asList(
StatCollector.translateToLocal("value.extreme_heat_exchanger.0") + " "
+ GTUtility.formatNumbers(Inputs[0].amount)
+ " L/s",
StatCollector.translateToLocal("value.extreme_heat_exchanger.1"),
GTUtility.formatNumbers(Outputs[0].amount / 160) + " L/s",
GTUtility.formatNumbers(Outputs[0].amount / 160 * denseMultiplier) + " L/s",
StatCollector.translateToLocal("value.extreme_heat_exchanger.2"),
GTUtility.formatNumbers(Outputs[1].amount / 160) + " L/s",
GTUtility.formatNumbers(Outputs[1].amount / 160 * denseMultiplier) + " L/s",
StatCollector.translateToLocal("value.extreme_heat_exchanger.4") + " " + threshold + " L/s");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import cpw.mods.fml.relauncher.Side;
Expand Down Expand Up @@ -59,4 +61,24 @@ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta,
return new ArrayList<>();
}

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

@Override
public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) {
return false;
}

@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) {
return null;
}

@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) {
return null;
}
}
Loading

0 comments on commit 31c84f6

Please sign in to comment.