-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Presumably its about to contact the lava, which means it will take damage, and die. Both of which are detectable events.
-
From what context? Do you want any dirt items any where in the world? Only around the player? Above a certain block?
-
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.
-
[1.15.2] NoSuchMethodError when testing on server
Draco18s replied to PianoManu's topic in Modder Support
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. -
TLDR: Learn to read your damn crash logs.
-
[1.14.4.]Check if the player is enough near to a block
Draco18s replied to dyno's topic in Modder Support
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. -
[1.14.4.]Check if the player is enough near to a block
Draco18s replied to dyno's topic in Modder Support
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. -
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.
-
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."
-
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.
-
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.
-
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
-
No. The first line calculates what would be left over if the stack were to be inserted.
-
You want to do it for real, or just simulate it.
-
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.
-
-
They kind of will.
-
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".
-
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
-
[1.16+] Any alternatives for Block::onEntityCollision?
Draco18s replied to tebreca's topic in Modder Support
Sigh https://forums.minecraftforge.net/search/?&q=deprecated -
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.
- 1 reply
-
- 1
-
Also: All of those things.
-
(1.16.1) How to add another texture layer to chestplate
Draco18s replied to iSyriux's topic in Modder Support
Well...of course not, the default chestplate model doesn't have the layer you want to add. -
(1.16.1) How to add another texture layer to chestplate
Draco18s replied to iSyriux's topic in Modder Support
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.