Skip to content

Commit

Permalink
add coil tooltips + LCR perfect overclock + fix fluid datagen crash +…
Browse files Browse the repository at this point in the history
… fix forge_hammer ui + fix ae facade cover rendering
  • Loading branch information
Yefancy committed Jul 16, 2023
1 parent 7d455b1 commit 370bb8d
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,17 @@ private void verifyInfo(MaterialProperties p, boolean averageRGB) {
}
}

// Verify FluidTexture
if (p.hasProperty(PropertyKey.FLUID)) {
var fluid = p.getProperty(PropertyKey.FLUID);
if (fluid.getStillTexture() == null) {
fluid.setStillTexture(MaterialIconType.fluid.getBlockTexturePath(iconSet, true));
}
if (fluid.getFlowTexture() == null) {
fluid.setFlowTexture(fluid.getStillTexture());
}
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public boolean useBlockLight(ItemStack stack) {
@Override
@Environment(EnvType.CLIENT)
public List<BakedQuad> renderModel(BlockAndTintGetter level, BlockPos pos, BlockState state, Direction side, RandomSource rand) {
if (level.getBlockEntity(pos) instanceof IPipeNode<?,?> pipeNode) {
if (level == null) {
return pipeModel.bakeQuads(side, PipeModel.ITEM_CONNECTIONS);
} else if (level.getBlockEntity(pos) instanceof IPipeNode<?,?> pipeNode) {
var quads = new LinkedList<>(pipeModel.bakeQuads(side, pipeNode.getVisualConnections()));
var modelState = ModelFactory.getRotation(pipeNode.getCoverContainer().getFrontFacing());
var modelFacing = side == null ? null : ModelFactory.modelFacing(side, pipeNode.getCoverContainer().getFrontFacing());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface ICoverableRenderer extends IRenderer {
@Override
@Environment(EnvType.CLIENT)
default List<BakedQuad> renderModel(BlockAndTintGetter level, BlockPos pos, BlockState state, Direction side, RandomSource rand) {
var blockEntity = level.getBlockEntity(pos);
var blockEntity = level == null ? null : level.getBlockEntity(pos);
if (blockEntity != null) {
var coverable = GTCapabilityHelper.getCoverable(blockEntity.getLevel(), blockEntity.getBlockPos(), null);
if (coverable != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public List<BakedQuad> getQuads(@org.jetbrains.annotations.Nullable BlockState s

@Override
@Environment(EnvType.CLIENT)
public final List<BakedQuad> renderModel(BlockAndTintGetter level, BlockPos pos, BlockState state, Direction side, RandomSource rand) {
if (state.getBlock() instanceof MetaMachineBlock machineBlock) {
public final List<BakedQuad> renderModel(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @Nullable BlockState state, @Nullable Direction side, RandomSource rand) {
if (state != null && state.getBlock() instanceof MetaMachineBlock machineBlock) {
var frontFacing = machineBlock.getFrontFacing(state);
var machine = machineBlock.getMachine(level, pos);
var machine = (level == null || pos == null) ? null : machineBlock.getMachine(level, pos);
if (machine != null) {
var definition = machine.getDefinition();
var modelState = ModelFactory.getRotation(frontFacing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.client.renderer.block.TextureOverrideRenderer;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.utils.GTUtil;
import com.lowdragmc.lowdraglib.Platform;
import lombok.Getter;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.BlockGetter;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
import java.util.Map;

/**
Expand All @@ -33,25 +40,22 @@ public CoilBlock(Properties properties, ICoilType coilType) {
this.coilType = coilType;
}

/*
@Override
public void appendHoverText(@Nullable CoilType coilType, ItemStack stack, @Nullable BlockGetter level, List<Component> tooltip, TooltipFlag flag) {
public void appendHoverText(ItemStack stack, @Nullable BlockGetter level, List<Component> tooltip, TooltipFlag flag) {
super.appendHoverText(stack, level, tooltip, flag);
if (coilType != null) {
if (GTUtil.isShiftDown()) {
int coilTier = coilType.ordinal();
tooltip.add(Component.translatable("tile.wire_coil.tooltip_smelter"));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_parallel_smelter", coilType.level * 32));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_energy_smelter", Math.max(1, 16 / coilType.energyDiscount)));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_pyro"));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_speed_pyro", coilTier == 0 ? 75 : 50 * (coilTier + 1)));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_cracking"));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_energy_cracking", 100 - 10 * coilTier));
} else {
tooltip.add(Component.translatable("tile.wire_coil.tooltip_extended_info"));
}
if (GTUtil.isShiftDown()) {
int coilTier = coilType.getTier();
tooltip.add(Component.translatable("tile.wire_coil.tooltip_smelter"));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_parallel_smelter", coilType.getLevel() * 32));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_energy_smelter", Math.max(1, 16 / coilType.getEnergyDiscount())));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_pyro"));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_speed_pyro", coilTier == 0 ? 75 : 50 * (coilTier + 1)));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_cracking"));
tooltip.add(Component.translatable("tile.wire_coil.tooltip_energy_cracking", 100 - 10 * coilTier));
} else {
tooltip.add(Component.translatable("tile.wire_coil.tooltip_extended_info"));
}
}*/// todo
}

public enum CoilType implements StringRepresentable, ICoilType {
CUPRONICKEL("cupronickel", 1800, 1, 1, GTMaterials.Cupronickel, GTCEu.id("block/casings/coils/machine_coil_cupronickel")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ public static BiConsumer<ItemStack, List<Component>> createTankTooltips(String n
public final static MultiblockMachineDefinition LARGE_CHEMICAL_REACTOR = REGISTRATE.multiblock("large_chemical_reactor", WorkableElectricMultiblockMachine::new)
.rotationState(RotationState.NON_Y_AXIS)
.recipeType(GTRecipeTypes.LARGE_CHEMICAL_RECIPES)
.recipeModifier(GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.NON_PERFECT_OVERCLOCK))
.recipeModifier(GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK))
.appearanceBlock(CASING_PTFE_INERT)
.pattern(definition -> {
var casing = blocks(CASING_PTFE_INERT.get()).setMinGlobalLimited(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,15 @@ private static void initCasingLang(RegistrateLangProvider provider) {
provider.add("tile.stone_bricks_square.concrete_light.name", "Square Light Concrete Bricks");
provider.add("tile.stone_bricks_square.concrete_dark.name", "Square Dark Concrete Bricks");
*/
provider.add("tile.stone_bricks_square.concrete_dark.name", "Square Dark Concrete Bricks");
provider.add("tile.wire_coil.tooltip_extended_info", "Hold SHIFT to show Coil Bonus Info");
provider.add("tile.wire_coil.tooltip_heat", "§cBase Heat Capacity: §f%,d K");
provider.add("tile.wire_coil.tooltip_smelter", "§8Multi Smelter:");
provider.add("tile.wire_coil.tooltip_parallel_smelter", " §5Max Parallel: §f%s");
provider.add("tile.wire_coil.tooltip_energy_smelter", " §aEnergy Usage: §f%s EU/t §8per recipe");
provider.add("tile.wire_coil.tooltip_pyro", "§8Pyrolyse Oven:");
provider.add("tile.wire_coil.tooltip_speed_pyro", " §bProcessing Speed: §f%s%%");
provider.add("tile.wire_coil.tooltip_cracking", "§8Cracking Unit:");
provider.add(" tile.wire_coil.tooltip_energy_cracking", " §aEnergy Usage: §f%s%%");
}
}
Binary file not shown.
12 changes: 11 additions & 1 deletion fabric/src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
" tile.wire_coil.tooltip_energy_cracking": "%s%%ɟ§ :ǝbɐs∩ ʎbɹǝuƎɐ§ ",
"behavior.item_magnet.disabled": "pǝןqɐsıᗡ pןǝıℲ ɔıʇǝubɐWɔ§",
"behavior.item_magnet.enabled": "pǝןqɐuƎ pןǝıℲ ɔıʇǝubɐWɐ§",
"behavior.prospector.not_enough_energy": "¡ʎbɹǝuƎ ɥbnouƎ ʇoN",
Expand Down Expand Up @@ -3898,5 +3899,14 @@
"tile.gtceu.petrified_foam.name": "ɯɐoℲ pǝıɟıɹʇǝԀ",
"tile.gtceu.reinforced_foam.name": "ɯɐoℲ pǝɔɹoɟuıǝᴚ",
"tile.gtceu.reinforced_stone.name": "ǝuoʇS pǝɔɹoɟuıǝᴚ",
"tile.gtceu.seal.name": "ʞɔoןᗺ pǝןɐǝS"
"tile.gtceu.seal.name": "ʞɔoןᗺ pǝןɐǝS",
"tile.stone_bricks_square.concrete_dark.name": "sʞɔıɹᗺ ǝʇǝɹɔuoƆ ʞɹɐᗡ ǝɹɐnbS",
"tile.wire_coil.tooltip_cracking": ":ʇıu∩ buıʞɔɐɹƆ8§",
"tile.wire_coil.tooltip_energy_smelter": "ǝdıɔǝɹ ɹǝd8§ ʇ/∩Ǝ %sɟ§ :ǝbɐs∩ ʎbɹǝuƎɐ§ ",
"tile.wire_coil.tooltip_extended_info": "oɟuI snuoᗺ ןıoƆ ʍoɥs oʇ ⟘ℲIHS pןoH",
"tile.wire_coil.tooltip_heat": "ʞ p'%ɟ§ :ʎʇıɔɐdɐƆ ʇɐǝH ǝsɐᗺɔ§",
"tile.wire_coil.tooltip_parallel_smelter": "%sɟ§ :ןǝןןɐɹɐԀ xɐWϛ§ ",
"tile.wire_coil.tooltip_pyro": ":uǝʌO ǝsʎןoɹʎԀ8§",
"tile.wire_coil.tooltip_smelter": ":ɹǝʇןǝɯS ıʇןnW8§",
"tile.wire_coil.tooltip_speed_pyro": "%s%%ɟ§ :pǝǝdS buıssǝɔoɹԀq§ "
}
12 changes: 11 additions & 1 deletion fabric/src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
" tile.wire_coil.tooltip_energy_cracking": " §aEnergy Usage: §f%s%%",
"behavior.item_magnet.disabled": "§cMagnetic Field Disabled",
"behavior.item_magnet.enabled": "§aMagnetic Field Enabled",
"behavior.prospector.not_enough_energy": "Not Enough Energy!",
Expand Down Expand Up @@ -3898,5 +3899,14 @@
"tile.gtceu.petrified_foam.name": "Petrified Foam",
"tile.gtceu.reinforced_foam.name": "Reinforced Foam",
"tile.gtceu.reinforced_stone.name": "Reinforced Stone",
"tile.gtceu.seal.name": "Sealed Block"
"tile.gtceu.seal.name": "Sealed Block",
"tile.stone_bricks_square.concrete_dark.name": "Square Dark Concrete Bricks",
"tile.wire_coil.tooltip_cracking": "§8Cracking Unit:",
"tile.wire_coil.tooltip_energy_smelter": " §aEnergy Usage: §f%s EU/t §8per recipe",
"tile.wire_coil.tooltip_extended_info": "Hold SHIFT to show Coil Bonus Info",
"tile.wire_coil.tooltip_heat": "§cBase Heat Capacity: §f%,d K",
"tile.wire_coil.tooltip_parallel_smelter": " §5Max Parallel: §f%s",
"tile.wire_coil.tooltip_pyro": "§8Pyrolyse Oven:",
"tile.wire_coil.tooltip_smelter": "§8Multi Smelter:",
"tile.wire_coil.tooltip_speed_pyro": " §bProcessing Speed: §f%s%%"
}
12 changes: 11 additions & 1 deletion forge/src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
" tile.wire_coil.tooltip_energy_cracking": "%s%%ɟ§ :ǝbɐs∩ ʎbɹǝuƎɐ§ ",
"behavior.item_magnet.disabled": "pǝןqɐsıᗡ pןǝıℲ ɔıʇǝubɐWɔ§",
"behavior.item_magnet.enabled": "pǝןqɐuƎ pןǝıℲ ɔıʇǝubɐWɐ§",
"behavior.prospector.not_enough_energy": "¡ʎbɹǝuƎ ɥbnouƎ ʇoN",
Expand Down Expand Up @@ -3898,5 +3899,14 @@
"tile.gtceu.petrified_foam.name": "ɯɐoℲ pǝıɟıɹʇǝԀ",
"tile.gtceu.reinforced_foam.name": "ɯɐoℲ pǝɔɹoɟuıǝᴚ",
"tile.gtceu.reinforced_stone.name": "ǝuoʇS pǝɔɹoɟuıǝᴚ",
"tile.gtceu.seal.name": "ʞɔoןᗺ pǝןɐǝS"
"tile.gtceu.seal.name": "ʞɔoןᗺ pǝןɐǝS",
"tile.stone_bricks_square.concrete_dark.name": "sʞɔıɹᗺ ǝʇǝɹɔuoƆ ʞɹɐᗡ ǝɹɐnbS",
"tile.wire_coil.tooltip_cracking": ":ʇıu∩ buıʞɔɐɹƆ8§",
"tile.wire_coil.tooltip_energy_smelter": "ǝdıɔǝɹ ɹǝd8§ ʇ/∩Ǝ %sɟ§ :ǝbɐs∩ ʎbɹǝuƎɐ§ ",
"tile.wire_coil.tooltip_extended_info": "oɟuI snuoᗺ ןıoƆ ʍoɥs oʇ ⟘ℲIHS pןoH",
"tile.wire_coil.tooltip_heat": "ʞ p'%ɟ§ :ʎʇıɔɐdɐƆ ʇɐǝH ǝsɐᗺɔ§",
"tile.wire_coil.tooltip_parallel_smelter": "%sɟ§ :ןǝןןɐɹɐԀ xɐWϛ§ ",
"tile.wire_coil.tooltip_pyro": ":uǝʌO ǝsʎןoɹʎԀ8§",
"tile.wire_coil.tooltip_smelter": ":ɹǝʇןǝɯS ıʇןnW8§",
"tile.wire_coil.tooltip_speed_pyro": "%s%%ɟ§ :pǝǝdS buıssǝɔoɹԀq§ "
}
12 changes: 11 additions & 1 deletion forge/src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
" tile.wire_coil.tooltip_energy_cracking": " §aEnergy Usage: §f%s%%",
"behavior.item_magnet.disabled": "§cMagnetic Field Disabled",
"behavior.item_magnet.enabled": "§aMagnetic Field Enabled",
"behavior.prospector.not_enough_energy": "Not Enough Energy!",
Expand Down Expand Up @@ -3898,5 +3899,14 @@
"tile.gtceu.petrified_foam.name": "Petrified Foam",
"tile.gtceu.reinforced_foam.name": "Reinforced Foam",
"tile.gtceu.reinforced_stone.name": "Reinforced Stone",
"tile.gtceu.seal.name": "Sealed Block"
"tile.gtceu.seal.name": "Sealed Block",
"tile.stone_bricks_square.concrete_dark.name": "Square Dark Concrete Bricks",
"tile.wire_coil.tooltip_cracking": "§8Cracking Unit:",
"tile.wire_coil.tooltip_energy_smelter": " §aEnergy Usage: §f%s EU/t §8per recipe",
"tile.wire_coil.tooltip_extended_info": "Hold SHIFT to show Coil Bonus Info",
"tile.wire_coil.tooltip_heat": "§cBase Heat Capacity: §f%,d K",
"tile.wire_coil.tooltip_parallel_smelter": " §5Max Parallel: §f%s",
"tile.wire_coil.tooltip_pyro": "§8Pyrolyse Oven:",
"tile.wire_coil.tooltip_smelter": "§8Multi Smelter:",
"tile.wire_coil.tooltip_speed_pyro": " §bProcessing Speed: §f%s%%"
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencyResolutionManagement {
def architecturyLoomVersion = "1.0-SNAPSHOT"
def quiltFlowerVersion = "1.+"
def macheteVersion = "1.+"
def ldLibVersion = "1.0.11"
def ldLibVersion = "1.0.12"

fabric {
def parchment = version("parchment", parchmentVersion)
Expand Down

0 comments on commit 370bb8d

Please sign in to comment.