Skip to content

Commit

Permalink
Use ClassModelLoader for Chest/Tank item models.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Nov 12, 2023
1 parent e0e9897 commit 818cfae
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 1.20.1 2023-09-08T23:52:29.3559643 EnderStorage Item models
a163c9ce1e63e428f3fa804b66e491b455f18540 assets/enderstorage/models/item/ender_chest.json
// 1.20.1 2023-11-13T04:01:20.744430711 EnderStorage Item models
acba8f17e2d7962b4f284bd0141fb59b507bce0a assets/enderstorage/models/item/ender_chest.json
e56e5f4371f82507db4f3edcd5514ff7a7c9b91c assets/enderstorage/models/item/ender_pouch.json
d85340997885467c20e49061f74a4858f9a276fd assets/enderstorage/models/item/ender_pouch_button_left_black.json
7e07a5bb75528acb4596870d5e8420545f848888 assets/enderstorage/models/item/ender_pouch_button_left_blue.json
Expand Down Expand Up @@ -53,4 +53,4 @@ c23266a51bb6eb50d6ee13cb45658690466b7b29 assets/enderstorage/models/item/ender_p
4f79a4c9572e3d1f01b41505c777038ea2c72b85 assets/enderstorage/models/item/ender_pouch_open.json
bca93d7cdab91d358aa60130acba6f555663a3b2 assets/enderstorage/models/item/ender_pouch_owned_closed.json
9cc9edaa2b3e3572f77a34d3ec878c8e0ebd4f75 assets/enderstorage/models/item/ender_pouch_owned_open.json
a163c9ce1e63e428f3fa804b66e491b455f18540 assets/enderstorage/models/item/ender_tank.json
e27ce04e6f2a4fc9cfe7f7816f9e5c7081b91958 assets/enderstorage/models/item/ender_tank.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"parent": "minecraft:item/generated"
"parent": "minecraft:item/generated",
"class": "codechicken.enderstorage.client.render.item.EnderChestItemRender",
"loader": "codechickenlib:class"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"parent": "minecraft:item/generated"
"parent": "minecraft:item/generated",
"class": "codechicken.enderstorage.client.render.item.EnderTankItemRender",
"loader": "codechickenlib:class"
}
12 changes: 0 additions & 12 deletions src/main/java/codechicken/enderstorage/init/ClientInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@
import codechicken.enderstorage.client.Shaders;
import codechicken.enderstorage.client.gui.GuiEnderItemStorage;
import codechicken.enderstorage.client.render.entity.TankLayerRenderer;
import codechicken.enderstorage.client.render.item.EnderChestItemRender;
import codechicken.enderstorage.client.render.item.EnderTankItemRender;
import codechicken.enderstorage.client.render.tile.RenderTileEnderChest;
import codechicken.enderstorage.client.render.tile.RenderTileEnderTank;
import codechicken.enderstorage.config.EnderStorageConfig;
import codechicken.enderstorage.manager.EnderStorageManager;
import codechicken.enderstorage.storage.EnderItemStorage;
import codechicken.lib.model.ModelRegistryHelper;
import net.covers1624.quack.util.CrashLock;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.item.ClampedItemPropertyFunction;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.client.event.ModelEvent;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
Expand All @@ -37,8 +31,6 @@ public class ClientInit {

private static final CrashLock LOCK = new CrashLock("Already Initialized.");

public static final ModelRegistryHelper modelHelper = new ModelRegistryHelper();

public static void init() {
LOCK.lock();
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
Expand Down Expand Up @@ -69,9 +61,6 @@ private static void onClientSetupEvent(FMLClientSetupEvent event) {
MenuScreens.register(ENDER_ITEM_STORAGE.get(), GuiEnderItemStorage::new);

event.enqueueWork(ClientInit::registerPredicates);

modelHelper.register(new ModelResourceLocation(ENDER_CHEST_ITEM.getId(), "inventory"), new EnderChestItemRender());
modelHelper.register(new ModelResourceLocation(ENDER_TANK_ITEM.getId(), "inventory"), new EnderTankItemRender());
}

private static void registerPredicates() {
Expand Down Expand Up @@ -102,5 +91,4 @@ private static void registerPredicates() {
);
}


}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package codechicken.enderstorage.init;

import codechicken.enderstorage.client.render.item.EnderChestItemRender;
import codechicken.enderstorage.client.render.item.EnderTankItemRender;
import codechicken.lib.colour.EnumColour;
import codechicken.lib.datagen.ItemModelProvider;
import net.minecraft.core.HolderLookup;
Expand Down Expand Up @@ -47,8 +49,8 @@ public ItemModels(PackOutput output, ExistingFileHelper existingFileHelper) {

@Override
protected void registerModels() {
generated(ENDER_CHEST_ITEM).noTexture();
generated(ENDER_TANK_ITEM).noTexture();
clazz(ENDER_CHEST_ITEM, EnderChestItemRender.class);
clazz(ENDER_TANK_ITEM, EnderTankItemRender.class);

CompositeLoaderBuilder bag = generated(ENDER_POUCH)
.noTexture()
Expand Down

0 comments on commit 818cfae

Please sign in to comment.