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.

Starless

Members
  • Joined

  • Last visited

Everything posted by Starless

  1. What is Block#getBlockLayer and Block#getRenderType I want to be able to place (X,Y,Z) 3x3x3 blocks of a certain kind with the height being variable from 3 to 5 (3x4x3, 3x5x3) similar to railcraft's tank. But I'm stuck at basic things like defining the block. 1.9.4 is a lot more complicated than I expected. My plan is to have a central block that is built differently from the others and that stays in the center of the bottom most layer and another in the center of the top layer. Those would be input/output blocks. The others would be just structure. But I'm lost with all the new stuff in 1.9.4. Can someone help me? Also, how to create a fluid?
  2. That fixed it, thanks!
  3. I made the following changes: CommonProxy class: public void registerItemRenderer(Item item, int meta, String name) { } ClientProxy class: @Override public void registerItemRenderer(Item item, int meta, String name) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(TheMod.MODID + ":" + name, "inventory")); } ItemBase class: public ItemBase init() { GameRegistry.register(this); TheMod.proxy.registerItemRenderer(this, 0, name); return this; } I think that covers your observation, but still no texture.
  4. I can't make my item display its texture. This is my code: Main mod class: @Mod(modid = TheMod.MODID, name = TheMod.NAME, version = TheMod.VERSION) public class TheMod { public static final String MODID = "mymod"; public static final String VERSION = "1.9-Alpha-1.0"; public static final String NAME = "My Mod"; @SidedProxy(clientSide = ClientProxy.NAME, serverSide = CommonProxy.NAME) public static CommonProxy proxy; @Instance public static TheMod instance; public static Logger logger; @EventHandler public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } } CommomProxy class: public class CommonProxy { public static final String NAME = "mod.mymod.CommonProxy"; public void preInit(FMLPreInitializationEvent event) { } public void init(FMLInitializationEvent event) { Items.init(event); } public void postInit(FMLPostInitializationEvent event) { } } ClientProxy class: public class ClientProxy extends CommonProxy { public static final String NAME = "mod.mymod.ClientProxy"; @Override public void preInit(FMLPreInitializationEvent event) { super.preInit(event); } @Override public void init(FMLInitializationEvent event) { super.init(event); } @Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); } } ItemBase class: public class ItemBase extends Item { public final String name; public ItemBase(String name) { setRegistryName(name); this.name = name; setUnlocalizedName(getRegistryName().toString()); } public ItemBase init(FMLInitializationEvent event) { GameRegistry.register(this); if(event.getSide() != Side.SERVER) { registerModel(); } return this; } private void registerModel() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(TheMod.MODID + ":" + name, "inventory")); } @Override public ItemBase setCreativeTab(CreativeTabs tab) { super.setCreativeTab(tab); return this; } } Items class: public final class Items { private Items() { } public static Item firstItem; public static void preInit(FMLPreInitializationEvent event) { } public static void init(FMLInitializationEvent event) { firstItem = new ItemBase("first_item").init(event); } public static void postInit(FMLPostInitializationEvent event) { } } What I understand should happen is: TheMod gets a chance to handle the 3 initialization events it is subscribed to. 1: TheMod handles the pre initialization event, where the logger field is initialized. 2: TheMod handles the initialization event by invoking the sided proxy init method. 3: the sided proxy's init invokes Items.init method 4: Items.init instantiates a new ItemBase 4.1: The constructor of ItemBase registers the non-prefixed name passed to it. 4.2: The constructor of ItemBase stores the non-prexifed name passed to it as the instance field name 4.3: The constructor of ItemBase invokes setUnlocalized name, passing as argument the result of getRegistryName (which will return the name prefixed by the mod id). 5: Items.init invokes ItemBase#init on the newly created ItemBase instance. 5.1: ItemBase#init registers this by invoking GameRegistry#register 5.2: ItemBase#init uses its event argument's getSide method to decide if registerModel should be invoked. 5.3: registerModel is responsible for the item having a texture. This method's body was copy pasted from somewhere else. I'm not sure what it's being done here. Where is my mistake and why? Thanks.
  5. Thank you. Do those tutorials cover the advanced stuff too? I have big plans for my mod.
  6. And where do I find 1.9 tutorials?
  7. I can't find tutorials for the right version to follow (1.9.4). Can someone send me some links? Thank you very much.

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.