-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* laser cables (#501) * feat: laser cables * fix: remove laser recipe capability, recipes * fix: add 16A dynamo hatch recipes. * remove todo * fix: steam machines only allow GT steam to be inserted. * reviews * High-tier content config option (#499) * feat: highTier. * fix: loot table errors when highTier is disabled * test for dev env in enabling HighTier, void miners * fix tooltips * Revert "fix tooltips" This reverts commit a53a9fc. * fix: add a cap on transfer rate. * chore: add missing, fix existing textures for pump/fluid regulator covers * fix: UHV+ fluid regulators. --------- Co-authored-by: Mikerooni <[email protected]> * chore: run data, changelog * ME i/o hatches for multiblocks (#500) * feat: ME HATCHES still lots of crashes tho. * fix up buses. next up: hatches. * works. current issues: - input buses output infinite of the inputs without clearing - you can't empty cleared configs (cause of the above?) * remove the sychronized blocks i used for testing * works better. AEItemDisplayWidget doesn't display items, somehow. no clue how. * feat: pass ME, energy through hulls FINISH * feat: recipes * reviews * fix: where the shit did this method go? --------- Co-authored-by: Mikerooni <[email protected]>
- Loading branch information
Showing
399 changed files
with
8,809 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# ChangeLog | ||
|
||
* fix transfer + fix ldlib | ||
* fix fluid slot overflow | ||
* fix assembly line recipe handling | ||
* update zh_cn lang | ||
* fix stone ores having broken translations | ||
* Add ME stocking input bus/hatch, ME output bus/hatch | ||
* add laser cables | ||
* add high-tier content config option | ||
* add ore processing chart recipeviewer page | ||
* make manual compression recipes be shaped | ||
* switch certus quartz material amount to 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
common/src/main/java/com/gregtechceu/gtceu/api/capability/ILaserContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.gregtechceu.gtceu.api.capability; | ||
|
||
/** | ||
* It is its own separate interface to make piping work easier | ||
*/ | ||
public interface ILaserContainer extends IEnergyContainer { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
common/src/main/java/com/gregtechceu/gtceu/api/item/LaserPipeBlockItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.gregtechceu.gtceu.api.item; | ||
|
||
import com.gregtechceu.gtceu.api.block.PipeBlock; | ||
import com.gregtechceu.gtceu.common.block.LaserPipeBlock; | ||
import com.lowdragmc.lowdraglib.client.renderer.IItemRendererProvider; | ||
import com.lowdragmc.lowdraglib.client.renderer.IRenderer; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.color.item.ItemColor; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class LaserPipeBlockItem extends PipeBlockItem implements IItemRendererProvider { | ||
|
||
public LaserPipeBlockItem(PipeBlock block, Properties properties) { | ||
super(block, properties); | ||
} | ||
|
||
@Override | ||
public LaserPipeBlock getBlock() { | ||
return (LaserPipeBlock) super.getBlock(); | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public static ItemColor tintColor() { | ||
return (itemStack, index) -> { | ||
if (itemStack.getItem() instanceof LaserPipeBlockItem materialBlockItem) { | ||
return materialBlockItem.getBlock().tinted(materialBlockItem.getBlock().defaultBlockState(), null, null, index); | ||
} | ||
return -1; | ||
}; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
@Environment(EnvType.CLIENT) | ||
public IRenderer getRenderer(ItemStack stack) { | ||
return getBlock().getRenderer(getBlock().defaultBlockState()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
common/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableLaserContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.gregtechceu.gtceu.api.machine.trait; | ||
|
||
import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; | ||
import com.gregtechceu.gtceu.api.capability.ILaserContainer; | ||
import com.gregtechceu.gtceu.api.machine.MetaMachine; | ||
import com.lowdragmc.lowdraglib.syncdata.field.ManagedFieldHolder; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
public class NotifiableLaserContainer extends NotifiableEnergyContainer implements ILaserContainer { | ||
|
||
public static final ManagedFieldHolder MANAGED_FIELD_HOLDER = new ManagedFieldHolder(NotifiableEnergyContainer.class, NotifiableRecipeHandlerTrait.MANAGED_FIELD_HOLDER); | ||
|
||
public NotifiableLaserContainer(MetaMachine machine, long maxCapacity, long maxInputVoltage, long maxInputAmperage, long maxOutputVoltage, long maxOutputAmperage) { | ||
super(machine, maxCapacity, maxInputVoltage, maxInputAmperage, maxOutputVoltage, maxOutputAmperage); | ||
} | ||
|
||
public static NotifiableLaserContainer emitterContainer(MetaMachine machine, long maxCapacity, long maxOutputVoltage, long maxOutputAmperage) { | ||
return new NotifiableLaserContainer(machine, maxCapacity, 0L, 0L, maxOutputVoltage, maxOutputAmperage); | ||
} | ||
|
||
public static NotifiableLaserContainer receiverContainer(MetaMachine machine, long maxCapacity, long maxInputVoltage, long maxInputAmperage) { | ||
return new NotifiableLaserContainer(machine, maxCapacity, maxInputVoltage, maxInputAmperage, 0L, 0L); | ||
} | ||
|
||
@Override | ||
public void serverTick() { | ||
amps = 0; | ||
if (getMachine().getLevel().isClientSide) | ||
return; | ||
if (getEnergyStored() < getOutputVoltage() || getOutputVoltage() <= 0 || getOutputAmperage() <= 0) | ||
return; | ||
long outputVoltage = getOutputVoltage(); | ||
long outputAmperes = Math.min(getEnergyStored() / outputVoltage, getOutputAmperage()); | ||
if (outputAmperes == 0) return; | ||
long amperesUsed = 0; | ||
for (Direction side : Direction.values()) { | ||
if (!outputsEnergy(side)) continue; | ||
BlockEntity tileEntity = getMachine().getLevel().getBlockEntity(getMachine().getPos().relative(side)); | ||
Direction oppositeSide = side.getOpposite(); | ||
ILaserContainer laserContainer = GTCapabilityHelper.getLaser(getMachine().getLevel(), getMachine().getPos().relative(side), oppositeSide); | ||
if (tileEntity != null && laserContainer != null) { | ||
if (laserContainer == null || !laserContainer.inputsEnergy(oppositeSide)) continue; | ||
amperesUsed += laserContainer.acceptEnergyFromNetwork(oppositeSide, outputVoltage, outputAmperes - amperesUsed); | ||
if (amperesUsed == outputAmperes) break; | ||
} | ||
} | ||
if (amperesUsed > 0) { | ||
setEnergyStored(getEnergyStored() - amperesUsed * outputVoltage); | ||
} | ||
} | ||
} |
Oops, something went wrong.