From 69bbb9ec75b5dc611f596b09506d22401ccb55f9 Mon Sep 17 00:00:00 2001 From: PouffyDev <99536749+pouffy@users.noreply.github.com> Date: Tue, 15 Jul 2025 21:17:29 +0100 Subject: [PATCH] Registries for Electrodes & Cable Types - Port my registry commit to 1.21.1! - Added registries for Electrodes and Cable Types. - Winding Machines now tint the main spool instead of requiring partial models for each spool. - Electrode Holders now render the item model of the electrode instead of requiring partial models for each electrode. - Added Resistivity config for Cable Types. - Updated classes to handle the new registries instead of enums. - Moved the ChemicalVatCategory's recipe sprite to a separate method so mixins can target the sprites specifically. --- src/main/java/com/drmangotea/tfmg/TFMG.java | 2 + .../com/drmangotea/tfmg/TFMGRegistries.java | 30 +++++++ .../drmangotea/tfmg/base/TFMGRegistrate.java | 37 ++++++++ .../com/drmangotea/tfmg/base/TFMGUtils.java | 12 +++ .../tfmg/base/events/TFMGCommonEvents.java | 9 ++ .../drmangotea/tfmg/config/TFMGConfigs.java | 3 + .../tfmg/config/TFMGResistivity.java | 63 +++++++++++++ .../tfmg/config/TFMGServerConfig.java | 1 + .../connection/cable_type/CableType.java | 69 ++++++++++++++ .../cable_type/CableTypeBuilder.java | 68 ++++++++++++++ .../connection/cable_type/CableTypeEntry.java | 15 ++++ .../cable_type/ResistivityValues.java | 14 +++ .../connection/cables/CableConnection.java | 24 +---- .../cables/CableConnectorBlockEntity.java | 2 +- .../cables/CableConnectorRenderer.java | 2 +- .../misc/winding_machine/SpoolItem.java | 25 +++--- .../WindingMachineRenderer.java | 7 +- .../ElectrodeHolderBlock.java | 15 +++- .../ElectrodeHolderBlockEntity.java | 76 +++++----------- .../ElectrodeHolderRenderer.java | 23 +++-- .../electrode_holder/electrode/Electrode.java | 85 ++++++++++++++++++ .../electrode/ElectrodeBuilder.java | 67 ++++++++++++++ .../electrode/ElectrodeEntry.java | 15 ++++ .../tfmg/mixin/BuiltInRegistriesMixin.java | 28 ++++++ .../tfmg/recipes/jei/ChemicalVatCategory.java | 61 ++++++++----- .../tfmg/recipes/jei/WindingCategory.java | 16 ++-- .../recipes/jei/machines/WindingMachine.java | 15 ++-- .../tfmg/registry/TFMGCableTypes.java | 51 +++++++++++ .../tfmg/registry/TFMGElectrodes.java | 41 +++++++++ .../tfmg/registry/TFMGGuiTextures.java | 1 + .../drmangotea/tfmg/registry/TFMGItems.java | 13 +-- .../tfmg/registry/TFMGPartialModels.java | 1 + .../block/winding_machine/spool_wire.json | 20 +++++ .../assets/tfmg/textures/block/spool_wire.png | Bin 0 -> 110 bytes .../textures/block/winding_machine_wire.png | Bin 193 -> 121 bytes .../block/winding_machine_wire_animated.png | Bin 243 -> 264 bytes .../assets/tfmg/textures/gui/chemical_vat.png | Bin 4258 -> 4151 bytes src/main/resources/tfmg.mixins.json | 1 + 38 files changed, 764 insertions(+), 148 deletions(-) create mode 100644 src/main/java/com/drmangotea/tfmg/TFMGRegistries.java create mode 100644 src/main/java/com/drmangotea/tfmg/config/TFMGResistivity.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableType.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeBuilder.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeEntry.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/ResistivityValues.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/Electrode.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeBuilder.java create mode 100644 src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeEntry.java create mode 100644 src/main/java/com/drmangotea/tfmg/mixin/BuiltInRegistriesMixin.java create mode 100644 src/main/java/com/drmangotea/tfmg/registry/TFMGCableTypes.java create mode 100644 src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java create mode 100644 src/main/resources/assets/tfmg/models/block/winding_machine/spool_wire.json create mode 100644 src/main/resources/assets/tfmg/textures/block/spool_wire.png diff --git a/src/main/java/com/drmangotea/tfmg/TFMG.java b/src/main/java/com/drmangotea/tfmg/TFMG.java index 137a0ff1..6fdd805c 100644 --- a/src/main/java/com/drmangotea/tfmg/TFMG.java +++ b/src/main/java/com/drmangotea/tfmg/TFMG.java @@ -62,6 +62,8 @@ public class TFMG { TFMGSoundEvents.prepare(); + TFMGElectrodes.init(); + TFMGCableTypes.init(); TFMGCreativeTabs.register(modEventBus); TFMGBlocks.init(); TFMGBlockEntities.init(); diff --git a/src/main/java/com/drmangotea/tfmg/TFMGRegistries.java b/src/main/java/com/drmangotea/tfmg/TFMGRegistries.java new file mode 100644 index 00000000..7b56f9d9 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/TFMGRegistries.java @@ -0,0 +1,30 @@ +package com.drmangotea.tfmg; + +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; +import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode.Electrode; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.neoforged.neoforge.registries.RegistryBuilder; + +import static com.drmangotea.tfmg.TFMG.REGISTRATE; + +public class TFMGRegistries { + public static final ResourceKey> CABLE_TYPE = createRegistryKey("cable_types"); + public static final ResourceKey> ELECTRODE = createRegistryKey("electrodes"); + + public static final Registry CABLE_TYPE_REGISTRY = makeSyncedRegistry(CABLE_TYPE); + public static final Registry ELECTRODE_REGISTRY = makeSyncedRegistry(ELECTRODE); + + + private static ResourceKey> createRegistryKey(String name) { + return ResourceKey.createRegistryKey(TFMG.asResource(name)); + } + + private static Registry makeSyncedRegistry(ResourceKey> registryKey) { + return new RegistryBuilder<>(registryKey).sync(true).create(); + } + + private static Registry makeRegistry(ResourceKey> registryKey) { + return new RegistryBuilder<>(registryKey).create(); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/base/TFMGRegistrate.java b/src/main/java/com/drmangotea/tfmg/base/TFMGRegistrate.java index 7b078792..4988c023 100644 --- a/src/main/java/com/drmangotea/tfmg/base/TFMGRegistrate.java +++ b/src/main/java/com/drmangotea/tfmg/base/TFMGRegistrate.java @@ -2,12 +2,17 @@ package com.drmangotea.tfmg.base; import com.drmangotea.tfmg.TFMG; import com.drmangotea.tfmg.base.fluid.GasFluidType; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableTypeBuilder; +import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode.Electrode; +import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode.ElectrodeBuilder; import com.simibubi.create.content.fluids.VirtualFluid; import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.data.VirtualFluidBuilder; import com.simibubi.create.foundation.item.TooltipModifier; import com.tterrag.registrate.Registrate; import com.tterrag.registrate.builders.FluidBuilder; +import com.tterrag.registrate.util.nullness.NonNullFunction; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; @@ -69,4 +74,36 @@ public class TFMGRegistrate extends CreateRegistrate { return TFMG.REGISTRATE.get(name+"_bucket", Registries.ITEM).get(); } + public CableTypeBuilder cableType(NonNullFunction factory) { + return cableType((TFMGRegistrate) self(), factory); + } + + public CableTypeBuilder cableType(String name, NonNullFunction factory) { + return cableType((TFMGRegistrate) self(), name, factory); + } + + public CableTypeBuilder cableType(P parent, NonNullFunction factory) { + return cableType(parent, currentName(), factory); + } + + public CableTypeBuilder cableType(P parent, String name, NonNullFunction factory) { + return entry(name, callback -> CableTypeBuilder.create(this, parent, name, callback, factory)); + } + + public ElectrodeBuilder electrode(NonNullFunction factory) { + return electrode((TFMGRegistrate) self(), factory); + } + + public ElectrodeBuilder electrode(String name, NonNullFunction factory) { + return electrode((TFMGRegistrate) self(), name, factory); + } + + public ElectrodeBuilder electrode(P parent, NonNullFunction factory) { + return electrode(parent, currentName(), factory); + } + + public ElectrodeBuilder electrode(P parent, String name, NonNullFunction factory) { + return entry(name, callback -> ElectrodeBuilder.create(this, parent, name, callback, factory)); + } + } diff --git a/src/main/java/com/drmangotea/tfmg/base/TFMGUtils.java b/src/main/java/com/drmangotea/tfmg/base/TFMGUtils.java index 355a95b2..07241dda 100644 --- a/src/main/java/com/drmangotea/tfmg/base/TFMGUtils.java +++ b/src/main/java/com/drmangotea/tfmg/base/TFMGUtils.java @@ -2,9 +2,12 @@ package com.drmangotea.tfmg.base; import com.drmangotea.tfmg.TFMG; +import com.drmangotea.tfmg.TFMGRegistries; import com.drmangotea.tfmg.base.spark.ElectricSparkParticle; import com.drmangotea.tfmg.base.spark.Spark; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; import com.drmangotea.tfmg.content.electricity.connection.cables.CablePos; +import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode.Electrode; import com.drmangotea.tfmg.registry.TFMGEntityTypes; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -22,6 +25,7 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; @@ -383,4 +387,12 @@ public class TFMGUtils { } + public static Electrode getElectrode(ResourceLocation key) { + return TFMGRegistries.ELECTRODE_REGISTRY.get(key); + } + + public static CableType getCableType(ResourceLocation key) { + return TFMGRegistries.CABLE_TYPE_REGISTRY.get(key); + } + } diff --git a/src/main/java/com/drmangotea/tfmg/base/events/TFMGCommonEvents.java b/src/main/java/com/drmangotea/tfmg/base/events/TFMGCommonEvents.java index 020dd2ea..44c78720 100644 --- a/src/main/java/com/drmangotea/tfmg/base/events/TFMGCommonEvents.java +++ b/src/main/java/com/drmangotea/tfmg/base/events/TFMGCommonEvents.java @@ -2,6 +2,7 @@ package com.drmangotea.tfmg.base.events; import com.drmangotea.tfmg.TFMG; +import com.drmangotea.tfmg.TFMGRegistries; import com.drmangotea.tfmg.content.decoration.tanks.TFMGFluidTankBlockEntity; import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankBlockEntity; import com.drmangotea.tfmg.content.electricity.base.IElectric; @@ -37,6 +38,7 @@ import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; import net.neoforged.neoforge.event.AddReloadListenerEvent; import net.neoforged.neoforge.event.level.BlockEvent; import net.neoforged.neoforge.event.level.LevelEvent; +import net.neoforged.neoforge.registries.NewRegistryEvent; @EventBusSubscriber @@ -105,6 +107,13 @@ public class TFMGCommonEvents { CokeOvenBlockEntity.registerCapabilities(event); AirIntakeBlockEntity.registerCapabilities(event); } + + @SubscribeEvent + public static void newRegistry(NewRegistryEvent event) { + event.register(TFMGRegistries.CABLE_TYPE_REGISTRY); + event.register(TFMGRegistries.ELECTRODE_REGISTRY); + } } + } diff --git a/src/main/java/com/drmangotea/tfmg/config/TFMGConfigs.java b/src/main/java/com/drmangotea/tfmg/config/TFMGConfigs.java index 747977f3..d77db6a6 100644 --- a/src/main/java/com/drmangotea/tfmg/config/TFMGConfigs.java +++ b/src/main/java/com/drmangotea/tfmg/config/TFMGConfigs.java @@ -1,5 +1,6 @@ package com.drmangotea.tfmg.config; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.ResistivityValues; import com.simibubi.create.api.stress.BlockStressValues; import com.simibubi.create.infrastructure.config.CCommon; @@ -60,6 +61,8 @@ public class TFMGConfigs { TFMGStress stress = TFMGConfigs.server().stressValues; BlockStressValues.IMPACTS.registerProvider(stress::getImpact); BlockStressValues.CAPACITIES.registerProvider(stress::getCapacity); + TFMGResistivity resistivity = server().resistivityValues; + ResistivityValues.RESISTIVITIES.registerProvider(resistivity::getResistivity); } @SubscribeEvent diff --git a/src/main/java/com/drmangotea/tfmg/config/TFMGResistivity.java b/src/main/java/com/drmangotea/tfmg/config/TFMGResistivity.java new file mode 100644 index 00000000..9ec6faf8 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/config/TFMGResistivity.java @@ -0,0 +1,63 @@ +package com.drmangotea.tfmg.config; + +import com.drmangotea.tfmg.TFMG; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableTypeBuilder; +import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; +import it.unimi.dsi.fastutil.objects.Object2DoubleMap; +import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap; +import net.createmod.catnip.config.ConfigBase; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.common.ModConfigSpec; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.DoubleSupplier; + +public class TFMGResistivity extends ConfigBase { + // bump this version to reset configured values. + private static final int VERSION = 2; + + // IDs need to be used since configs load before registration + + private static final Object2DoubleMap DEFAULT_RESISTIVITIES = new Object2DoubleOpenHashMap<>(); + + protected final Map> resistivities = new HashMap<>(); + + @Override + public void registerAll(ModConfigSpec.Builder builder) { + builder.comment(".", Comments.resistivity).push("resistivity"); + DEFAULT_RESISTIVITIES.forEach((id, value) -> this.resistivities.put(id, builder.define(id.getPath(), value))); + builder.pop(); + } + + @Override + public String getName() { + return "resistivityValues.v" + VERSION; + } + + @Nullable + public DoubleSupplier getResistivity(CableType cableType) { + ResourceLocation id = cableType.getKey(); + ModConfigSpec.ConfigValue value = this.resistivities.get(id); + return value == null ? null : value::get; + } + + public static NonNullUnaryOperator> setNoResistivity() { + return setResistivity(0); + } + + public static NonNullUnaryOperator> setResistivity(double value) { + return builder -> { + //assertFromCreate(builder); + ResourceLocation id = TFMG.asResource(builder.getName()); + DEFAULT_RESISTIVITIES.put(id, value); + return builder; + }; + } + + private static class Comments { + static String resistivity = "Configure the individual resistivity of cable types."; + } +} diff --git a/src/main/java/com/drmangotea/tfmg/config/TFMGServerConfig.java b/src/main/java/com/drmangotea/tfmg/config/TFMGServerConfig.java index 99a3ee77..4a48d691 100644 --- a/src/main/java/com/drmangotea/tfmg/config/TFMGServerConfig.java +++ b/src/main/java/com/drmangotea/tfmg/config/TFMGServerConfig.java @@ -8,6 +8,7 @@ public class TFMGServerConfig extends ConfigBase { public final TFMGStress stressValues = nested(0, TFMGStress::new, "Fine tune the kinetic stats of individual components"); + public final TFMGResistivity resistivityValues = nested(0, TFMGResistivity::new, "Fine tune the resistivity stats of individual cable types"); @Override public String getName() { diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableType.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableType.java new file mode 100644 index 00000000..7050cb9c --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableType.java @@ -0,0 +1,69 @@ +package com.drmangotea.tfmg.content.electricity.connection.cable_type; + +import com.drmangotea.tfmg.registry.TFMGItems; +import com.tterrag.registrate.util.entry.ItemEntry; +import net.minecraft.Util; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; + +public class CableType { + private String descriptionId; + private final ResourceLocation id; + private final int color; + private final ItemEntry spool; + + public CableType(Properties properties) { + this.id = properties.id; + this.color = properties.color; + this.spool = properties.spool; + } + + public int getColor() { + return this.color; + } + + public ItemEntry getSpool() { + return this.spool; + } + + public String getOrCreateDescriptionId() { + if (this.descriptionId == null) { + this.descriptionId = Util.makeDescriptionId("cable_type", getKey()); + } + + return this.descriptionId; + } + + public String getDescriptionId() { + return this.getOrCreateDescriptionId(); + } + + public Component getDisplayName() { + return Component.translatable(this.getOrCreateDescriptionId()); + } + + public ResourceLocation getKey() { + return this.id; + } + + public static class Properties { + private ResourceLocation id; + + int color = 0xffffff; + ItemEntry spool = TFMGItems.COPPER_SPOOL; + + public Properties color(int color) { + this.color = color; + return this; + } + + public Properties spool(ItemEntry spool) { + this.spool = spool; + return this; + } + + public Properties(ResourceLocation id) { + this.id = id; + } + } +} diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeBuilder.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeBuilder.java new file mode 100644 index 00000000..a246a485 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeBuilder.java @@ -0,0 +1,68 @@ +package com.drmangotea.tfmg.content.electricity.connection.cable_type; + +import com.drmangotea.tfmg.TFMG; +import com.drmangotea.tfmg.TFMGRegistries; +import com.tterrag.registrate.AbstractRegistrate; +import com.tterrag.registrate.builders.AbstractBuilder; +import com.tterrag.registrate.builders.BuilderCallback; +import com.tterrag.registrate.util.entry.RegistryEntry; +import com.tterrag.registrate.util.nullness.NonNullFunction; +import com.tterrag.registrate.util.nullness.NonNullSupplier; +import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; +import com.tterrag.registrate.util.nullness.NonnullType; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.registries.DeferredHolder; + +public class CableTypeBuilder extends AbstractBuilder> { + + public static CableTypeBuilder create(AbstractRegistrate owner, P parent, String name, BuilderCallback callback, NonNullFunction factory) { + return new CableTypeBuilder<>(owner, parent, name, callback, factory); + } + + private final NonNullFunction factory; + + private NonNullSupplier initialProperties = () -> new CableType.Properties(ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName())); + private NonNullFunction propertiesCallback = NonNullUnaryOperator.identity(); + + public CableTypeBuilder(AbstractRegistrate owner, P parent, String name, BuilderCallback callback, NonNullFunction factory) { + super(owner, parent, name, callback, TFMGRegistries.CABLE_TYPE); + this.factory = factory; + } + + public CableTypeBuilder properties(NonNullUnaryOperator func) { + propertiesCallback = propertiesCallback.andThen(func); + return this; + } + + public CableTypeBuilder initialProperties(NonNullSupplier properties) { + initialProperties = properties; + return this; + } + + public CableTypeBuilder defaultLang() { + return lang(CableType::getDescriptionId); + } + + public CableTypeBuilder lang(String name) { + return lang(CableType::getDescriptionId, name); + } + + @Override + protected @NonnullType T createEntry() { + CableType.Properties properties = this.initialProperties.get(); + properties = propertiesCallback.apply(properties); + return factory.apply(properties); + } + + @Override + protected RegistryEntry createEntryWrapper(DeferredHolder delegate) { + return new CableTypeEntry<>(getOwner(), delegate); + } + + @Override + public CableTypeEntry register() { + //Registry.register(TFMGRegistries.CABLE_TYPE_REGISTRY, ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName()), createEntry()); + return (CableTypeEntry) super.register(); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeEntry.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeEntry.java new file mode 100644 index 00000000..67f05ec9 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/CableTypeEntry.java @@ -0,0 +1,15 @@ +package com.drmangotea.tfmg.content.electricity.connection.cable_type; + +import com.tterrag.registrate.AbstractRegistrate; +import com.tterrag.registrate.util.entry.RegistryEntry; +import net.neoforged.neoforge.registries.DeferredHolder; + +public class CableTypeEntry extends RegistryEntry { + public CableTypeEntry(AbstractRegistrate owner, DeferredHolder delegate) { + super(owner, delegate); + } + + public static CableTypeEntry cast(RegistryEntry entry) { + return RegistryEntry.cast(CableTypeEntry.class, entry); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/ResistivityValues.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/ResistivityValues.java new file mode 100644 index 00000000..053c1ace --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cable_type/ResistivityValues.java @@ -0,0 +1,14 @@ +package com.drmangotea.tfmg.content.electricity.connection.cable_type; + +import com.simibubi.create.api.registry.SimpleRegistry; + +import java.util.function.DoubleSupplier; + +public class ResistivityValues { + public static final SimpleRegistry RESISTIVITIES = SimpleRegistry.create(); + + public static double getResistivity(CableType conductor) { + DoubleSupplier supplier = RESISTIVITIES.get(conductor); + return supplier == null ? 0 : supplier.getAsDouble(); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnection.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnection.java index 931b2854..aa3994f7 100644 --- a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnection.java +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnection.java @@ -1,10 +1,12 @@ package com.drmangotea.tfmg.content.electricity.connection.cables; import com.drmangotea.tfmg.base.TFMGUtils; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; import com.drmangotea.tfmg.registry.TFMGItems; import com.tterrag.registrate.util.entry.ItemEntry; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import org.checkerframework.checker.units.qual.C; @@ -46,7 +48,7 @@ public class CableConnection { compoundTag.putBoolean("Visible", visible); - compoundTag.putString("CableType", type.toString()); + compoundTag.putString("CableType", type.getKey().toString()); return compoundTag; } @@ -63,29 +65,11 @@ public class CableConnection { BlockPos blockPos1 = BlockPos.of(compoundTag.getLong("Pos")); boolean visible = compoundTag.getBoolean("Visible"); - CableType type = CableType.valueOf(compoundTag.getString("CableType")); + CableType type = TFMGUtils.getCableType(ResourceLocation.parse(compoundTag.getString("CableType"))); return new CableConnection(pos1,pos2,blockPos1,type,visible); } public float getLength(){ return TFMGUtils.getDistance(new BlockPos((int) pos1.x(), (int) pos1.y(), (int) pos1.z()),new BlockPos((int) pos2.x(), (int) pos2.y(), (int) pos2.z()), false); } - - - public enum CableType{ - NONE(TFMGItems.COPPER_WIRE, 0,0xffffff), - COPPER(TFMGItems.COPPER_WIRE, 0.00188f,0xD8735A), - ALUMINUM(TFMGItems.ALUMINUM_WIRE, 0.0027f,0xEDEFEF), - CONSTANTAN(TFMGItems.CONSTANTAN_WIRE, 1f,0xEDEFEF), - STEEL_REINFORCED_ALUMINUM(TFMGItems.COPPER_WIRE, 0.0027f,0xB8A08D) - ; - public final ItemEntry wire; - public final float resistivity; - public final int color; - CableType(ItemEntry wire, float resistivity, int color){ - this.wire = wire; - this.resistivity = resistivity; - this.color = color; - } - } } diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorBlockEntity.java index 09ccbe74..f3a9ab10 100644 --- a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorBlockEntity.java @@ -72,7 +72,7 @@ public class CableConnectorBlockEntity extends ElectricBlockEntity implements IH return; for (CableConnection connection : connections) { - ItemEntity itemToDrop = new ItemEntity(level, getBlockPos().getX() + 0.5f, getBlockPos().getY() + 0.5f, getBlockPos().getZ() + 0.5f, new ItemStack(connection.type.wire.get(), (int) (connection.getLength()/8))); + ItemEntity itemToDrop = new ItemEntity(level, getBlockPos().getX() + 0.5f, getBlockPos().getY() + 0.5f, getBlockPos().getZ() + 0.5f, new ItemStack(connection.type.getSpool().get(), (int) (connection.getLength()/8))); if (itemToDrop.getItem().getCount() > 0) { level.addFreshEntity(itemToDrop); } diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorRenderer.java b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorRenderer.java index 03ee63b1..0dbe4910 100644 --- a/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorRenderer.java +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/connection/cables/CableConnectorRenderer.java @@ -36,7 +36,7 @@ public class CableConnectorRenderer extends SafeBlockEntityRendererposToConnect.asLong() ? otherBE : be; //CableConnectorBlockEntity connectedBe2= pos.asLong()>posToConnect.asLong() ? be : otherBE; -// - CableConnection connection1 = new CableConnection(be.getCablePosition(), otherBE.getCablePosition(), otherBE.getBlockPos(),type,true); - CableConnection connection2 = new CableConnection(otherBE.getCablePosition(), be.getCablePosition(), be.getBlockPos(),type,false); + CableType cableType = TFMGUtils.getCableType(cableTypeKey); + + CableConnection connection1 = new CableConnection(be.getCablePosition(), otherBE.getCablePosition(), otherBE.getBlockPos(),cableType,true); + CableConnection connection2 = new CableConnection(otherBE.getCablePosition(), be.getCablePosition(), be.getBlockPos(),cableType,false); float wireCost = (connection1.getLength()/8); @@ -224,7 +227,7 @@ public class SpoolItem extends Item { @Override public boolean isBarVisible(ItemStack stack) { - return model != null; + return !Objects.equals(cableTypeKey, TFMG.asResource("empty")) && TFMGRegistries.CABLE_TYPE_REGISTRY.containsKey(cableTypeKey); } @Override diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/misc/winding_machine/WindingMachineRenderer.java b/src/main/java/com/drmangotea/tfmg/content/machinery/misc/winding_machine/WindingMachineRenderer.java index e7341be3..37da64c6 100644 --- a/src/main/java/com/drmangotea/tfmg/content/machinery/misc/winding_machine/WindingMachineRenderer.java +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/misc/winding_machine/WindingMachineRenderer.java @@ -52,18 +52,18 @@ public class WindingMachineRenderer extends KineticBlockEntityRenderer type, BlockPos pos, BlockState state) { @@ -40,10 +41,12 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I public boolean setElectrode(ItemStack modeItem, boolean simulate) { - for (ElectrodeType type : ElectrodeType.values()) { - if (type.item.is(modeItem.getItem())) { + if (level == null) return false; + for (Electrode electrode : TFMGRegistries.ELECTRODE_REGISTRY.stream().toList()) { + if (electrode.getStack().isEmpty()) continue; + if (modeItem.is(electrode.getStack().getItem())) { if (!simulate) { - electrodeType = type; + this.electrode = electrode; } else return true; } } @@ -68,14 +71,7 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I @Override public float resistance() { - - if (electrodeType != ElectrodeType.NONE) { - if (electrodeType == ElectrodeType.GRAPHITE) { - return 300; - } else return 100; - } - - return 0; + return this.electrode.getResistance(); } @Override @@ -83,13 +79,11 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I return true; } - public boolean setElectrode(String name, boolean simulate) { - for (ElectrodeType type : ElectrodeType.values()) { - if (Objects.equals(type.name, name)) { - if (!simulate) { - electrodeType = type; - } else return true; - } + public boolean setElectrode(Electrode electrode, boolean simulate) { + if (electrode != null) { + if (!simulate) { + this.electrode = electrode; + } else return true; } if (!simulate && hasLevel()) VatBlock.updateVatState(getBlockState(), getLevel(), getBlockPos().relative(Direction.DOWN)); @@ -115,11 +109,8 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I @Override public void write(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) { - for (ElectrodeType electrode : ElectrodeType.values()) { - if (electrode == electrodeType) { - compound.putString("Electrode", electrode.name); - } - } + compound.putString("Electrode", electrode.getKey().toString()); + super.write(compound,registries , clientPacket); } @@ -127,20 +118,13 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I protected void read(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) { super.read(compound,registries , clientPacket); - setElectrode(compound.getString("Electrode"), false); + setElectrode(TFMGUtils.getElectrode(ResourceLocation.parse(compound.getString("Electrode"))), false); } @Override public String getOperationId() { - - - return switch (electrodeType) { - - case NONE -> ""; - case COPPER, ZINC -> isOperational() ? "tfmg:electrode" : ""; - case GRAPHITE -> isOperational() ? "tfmg:graphite_electrode" : ""; - }; + return isOperational() ? electrode.getOperationId() : ""; } @Override @@ -154,22 +138,4 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I } - enum ElectrodeType { - - NONE("none", ItemStack.EMPTY, null), - COPPER("copper", TFMGItems.COPPER_ELECTRODE.asStack(), TFMGPartialModels.COPPER_ELECTRODE), - ZINC("zinc", TFMGItems.ZINC_ELECTRODE.asStack(), TFMGPartialModels.ZINC_ELECTRODE), - GRAPHITE("graphite", TFMGItems.GRAPHITE_ELECTRODE.asStack(), TFMGPartialModels.GRAPHITE_ELECTRODE); - - public final String name; - public final ItemStack item; - public final PartialModel model; - - ElectrodeType(String name, ItemStack stack, PartialModel model) { - this.name = name; - this.item = stack; - this.model = model; - } - - } } diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/ElectrodeHolderRenderer.java b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/ElectrodeHolderRenderer.java index d4da65ba..6c21a8eb 100644 --- a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/ElectrodeHolderRenderer.java +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/ElectrodeHolderRenderer.java @@ -1,19 +1,27 @@ package com.drmangotea.tfmg.content.machinery.vat.electrode_holder; +import com.drmangotea.tfmg.TFMG; +import com.drmangotea.tfmg.base.TFMGUtils; import com.drmangotea.tfmg.registry.TFMGPartialModels; import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.math.Axis; import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer; import net.createmod.catnip.render.CachedBuffers; import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.client.renderer.entity.ItemRenderer; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.level.block.state.BlockState; public class ElectrodeHolderRenderer extends SafeBlockEntityRenderer { + private final ItemRenderer itemRenderer; public ElectrodeHolderRenderer(BlockEntityRendererProvider.Context context) { + this.itemRenderer = context.getItemRenderer(); } @Override @@ -24,16 +32,17 @@ public class ElectrodeHolderRenderer extends SafeBlockEntityRenderer item; + private final int resistance; + private final String operationId; + + public Electrode(Properties properties) { + this.id = properties.id; + this.item = properties.item; + this.resistance = properties.resistance; + this.operationId = properties.operationId; + } + + public ItemEntry getItem() { + return this.item; + } + + public ItemStack getStack() { + return getItem() != null ? getItem().asStack() : ItemStack.EMPTY; + } + + public int getResistance() { + return this.resistance; + } + + public String getOperationId() { + return this.operationId; + } + + public String getOrCreateDescriptionId() { + if (this.descriptionId == null) { + this.descriptionId = Util.makeDescriptionId("electrode", getKey()); + } + + return this.descriptionId; + } + + public String getDescriptionId() { + return this.getOrCreateDescriptionId(); + } + + public Component getDisplayName() { + return Component.translatable(this.getOrCreateDescriptionId()); + } + + public ResourceLocation getKey() { + return this.id; + } + + public static class Properties { + private ResourceLocation id; + + ItemEntry item; + int resistance = 0; + String operationId = ""; + + public Properties item(ItemEntry item) { + this.item = item; + return this; + } + + public Properties resistance(int resistance) { + this.resistance = resistance; + return this; + } + + public Properties operationId(String operationId) { + this.operationId = operationId; + return this; + } + + public Properties(ResourceLocation id) { + this.id = id; + } + } +} diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeBuilder.java b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeBuilder.java new file mode 100644 index 00000000..fde1a4ad --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeBuilder.java @@ -0,0 +1,67 @@ +package com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode; + +import com.drmangotea.tfmg.TFMGRegistries; +import com.tterrag.registrate.AbstractRegistrate; +import com.tterrag.registrate.builders.AbstractBuilder; +import com.tterrag.registrate.builders.BuilderCallback; +import com.tterrag.registrate.util.entry.RegistryEntry; +import com.tterrag.registrate.util.nullness.NonNullFunction; +import com.tterrag.registrate.util.nullness.NonNullSupplier; +import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; +import com.tterrag.registrate.util.nullness.NonnullType; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.registries.DeferredHolder; + +public class ElectrodeBuilder extends AbstractBuilder> { + + public static ElectrodeBuilder create(AbstractRegistrate owner, P parent, String name, BuilderCallback callback, NonNullFunction factory) { + return new ElectrodeBuilder<>(owner, parent, name, callback, factory); + } + + private final NonNullFunction factory; + + private NonNullSupplier initialProperties = () -> new Electrode.Properties(ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName())); + private NonNullFunction propertiesCallback = NonNullUnaryOperator.identity(); + + public ElectrodeBuilder(AbstractRegistrate owner, P parent, String name, BuilderCallback callback, NonNullFunction factory) { + super(owner, parent, name, callback, TFMGRegistries.ELECTRODE); + this.factory = factory; + } + + public ElectrodeBuilder properties(NonNullUnaryOperator func) { + propertiesCallback = propertiesCallback.andThen(func); + return this; + } + + public ElectrodeBuilder initialProperties(NonNullSupplier properties) { + initialProperties = properties; + return this; + } + + public ElectrodeBuilder defaultLang() { + return lang(Electrode::getDescriptionId); + } + + public ElectrodeBuilder lang(String name) { + return lang(Electrode::getDescriptionId, name); + } + + @Override + protected @NonnullType T createEntry() { + Electrode.Properties properties = this.initialProperties.get(); + properties = propertiesCallback.apply(properties); + return factory.apply(properties); + } + + @Override + protected RegistryEntry createEntryWrapper(DeferredHolder delegate) { + return new ElectrodeEntry<>(getOwner(), delegate); + } + + @Override + public ElectrodeEntry register() { + //Registry.register(TFMGRegistries.ELECTRODE_REGISTRY, ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName()), createEntry()); + return (ElectrodeEntry) super.register(); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeEntry.java b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeEntry.java new file mode 100644 index 00000000..9c1d9e87 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/electrode_holder/electrode/ElectrodeEntry.java @@ -0,0 +1,15 @@ +package com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode; + +import com.tterrag.registrate.AbstractRegistrate; +import com.tterrag.registrate.util.entry.RegistryEntry; +import net.neoforged.neoforge.registries.DeferredHolder; + +public class ElectrodeEntry extends RegistryEntry { + public ElectrodeEntry(AbstractRegistrate owner, DeferredHolder delegate) { + super(owner, delegate); + } + + public static ElectrodeEntry cast(RegistryEntry entry) { + return RegistryEntry.cast(ElectrodeEntry.class, entry); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/mixin/BuiltInRegistriesMixin.java b/src/main/java/com/drmangotea/tfmg/mixin/BuiltInRegistriesMixin.java new file mode 100644 index 00000000..04e3005b --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/mixin/BuiltInRegistriesMixin.java @@ -0,0 +1,28 @@ +package com.drmangotea.tfmg.mixin; + +import com.drmangotea.tfmg.TFMG; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import java.util.function.Consumer; + +@Mixin(BuiltInRegistries.class) +public class BuiltInRegistriesMixin { + static { + //TFMGBuiltInRegistries.init(); + } + + @WrapOperation(method = "validate", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/Registry;forEach(Ljava/util/function/Consumer;)V")) + private static > void create$ourRegistriesAreNotEmpty(Registry instance, Consumer consumer, Operation original) { + Consumer callback = (t) -> { + if (!t.key().location().getNamespace().equals(TFMG.MOD_ID)) + consumer.accept(t); + }; + + original.call(instance, callback); + } +} diff --git a/src/main/java/com/drmangotea/tfmg/recipes/jei/ChemicalVatCategory.java b/src/main/java/com/drmangotea/tfmg/recipes/jei/ChemicalVatCategory.java index 97644d12..41190728 100644 --- a/src/main/java/com/drmangotea/tfmg/recipes/jei/ChemicalVatCategory.java +++ b/src/main/java/com/drmangotea/tfmg/recipes/jei/ChemicalVatCategory.java @@ -88,31 +88,11 @@ public class ChemicalVatCategory extends CreateRecipeCategory TFMGGuiTextures.VAT.render(graphics, 0, 24); - if (allowedVatTypes.contains("tfmg:firebrick_lined_vat") && allowedVatTypes.size() == 1) { - TFMGGuiTextures.FIREPROOF_BRICK_OVERLAY.render(graphics, 55 - 48, 32); - } + drawVatTypes(allowedVatTypes, graphics); + + drawSprites(machines, graphics); + renderHeated(recipe.getRequiredHeat(), graphics); - if (machines.contains("tfmg:mixing")) { - TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12, 0); - TFMGGuiTextures.MIXER.render(graphics, 55 - 19, 32); - } - if (machines.contains("tfmg:electrode")) { - TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 - 32, 0); - TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 + 32, 0); - TFMGGuiTextures.ELECTRODE.render(graphics, 55 - 3 - 32, 32); - TFMGGuiTextures.ELECTRODE.render(graphics, 55 - 3 + 32, 32); - } - if (machines.contains("tfmg:graphite_electrode")) { - TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 - 32, 0); - TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 + 32, 0); - TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12, 0); - TFMGGuiTextures.GRAPHITE_ELECTRODE.render(graphics, 55 - 4 - 32, 32); - TFMGGuiTextures.GRAPHITE_ELECTRODE.render(graphics, 55 - 4 + 32, 32); - TFMGGuiTextures.GRAPHITE_ELECTRODE.render(graphics, 55 - 4, 32); - } - if (recipe.getRequiredHeat() == HeatCondition.HEATED){ - TFMGGuiTextures.VAT_HEATER.render(graphics, 55 - 10, 109); - } int pos = 55; int width = ((recipe.getFluidIngredients().size()) * 21) / 2; for (int i = 0; i < recipe.getFluidIngredients().size(); i++) { @@ -137,5 +117,38 @@ public class ChemicalVatCategory extends CreateRecipeCategory } + private void renderHeated(HeatCondition heatCondition, GuiGraphics graphics) { + if (heatCondition == HeatCondition.HEATED) + TFMGGuiTextures.VAT_HEATER.render(graphics, 55 - 10, 109); + if (heatCondition == HeatCondition.SUPERHEATED) + TFMGGuiTextures.VAT_SUPERHEATER.render(graphics, 55 - 10, 109); + } + + private void drawVatTypes(List allowedVatTypes, GuiGraphics graphics) { + if (allowedVatTypes.contains("firebrick_lined_vat") && allowedVatTypes.size() == 1) { + TFMGGuiTextures.FIREPROOF_BRICK_OVERLAY.render(graphics, 55 - 48, 32); + } + } + + private void drawSprites(List machines, GuiGraphics graphics) { + if (machines.contains("tfmg:mixing")) { + TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12, 0); + TFMGGuiTextures.MIXER.render(graphics, 55 - 19, 32); + } + if (machines.contains("tfmg:electrode")) { + TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 - 32, 0); + TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 + 32, 0); + TFMGGuiTextures.ELECTRODE.render(graphics, 55 - 3 - 32, 32); + TFMGGuiTextures.ELECTRODE.render(graphics, 55 - 3 + 32, 32); + } + if (machines.contains("tfmg:graphite_electrode")) { + TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 - 32, 0); + TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12 + 32, 0); + TFMGGuiTextures.VAT_MACHINE.render(graphics, 55 - 12, 0); + TFMGGuiTextures.GRAPHITE_ELECTRODE.render(graphics, 55 - 4 - 32, 32); + TFMGGuiTextures.GRAPHITE_ELECTRODE.render(graphics, 55 - 4 + 32, 32); + TFMGGuiTextures.GRAPHITE_ELECTRODE.render(graphics, 55 - 4, 32); + } + } } \ No newline at end of file diff --git a/src/main/java/com/drmangotea/tfmg/recipes/jei/WindingCategory.java b/src/main/java/com/drmangotea/tfmg/recipes/jei/WindingCategory.java index bd19c4d0..afd12515 100644 --- a/src/main/java/com/drmangotea/tfmg/recipes/jei/WindingCategory.java +++ b/src/main/java/com/drmangotea/tfmg/recipes/jei/WindingCategory.java @@ -49,14 +49,12 @@ public class WindingCategory extends CreateRecipeCategory { AllGuiTextures.JEI_ARROW.render(graphics, 85, 32); AllGuiTextures.JEI_DOWN_ARROW.render(graphics, 43, 4); - PartialModel coil = null; + int coilColor = 0; if (recipe.getIngredients().get(1).getItems()[0].getItem() instanceof SpoolItem) { - - coil = ((SpoolItem)recipe.getIngredients().get(1).getItems()[0].getItem()).model; - + coilColor = recipe.getIngredients().get(1).getItems()[0].getBarColor(); } - this.windingMachine.draw(graphics, 48, 27,coil,true); + this.windingMachine.draw(graphics, 48, 27,coilColor,true); graphics.drawString(Minecraft.getInstance().font, recipe.getProcessingDuration() + " Turns", 86.0F, 9.0F, 4210752, false); } @@ -77,18 +75,16 @@ public class WindingCategory extends CreateRecipeCategory { PoseStack ms = graphics.pose(); - PartialModel coil = null; + int coilColor = 0; if (recipe.getRecipe().getIngredients().get(1).getItems()[0].getItem() instanceof SpoolItem) { - - coil = ((SpoolItem)recipe.getRecipe().getIngredients().get(1).getItems()[0].getItem()).model; - + coilColor = recipe.getRecipe().getIngredients().get(1).getItems()[0].getBarColor(); } windingMachine.offset = index; ms.pushPose(); ms.translate(0.0, 67, 0.0); ms.scale(0.7F, 0.7F, 0.7F); - this.windingMachine.draw(graphics, this.getWidth() / 2, 0,coil,false); + this.windingMachine.draw(graphics, this.getWidth() / 2, 0,coilColor,false); ms.popPose(); diff --git a/src/main/java/com/drmangotea/tfmg/recipes/jei/machines/WindingMachine.java b/src/main/java/com/drmangotea/tfmg/recipes/jei/machines/WindingMachine.java index 149a172e..488c0b70 100644 --- a/src/main/java/com/drmangotea/tfmg/recipes/jei/machines/WindingMachine.java +++ b/src/main/java/com/drmangotea/tfmg/recipes/jei/machines/WindingMachine.java @@ -17,7 +17,7 @@ public class WindingMachine extends AnimatedKinetics { public WindingMachine() { } - public void draw(GuiGraphics graphics, int xOffset, int yOffset, PartialModel coil, boolean shadow) { + public void draw(GuiGraphics graphics, int xOffset, int yOffset, int coilColor, boolean shadow) { PoseStack matrixStack = graphics.pose(); @@ -42,12 +42,13 @@ public class WindingMachine extends AnimatedKinetics { .atLocal(-0.15, -0.4, -0.23) .scale(scale) .render(graphics); - if (coil != null) - blockElement(coil) - .rotateBlock(22.5, 22.5, 0) - .atLocal(-0.15, -0.4, -0.23) - .scale(scale) - .render(graphics); + + blockElement(TFMGPartialModels.SPOOL_WIRE) + .rotateBlock(22.5, 22.5, 0) + .atLocal(-0.15, -0.4, -0.23) + .color(coilColor) + .scale(scale) + .render(graphics); matrixStack.popPose(); } diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGCableTypes.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGCableTypes.java new file mode 100644 index 00000000..f70e2734 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGCableTypes.java @@ -0,0 +1,51 @@ +package com.drmangotea.tfmg.registry; + +import com.drmangotea.tfmg.TFMG; +import com.drmangotea.tfmg.TFMGRegistries; +import com.drmangotea.tfmg.config.TFMGResistivity; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType; +import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableTypeEntry; +import com.simibubi.create.api.contraption.ContraptionType; +import com.simibubi.create.api.registry.CreateBuiltInRegistries; +import com.simibubi.create.content.contraptions.Contraption; +import com.tterrag.registrate.util.entry.ItemEntry; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; + +import java.util.function.Supplier; + +import static com.drmangotea.tfmg.TFMG.REGISTRATE; +import static com.simibubi.create.AllContraptionTypes.BY_LEGACY_NAME; + +public class TFMGCableTypes { + + public static final CableTypeEntry empty = REGISTRATE.cableType("empty", CableType::new) + .properties((p) -> p.spool(TFMGItems.COPPER_SPOOL)) + .register(); + + public static final CableTypeEntry copper = REGISTRATE.cableType("copper", CableType::new) + .properties((p) -> p.color(0xD8735A).spool(TFMGItems.COPPER_SPOOL)) + .transform(TFMGResistivity.setResistivity(0.00188f)) + .register(); + + public static final CableTypeEntry aluminum = REGISTRATE.cableType("aluminum", CableType::new) + .properties((p) -> p.color(0xEDEFEF).spool(TFMGItems.ALUMINUM_SPOOL)) + .transform(TFMGResistivity.setResistivity(0.0027f)) + .register(); + + public static final CableTypeEntry constantan = REGISTRATE.cableType("constantan", CableType::new) + .properties((p) -> p.color(0xCFC2A8).spool(TFMGItems.CONSTANTAN_SPOOL)) + .transform(TFMGResistivity.setResistivity(1f)) + .register(); + + // Why is this a thing? I'll leave it her in case you do need it. - Krystal + //public static final CableTypeEntry steelReinforcedAluminum = REGISTRATE.cableType("steel_reinforced_aluminum", CableType::new) + // .properties((p) -> p.color(0xB8A08D).spool(TFMGItems.COPPER_SPOOL)) + // .transform(TFMGResistivity.setResistivity(0.0027f)) + // .register(); + + public static void init() { + + } +} diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java new file mode 100644 index 00000000..d8c77e30 --- /dev/null +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java @@ -0,0 +1,41 @@ +package com.drmangotea.tfmg.registry; + +import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode.Electrode; +import com.drmangotea.tfmg.content.machinery.vat.electrode_holder.electrode.ElectrodeEntry; + +import static com.drmangotea.tfmg.TFMG.REGISTRATE; + +public class TFMGElectrodes { + + public static final ElectrodeEntry none = REGISTRATE.electrode("none", Electrode::new) + .properties((p) -> p) + .register(); + + public static final ElectrodeEntry copper = REGISTRATE.electrode("copper", Electrode::new) + .properties((p) -> p + .resistance(100) + .item(TFMGItems.COPPER_ELECTRODE) + .operationId("tfmg:electrode") + ) + .register(); + + public static final ElectrodeEntry zinc = REGISTRATE.electrode("zinc", Electrode::new) + .properties((p) -> p + .resistance(100) + .item(TFMGItems.ZINC_ELECTRODE) + .operationId("tfmg:electrode") + ) + .register(); + + public static final ElectrodeEntry graphite = REGISTRATE.electrode("graphite", Electrode::new) + .properties((p) -> p + .resistance(300) + .item(TFMGItems.GRAPHITE_ELECTRODE) + .operationId("tfmg:graphite_electrode") + ) + .register(); + + public static void init() { + + } +} diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGGuiTextures.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGGuiTextures.java index d05dfe13..ae60cf58 100644 --- a/src/main/java/com/drmangotea/tfmg/registry/TFMGGuiTextures.java +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGGuiTextures.java @@ -32,6 +32,7 @@ public enum TFMGGuiTextures implements ScreenElement { GRAPHITE_ELECTRODE("chemical_vat", 176, 0, 8, 29), FIREPROOF_BRICK_OVERLAY("chemical_vat", 0, 84, 96, 72), VAT_HEATER("chemical_vat", 112, 44, 20, 14), + VAT_SUPERHEATER("chemical_vat", 112, 58, 20, 14), ; diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGItems.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGItems.java index dd112f2a..59af1fb9 100644 --- a/src/main/java/com/drmangotea/tfmg/registry/TFMGItems.java +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGItems.java @@ -41,6 +41,7 @@ import com.tterrag.registrate.util.entry.RegistryEntry; import dev.engine_room.flywheel.lib.model.baked.PartialModel; import net.minecraft.core.Holder; import net.minecraft.data.recipes.RecipeCategory; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.item.*; import net.minecraft.world.level.block.Blocks; @@ -191,14 +192,14 @@ public class TFMGItems { ENGINE_CYLINDER = REGISTRATE.item("engine_cylinder", CylinderItem::new).register(), TURBINE_BLADE = REGISTRATE.item("turbine_blade", CylinderItem::new).register(); public static final ItemEntry - EMPTY_SPOOL = spoolItem("empty", null, 0x000000, CableConnection.CableType.NONE) + EMPTY_SPOOL = spoolItem("empty", 0x000000, TFMG.asResource("empty")) .recipe((c, p) -> p.stonecutting(DataIngredient.items(TFMGBlocks.HARDENED_PLANKS.asItem()), RecipeCategory.BUILDING_BLOCKS, c::get, 1)) .register(), - COPPER_SPOOL = spoolItem("copper", TFMGPartialModels.COPPER_SPOOL, 0xD8735A, CableConnection.CableType.COPPER) + COPPER_SPOOL = spoolItem("copper", 0xD8735A, TFMG.asResource("copper")) .register(), - ALUMINUM_SPOOL = spoolItem("aluminum", TFMGPartialModels.ALUMINUM_SPOOL, 0xEDEFEF, CableConnection.CableType.ALUMINUM) + ALUMINUM_SPOOL = spoolItem("aluminum", 0xEDEFEF, TFMG.asResource("aluminum")) .register(), - CONSTANTAN_SPOOL = spoolItem("constantan", TFMGPartialModels.CONSTANTAN_SPOOL, 0xCFC2A8, CableConnection.CableType.CONSTANTAN) + CONSTANTAN_SPOOL = spoolItem("constantan", 0xCFC2A8, TFMG.asResource("constantan")) .register(); public static final ItemEntry ELECTROMAGNETIC_COIL = @@ -447,8 +448,8 @@ public class TFMGItems { return map; } - public static ItemBuilder spoolItem(String name, PartialModel model, int barColor, CableConnection.CableType type) { - return REGISTRATE.item(name + "_spool", p -> new SpoolItem(p, model, barColor, type)) + public static ItemBuilder spoolItem(String name, int barColor, ResourceLocation type) { + return REGISTRATE.item(name + "_spool", p -> new SpoolItem(p, barColor, type)) .tag(TFMGTags.TFMGItemTags.SPOOLS.tag) .properties(p -> p.stacksTo(1)); diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGPartialModels.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGPartialModels.java index 21f50f36..ac9eb3be 100644 --- a/src/main/java/com/drmangotea/tfmg/registry/TFMGPartialModels.java +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGPartialModels.java @@ -75,6 +75,7 @@ public class TFMGPartialModels { SHAFTLESS_LARGE_ALUMINUM_COGHWEEL = block("large_aluminum_cogwheel_shaftless"), SHAFTLESS_LARGE_STEEL_COGHWEEL = block("large_steel_cogwheel_shaftless"), SPOOL = block("winding_machine/spool"), + SPOOL_WIRE = block("winding_machine/spool_wire"), COPPER_SPOOL = block("winding_machine/copper_spool"), ALUMINUM_SPOOL = block("winding_machine/aluminum_spool"), CONSTANTAN_SPOOL = block("winding_machine/constantan_spool"), diff --git a/src/main/resources/assets/tfmg/models/block/winding_machine/spool_wire.json b/src/main/resources/assets/tfmg/models/block/winding_machine/spool_wire.json new file mode 100644 index 00000000..2e1aa062 --- /dev/null +++ b/src/main/resources/assets/tfmg/models/block/winding_machine/spool_wire.json @@ -0,0 +1,20 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "tfmg:block/spool_wire", + "particle": "tfmg:block/spool_wire" + }, + "elements": [ + { + "from": [4, 6, 6], + "to": [11, 10, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 7]}, + "faces": { + "north": {"uv": [0, 0, 4, 7], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 0, 4, 7], "rotation": 90, "texture": "#0"}, + "up": {"uv": [0, 0, 4, 7], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 4, 7], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/tfmg/textures/block/spool_wire.png b/src/main/resources/assets/tfmg/textures/block/spool_wire.png new file mode 100644 index 0000000000000000000000000000000000000000..922ae8e3274f4fad2a07d8417ae43d2aa482ccd5 GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`rk*a2Ar*1SH@0M6{?9LO_lLdF zd%E7=bOq5TPoMsM|N8ZBej|<}ZqwB{++rPA#e13p9e5cS(t09X`>m`Pfd(*my85}S Ib4q9e0J9w;A^-pY literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tfmg/textures/block/winding_machine_wire.png b/src/main/resources/assets/tfmg/textures/block/winding_machine_wire.png index 6b689078e3accff281d64ae1787e0680b89a980d..0b76c601a7affeaa0d9a38f9992639085ec9771c 100644 GIT binary patch delta 91 zcmX@eSUEu@)WOrmF{C0cIYB}2%h#`e-NltTV|JBv8Zq0|{4lt}yTF3SEccenOhyrR u<)eB)o<<*Q7w>`_+#>8sN7)uEXJ&Y{-&DUy>eCqpAn*8o|0J>k`J4qFk;M!Qe1}1p@p%4< z6rf<3r;B5Vh5z1*8#x^eIamTts)+SHvhmA#sP^;2-cwpiKcv=M`7F^h-rcdk`KM3l z#Gu^`Gl9f{TlyUwORne@lrPz`|KJZUrKTz0%vZ>LvoEYUmi2>W5x+6JNCrdU9+15Z Mp00i_>zopr0J_dTJOBUy diff --git a/src/main/resources/assets/tfmg/textures/block/winding_machine_wire_animated.png b/src/main/resources/assets/tfmg/textures/block/winding_machine_wire_animated.png index 66c87d4d40998af11ed65652adcc94ceab3331ea..e00fa5740bffd9107d792287a2e49e594c199112 100644 GIT binary patch delta 236 zcmey&*ugYGrT)C9i(^Pd+}%qXc^M2jj$U{ZZ@{zIfK&R;*O!aJ6($-3&X_QSCouRYbk3Q`Xw#@_)bPGRwty8V@so?^0jJJHW1|N34K8dS zWDOd$4HE2>y;D#XGwKvNx=lO5Fz1rt!geMaVpM@>CCU=xen*gmiT73^bX z+i-+cGExbo=1C9OaK;*To`g;nV^# P1|aZs^>bP0l+XkK+J0BX delta 215 zcmV;|04V>60`mcoB!2;OQb$4nuFf3k00023NklJQ36?{{kXPYOVYEylDeUDVMW4Af;prK-2+qPFuhj!+8Sa`z_?0 zohLv7_5k_*5vVhD7V0eW51q~Q-fjN}NWe8xXX^Y!z#{p7-cbG5=)VQ(yh0ClauX&FuN(lx|HOe zahuREvo&a4B4QZVMlCI38fM7td&d4A``CYf|9t=W&OdWLXU;jF*ZcK)zTf9DarU;B zQj!Xi005~|Cr>y40HKEv*n~m9+(QZi0NAp6>clZelIL{h(4_x4`R3-;nAoj9QTJ>* zeP6yxzti#Q{vVEY4<9;dEpK5Ev5^?_YJVDb&+B`alU4UjIMl_dZg_cbYn|kV-4T#( zyt?+lN>=w##`PN`{kp-^l|s+p8U7+OmHgIp@;u{FeJ|fbcZvS1aTsf!J<^#o|AwO# z^2c0zyJ8mum*PfbR4#JPj$Hauzb2b#(#sY;UTh|&|1lC><8W>Dr0X#0ThfvAf@U+} z8(SfHYIW#LD^X$6K71&Y$Y=ZtA(6>Ay0EguIMK4;8r#nZ7MRzar#xy7zxR;O?O zkoKInYs~@yVnS&J|%jt z4wpkyZ1G_qBP7rmAzo{>%dIEWt34u*$YW^4>xw2{qEF&bXTlC8KCdj9p} z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