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.

CJLetsGame

Forge Modder
  • Joined

  • Last visited

Everything posted by CJLetsGame

  1. Did you really expect good results from modifying base classes? Or mod compatibility for that matter?
  2. Is the block just not in the tab, or is the tab not there at all. It would help if you initialized the tab BEFORE assigning the block to it...
  3. put the entire assets folder inside the zip for your mod.
  4. He already told you where to look. As for if it will actually work or not, test it for yourself and find out.
  5. System.out.println("Ore: " + Xcoord + "," + Ycoord + "," + Zcoord); place it right before the call to WorldGenMineable.
  6. Your for loop is only running twice per chunk. Try going from 0 to 10 or so. Also, do what diesieben suggested and print the locations the ore is spawning to the console to see if it is spawning at all and where to look.
  7. public ItemStack decrStackSize(int par1, int par2) { if (this.furnaceItemStacks[par1] != null) { ItemStack itemstack; if (this.furnaceItemStacks[par1].stackSize <= par2) { itemstack = this.furnaceItemStacks[par1]; this.furnaceItemStacks[par1] = null; return itemstack; } else { itemstack = this.furnaceItemStacks[par1].splitStack(par2); if (this.furnaceItemStacks[par1].stackSize == 0) { this.furnaceItemStacks[par1] = null; } return itemstack; } } else { return null; } } Im not sure why you didnt just use the furnace tile entity as reference... The above is from the furnace.
  8. Why did you set the last parameter to draw the text 0? That's supposed to be the color. of the text.
  9. He means post YOUR code. Even if you copied the tutorial, we need to see your code.
  10. It'll also let you know when the function your trying to use doesn't match the function that exists. That's what I said.
  11. The @Override annotation doesnt do anything major. It is useful if you update and the names of base methods change because it will be marked with an error, letting you know to change the method name.
  12. Like i said... In the getServerGuiElement, it has to return containers like you are doing now. However, the cient one needs to return GUIS. Right now you are returning the containers. Containers are handled server-side only. Guis are client only.
  13. Hmm its still casting a container to a gui... Both returns HAVE to be a container in the server. Both have to be a gui in the client.
  14. can I see the code for the Macerator gui?
  15. for the client element case MainRegistry.guiIdDarkIronFurance: if (entity instanceof TileEntityDarkIronFurnace) { return new DarkIronFurnaceContainer(player.inventory, (TileEntityDarkIronFurnace) entity); } It should be returning a gui not a container
  16. post the console output. I need an error to work with.
  17. Ignoring how suspicious that sounds, what code could you have possibly needed so bad that you had to look at someone elses compiled code instead of: A.) Working it out yourself B.) Asking for help C.) Looking at examples already inside the Minecraft code. Trust me, you will get much more satisfaction from doing your own work than copying code from someone else. As for renaming imports though, its a matter of trial and error really. You might get lucky and guess a few. For example if its a block class one of the imports is probably net.minecraft.blocks.block...
  18. you need to add a break after each case like this: switch (id) { case MainRegistry.guiIdMacerator: if (entity instanceof TileEntityMacerator) { return new ContainerMacerator(player.inventory, (TileEntityMacerator) entity); break; } case MainRegistry.guiIdDarkIronFurance: { if (entity instanceof TileEntityDarkIronFurnace) { return new DarkIronFurnaceContainer(player.inventory, (TileEntityDarkIronFurnace) entity); } break; } return null; default: return null; } } Otherwise it would just fall through all the cases whether they matched or not. Kind of like an OR in an If/Then statement
  19. Add more cases to the switch statement. Dont forget to add breaks at the end of each case though.
  20. You can handle both within the same handler Example: public class GuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile_entity = world.getBlockTileEntity(x, y, z); int BlockID = world.getBlockId(x, y, z); int Meta = world.getBlockMetadata(x, y, z); if (ID == 1) { return new ContainerWorkbenchClone(player.inventory,player.worldObj); } //Logger.getLogger("CJTECH").log(Level.INFO, "GUI Block Id: " + BlockID); //Logger.getLogger("CJTECH").log(Level.INFO, "GUI Block Meta: " + Meta); if (BlockID == Blocks.blockMachine.blockID) { return new ContainerMachine(player.inventory, (TileEntityMachine) tile_entity); } if (BlockID == Blocks.blockPowerStorage.blockID) { return new ContainerPowerStorage(player.inventory, (TileEntityPowerStorage) tile_entity); } if (BlockID == Blocks.blockColliderController.blockID){ return new ContainerCollider(player.inventory, (TileEntityCollider) tile_entity); } if (BlockID == Blocks.blockMultiFurnace.blockID){ return new ContainerMultiFurnace(player.inventory, (TileEntityMBFurnace) tile_entity); } if (BlockID == Blocks.blockEnderNetTerminal.blockID) { if (Meta == 1) { return new ContainerEnderNetItemTerminal(player, new EnderNetItemPage((TileEntityEnderNetTerminal) tile_entity, 0)); } } if (BlockID == Blocks.blockItemTransport.blockID) { if (Meta == 4) { return new ContainerTransportSorter(player.inventory, (ItemTransportBase) tile_entity); } } if (BlockID == Blocks.blockResearchTable.blockID) { return new ContainerResearchTable(player.inventory, (TileEntityResearchTable) tile_entity); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile_entity = world.getBlockTileEntity(x, y, z); int BlockID = world.getBlockId(x, y, z); int Meta = world.getBlockMetadata(x, y, z); if (ID == 1) { return new guiCraftingClone(player.inventory, player.worldObj); } if (ID == 2) { return new guiResearchBook(player, player.worldObj); } if (BlockID == Blocks.blockMachine.blockID) { switch (Meta) { case 0: return new guiPoweredFurnace(player.inventory, (TileEntityMachine) tile_entity); case 1: return new guiPoweredFurnace(player.inventory, (TileEntityMachine) tile_entity); case 2: return new guiPoweredGrinder(player.inventory, (TileEntityMachine) tile_entity); case 3: return new guiPoweredGrinder(player.inventory, (TileEntityMachine) tile_entity); case 4: return new guiCompressor(player.inventory, (TileEntityMachine) tile_entity); case 5: return new guiCompressor(player.inventory, (TileEntityMachine) tile_entity); } } if (BlockID == Blocks.blockPowerStorage.blockID) { Logger.getLogger("CJTECH").log(Level.INFO, "Block is Power Storage"); switch (Meta) { case 0: return new guiSmallPowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 1: return new guiSmallPowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 2: return new guiMediumPowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 3: return new guiMediumPowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 4: return new guiLargePowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 5: return new guiLargePowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 6: return new guiHugePowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); case 7: return new guiHugePowerBox(player.inventory, (TileEntityPowerStorage) tile_entity); } } if (BlockID == Blocks.blockColliderController.blockID) { return new guiCollider(player.inventory, (TileEntityCollider) tile_entity); } if (BlockID == Blocks.blockTDTeleporter.blockID) { return new guiTDTeleporter(player, (TileEntityTDTeleporter) tile_entity, tile_entity.worldObj); } if (BlockID == Blocks.blockMultiFurnace.blockID) { return new guiMultiFurnace(player.inventory, (TileEntityMBFurnace) tile_entity); } if (BlockID == Blocks.blockEnderNetTerminal.blockID) { if (Meta == 0) return new guiENetPowerTerminal(player, (TileEntityEnderNetTerminal) tile_entity); if (Meta == 1) return new guiENetItemTerminal(player, (TileEntityEnderNetTerminal) tile_entity, 0); } if (BlockID == Blocks.blockItemTransport.blockID) { if (Meta == 4) return new guiTransportSort(player.inventory, (ItemTransportBase) tile_entity); } if (BlockID == Blocks.blockResearchTable.blockID) { if (Meta == 0) return new guiBasicResearchTable(player.inventory, (TileEntityResearchTable) tile_entity); } return null; } } You can either do it by checking the block id and meta like I did, or by the gui ID you pass into the handler when you open a gui.
  21. In the cure method, it checks the itemstack you pass in with the curing item of each potion effect. In other words, the effects have no clue you want your item to be a cure. Try passing in an itemstack of a bucket of milk instead EDIT: Or copy the code in the cure method and alter it if you want to target specific effects
  22. Change your registers to: GameRegistry.registerBlock(snowstormBlock, "snowstormBlock"); LanguageRegistry.addName(snowstormBlock, "Blanket"); You should also give the block a unlocalized name public BlockSnowstormBlock(int id, Material mat) { super(id, mat); this.setCreativeTab(CreativeTabs.tabBlock); this.setUnlocalizedName("snowtormBlock"); }
  23. The following should work public class BlockSnowstormBlock extends Block{ public BlockSnowstormBlock(int id, Material mat) { super(id, mat); this.setCreativeTab(CreativeTabs.tabBlock); } public registerIcon (IconRegister icon){ this.blockIcon = icon.registerIcon("Snowstorm:blanket"); } }

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.