Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into 1.20.1
  • Loading branch information
code-onigiri committed Sep 8, 2024
2 parents 9b88766 + 008861c commit 0914fd4
Show file tree
Hide file tree
Showing 113 changed files with 572 additions and 413 deletions.
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -3799,6 +3799,7 @@
"gtceu.multiblock.universal.problem.soft_mallet": ")ㄥ§ʇǝןןɐW ʇɟoSɐ§( ˙ʞɔnʇs sı buıɥʇǝɯoSㄥ§%s",
"gtceu.multiblock.universal.problem.wire_cutter": ")ㄥ§ɹǝʇʇnƆ ǝɹıMɐ§( ˙ʇno pǝuɹnq sǝɹıMㄥ§%s",
"gtceu.multiblock.universal.problem.wrench": ")ㄥ§ɥɔuǝɹMɐ§( ˙ǝsooן sı ǝdıԀㄥ§%s",
"gtceu.multiblock.universal.rotor_obstructed": "¡pǝʇɔnɹʇsqO sı ɹoʇoᴚ",
"gtceu.multiblock.uv_fusion_reactor.description": "˙W0ㄣ9 ɟo ɯnɯıxɐɯ ɐ sɐɥ puɐ '∩Ǝ W0ㄣ ʎq sǝsɐǝɹɔuı ɹǝɟɟnq sʇı 'sɐɥ ʇı ɥɔʇɐH ʎɹǝʌǝ ɹoℲ ˙sǝɥɔʇɐH ʎbɹǝuƎ Λ∩ ǝsn ʎןuo uɐɔ ʇI ˙sǝuo ɹǝıʌɐǝɥ oʇuı sʇuǝɯǝןǝ buısnɟ ɹoɟ pǝsn ǝɹnʇɔnɹʇs ʞɔoןqıʇןnɯ ǝbɹɐן ɐ sı Ɛ ʞW ɹoʇɔɐǝᴚ uoısnℲ ǝɥ⟘",
"gtceu.multiblock.vacuum_freezer.description": "˙ɹǝʇɐM sɐ ɥɔns 'sǝɔuɐʇsqns ɹǝɥʇo ǝzǝǝɹɟ osןɐ uɐɔ ʇı 'ɹǝʌǝʍoH ˙sʇobuI ɹɐןnbǝɹ oʇuı sʇobuI ʇoH buızǝǝɹɟ ɹoɟ pǝsn ʎןuıɐɯ ǝɹnʇɔnɹʇs ʞɔoןqıʇןnɯ ɐ sı ɹǝzǝǝɹℲ ɯnnɔɐΛ ǝɥ⟘",
"gtceu.multiblock.validation_failed": "˙sʇndʇno/sʇnduı ɟo ʇunoɯɐ pıןɐʌuI",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3799,6 +3799,7 @@
"gtceu.multiblock.universal.problem.soft_mallet": "%s§7Something is stuck. (§aSoft Mallet§7)",
"gtceu.multiblock.universal.problem.wire_cutter": "%s§7Wires burned out. (§aWire Cutter§7)",
"gtceu.multiblock.universal.problem.wrench": "%s§7Pipe is loose. (§aWrench§7)",
"gtceu.multiblock.universal.rotor_obstructed": "Rotor is Obstructed!",
"gtceu.multiblock.uv_fusion_reactor.description": "The Fusion Reactor MK 3 is a large multiblock structure used for fusing elements into heavier ones. It can only use UV Energy Hatches. For every Hatch it has, its buffer increases by 40M EU, and has a maximum of 640M.",
"gtceu.multiblock.vacuum_freezer.description": "The Vacuum Freezer is a multiblock structure mainly used for freezing Hot Ingots into regular Ingots. However, it can also freeze other substances, such as Water.",
"gtceu.multiblock.validation_failed": "Invalid amount of inputs/outputs.",
Expand Down
6 changes: 6 additions & 0 deletions src/generated/resources/data/gtceu/tags/items/step_boots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"gtceu:nanomuscle_boots",
"gtceu:quarktech_boots"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ default void attachFancyTooltipsToController(IMultiController controller, Toolti
default void attachTooltips(TooltipsPanel tooltipsPanel) {
tooltipsPanel.attachTooltips(new IFancyTooltip.Basic(
() -> GuiTextures.INDICATOR_NO_STEAM.get(false),
() -> List.of(Component.translatable("gtceu.multiblock.universal.muffler_obstructed")
() -> List.of(Component.translatable("gtceu.multiblock.universal.rotor_obstructed")
.setStyle(Style.EMPTY.withColor(ChatFormatting.RED))),
() -> !isFrontFaceFree(),
() -> null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
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;
Expand All @@ -18,6 +15,8 @@

import java.util.List;

import static com.gregtechceu.gtceu.client.renderer.machine.OverlayEnergyIORenderer.*;

/**
* @author KilaBash
* @date 2023/3/10
Expand All @@ -39,10 +38,10 @@ public void renderMachine(List<BakedQuad> quads, MachineDefinition definition, @
ModelState modelState) {
super.renderMachine(quads, definition, machine, frontFacing, side, rand, modelFacing, modelState);
if (side == frontFacing && modelFacing != null) {
var texture = inventorySize <= 4 ? TransformerRenderer.ENERGY_OUT :
inventorySize <= 8 ? TransformerRenderer.ENERGY_OUT_MULTI :
TransformerRenderer.ENERGY_OUT_ULTRA;
quads.add(StaticFaceBakery.bakeFace(modelFacing, ModelFactory.getBlockSprite(texture), modelState, 2));
var texture = inventorySize <= 4 ? ENERGY_OUT_4A :
inventorySize <= 8 ? ENERGY_OUT_8A :
ENERGY_OUT_16A;
texture.renderOverlay(quads, modelFacing, modelState, 2);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,35 @@
import java.util.List;
import java.util.function.Consumer;

import static com.gregtechceu.gtceu.client.renderer.machine.OverlayEnergyIORenderer.*;

public class ConverterRenderer extends TieredHullMachineRenderer {

private static final ResourceLocation ENERGY_IN = GTCEu.id("block/overlay/machine/overlay_energy_in"),
ENERGY_OUT = GTCEu.id("block/overlay/machine/overlay_energy_out"),
CONVERTER_NATIVE_IN = GTCEu.id("block/overlay/converter/converter_native_in"),
CONVERTER_NATIVE_OUT = GTCEu.id("block/overlay/converter/converter_native_out");
private static final ResourceLocation CONVERTER_FE_IN = GTCEu.id("block/overlay/converter/converter_native_in");
private static final ResourceLocation CONVERTER_FE_OUT = GTCEu.id("block/overlay/converter/converter_native_out");
private final OverlayEnergyIORenderer ENERGY_IN;
private final OverlayEnergyIORenderer ENERGY_OUT;

public ConverterRenderer(int tier) {
public ConverterRenderer(int tier, int baseAmp) {
super(tier, GTCEu.id("block/machine/hull_machine"));
switch (baseAmp) {
case 4:
ENERGY_IN = ENERGY_IN_4A;
ENERGY_OUT = ENERGY_OUT_4A;
break;
case 8:
ENERGY_IN = ENERGY_IN_8A;
ENERGY_OUT = ENERGY_OUT_8A;
break;
case 16:
ENERGY_IN = ENERGY_IN_16A;
ENERGY_OUT = ENERGY_OUT_16A;
break;
default:
ENERGY_IN = ENERGY_IN_1A;
ENERGY_OUT = ENERGY_OUT_1A;
break;
}
}

@Override
Expand All @@ -39,27 +59,33 @@ public void renderMachine(List<BakedQuad> quads, MachineDefinition definition, @
Direction frontFacing, @Nullable Direction side, RandomSource rand, Direction modelFacing,
ModelState modelState) {
super.renderMachine(quads, definition, machine, frontFacing, side, rand, modelFacing, modelState);
var otherFaceTexture = ENERGY_IN;
var frontFaceTexture = CONVERTER_NATIVE_OUT;
var isFeToEu = false;
if (machine instanceof ConverterMachine converter) {
otherFaceTexture = converter.isFeToEu() ? CONVERTER_NATIVE_IN : otherFaceTexture;
frontFaceTexture = converter.isFeToEu() ? ENERGY_OUT : frontFaceTexture;
isFeToEu = converter.isFeToEu();
}
if (side == frontFacing && modelFacing != null) {
quads.add(
StaticFaceBakery.bakeFace(modelFacing, ModelFactory.getBlockSprite(frontFaceTexture), modelState));
if (isFeToEu) {
ENERGY_OUT.renderOverlay(quads, modelFacing, modelState, 2);
} else {
quads.add(StaticFaceBakery.bakeFace(modelFacing, ModelFactory.getBlockSprite(CONVERTER_FE_OUT),
modelState, -1));
}
} else if (side != null && modelFacing != null) {
quads.add(
StaticFaceBakery.bakeFace(modelFacing, ModelFactory.getBlockSprite(otherFaceTexture), modelState));
if (isFeToEu) {
quads.add(StaticFaceBakery.bakeFace(modelFacing, ModelFactory.getBlockSprite(CONVERTER_FE_IN),
modelState, -1));
} else {
ENERGY_IN.renderOverlay(quads, modelFacing, modelState, 2);
}
}
}

@Override
public void onPrepareTextureAtlas(ResourceLocation atlasName, Consumer<ResourceLocation> register) {
super.onPrepareTextureAtlas(atlasName, register);
if (atlasName.equals(TextureAtlas.LOCATION_BLOCKS)) {
register.accept(CONVERTER_NATIVE_IN);
register.accept(CONVERTER_NATIVE_OUT);
register.accept(CONVERTER_FE_IN);
register.accept(CONVERTER_FE_OUT);
}
}
}
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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ public void renderPartModel(List<BakedQuad> quads, IMultiController machine, IMu
ModelFactory.getBlockSprite(firebox.side()), modelState));
if (machine instanceof IRecipeLogicMachine recipeLogicMachine &&
recipeLogicMachine.getRecipeLogic().isWorking()) {
quads.add(StaticFaceBakery.bakeFace(modelFacing, ModelFactory.getBlockSprite(BLOOM_OVERLAY),
modelState, -101, 15, true, false));
quads.add(StaticFaceBakery.bakeFace(StaticFaceBakery.SLIGHTLY_OVER_BLOCK,
modelFacing, ModelFactory.getBlockSprite(BLOOM_OVERLAY), modelState,
-101, 15, true, false));
}
}
}
Expand Down
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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
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;
Expand All @@ -16,6 +13,8 @@

import java.util.List;

import static com.gregtechceu.gtceu.client.renderer.machine.OverlayEnergyIORenderer.ENERGY_OUT_1A;

/**
* @author KilaBash
* @date 2023/3/17
Expand All @@ -33,9 +32,7 @@ public void renderMachine(List<BakedQuad> quads, MachineDefinition definition, @
ModelState modelState) {
super.renderMachine(quads, definition, machine, frontFacing, side, rand, modelFacing, modelState);
if (side == frontFacing && modelFacing != null) {
quads.add(StaticFaceBakery.bakeFace(
modelFacing, ModelFactory.getBlockSprite(TransformerRenderer.ENERGY_OUT),
modelState, 2));
ENERGY_OUT_1A.renderOverlay(quads, modelFacing, modelState, 2);
}
}
}
Loading

0 comments on commit 0914fd4

Please sign in to comment.