Skip 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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Well, the other half is a complex formula (the part inside max(...)) that means that the more damage you take at once, the less each point of armor counts. But yes. The maximum damage reduction you can get is 80% Also, hit points are a float, meaning you can (and will) take 0.01 damage in certain circumstances (death by a thousand tiny cuts).
  2. Well, yes, there is a maximum amount of damage reduction. That's what min(...) does.
  3. Set a breakpoint and run it in the debugger. Figure out what it's not doing that it should be.
  4. The damage formula is damage = damage * ( 1 - min( 20, max( defensePoints / 5, defensePoints - damage / ( 2 + toughness / 4 ) ) ) / 25 ). You can figure it out. Toughness is 0 for all types of (vanilla) armor except diamond (which has 2). Defense points is the number of armor displayed in the UI.
  5. If the iattributeinstance is null, then get the modifier from the iattributeinstance...
  6. BlockFlowerPot line 433. It says: /*============================FORGE START=====================================*/ And then some functions.
  7. The fact that the chest being not-empty causes the undesired behavior, we can look at your code and find that you have a conditional for exactly this case: if (!tileentityiubertable.isEmpty()) { Therefore, this code is responsible for dropping one of the two items. spawnAsEntity(worldIn, pos, itemstack); Oh, look, it does. However we know that this is also the version we want to drop therefore it must be something else that's causing the empty copy to drop. Hmm. Empty chest...wait, we get one of these when the chest is empty too! There must be a line that is probably responsible and outside that if-block. Getting a TE...no Casting a TE...no Only one other line: super.breakBlock(worldIn, pos, state); This must be responsible. Unfortunately as you did not include your whole class, I cannot be sure that the parent class is not just Block.
  8. TiC almost certainly uses multiple pieces to create their items. e.g. there's a wooden shaft, a metal blade, and a leather grip. So the item model is actually 3 models combined. They only register 3* images to get baked into models, then the item uses all three when created. Also, TiC is on GitHub: https://github.com/SlimeKnights/TinkersConstruct *Obviously there are more, the "3" in this context is the example three.
  9. Those are both ModelLoader tasks. Which bake models. Which you would still have to do. So yes.
  10. Assuming that getItem() returns the Item and not an ItemStack... if(event.crafting.getMetadata() == whatever) { }
  11. Idk

    Draco18s replied to ejer's topic in Modder Support
    int totalCoins = 0; totalCoins = totalCoins + coins; Wot
  12. You would still need to register each image so that it can be baked into a model.
  13. Removing a crafting table recipe is easy: Subscribe to the Register<IRecipe> event and (casting the event's registry to IForgeRegistryModifiable) simply remove the desired recipe from the registry via its ResourceLocation Fiddling with the anvil is harder.
  14. cps

    Draco18s replied to ejer's topic in Modder Support
    What version are you working with?
  15. cps

    Draco18s replied to ejer's topic in Modder Support
    Press F3 on your keyboard. Magically, Minecraft displays both of those things for you. That said, it doesn't display a "clicks per second" counter, but I don't even see the point of one. It's either going to read 0 (no clicks this second) or 1. MAYBE you'd get a 2 once in a while. Something something spam-clicking during combat something something completely pointless.
  16. Use the debugger.
  17. *cough* 0x00FF00
  18. Oh I get why it's done, Lex. Minecraft has its limitations because of the decompile and deobf process. All I meant was that I, as a coder, wouldn't have chosen those names for my own functions.
  19. That only makes me think of How to Write Unmaintainable Code
  20. https://github.com/Excaliburns/ModPractice/blob/master/src/main/java/items/HuskItem.java#L52 If (not client) then...
  21. Well....let's see here... matches returns....if what's in the crafting grid matches the recipe getCraftingResult returns....the result of the recipe getRecipeOutput returns....the output item of the recipe (this will be the basic item with no knowledge of the grid, but you need to return something) getRemainingItems returns....the items remaining in the crafting grid after the result is taken canFit returns....if the recipe fits within a given grid (2x2, 3x3, etc) Look at some existing implementations to snaggle most of those methods already implemented. All you'd have to do is fluff up the getRecipeOutput method to grab the metadata you want from the items in the grid.
  22. (On the single player integrated server, anyway)

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

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.