diff --git a/AntimatterAPI b/AntimatterAPI index b268a1b63..97e184836 160000 --- a/AntimatterAPI +++ b/AntimatterAPI @@ -1 +1 @@ -Subproject commit b268a1b63929a2a124d94bf95c6b1317dbd3954e +Subproject commit 97e184836fa3b84a8a23849df266e89bb6acf787 diff --git a/common/src/main/java/muramasa/gregtech/GregTech.java b/common/src/main/java/muramasa/gregtech/GregTech.java index f52839d47..b5d75cb0f 100644 --- a/common/src/main/java/muramasa/gregtech/GregTech.java +++ b/common/src/main/java/muramasa/gregtech/GregTech.java @@ -19,6 +19,7 @@ import muramasa.antimatter.tool.IAntimatterTool; import muramasa.antimatter.util.AntimatterPlatformUtils; import muramasa.gregtech.block.BlockAsphalt; +import muramasa.gregtech.client.GregTechModelManager; import muramasa.gregtech.data.Machines; import muramasa.gregtech.data.*; import muramasa.gregtech.datagen.*; @@ -242,7 +243,10 @@ public void onRegistrationEvent(RegistrationEvent event, Side side) { // if (side == Dist.CLIENT) StructureInfo.init(); TierMaps.providerInit(); } - case CLIENT_DATA_INIT -> ClientData.init(); + case CLIENT_DATA_INIT -> { + ClientData.init(); + GregTechModelManager.init(); + } } } diff --git a/common/src/main/java/muramasa/gregtech/client/GregTechModelManager.java b/common/src/main/java/muramasa/gregtech/client/GregTechModelManager.java new file mode 100644 index 000000000..2b2d88fc4 --- /dev/null +++ b/common/src/main/java/muramasa/gregtech/client/GregTechModelManager.java @@ -0,0 +1,14 @@ +package muramasa.gregtech.client; + +import muramasa.antimatter.Ref; +import muramasa.gregtech.GTIRef; +import net.minecraft.resources.ResourceLocation; + +public class GregTechModelManager { + + public static final ResourceLocation LOADER_REACTOR = new ResourceLocation(GTIRef.ID, "reactor"); + + public static void init(){ + new ReactorModelLoader(LOADER_REACTOR); + } +} diff --git a/common/src/main/java/muramasa/gregtech/client/ReactorBakedModel.java b/common/src/main/java/muramasa/gregtech/client/ReactorBakedModel.java index 06659bad5..a06131d98 100644 --- a/common/src/main/java/muramasa/gregtech/client/ReactorBakedModel.java +++ b/common/src/main/java/muramasa/gregtech/client/ReactorBakedModel.java @@ -33,7 +33,7 @@ public ReactorBakedModel(TextureAtlasSprite particle, ImmutableMap getBlockQuads(BlockState state, Direction side, Random rand, BlockAndTintGetter level, @NotNull BlockPos pos) { List superBlockQuads = super.getBlockQuads(state, side, rand, level, pos); - if (side == null){ + if (side == Direction.UP){ List list = new ArrayList<>(); BlockEntity tile = level.getBlockEntity(pos); if (!(tile instanceof BlockEntityNuclearReactorCore core)) return Collections.emptyList(); @@ -46,6 +46,7 @@ public List getBlockQuads(BlockState state, Direction side, Random ra } list.addAll(ModelUtils.getQuadsFromBaked(model, state, null, rand, level, pos)); } + list.addAll(superBlockQuads); return list; } return superBlockQuads; diff --git a/common/src/main/java/muramasa/gregtech/client/ReactorModelLoader.java b/common/src/main/java/muramasa/gregtech/client/ReactorModelLoader.java index fb0883a7b..ade2bb1c5 100644 --- a/common/src/main/java/muramasa/gregtech/client/ReactorModelLoader.java +++ b/common/src/main/java/muramasa/gregtech/client/ReactorModelLoader.java @@ -4,8 +4,10 @@ import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; import muramasa.antimatter.AntimatterAPI; +import muramasa.antimatter.client.ModelUtils; import muramasa.antimatter.client.model.loader.AntimatterModelLoader; import muramasa.antimatter.machine.MachineState; +import muramasa.gregtech.GTIRef; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite; import net.minecraft.client.resources.model.UnbakedModel; @@ -37,9 +39,9 @@ public ReactorModel readModel(JsonDeserializationContext context, JsonObject jso String[] array = new String[]{"north-west", "south-west", "north-east", "south-east"}; //northwest is 0, southwest is 1, northeast is 2, southeast is 3 for (int i = 0; i < 4; i++) { - //rods[i] = context.deserialize(J) + ResourceLocation modelLocation = new ResourceLocation(GTIRef.ID, "block/machine/overlay/nuclear_reactor_core/"+ array[i] + "-rod"); + rods[i] = ModelUtils.getModel(modelLocation); } - - return null; + return new ReactorModel(m, particle, rods); } } diff --git a/common/src/main/java/muramasa/gregtech/data/Machines.java b/common/src/main/java/muramasa/gregtech/data/Machines.java index a0deeb0a4..885f93c5e 100644 --- a/common/src/main/java/muramasa/gregtech/data/Machines.java +++ b/common/src/main/java/muramasa/gregtech/data/Machines.java @@ -25,6 +25,7 @@ import muramasa.gregtech.blockentity.miniportals.BlockEntityMiniTwilightPortal; import muramasa.gregtech.blockentity.multi.*; import muramasa.gregtech.blockentity.single.*; +import muramasa.gregtech.client.GregTechModelManager; import muramasa.gregtech.items.IItemReactorRod; import muramasa.gregtech.machine.MiniPortalMachine; import muramasa.gregtech.machine.MultiblockTankMachine; @@ -204,7 +205,7 @@ public class Machines { tooltip.add(Utils.translatable("machine.power.capacity").append(": ").append(Utils.literal("" + 80).withStyle(ChatFormatting.BLUE))); } }); - public static BasicMachine NUCLEAR_REACTOR_CORE = new SecondaryOutputMachine(GTIRef.ID, "nuclear_reactor_core").setSecondaryOutputCover(COVER_REACTOR_OUTPUT_SECONDARY).removeFlags(EU).setTiers(NONE).addFlags(GUI, ITEM, FLUID).custom().overlayTexture(Textures.REACTOR_CORE_OVERLAY_HANDLER).baseTexture(new Texture(GTIRef.ID, "block/machine/base/nuclear_reactor_core")).setTile(BlockEntityNuclearReactorCore::new).blockColorHandler(Machines::getBlockColorNuclear).frontCovers().allowFrontIO().setNoTextureRotation(true).setOutputCover(GregTechCovers.COVER_REACTOR_OUTPUT).covers(ICover.emptyFactory, ICover.emptyFactory, GregTechCovers.COVER_REACTOR_OUTPUT, GregTechCovers.COVER_REACTOR_OUTPUT_SECONDARY, ICover.emptyFactory, ICover.emptyFactory); + public static BasicMachine NUCLEAR_REACTOR_CORE = new SecondaryOutputMachine(GTIRef.ID, "nuclear_reactor_core").setSecondaryOutputCover(COVER_REACTOR_OUTPUT_SECONDARY).removeFlags(EU).setTiers(NONE).addFlags(GUI, ITEM, FLUID, UNCULLED).custom().overlayTexture(Textures.REACTOR_CORE_OVERLAY_HANDLER).baseTexture(new Texture(GTIRef.ID, "block/machine/base/nuclear_reactor_core")).modelLoader(GregTechModelManager.LOADER_REACTOR).setTile(BlockEntityNuclearReactorCore::new).blockColorHandler(Machines::getBlockColorNuclear).frontCovers().allowFrontIO().setNoTextureRotation(true).setOutputCover(GregTechCovers.COVER_REACTOR_OUTPUT).covers(ICover.emptyFactory, ICover.emptyFactory, GregTechCovers.COVER_REACTOR_OUTPUT, GregTechCovers.COVER_REACTOR_OUTPUT_SECONDARY, ICover.emptyFactory, ICover.emptyFactory); public static BasicMachine SMALL_HEAT_EXCHANGER = new SecondaryOutputMachine(GTIRef.ID, "small_heat_exchanger").setSecondaryOutputCover(COVER_OUTPUT_SECONDARY).removeFlags(EU).covers(ICover.emptyFactory, ICover.emptyFactory, ICover.emptyFactory, COVEROUTPUT, COVER_OUTPUT_SECONDARY, ICover.emptyFactory).setTiers(NONE).baseTexture(new Texture(GTIRef.ID, "block/machine/base/small_heat_exchanger")).setMap(HEAT_EXCHANGER).addFlags(GUI, ITEM, FLUID).setTile(BlockEntitySmallHeatExchanger::new).frontCovers().allowFrontIO(); /** diff --git a/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/sides.png b/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/sides.png index 7d48c4029..a0866cecd 100644 Binary files a/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/sides.png and b/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/sides.png differ diff --git a/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/top.png b/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/top.png index 81381c757..6a5941c78 100644 Binary files a/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/top.png and b/common/src/main/resources/assets/gti/textures/block/machine/base/reactor_rods/top.png differ diff --git a/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_sides.png b/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_sides.png index d698653c8..550182194 100644 Binary files a/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_sides.png and b/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_sides.png differ diff --git a/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_top.png b/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_top.png index 6ff3a5b94..739077b04 100644 Binary files a/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_top.png and b/common/src/main/resources/assets/gti/textures/block/machine/overlay/nuclear_reactor_core/rod_top.png differ