Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Presumably its about to contact the lava, which means it will take damage, and die. Both of which are detectable events.
  2. From what context? Do you want any dirt items any where in the world? Only around the player? Above a certain block?
  3. Yes, exactly which method you want depends on what you are trying to do. And I do not understand what you are trying to do.
  4. I'm pretty sure new ItemStack(blockstate.getBlock()) is sufficient. Last I checked, the ItemStack class has a constructor that will do the block -> item conversion for you.
  5. You need to clone the result stack before putting it into an inventory.
  6. TLDR: Learn to read your damn crash logs.
  7. That works most of the time. Not in the sense that you won't get an item, but the last time I was doing something similar--as an example--wheat's pick-block stack is "seeds" (which thankfully are not named "Wheat Seeds" now but they hadn't been back in 1.10). So you have to work around that particular problem.
  8. Have fun with that. Some block don't have (translated) names. Most crops can never exist in your inventory and so don't have names.
  9. There are two functions here. One is inserting a stack into a slot. The other is splitting the item stack in the player's hand and returning a new stack. The former is taking as a parameter the result of the latter. handstack is indeed left empty if it was a stack of 1 item. Empty stacks that are not air, and stacks of air, are functionally identical as far as all of vanilla's code is concerned. The whole point of split() is that you have TWO stacks after calling it, the original (now empty) and the new stack (with one item) that gets inserted into the tile entity. That's how the player's held item is cleared.
  10. Why are you suing a mutable blockpos when you aren't reusing it? What the fuck. Jesus christ. Inline this garbage or use intelligent variable names. "If the block blocks movement (player is not allowed to stand there) or we've reached max distance (we don't fucking care), then put the player inside that block. Yes, INSIDE the NON WALKABLE BLOCK."
  11. Hi. Welcome to the internet. This is a forum, aka an asynchronous medium. Any given user does not sit and hit refresh constantly and they are not immediately notified of new replies. Instead they check in when they have time at their convenience. It has been all of 18 minutes, you do not need to bump your thread. I, however, do not know the answer to this as I have no familiarity with the mod in question. Examine their code and work it out for yourself.
  12. Vanilla treats stacks of size zero as identical to air. You don't have to do anything about it. That's why .isEmpty() is a thing.
  13. Yes. But keep in mind that that is not the only way these methods can be used. That's what it does here because only 1 of whatever item is trying to be inserted at a time. If we wanted to do more than 1, it gets a little trickier, but the general process is still the same: Attempt to insert Check if the remainder has a smaller stack size than what we tried to insert Actually split off and insert only the amount that will fit
  14. No. The first line calculates what would be left over if the stack were to be inserted.
  15. You want to do it for real, or just simulate it.
  16. To the surprise of no one: Yes. It splits the stack such that the returned stack has the indicated size (or the original's size, whichever is lower) and the original stack is reduced by that amount (to a minimum of zero). Oh and this: Is what checks to see if the item can be inserted, regardless of what stack is currently in the TE's inventory.
  17. They kind of will.
  18. Welcome to the quest to find the holy grail of computing: transparency sorting. Whatever you did (which you didn't show your code) caused the polygons you tried to render to occlude the transparent blocks at a time when the triangle sorting was set to "nearest first".
  19. Have some working example code. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/block/MillstoneBlock.java#L65-L67
  20. Sigh https://forums.minecraftforge.net/search/?&q=deprecated
  21. The values are inclusive. Note that it is not wise to use values that extend beyond the 1x1.5x1 volume, instead using multiple blocks, but the model json format does permit the values.
  22. Also: All of those things.
  23. Well...of course not, the default chestplate model doesn't have the layer you want to add.
  24. That's not how generics work. This works: public List<Article> { return articles; } because of this (not shown): private List<Article> articles = new List<Article>(); Not because this: public List<FooBar> { return foobar; //return "foobar" because FooBar is inside <>! } The "thing inside the angle brackets" is a generic. List<T> is a list of things that are Type T. What is T? Whatever you want it to be. <A extends ModelBiped> is a Type A (and extends ModelBiped). You need to return some object that is of Type A.
×
×
  • Create New...

Important Information

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