Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Apr 1, 2022
2 parents 3a35683 + 7d9a80d commit 8d10bea
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

public class NeutronAccelerator extends GT_MetaTileEntity_Hatch_Energy {

public boolean isRunning;

public NeutronAccelerator(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
}
Expand All @@ -27,13 +25,11 @@ public int getMaxEUConsume() {
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
this.isRunning = aNBT.getBoolean("isRunning");
}

@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
aNBT.setBoolean("isRunning", this.isRunning);
}

@Override
Expand All @@ -53,12 +49,12 @@ public String[] getDescription() {

@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (this.getBaseMetaTileEntity().isServerSide()) {
if (aBaseMetaTileEntity.isServerSide()) {
if (aBaseMetaTileEntity.getStoredEU() >= getMaxEUConsume() && aBaseMetaTileEntity.isAllowedToWork()) {
setEUVar(aBaseMetaTileEntity.getStoredEU() - getMaxEUConsume());
isRunning = true;
aBaseMetaTileEntity.setActive(true);
} else {
isRunning = false;
aBaseMetaTileEntity.setActive(false);
}
}
super.onPostTick(aBaseMetaTileEntity, aTick);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
boolean anyWorking = false;
if (this.getBaseMetaTileEntity().isServerSide()) {
if (aBaseMetaTileEntity.isServerSide()) {

for (ItemStack input : getStoredInputs()) {
if (input.isItemEqual(Materials.Graphite.getDust(1)) || input.isItemEqual(Materials.Beryllium.getDust(1))) {
Expand All @@ -341,7 +341,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
}

for (NeutronAccelerator tHatch : mNeutronAccelerator) {
if (tHatch.isRunning && this.getRepairStatus() == this.getIdealStatus()) {
if (tHatch.getBaseMetaTileEntity().isActive() && this.getRepairStatus() == this.getIdealStatus()) {
anyWorking = true;
this.eV += Math.max(nextInt(tHatch.getMaxEUConsume(), tHatch.getMaxEUConsume() * 2 + 1) * 10 * Math.pow(0.95, height - 4), 10);
}
Expand Down Expand Up @@ -413,7 +413,7 @@ public String[] getInfoData() {
int currentNKEInput = 0;
boolean anyWorking = false;
for (NeutronAccelerator tHatch : mNeutronAccelerator) {
if (tHatch.isRunning) {
if (tHatch.getBaseMetaTileEntity().isActive()) {
currentNKEInput += nextInt(tHatch.getMaxEUConsume(), tHatch.getMaxEUConsume() * 2 + 1) * 10 * Math.pow(0.95, height - 4);
anyWorking = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import goodgenerator.blocks.tileEntity.base.GT_MetaTileEntity_TooltipMultiBlockBase_EM;
import goodgenerator.loader.Loaders;
import goodgenerator.main.GoodGenerator;
import goodgenerator.network.MessageResetTileTexture;
import goodgenerator.util.DescTextLocalization;
import goodgenerator.util.MyRecipeAdder;
import gregtech.api.GregTech_API;
Expand All @@ -27,6 +30,7 @@
import ic2.core.Ic2Items;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
Expand Down Expand Up @@ -194,7 +198,7 @@ public boolean checkRecipe_EM(ItemStack itemStack) {
if (this.mode == 0) {
for (GT_MetaTileEntity_Hatch_InputBus bus : mInputBusses) {
if (!isValidMetaTileEntity(bus)) continue;
GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), true, Math.min(getMachineVoltageLimit(), getMaxInputVoltage()), inputFluids, getStoredItemFromHatch(bus));
GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Math.min(getMachineVoltageLimit(), getMaxInputVoltage()), inputFluids, getStoredItemFromHatch(bus));
if (tRecipe != null && tRecipe.mSpecialValue <= casingTier) {
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
Expand All @@ -211,8 +215,8 @@ public boolean checkRecipe_EM(ItemStack itemStack) {
}
else {
for (GT_MetaTileEntity_Hatch_InputBus bus : mInputBusses) {
if (!isValidMetaTileEntity(bus)) continue;
GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), true, Math.min(getMachineVoltageLimit(), getMaxInputVoltage()), inputFluids, getStoredItemFromHatch(bus));
if (!isValidMetaTileEntity(bus) || getStoredItemFromHatch(bus).length < 1) continue;
GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Math.min(getMachineVoltageLimit(), getMaxInputVoltage()), inputFluids, getStoredItemFromHatch(bus));
if (tRecipe != null) {
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
Expand Down Expand Up @@ -319,7 +323,8 @@ public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStac
if (casingTier != 0) {
reUpdate(1538 + casingTier);
}
return casingAmount >= 12 && machineTier != 0 && casingTier != 0 && mMaintenanceHatches.size() == 1 && !mMufflerHatches.isEmpty();
GoodGenerator.CHANNEL.sendToAllAround(new MessageResetTileTexture(aBaseMetaTileEntity, casingTier), new NetworkRegistry.TargetPoint(aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), 16));
return casingAmount >= 42 && machineTier != 0 && casingTier != 0 && mMaintenanceHatches.size() == 1 && !mMufflerHatches.isEmpty();
}
return false;
}
Expand Down Expand Up @@ -431,34 +436,4 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide
}
else return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(1538 + t)};
}

@SideOnly(Side.CLIENT)
public int getCasingTierClient() {
if (this.getBaseMetaTileEntity().getWorld() == null) {
return 0;
}
try {
for (byte i = 0; i < 6; i++) {
Block casing = getBaseMetaTileEntity().getBlockAtSide(i);
if (casing != null && casing.equals(Loaders.preciseUnitCasing)) {
return getBaseMetaTileEntity().getMetaIDAtSide(i) + 1;
}
}
}
catch (Throwable t) {
return 0;
}
return 0;
}

@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isClientSide()) {
if (this.getBaseMetaTileEntity() != null && this.getBaseMetaTileEntity().getWorld() != null) {
this.casingTier = getCasingTierClient();
markDirty();
}
}
super.onPostTick(aBaseMetaTileEntity, aTick);
}
}
14 changes: 14 additions & 0 deletions src/main/java/goodgenerator/loader/RecipeLoader_02.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ public class RecipeLoader_02 {

public static void RecipeLoad(){

GT_Values.RA.addAssemblerRecipe(
new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.StainlessSteel,1),
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlueAlloy,1),
GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorHV,32),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Beryllium,32),
GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite,1)
},
null,
ItemRefer.Speeding_Pipe.get(1),
300,
1920
);

// Compact MK1 Fusion Disassembly Recipe
GT_Values.RA.addAssemblerRecipe(
new ItemStack[]{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/goodgenerator/main/GoodGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
+ "required-after:bartworks; "
+ "required-after:tectech; "
+ "required-after:structurelib; "
+ "required:dreamcraft;")
+ "after:dreamcraft;")
public final class GoodGenerator {
public static final String MOD_ID = "GRADLETOKEN_MODID";
public static final String MOD_NAME = "GRADLETOKEN_MODNAME";
Expand Down

0 comments on commit 8d10bea

Please sign in to comment.