-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.20.1' of https://github.com/code-onigiri/GregTech-Modern
- Loading branch information
Showing
113 changed files
with
572 additions
and
413 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
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
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/gtceu/tags/items/step_boots.json
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,6 @@ | ||
{ | ||
"values": [ | ||
"gtceu:nanomuscle_boots", | ||
"gtceu:quarktech_boots" | ||
] | ||
} |
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
64 changes: 64 additions & 0 deletions
64
src/main/java/com/gregtechceu/gtceu/client/renderer/machine/DiodeRenderer.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,64 @@ | ||
package com.gregtechceu.gtceu.client.renderer.machine; | ||
|
||
import com.gregtechceu.gtceu.GTCEu; | ||
import com.gregtechceu.gtceu.api.machine.MachineDefinition; | ||
import com.gregtechceu.gtceu.api.machine.MetaMachine; | ||
import com.gregtechceu.gtceu.common.machine.multiblock.part.DiodePartMachine; | ||
|
||
import net.minecraft.client.renderer.block.model.BakedQuad; | ||
import net.minecraft.client.resources.model.ModelState; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.util.RandomSource; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
import static com.gregtechceu.gtceu.client.renderer.machine.OverlayEnergyIORenderer.*; | ||
|
||
public class DiodeRenderer extends TieredHullMachineRenderer { | ||
|
||
public DiodeRenderer(int tier) { | ||
super(tier, GTCEu.id("block/machine/hull_machine")); | ||
} | ||
|
||
@Override | ||
@OnlyIn(Dist.CLIENT) | ||
public void renderMachine(List<BakedQuad> quads, MachineDefinition definition, @Nullable MetaMachine machine, | ||
Direction frontFacing, @Nullable Direction side, RandomSource rand, Direction modelFacing, | ||
ModelState modelState) { | ||
super.renderMachine(quads, definition, machine, frontFacing, side, rand, modelFacing, modelState); | ||
OverlayEnergyIORenderer energyIn = ENERGY_IN_1A; | ||
OverlayEnergyIORenderer energyOut = ENERGY_OUT_1A; | ||
var amps = 1; | ||
if (machine instanceof DiodePartMachine diode) { | ||
amps = diode.getAmps(); | ||
} | ||
switch (amps) { | ||
case 2 -> { | ||
energyIn = ENERGY_IN_2A; | ||
energyOut = ENERGY_OUT_2A; | ||
} | ||
case 4 -> { | ||
energyIn = ENERGY_IN_4A; | ||
energyOut = ENERGY_OUT_4A; | ||
} | ||
case 8 -> { | ||
energyIn = ENERGY_IN_8A; | ||
energyOut = ENERGY_OUT_8A; | ||
} | ||
case 16 -> { | ||
energyIn = ENERGY_IN_16A; | ||
energyOut = ENERGY_OUT_16A; | ||
} | ||
} | ||
|
||
if (side == frontFacing && modelFacing != null) { | ||
energyOut.renderOverlay(quads, modelFacing, modelState, 2); | ||
} else if (side != null && modelFacing != null) { | ||
energyIn.renderOverlay(quads, modelFacing, modelState, 2); | ||
} | ||
} | ||
} |
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
59 changes: 59 additions & 0 deletions
59
src/main/java/com/gregtechceu/gtceu/client/renderer/machine/OverlayEnergyIORenderer.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,59 @@ | ||
package com.gregtechceu.gtceu.client.renderer.machine; | ||
|
||
import com.gregtechceu.gtceu.GTCEu; | ||
import com.gregtechceu.gtceu.client.util.StaticFaceBakery; | ||
|
||
import com.lowdragmc.lowdraglib.client.model.ModelFactory; | ||
|
||
import net.minecraft.client.renderer.block.model.BakedQuad; | ||
import net.minecraft.client.resources.model.ModelState; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
import java.util.List; | ||
|
||
public class OverlayEnergyIORenderer { | ||
|
||
public static final OverlayEnergyIORenderer ENERGY_IN_1A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_1a_tinted", "block/overlay/machine/overlay_energy_1a_in"); | ||
public static final OverlayEnergyIORenderer ENERGY_IN_2A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_2a_tinted", "block/overlay/machine/overlay_energy_2a_in"); | ||
public static final OverlayEnergyIORenderer ENERGY_IN_4A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_4a_tinted", "block/overlay/machine/overlay_energy_4a_in"); | ||
public static final OverlayEnergyIORenderer ENERGY_IN_8A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_8a_tinted", "block/overlay/machine/overlay_energy_8a_in"); | ||
public static final OverlayEnergyIORenderer ENERGY_IN_16A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_16a_tinted", "block/overlay/machine/overlay_energy_16a_in"); | ||
public static final OverlayEnergyIORenderer ENERGY_IN_64A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_64a_tinted", "block/overlay/machine/overlay_energy_64a_in"); | ||
|
||
public static final OverlayEnergyIORenderer ENERGY_OUT_1A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_1a_tinted", "block/overlay/machine/overlay_energy_1a_out"); | ||
public static final OverlayEnergyIORenderer ENERGY_OUT_2A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_2a_tinted", "block/overlay/machine/overlay_energy_2a_out"); | ||
public static final OverlayEnergyIORenderer ENERGY_OUT_4A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_4a_tinted", "block/overlay/machine/overlay_energy_4a_out"); | ||
public static final OverlayEnergyIORenderer ENERGY_OUT_8A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_8a_tinted", "block/overlay/machine/overlay_energy_8a_out"); | ||
public static final OverlayEnergyIORenderer ENERGY_OUT_16A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_16a_tinted", "block/overlay/machine/overlay_energy_16a_out"); | ||
public static final OverlayEnergyIORenderer ENERGY_OUT_64A = new OverlayEnergyIORenderer( | ||
"block/overlay/machine/overlay_energy_64a_tinted", "block/overlay/machine/overlay_energy_64a_out"); | ||
|
||
private final ResourceLocation tintedPart; | ||
private final ResourceLocation ioPart; | ||
|
||
public OverlayEnergyIORenderer(String tintedPart, String ioPart) { | ||
this.tintedPart = GTCEu.id(tintedPart); | ||
this.ioPart = GTCEu.id(ioPart); | ||
} | ||
|
||
public void renderOverlay(List<BakedQuad> quads, Direction modelFacing, ModelState modelState, int tintIndex) { | ||
quads.add(StaticFaceBakery.bakeFace( | ||
StaticFaceBakery.SLIGHTLY_OVER_BLOCK, modelFacing, | ||
ModelFactory.getBlockSprite(tintedPart), modelState, tintIndex, 0, true, true)); | ||
quads.add(StaticFaceBakery.bakeFace( | ||
StaticFaceBakery.SLIGHTLY_OVER_BLOCK, modelFacing, | ||
ModelFactory.getBlockSprite(ioPart), modelState, -1, 0, true, true)); | ||
} | ||
} |
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
Oops, something went wrong.