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. Then use ItemStack#getDisplayName . This will return the custom name if the stack has one, otherwise it will return the item's display name.
  2. What are you actually trying to achieve? Block#setBlockBounds lets you set a block's bounds. Block#addCollisionBoxesToList lets you have multiple bounding boxes and/or change the bounds based on the colliding Entity .
  3. Thanks diesieben07. I found all sorts of references that said event.block when I was doing my research. Here's two examples: http://www.minecraftforge.net/wiki/Event_Reference http://www.minecraftforge.net/forum/index.php?topic=19820.0 But I appreciate your assistance in getting me a quick and accurate response. Those are for 1.7.10 and earlier. 1.8 introduced the blockstate system (i.e. IBlockState ), which largely replaced the old block metadata system (though technically the new system is still just a wrapper around the metadata).
  4. Use ItemStack#hasDisplayName .
  5. I found the source of the problem: not all blocks have a harvest tool/level set, so you need to override Item#canHarvestBlock and Item#getDigSpeed to check the block's Material like the vanilla tools do. You can see my new code here: 1.7.10, 1.8
  6. Yes it is. My resources are in src/main/resources Your build.gradle is telling Gradle to look in $projectDir/src/java and $projectDir/src/resources instead of the default src/main/java and src/main/resources. You should delete the sourceSets block entirely, it's not needed if you use the default locations.
  7. Unfortunately there are no obvious errors in the log. Are you sure your @Mod class is present in the JAR?
  8. Then post a log from when it doesn't load (i.e. from a client with the mod in its mods folder). The debugging suggestion was a separate recommendation to the log posting.
  9. Headcrumbs is trying to use a global entity ID that's already being used by something else. Report this to the author.
  10. Each tick, World#updateEntities updates any loaded entities that aren't dead and removes any dead entities from the loaded entity list. Once there are no more references to the Entity , it should simply be garbage collected.
  11. It looks like your mod loads without issue in that log.
  12. Post the full error and the full class.
  13. I don't know what you are talking about [nobbc][/nobbc] Jokes aside: Either check "Don't use smileys" in "Attachments and other options" or disable BBCode temporarily by surrounding the desired passage with [nobbc][nobbc][/nobbc][/nobbc] (the creation of this involved that tag ). Thanks, I wasn't aware of that option.
  14. BlockFluidNoFlow is my own fluid block class, it's just a fluid that doesn't flow outwards. BlockFluidClassic and BlockFluidFinite are the fluid block classes provided by Forge. The doc comment on each class briefly explains what it does. ModFluids.createFluid creates and registers the Fluid instance (a singleton like Block and Item ) using the specified fluid name and texture name. The Fluid instance defines the physical properties of the fluid like luminosity, density and viscosity (explained in doc comments of the corresponding Fluid fields). ModFluids.registerFluidBlock receives the fluid's Block instance as an argument, sets its unlocalised name to the fluid's unlocalised name and registers it. The Block instance represents the fluid when it's in the world and actually implements the in-world behaviour corresponding to the Fluid 's properties (e.g. light level is controlled by the luminosity, flow speed is controlled by the viscosity). My code doesn't handle the Fluid already being registered by another mod. If a Fluid with the same name as yours (e.g. steam ) is already registered, you should use that Fluid instance and its Block instead of creating your own. I know BuildCraft has an example of this (for 1.7.10, but it should be the same in 1.. Edit: I wish 8 followed by a ) didn't turn into a smiley.
  15. Yes, that's what my ModFluids class does. You can do model registration in the same class as the fluid creation/registration, but I prefer to register all models in a separate client-only class ( ModModelManager ). A Fluid can be either a liquid or a gas. Liquids behave like Water/Lava, gases are just liquids that flow upwards instead of downwards.
  16. Industrial Craft 2 failed to extract its copy of the EJML library properly. If you're using a modpack, report this to the modpack authors. Otherwise, try updating to the latest official build of IC2.
  17. It looks like you've posted the output from the console, but the log file should have some more information about the mod loading process in it. Could you post that? Use Gist if it's too large for Pastebin. You should also try building a deobfuscated copy of your mod (run the jar Gradle task), adding that as a mod in a separate ForgeGradle project, putting some breakpoints in JarDiscoverer#discover and stepping through it to see what's going wrong.
  18. In 1.8, Item#getStrVsBlock is only used in Item#getDigSpeed (which ItemTool overrides to use tool classes) and InventoryPlayer#getStrVsBlock (which isn't used anywhere). In 1.7.10, Item#func_150893_a (the equivalent method) is only used in EntityPlayer#isCurrentToolAdventureModeExempt (which should use my override of Item#canHarvestBlock first) and Inventory#func_146023_a (which again isn't used anywhere).
  19. Adding the Fluid and its Block aren't that different in 1.8, except you need to pass ResourceLocation s of the fluid's textures to the Fluid constructor. The new model system is fairly different, though. You need to use Forge's advanced blockstates format to tell each fluid block to use Forge's fluid model and specify which Fluid to use the textures from. I don't have a guide, but I do have examples: Fluid / Block instantiation and registration: my mod, Forge Model registration: my mod, Forge Blockstates file: my mod, Forge The registration of fluid containers (buckets and tanks) in my ModFluids class is currently broken ( FluidContainerRegistry doesn't support NBT-based fluid containers), so don't use that. Edit: Fixed the formatting.
  20. I've created a tool that can function as a pickaxe, axe or shovel; but for some reason it's harvesting specific blocks much slower than the effective vanilla tool does while harvesting other blocks at the same speed as the vanilla tool. The slow blocks include Block of Coal, Dispenser, Note Block, Bricks, Obsidian, Redstone Ore, Monster Spawner, Stairs, Doors and Pressure Plates. I can't see any pattern in which blocks are slow and which are normal speed. My code can be found here: 1.7.10, 1.8. Does anyone know what's going wrong? Is there some vanilla method I need to implement?
  21. If you're going to use multiple values from a string split, you should store returned array in a local variable and reference that instead of calling String#split once per value. Doing this will also allow you to step through the code in a debugger and see what the values for each position are before they're parsed into floats.
  22. BuildCraft and EnderIO both have examples of RF generators and pipes.
  23. You'll probably want to use IExtendedEntityProperties to store the stats for each player. coolAlis has a tutorial on the system here. To implement the effects of these stats, just use the hooks and events provided by Forge. How you do this depends on what you actually want to do.
  24. Witches are spawned in Witch Huts in the ComponentScatteredFeaturePieces.SwampHut#addComponentParts method.
  25. If using the Ibuprofen is instant, override Item#onItemRightClick to apply the damage or potion effect. If you need to eat it like a potion, override the following methods (look at ItemFood and ItemPotion to see examples of this): Item#getMaxItemUseDuration to return 32 (the same use duration as food and potions) Item#getItemUseAction to return EnumAction.drink (the same action as potions) or EnumAction.eat (the same action as food) Item#onItemRightClick to call EntityPlayer#setItemInUse with the ItemStack argument and the result of calling this.getMaxItemUseDuration with the ItemStack argument (this makes the player start using the item when they right click) Item#onEaten to apply the damage or potion effect To check if a player has a potion effect active, use EntityLivingBase#isPotionActive ( EntityPlayer extends from EntityLivingBase ). To apply a potion effect, use EntityLivingBase#addPotionEffect . To damage a player, use Entity#attackEntityFrom .

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.