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.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. You can see some examples in my mod's init classes.
  2. Minecraft calls BlockModelShapes#registerBuiltInBlocks for the shulker box Blocks, which means that BlockStateMapper#getBlockstateLocations and BlockStateMapper#getVariants return an empty Set/Map respectively when called with one of the Blocks. You can achieve the same result by implementing IStateMapper#putStateModelLocations to return an empty Map (using Collections.emptyMap) and registering an instance in ModelRegistryEvent using ModelLoader.setCustomStateMapper.
  3. You're checking if the Block is both replaceable and is equal to Blocks.GRASS, which will never be true because Blocks.GRASS isn't replaceable. You can use the && (and) operator to combine multiple boolean expressions (like the conditions of the four if statements) into one. Don't call World#getBiomeForCoordsBody directly, call World#getBiomeForCoords instead. This allows the WorldProvider to return the appropriate Biome (this may or may not call World#getBiomeForCoordsBody). Don't compare to Blocks.AIR directly, use Block#isAir to support modded air-like blocks.
  4. You needed to change the blockstates file and the model, not the registration class. RegUt.registerBlocks and RegUt.regItems are broken since they only register the Blocks/Items on the physical client, but this needs to happen on both physical sides. Model registration must be done in a separate client-only class to avoid crashing the dedicated server. You should be using registry events instead of registering things in preInit. GameRegistry.register is no longer accessible in 1.12, so this will make it easier to update. The log you linked isn't the FML log.
  5. Items load their models from either an item model file (the normal location) or a variant of a blockstates file (the blockstate location). You need to provide at least one model for every item. That's correct. Display transformations are rotation, translation and scale operations applied to the model when it's rendered as an item in various contexts (e.g. left/right hand, GUI, item entity, etc.).
  6. You need to include your mod ID as the domain of the model and texture paths, i.e. "<modid>:<model_name>" and "<modid>:<texture_path>". Textures need to in PNG format, not JPEG. Is the block called fooblock or memeblock? Your files are apparently called fooblock, but the blockstates file uses the memeblock.json model and the model uses the memeblock.png texture. In future, the FML log (logs/fml-client-latest.log in the game directory) will tell you why models/textures failed to load. If you don't know how to interpret the errors, post the full log using Gist or Pastebin when asking for help.
  7. Override Block#getDrops to do the following: Write the TileEntity to NBT. Create the ItemStack that will be dropped. Set the "BlockEntityTag" key of the ItemStack's compound tag to the compound tag containing the TileEntity data. Add the ItemStack to the drops list. The TileEntity is normally removed from the world before Block#getDrops is called, so you need to delay its removal by overriding BlockFlowerPot#removedByPlayer and BlockFlowerPot#harvestBlock. See Forge's patch to BlockFlowerPot for an example of this. When an ItemBlock (or ItemBlockSpecial) is placed by a player and the ItemStack has a compound tag at the "BlockEntityTag" key, it will automatically call TileEntity#readFromNBT with the compound tag (unless TileEntity#onlyOpsCanSetNbt returns true and the player isn't an op).
  8. Which version of Forge are you using? Post your code and the full stacktrace of the exception.
  9. The recipe registry (unlike other registries) is modifiable, so you can actually remove a recipe using IForgeRegistryModifiable#remove. Any advancement that rewards the recipe will throw a syntax exception (spamming the log) if you do this, though.
  10. You need to have a solid understanding of Java before making a mod. As it says in this section's description, we're not here to help with basic Java problems. Java has a tutorial on parameters here.
  11. Do you know what a parameter is? This is a basic Java concept.
  12. The logging of missing models was broken in Forge 1.12-14.21.0.2363 (commit dc043ac) and fixed in Forge 1.12-14.21.1.2390 (commit ede05a2). After updating Forge, it was easy to identify the issues with the turret blockstates file: You were using strings instead of integers for the x and y rotations. The first variant was misspelled (facung=up rather than facing=up). The first variant has an invalid block/ prefix in its model location. Some other issues I noticed: There's no item model for the turret in the repository. IanusIncHq uses Java's Logger instead of log4j's (which is what Minecraft uses). CustomBlock has a missing semicolon. The turret and small super condensator models extend minecraft:block/cube_all but override its elements and don't specify the all texture. They should extend minecraft:block/block instead, since it provides the standard display transformations without providing any elements. The other non-cube models don't extend any model and don't specify any display transformations, they should extend minecraft:block/block. I've fixed these issues and pushed the changes to GitHub. You can view and/or merge the changes here.
  13. It was renamed to Biome in 1.9.
  14. Edit the first post of a thread and you'll be able to edit the thread title, including adding [SOLVED] to it. There's no actual mechanism for marking threads as solved, it's just editing the title.
  15. Which Minecraft version are you using? I'm guessing you're using a version where Block#isOpaqueCube has an IBlockState parameter, which your isOpaqueCube method doesn't. Always annotate override methods with @Override so you get a compilation error when they don't actually override a super method. You should also use your IDE to auto-generate override methods with the correct signature and annotation. In future, please post code using a code block (the <> icon) or on Gist/Pastebin.
  16. I've submitted an issue for this here. Being able to override an object from your own mod doesn't make much sense, so it should crash with a more obvious exception when you attempt to do so.
  17. Extend CommandBase, implement IClientCommand and register it by calling CommandHandler#registerCommand on ClientCommandHandler.instance.
  18. BlockFire.init sets the flammability and spread speed of vanilla Blocks.
  19. TileEntity#getUpdateTag is called when a Chunk is being sent to players and the returned compound tag is included in the SPacketChunkData. ChunkWatchEvent.Watch is fired when a player starts watching a Chunk, directly after the SPacketChunkData has been sent.
  20. You're overriding expanded:dark_oak_bed_item (i.e. registering a new value with the same name), but the old value doesn't have an OverrideOwner associated with it. If I understand Forge's registry code correctly, this would happen when the new value has the same owner (mod ID) as the old one (because the new OverrideOwner and value replace the old OverrideOwner and value in the ForgeRegistry#owners BiMap). Are you registering this Item in multiple places? As Draco said, we need to see more of your code.
  21. Post your code, specifically where you register an override of a vanilla registry entry. Also post the FML log so we can see exactly what the message is warning about. This is related to the new override system provided by Forge's registries, which replaces the old substitution alias system. It's not related to overriding a method.
  22. ItemStacks can be null in 1.10.2 and earlier, so your ItemStackHandler#insertItem override should be annotated with @Nullable, not @Nonnull. This also applies to the ItemStack parameter. It's only in 1.11 and later that ItemStacks can't be null. This particular crash is triggered by IDEA's automatic runtime null-checking. For methods that you control, fix the annotations or the code so that @Nonnull methods don't return null values. For methods that you don't control, you can disable the null-checking as described here.
  23. What do you mean? Do you know how to override a method? If the flammability/spread speed is always the same, you can simply return a constant value and ignore the arguments.
  24. Please include the files required to build the mod in the repository: build.gradle, gradlew, gradlew.bat and the gradle directory.

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.