Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Jan 30, 2025
2 parents f180132 + 2ac9861 commit 4de22e2
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public boolean canDumpFluidToME() {

for (IFluidStore tHatch : tLayerOutputHatches) {
if (tHatch instanceof MTEHatchOutputME tMEHatch) {
if (tMEHatch.canAcceptFluid()) {
if (tMEHatch.canFillFluid()) {
foundMEHatch = true;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,9 @@ private static void uvRecipes() {
.fluidInputs(
INDALLOY_140.getFluidStack(432 * L),
Lubricant.getFluid(96000),
Neutronium.getMolten(2304 * L),
Americium.getMolten(2304 * L),
Naquadria.getMolten(432 * L),
Neutronium.getMolten(325 * L + 48),
Samarium.getMolten(96 * L))
.duration(24 * MINUTES)
.eut(RECIPE_ZPM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ protected static boolean dumpFluid(List<MTEHatchOutput> aOutputHatches, FluidSta
if (!tHatch.canStoreFluid(copiedFluidStack)) continue;

if (tHatch instanceof MTEHatchOutputME tMEHatch) {
if (!tMEHatch.canAcceptFluid()) continue;
if (!tMEHatch.canFillFluid()) continue;
}

int tAmount = tHatch.fill(copiedFluidStack, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,17 @@ private long getCacheCapacity() {
}

/**
* Check if the internal cache can still fit more fluids in it
* Check if the internal cache can still fit more fluids in it for a recipe check
*/
public boolean canAcceptFluid() {
return getCachedAmount() < getCacheCapacity() || lastInputTick == tickCounter;
return getCachedAmount() < getCacheCapacity();
}

/**
* Check if there is space for fluids or if we can overfill.
*/
public boolean canFillFluid() {
return canAcceptFluid() || lastInputTick == tickCounter;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public boolean canDumpFluidToME() {
return this.mOutputHatchesByLayer.stream()
.allMatch(
tLayerOutputHatches -> tLayerOutputHatches.stream()
.anyMatch(tHatch -> (tHatch instanceof MTEHatchOutputME tMEHatch) && (tMEHatch.canAcceptFluid())));
.anyMatch(tHatch -> (tHatch instanceof MTEHatchOutputME tMEHatch) && (tMEHatch.canFillFluid())));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public boolean canDumpFluidToME() {
return this.mOutputHatchesByLayer.stream()
.allMatch(
tLayerOutputHatches -> tLayerOutputHatches.stream()
.anyMatch(tHatch -> (tHatch instanceof MTEHatchOutputME tMEHatch) && (tMEHatch.canAcceptFluid())));
.anyMatch(tHatch -> (tHatch instanceof MTEHatchOutputME tMEHatch) && (tMEHatch.canFillFluid())));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addPollutionAmount(getPollutionPerSecond(null))
.beginStructureBlock(9, 6, 9, true)
.addController("Top Center")
.addCasingInfoMin("Elemental Confinement Shell", 138, false)
.addCasingInfoMin("Elemental Confinement Shell", 120, false)
.addCasingInfoMin("Matter Fabricator Casing", 24, false)
.addCasingInfoMin("Particle Containment Casing", 24, false)
.addCasingInfoMin("Matter Generation Coil", 24, false)
Expand Down Expand Up @@ -122,7 +122,7 @@ public IStructureDefinition<MTEElementalDuplicator> getStructureDefinition() {
.addShape(
STRUCTURE_PIECE_MAIN,
(new String[][] {
{ " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccch~hccc", "ccchhhccc", " ccccccc ",
{ " ccc ", " ccccc ", " ccccccc ", "ccccccccc", "cccc~cccc", "ccccccccc", " ccccccc ",
" ccccc ", " ccc " },
{ " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ",
" abfba ", " cac " },
Expand All @@ -132,17 +132,16 @@ public IStructureDefinition<MTEElementalDuplicator> getStructureDefinition() {
" e e ", " cec " },
{ " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ",
" abfba ", " cac " },
{ " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccchhhccc", "ccchhhccc", " ccccccc ",
{ " ccc ", " ccccc ", " ccccccc ", "ccccccccc", "ccccccccc", "ccccccccc", " ccccccc ",
" ccccc ", " ccc " }, }))
.addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6()))
.addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7()))
.addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2()))
.addElement('e', ofBlock(getCasingBlock2(), getCasingMeta3()))
.addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4()))
.addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5()))
.addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
.addElement(
'h',
'c',
lazy(
t -> ofChain(
buildHatchAdder(MTEElementalDuplicator.class)
Expand Down Expand Up @@ -172,13 +171,11 @@ public void construct(ItemStack stackSize, boolean hintsOnly) {
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasing = 0;
boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0);
if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && !this.mOutputHatches.isEmpty())
|| this.mEnergyHatches.size() != 1
|| this.mReplicatorDataOrbHatches.size() != 1) {
if (this.mReplicatorDataOrbHatches.size() != 1) {
return false;
}
log("Casings: " + mCasing);
return aDidBuild && mCasing >= 138 && checkHatch();
return aDidBuild && mCasing >= 120 && checkHatch();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;

import java.util.List;

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.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.util.GTUtility;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import tectech.thing.metaTileEntity.Textures;
import tectech.util.CommonValues;
import tectech.util.TTUtility;
Expand Down Expand Up @@ -114,6 +124,41 @@ public long maxWorkingAmperesIn() {
return Amperes;
}

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

@Override
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setLong("amperage", Amperes);
}

@Override
public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
super.getWailaBody(itemStack, currenttip, accessor, config);
currenttip.add(
translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": "
+ EnumChatFormatting.YELLOW
+ GTUtility.formatNumbers(
accessor.getNBTData()
.getLong("amperage") * V[mTier])
+ EnumChatFormatting.RESET
+ " EU/t");
}

@Override
public String[] getInfoData() {
return new String[] { translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": "
+ EnumChatFormatting.YELLOW
+ GTUtility.formatNumbers(Amperes * V[mTier])
+ EnumChatFormatting.RESET
+ " EU/t" };
}

@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new MTEHatchEnergyMulti(mName, mTier, Amperes, mDescriptionArray, mTextures);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,51 +65,16 @@ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return new ITexture[] { aBaseTexture, Textures.OVERLAYS_ENERGY_IN_LASER_TT[mTier] };
}

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

@Override
public boolean isFacingValid(ForgeDirection facing) {
return true;
}

@Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}

@Override
public boolean isInputFacing(ForgeDirection side) {
return side == getBaseMetaTileEntity().getFrontFacing();
}

@Override
public boolean isValidSlot(int aIndex) {
return false;
}

@Override
public long getMinimumStoredEU() {
return V[mTier];
}

@Override
public long maxEUInput() {
return V[mTier];
}

@Override
public long maxEUStore() {
return V[mTier] * 24L * Amperes;
}

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

@Override
public boolean isEnetInput() {
return false;
Expand All @@ -125,18 +90,6 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new MTEHatchEnergyTunnel(mName, mTier, Amperes, mDescriptionArray, mTextures);
}

@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
return false;
}

@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
return false;
}

@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,46 +128,16 @@ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return new ITexture[] { aBaseTexture, TEXTURE_OVERLAY[mTier] };
}

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

@Override
public boolean isFacingValid(ForgeDirection facing) {
return true;
}

@Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}

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

@Override
public boolean isInputFacing(ForgeDirection side) {
return side == getBaseMetaTileEntity().getFrontFacing();
}

@Override
public boolean isValidSlot(int aIndex) {
return false;
}

@Override
public long getMinimumStoredEU() {
return Amperes * V[mTier];
}

@Override
public long maxEUInput() {
return V[mTier];
}

@Override
public long maxEUStore() {
return (long) (totalStorage(V[mTier]) / (2 * overflowDivisor) * Amperes);
Expand All @@ -178,28 +148,11 @@ public long maxAmperesIn() {
return Amperes;
}

@Override
public long maxWorkingAmperesIn() {
return Amperes;
}

@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new MTEHatchWirelessMulti(mName, mTier, Amperes, mDescriptionArray, mTextures);
}

@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
return false;
}

@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
return false;
}

@Override
public ConnectionType getConnectionType() {
return ConnectionType.WIRELESS;
Expand Down

0 comments on commit 4de22e2

Please sign in to comment.