Sign in to follow this
Followers
0
How do you use gradle to build mods (having used advanced initial setup)?
By
Feldherren, in ForgeGradle
-
Recently Browsing
No registered users viewing this page.
-
Posts
-
By matt1999rd · Posted
it works well with Capability thanks -
By DaemonUmbra · Posted
Any particular reason you're running 1.12 instead of 1.12.2? -
By Simon_kungen · Posted
Hi I got this item that stores a single stack of something else, and a glass variant of it should render the stack inside, but according to the docs I just need to set the renderer on the item and it should work but as far as I can see nothing happens, not even the console prints anything: ItemSingleStackGlassContainer.java public class ItemSingleStackGlassContainer extends ItemSingleStackContainer { public ItemSingleStackGlassContainer(String name, float isolation, int tint) { super(new Item.Properties().setTEISR(() -> SingleStackGlassContainerItemRender::new),name,isolation,tint); } ... } The superclass: ItemSingleStackContainer.java public class ItemSingleStackContainer extends Item { public static final ResourceLocation open = new ResourceLocation(Reference.MODID,"open"); private final float isolation; private final int tint; private static short failedToOpen = 0; private boolean isOpen = false; public ItemSingleStackContainer(Item.Properties properties,String name, float isolation, int tint) { super(properties.maxStackSize(1).group(ItemGroup.TOOLS)); if (isolation < 0 || isolation > 1) throw new IllegalArgumentException("Can only be between 0 and 1!"); addPropertyOverride(open,(itemStack, worldIn, entityLivingBase) -> isOpen ? 1 : 0); this.isolation = isolation; this.tint = tint; setRegistryName(name); } public static ItemStack getContainedItemStack(ItemStack stack) { IItemHandler handler = stack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElseThrow(NullPointerException::new); return handler.getStackInSlot(0); } ... } The renderer that should just render the stack somewhere visible on the camera for now and print out to the console: SingleStackGlassContainerItemRender.java @OnlyIn(Dist.CLIENT) public class SingleStackGlassContainerItemRender extends ItemStackTileEntityRenderer { @Override public void renderByItem(ItemStack itemStackIn) { System.out.println("Rendering it I guess."); // Doesn't get printed out to the console. if (itemStackIn.getItem() instanceof ItemSingleStackGlassContainer) { ItemStack itemStack = ItemSingleStackContainer.getContainedItemStack(itemStackIn); if (itemStack != ItemStack.EMPTY) { GlStateManager.pushMatrix(); Minecraft.getInstance().getItemRenderer().renderItem(itemStack, ItemCameraTransforms.TransformType.FIXED); GlStateManager.popMatrix(); } } } } -
Well aren't I the stupid idiot! Much appreciated for your time! ❤️
-
By DaemonUmbra · Posted
You are missing a mod that LittleTiles depends on, please re-read the mod’s CurseForge page
-
-
Topics
-
Who's Online (See full list)