Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LionBlazer

Members
  • Joined

  • Last visited

  1. Thanks, you gave me an idea. @Override public ItemCameraTransforms getItemCameraTransforms() { ItemTransformVec3f firstperson = new ItemTransformVec3f(new Vector3f(0,45,0), new Vector3f(0, 0, 0), new Vector3f(0.40f, 0.40f, 0.40f)); ItemCameraTransforms itemCameraTransforms = new ItemCameraTransforms(firstperson, firstperson, firstperson, firstperson, firstperson, firstperson, firstperson, firstperson); return itemCameraTransforms; } This works for the block! from the first person, the rest is easy to finish. I am copied the transformation from a json file block.
  2. Anyone even know how these IModel work?
  3. I am even tried to do so: @Override public IModel loadModel(ResourceLocation modelLocation) throws Exception { ModelBlock blockModel = ModelBlock.deserialize("{\n" + " \"parent\": \"item/generated\",\n" + " \"textures\": {\n" + " \"layer0\": \"items/charcoal\"\n" + " }\n" + "}\n"); return new ItemLayerModel(blockModel); } The problem isn't the model.
  4. This class is deprecated. In Vanilla too ItemCameraTransforms.DEFAULT.
  5. I've tried it before, nothing changes. @Override public IModel loadModel(ResourceLocation modelLocation) throws Exception { ImmutableMap.Builder<String, String> textures = ImmutableMap.builder(); textures.put("layer0", "items/apple"); ModelBlock blockModel = new ModelBlock(new ResourceLocation("item/generated"), new ArrayList<>(), textures.build(), true, true, ItemCameraTransforms.DEFAULT, new ArrayList<>()); return new ItemLayerModel(blockModel); } I have a feeling that it is not that no effect.
  6. I have Item with IModel(ItemLayerModel). But in game model is rendered wrong: My model: vanilla: Help! Code. ICustomModelLoader: public class TestCustomModelLoader implements ICustomModelLoader { @Override public boolean accepts(ResourceLocation modelLocation) { return modelLocation.toString().contains("testitem"); } @Override public IModel loadModel(ResourceLocation modelLocation) throws Exception { ImmutableMap.Builder<String, String> textures = ImmutableMap.builder(); textures.put("layer0", "items/apple"); ModelBlock blockModel = new ModelBlock(new ResourceLocation("item/builtin/generated"), new ArrayList<>(), textures.build(), true, true, ItemCameraTransforms.DEFAULT, new ArrayList<>()); return new ItemLayerModel(blockModel); } @Override public void onResourceManagerReload(IResourceManager resourceManager) { } } main class @Mod(modid = "testmod") public class TestMod { static Item testItem; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { testItem = new Item(); testItem.setRegistryName("testitem"); ForgeRegistries.ITEMS.register(testItem); MinecraftForge.EVENT_BUS.register(this); } @SideOnly(Side.CLIENT) @SubscribeEvent public void eventRegisterModel(ModelRegistryEvent event){ ModelLoaderRegistry.registerLoader(new TestCustomModelLoader()); } @SideOnly(Side.CLIENT) @Mod.EventHandler public void init(FMLInitializationEvent event) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(testItem, 0, new ModelResourceLocation(testItem.getRegistryName(), "inventory")); } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.