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.

Lycanus Darkbinder

Members
  • Joined

  • Last visited

Everything posted by Lycanus Darkbinder

  1. Greetings, I've been trying to convert a Minecraft 1.5.2 mod I've written to use one ID for 6 different colored blocks instead of 6 different blocks but they all have the same texture. I followed the guide on the wiki to get the 6 blocks registered under the same ID but I can't seem to figure out how to give them different textures. So far I have 6 separate blocks that register properly (creative tab and crafting) and 6 separate texture files. I just can't figure out how to register the different textures. In the creative tab, inventory and when placed they all have the same texture. Any tips would be appreciated, thanks! Notes: The guide on the wiki is a little outdated. In 1.5.2 there is no getBlockTextureFromSideAndMetadata() and other related functions to override. I want to stay with 1.5.2 for now
  2. I understand the message, but how do you expose the Mod.name, Mod.modid and Mod.version information that gets set in the main class file? I would think that as soon as @PreInit is called an instance of the main class has been created. Obviously it's available somewhere because it gets listed in the "Mods" list in the Minecraft GUI.
  3. Forge 7.8.1.738, Minecraft 1.5.2 I'm trying to use Mod.name() to print the name of the mod in a debug message using System.out.println but I keep getting this error: In the past you used to be able to reference modid, name and version from the Mod class. Several tutorials I've seen use this in registerIcons() to refer to the mod package. Is this no longer possible?
  4. I do have the @Mod annotation and I actually don't have any Side.CLIENT yet and I have @NetworkMod with clientSideRequired=false, serverSideRequired=true. Also I assume when you say Eclipse has a launcher that you're not talking about the batch file?
  5. I'm working on a server-side mod but I can't figure out how to debug it. When I run "startserver.bat" and then start the client through Eclipse in debug mode, it tells me that "the mod testBlocks was not found on the server"... I've tried the following: @NetworkMod(clientSideRequired=false, serverSideRequired=true) @NetworkMod(clientSideRequired=true, serverSideRequired=true) but for whatever reason, the server doesn't see the mod's source code.
  6. Well, it looks like Mod.PostInit delays it long enough. I couldn't test it in MCP because I didn't have other deobfuscated mods to add but it seems to work with a "live" version of Minecraft.
  7. Well, it looks like Mod.PostInit delays it long enough. I couldn't test it in MCP because I didn't have other deobfuscated mods to add but it seems to work with a "live" version of Minecraft.
  8. Hmm, TextureLoadEvent seems like it might work. It appears this is called last after all the mods are loaded. Perhaps the mod can then do ID validation at this point.
  9. Hmm, TextureLoadEvent seems like it might work. It appears this is called last after all the mods are loaded. Perhaps the mod can then do ID validation at this point.
  10. I also found this: @Mod.ServerStarted public void serverStarted(FMLServerStartedEvent event) { System.out.println("@ServerStarted"); } I put a breakpoint on that println() and it never gets called. According to the comments, ServerStarted is supposed to be called after the server is running but I guess it doesn't include the integrated server.
  11. I also found this: @Mod.ServerStarted public void serverStarted(FMLServerStartedEvent event) { System.out.println("@ServerStarted"); } I put a breakpoint on that println() and it never gets called. According to the comments, ServerStarted is supposed to be called after the server is running but I guess it doesn't include the integrated server.
  12. That's exactly what the mod does. It allows the user to create text files with alternative recipes, for example: and it works fine with default items. The issue is if the user puts an item from a mod then the recipe has a chance to error if the mod hasn't been loaded yet. Since I don't have any foreknowledge of wether a user will have items: "bigBlock" or "wetLeaves", I can't use the mod dependency file. I need some way to delay loading the mod. I did find FMLClientHandler.finishMinecraftLoading() but I haven't been able to hook into it.
  13. That's exactly what the mod does. It allows the user to create text files with alternative recipes, for example: and it works fine with default items. The issue is if the user puts an item from a mod then the recipe has a chance to error if the mod hasn't been loaded yet. Since I don't have any foreknowledge of wether a user will have items: "bigBlock" or "wetLeaves", I can't use the mod dependency file. I need some way to delay loading the mod. I did find FMLClientHandler.finishMinecraftLoading() but I haven't been able to hook into it.
  14. The dependencies file unfortunately won't work because there's no way to tell which mods a user has at any given time. This recipe mod really needs to be loaded absolutely last so it can check item and block IDs that are added by other, unrelated mods.
  15. The dependencies file unfortunately won't work because there's no way to tell which mods a user has at any given time. This recipe mod really needs to be loaded absolutely last so it can check item and block IDs that are added by other, unrelated mods.
  16. Greetings, I've been helping TheBoo fix a recipe mod but the mod gets loaded too early so it can't validate item IDs from other mods. Is there any event or method that will delay a mod? I've looked at the event system but couldn't see anything that deals with server loading. Thanks! Edit: Links to the original thread... http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__240#entry22087354 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22091817 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22093408
  17. Greetings, I've been helping TheBoo fix a recipe mod but the mod gets loaded too early so it can't validate item IDs from other mods. Is there any event or method that will delay a mod? I've looked at the event system but couldn't see anything that deals with server loading. Thanks! Edit: Links to the original thread... http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__240#entry22087354 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22091817 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22093408
  18. Thanks to everyone for the discussion. The primary reason I had avoided TileEntity was because everything I've read about those said to be cautious about using them because they're extremely resource intensive. I'll have to look into TileEntity a bit more.
  19. Thanks to everyone for the discussion. The primary reason I had avoided TileEntity was because everything I've read about those said to be cautious about using them because they're extremely resource intensive. I'll have to look into TileEntity a bit more.
  20. Interesting. I just came back to reply that I had figured it out by creating my own ArrayList to track the info I needed. From the link you provided it's similar to a TileEntity. In case anyone is interested, here's my code. It can be used as a blueprint where all you need to do is create your own "FencePostInfo" class (or whatever). I created a class called FencePostInfo that contains two booleans and an array of 6 integers. I then store this in an ArrayList in my FencePost class and use accessor functions to add / remove instances of FencePostInfo. private static ArrayList<FencePostInfo> infList = new ArrayList<FencePostInfo>(); private static ArrayList<String> infListIdx = new ArrayList<String>(); infListIdx is used as a lookup table for indices into infList by converting the xyz of the block into a string and using infListIdx.indexOf(). private int addToInfList(int x, int y, int z) { // Adds an instance of FencePostInfo to the list // and tracks the lookup key using the block's coordinates // Initialize private info for this block FencePostInfo i = new FencePostInfo (this.blockID, x, y, z); infList.add(i); infListIdx.add(coordsToString(x, y, z)); return getInfListIdx(x, y, z); // return the index of our new entry } private void removeFromInfList(int x, int y, int z) { // Removes an instance of FencePostInfo from the list // and delete it's index tracking entry int i = getInfListIdx(x, y, z); // If object doesn't exist, i = -1 if (i > -1) { FencePostInfo ri = infList.get(i); if (ri != null) { infList.remove(i); // remove the instance infListIdx.remove(i); // remove the index tracker ri = null; } } } private FencePostInfo getInfo(int x, int y, int z) { // Allows access to a FencePostInfo instance int i = this.getInfListIdx(x, y, z); if (i == -1) { // instance didn't exist, make one so we don't crash addToInfList(x, y, z); i = this.getInfListIdx(x, y, z); } return infList.get(i); } private int getInfListIdx(int x, int y, int z) { // Returns the index of the FencePostInfo represented // by the coordinate string so we can retrieve it from infList return infListIdx.indexOf(coordsToString(x, y, z)); } private String coordsToString(int x, int y, int z) { // Converts a coordinate to a string // in the format xN, yN, zN return "x" + x + "y" + y + "z" + z; } I can then use it anywhere in my class like this: boolean isBottom = getInfo(par1, par2, par3).isOnBottom() It has quite a bit of flexibility. For example, I can add any fields and methods to FencePostInfo that I want such as a unique GUID for the block using Math.Random() and then use that info to make decisions when the block is destroyed, etc. Note: The current implementation does not save ArrayList...it only works if you only "quit to title" and don't close Minecraft. Need to implement saving this to disk (it's more lightweight than a TileEntity).
  21. Interesting. I just came back to reply that I had figured it out by creating my own ArrayList to track the info I needed. From the link you provided it's similar to a TileEntity. In case anyone is interested, here's my code. It can be used as a blueprint where all you need to do is create your own "FencePostInfo" class (or whatever). I created a class called FencePostInfo that contains two booleans and an array of 6 integers. I then store this in an ArrayList in my FencePost class and use accessor functions to add / remove instances of FencePostInfo. private static ArrayList<FencePostInfo> infList = new ArrayList<FencePostInfo>(); private static ArrayList<String> infListIdx = new ArrayList<String>(); infListIdx is used as a lookup table for indices into infList by converting the xyz of the block into a string and using infListIdx.indexOf(). private int addToInfList(int x, int y, int z) { // Adds an instance of FencePostInfo to the list // and tracks the lookup key using the block's coordinates // Initialize private info for this block FencePostInfo i = new FencePostInfo (this.blockID, x, y, z); infList.add(i); infListIdx.add(coordsToString(x, y, z)); return getInfListIdx(x, y, z); // return the index of our new entry } private void removeFromInfList(int x, int y, int z) { // Removes an instance of FencePostInfo from the list // and delete it's index tracking entry int i = getInfListIdx(x, y, z); // If object doesn't exist, i = -1 if (i > -1) { FencePostInfo ri = infList.get(i); if (ri != null) { infList.remove(i); // remove the instance infListIdx.remove(i); // remove the index tracker ri = null; } } } private FencePostInfo getInfo(int x, int y, int z) { // Allows access to a FencePostInfo instance int i = this.getInfListIdx(x, y, z); if (i == -1) { // instance didn't exist, make one so we don't crash addToInfList(x, y, z); i = this.getInfListIdx(x, y, z); } return infList.get(i); } private int getInfListIdx(int x, int y, int z) { // Returns the index of the FencePostInfo represented // by the coordinate string so we can retrieve it from infList return infListIdx.indexOf(coordsToString(x, y, z)); } private String coordsToString(int x, int y, int z) { // Converts a coordinate to a string // in the format xN, yN, zN return "x" + x + "y" + y + "z" + z; } I can then use it anywhere in my class like this: boolean isBottom = getInfo(par1, par2, par3).isOnBottom() It has quite a bit of flexibility. For example, I can add any fields and methods to FencePostInfo that I want such as a unique GUID for the block using Math.Random() and then use that info to make decisions when the block is destroyed, etc. Note: The current implementation does not save ArrayList...it only works if you only "quit to title" and don't close Minecraft. Need to implement saving this to disk (it's more lightweight than a TileEntity).
  22. Given that Minecraft only uses one instance of a particular Block class, it makes it difficult to save unique data each time a block is placed in the world. I'm trying to save some data about a block (two booleans and an array of neighboring block IDs and metadata) when onBlockAdded() is called. Naturally this information can't simply be stored in a local variable because each time onBlockAdded() is called it overwrites the previous data. Is there any storage mechanism besides metadata that allows us to save unique data about an instance of a block? Thanks. PS: I know I can write lookup functions to accomplish the same as the boolean values but I figured it would be a performance hit to drill down into World() for some info when I can just look it up once and save it until the block is destroyed. The array is used by a lookup function called WhichBlockChanged() which is called from onNeighborBlockChange() since this function oddly gives the block its own coordinates instead of those of the block that changed.
  23. Given that Minecraft only uses one instance of a particular Block class, it makes it difficult to save unique data each time a block is placed in the world. I'm trying to save some data about a block (two booleans and an array of neighboring block IDs and metadata) when onBlockAdded() is called. Naturally this information can't simply be stored in a local variable because each time onBlockAdded() is called it overwrites the previous data. Is there any storage mechanism besides metadata that allows us to save unique data about an instance of a block? Thanks. PS: I know I can write lookup functions to accomplish the same as the boolean values but I figured it would be a performance hit to drill down into World() for some info when I can just look it up once and save it until the block is destroyed. The array is used by a lookup function called WhichBlockChanged() which is called from onNeighborBlockChange() since this function oddly gives the block its own coordinates instead of those of the block that changed.
  24. Well, I figured it out so I'll post here in case any other newcomers get stuck... There were actually two things I was doing wrong: 1. I commented out my scheduleBlockUpdate() inside onBlockAdded() This is required to schedule the block for updates after logging out / in. Part of the data saved with the world is the tickRate for the block and when it's next scheduled 2. Existing blocks don't get updated after making changes I made the code changes but the blocks that were already in the world needed to be destroyed and replaced. I should've realized this earlier but hey, it's late and I'm tired.
  25. Well, I figured it out so I'll post here in case any other newcomers get stuck... There were actually two things I was doing wrong: 1. I commented out my scheduleBlockUpdate() inside onBlockAdded() This is required to schedule the block for updates after logging out / in. Part of the data saved with the world is the tickRate for the block and when it's next scheduled 2. Existing blocks don't get updated after making changes I made the code changes but the blocks that were already in the world needed to be destroyed and replaced. I should've realized this earlier but hey, it's late and I'm tired.

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.