Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various issues in 2.7 #1935

Merged
merged 5 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nonnull;
import java.util.Objects;
Expand Down Expand Up @@ -87,6 +89,7 @@ public MaterialRegistry getMaterialRegistry() {
return registry;
}

@SideOnly(Side.CLIENT)
@Nonnull
public abstract PipeRenderer getPipeRenderer();

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ public static class MachineOptions {
public boolean enableResearch = true;

@Config.Comment({"Whether the Assembly Line should require the item inputs to be in order.", "Default: true"})
@Config.RequiresMcRestart
public boolean orderedAssembly = true;

@Config.Comment({"Whether the Assembly Line should require the fluid inputs to be in order.",
"This does nothing if B:orderedAssembly is false.",
"Default: false"})
@Config.RequiresMcRestart
public boolean orderedFluidAssembly = false;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void invalidateStructure() {
}

private TraceabilityPredicate getHatchPredicates() {
return abilities(MultiblockAbility.INPUT_ENERGY).setMaxGlobalLimited(3, 1)
.or(abilities(MultiblockAbility.OUTPUT_ENERGY).setMaxGlobalLimited(3, 1))
return abilities(MultiblockAbility.INPUT_ENERGY).setPreviewCount(2)
.or(abilities(MultiblockAbility.OUTPUT_ENERGY).setPreviewCount(2))
.or(abilities(MultiblockAbility.INPUT_LASER).setMaxGlobalLimited(1))
.or(abilities(MultiblockAbility.OUTPUT_LASER).setMaxGlobalLimited(1))
// Disallow the config maintenance hatch because that would probably break the conservation of energy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityMultiFluidHatch;
import gregtech.core.sound.GTSoundEvents;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
Expand All @@ -45,6 +47,7 @@
import net.minecraftforge.items.IItemHandlerModifiable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.function.Function;

Expand Down Expand Up @@ -107,11 +110,14 @@ protected static IBlockState getGrateState() {

@Nonnull
protected static TraceabilityPredicate fluidInputPredicate() {
// block multi-fluid hatches
return metaTileEntities(MultiblockAbility.REGISTRY.get(MultiblockAbility.IMPORT_FLUIDS).stream()
.filter(mte -> !(mte instanceof MetaTileEntityMultiFluidHatch))
.toArray(MetaTileEntity[]::new))
.setMaxGlobalLimited(4);
// block multi-fluid hatches if ordered fluids is enabled
if (ConfigHolder.machines.orderedFluidAssembly) {
return metaTileEntities(MultiblockAbility.REGISTRY.get(MultiblockAbility.IMPORT_FLUIDS).stream()
.filter(mte -> !(mte instanceof MetaTileEntityMultiFluidHatch))
.toArray(MetaTileEntity[]::new))
.setMaxGlobalLimited(4);
}
return abilities(MultiblockAbility.IMPORT_FLUIDS);
}

@Nonnull
Expand Down Expand Up @@ -338,4 +344,15 @@ private static boolean isRecipeAvailable(@Nonnull Iterable<? extends IDataAccess
}
return false;
}

@Override
public void addInformation(ItemStack stack, @Nullable World world, @Nonnull List<String> tooltip, boolean advanced) {
if (ConfigHolder.machines.orderedAssembly && ConfigHolder.machines.orderedFluidAssembly) {
tooltip.add(I18n.format("gregtech.machine.assembly_line.tooltip_ordered_both"));
} else if (ConfigHolder.machines.orderedAssembly) {
tooltip.add(I18n.format("gregtech.machine.assembly_line.tooltip_ordered_items"));
} else if (ConfigHolder.machines.orderedFluidAssembly) {
tooltip.add(I18n.format("gregtech.machine.assembly_line.tooltip_ordered_fluids"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ public void addInformation(ItemStack stack, @Nullable World world, @Nonnull List
tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.1"));
tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.2"));
tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.3"));
tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.4", GTValues.VA[GTValues.EV], GTValues.VA[GTValues.LuV]));
tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.4", GTValues.VA[GTValues.EV]));
tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.5", GTValues.VA[GTValues.LuV]));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected boolean openGUIOnRightClick() {
}

protected int getInventorySize() {
return getTier() == GTValues.ZPM ? 16 : 9;
return getTier() == GTValues.LuV ? 16 : 9;
}

private void rebuildData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected WireProperties createProperties(Insulation insulation, Material materi
return insulation.modifyProperties(enabledMaterials.getOrDefault(material, getFallbackType()));
}

@SideOnly(Side.CLIENT)
@Nonnull
@Override
public PipeRenderer getPipeRenderer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected FluidPipeProperties createProperties(FluidPipeType fluidPipeType, Mate
return fluidPipeType.modifyProperties(enabledMaterials.getOrDefault(material, getFallbackType()));
}

@SideOnly(Side.CLIENT)
@Nonnull
@Override
public PipeRenderer getPipeRenderer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ protected ItemPipeProperties createProperties(ItemPipeType itemPipeType, Materia
return itemPipeType.modifyProperties(enabledMaterials.getOrDefault(material, getFallbackType()));
}

@SideOnly(Side.CLIENT)
@Nonnull
@Override
public PipeRenderer getPipeRenderer() {
Expand Down
31 changes: 16 additions & 15 deletions src/main/java/gregtech/loaders/recipe/ComputerRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ public static void init() {

ASSEMBLY_LINE_RECIPES.recipeBuilder()
.inputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_CASING))
.input(circuit, Tier.LuV, 4)
.input(circuit, Tier.LuV, 8)
.inputNBT(TOOL_DATA_ORB, NBTMatcher.ANY, NBTCondition.ANY)
.input(wireFine, Cobalt, 64)
.input(wireFine, Copper, 64)
.input(OPTICAL_PIPES[0], 4)
.input(wireGtSingle, IndiumTinBariumTitaniumCuprate, 8)
.input(wireGtDouble, IndiumTinBariumTitaniumCuprate, 16)
.fluidInputs(SolderingAlloy.getFluid(L * 2))
.fluidInputs(Lubricant.getFluid(500))
.output(DATA_BANK)
Expand All @@ -107,11 +107,11 @@ public static void init() {

ASSEMBLY_LINE_RECIPES.recipeBuilder()
.input(DATA_BANK)
.input(SENSOR_LuV, 4)
.input(SENSOR_LuV, 8)
.input(circuit, Tier.ZPM, 8)
.input(FIELD_GENERATOR_LuV)
.input(FIELD_GENERATOR_LuV, 2)
.input(ELECTRIC_MOTOR_ZPM, 2)
.input(wireGtSingle, UraniumRhodiumDinaquadide, 16)
.input(wireGtDouble, UraniumRhodiumDinaquadide, 32)
.input(foil, Trinium, 32)
.input(OPTICAL_PIPES[0], 16)
.fluidInputs(SolderingAlloy.getFluid(L * 8))
Expand All @@ -125,11 +125,11 @@ public static void init() {

ASSEMBLY_LINE_RECIPES.recipeBuilder()
.input(ITEM_IMPORT_BUS[ZPM])
.input(EMITTER_LuV, 4)
.input(EMITTER_LuV, 8)
.input(circuit, Tier.ZPM)
.input(ROBOT_ARM_ZPM)
.input(ROBOT_ARM_ZPM, 2)
.input(ELECTRIC_MOTOR_ZPM, 2)
.input(wireGtSingle, UraniumRhodiumDinaquadide, 4)
.input(wireGtDouble, UraniumRhodiumDinaquadide, 16)
.input(OPTICAL_PIPES[0], 2)
.fluidInputs(SolderingAlloy.getFluid(L * 4))
.fluidInputs(Polybenzimidazole.getFluid(L * 2))
Expand All @@ -142,11 +142,12 @@ public static void init() {

ASSEMBLY_LINE_RECIPES.recipeBuilder()
.inputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_CASING))
.input(EMITTER_ZPM)
.input(SENSOR_ZPM)
.input(EMITTER_ZPM, 4)
.input(SENSOR_ZPM, 4)
.input(circuit, Tier.UV, 4)
.input(wireGtSingle, UraniumRhodiumDinaquadide, 4)
.input(foil, Tritanium, 32)
.input(wireGtDouble, EnrichedNaquadahTriniumEuropiumDuranide, 32)
.input(foil, Tritanium, 64)
.input(foil, Tritanium, 64)
.input(OPTICAL_PIPES[0], 8)
.fluidInputs(SolderingAlloy.getFluid(L * 4))
.fluidInputs(Polybenzimidazole.getFluid(L * 4))
Expand All @@ -160,10 +161,10 @@ public static void init() {
ASSEMBLY_LINE_RECIPES.recipeBuilder()
.input(DATA_BANK)
.input(circuit, Tier.ZPM, 4)
.input(FIELD_GENERATOR_LuV, 2)
.input(FIELD_GENERATOR_LuV, 8)
.inputNBT(TOOL_DATA_ORB, NBTMatcher.ANY, NBTCondition.ANY)
.input(COVER_SCREEN)
.input(wireGtSingle, EnrichedNaquadahTriniumEuropiumDuranide, 16)
.input(wireGtDouble, UraniumRhodiumDinaquadide, 64)
.input(OPTICAL_PIPES[0], 16)
.fluidInputs(SolderingAlloy.getFluid(L * 8))
.fluidInputs(VanadiumGallium.getFluid(L * 8))
Expand Down Expand Up @@ -228,7 +229,7 @@ public static void init() {
.input(FIELD_GENERATOR_ZPM)
.output(HPCA_ADVANCED_COMPUTATION_COMPONENT)
.fluidInputs(PCBCoolant.getFluid(1000))
.cleanroom(CleanroomType.STERILE_CLEANROOM)
.cleanroom(CleanroomType.CLEANROOM)
.duration(200).EUt(VA[ZPM]).buildAndRegister();

ASSEMBLER_RECIPES.recipeBuilder()
Expand Down
12 changes: 8 additions & 4 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4600,6 +4600,9 @@ gregtech.machine.large_boiler.titanium.name=Large Titanium Boiler
gregtech.machine.large_boiler.tungstensteel.name=Large Tungstensteel Boiler

gregtech.machine.assembly_line.name=Assembly Line
gregtech.machine.assembly_line.tooltip_ordered_items=§fItems§7 must be in the correct order to run.
gregtech.machine.assembly_line.tooltip_ordered_fluids=§Fluids§7 must be in the correct order to run.
gregtech.machine.assembly_line.tooltip_ordered_both=§fItems§7 and §Fluids§7 must be in the correct order to run.
gregtech.machine.fusion_reactor.luv.name=Fusion Reactor Computer Mark 1
gregtech.machine.fusion_reactor.zpm.name=Fusion Reactor Computer Mark 2
gregtech.machine.fusion_reactor.uv.name=Fusion Reactor Computer Mark 3
Expand Down Expand Up @@ -4667,7 +4670,8 @@ gregtech.machine.data_bank.name=Data Bank
gregtech.machine.data_bank.tooltip.1=Your Personal NAS
gregtech.machine.data_bank.tooltip.2=Bulk Data Storage. Transfer with Optical Cables.
gregtech.machine.data_bank.tooltip.3=Data Banks can be chained together.
gregtech.machine.data_bank.tooltip.4=Uses §f%s EU/t§7 per Data Hatch and §f%s EU/t§7 when chained.
gregtech.machine.data_bank.tooltip.4=Uses §f%s EU/t§7 per Data Hatch normally.
gregtech.machine.data_bank.tooltip.5=Uses §f%s EU/t§7 per Data Hatch when chained.
gregtech.multiblock.data_bank.description=The Data Bank is a multiblock structure used for sharing Assembly Line Research Data between multiple Assembly Lines. Additionally, it enables Assembly Lines to read more complex research data on Data Modules.

gregtech.machine.power_substation.name=Power Substation
Expand Down Expand Up @@ -4986,7 +4990,7 @@ gregtech.machine.passthrough_hatch_fluid.tooltip=Sends Fluids from one Side to t

gregtech.machine.data_access_hatch.name=Data Access Hatch
gregtech.machine.data_access_hatch.tooltip.1=Data Access for Multiblocks
gregtech.machine.data_access_hatch.tooltip.2=Adds §a%s§7 slots for Data Sticks
gregtech.machine.data_access_hatch.tooltip.2=Adds §a%s§7 slots for Data Items
gregtech.machine.data_access_hatch.advanced.name=Advanced Data Access Hatch
gregtech.machine.data_access_hatch.creative.name=Creative Data Access Hatch

Expand All @@ -5002,10 +5006,10 @@ gregtech.machine.research_station.object_holder.name=Object Holder
gregtech.machine.research_station.object_holder.tooltip=Advanced Holding Mechanism for Research Station

gregtech.machine.laser_hatch.source.name=Laser Source Hatch
gregtech.machine.laser_hatch.source.tooltip1=Receiving power from distance
gregtech.machine.laser_hatch.source.tooltip1=Transmitting power at distance
gregtech.machine.laser_hatch.source.tooltip2=§cLaser Cables must be in a straight line!§7
gregtech.machine.laser_hatch.target.name=Laser Target Hatch
gregtech.machine.laser_hatch.target.tooltip1=Transmitting power at distance
gregtech.machine.laser_hatch.target.tooltip1=Receiving power from distance
gregtech.machine.laser_hatch.target.tooltip2=§cLaser Cables must be in a straight line!§7

gregtech.machine.fluid_tank.max_multiblock=Max Multiblock Size: %,dx%,dx%,d
Expand Down