#1.20.5/6 Snapshots
1 messages · Page 6 of 1
Also, Tech, you're the major pusher for unifying fluids and items
I think they should be seperate concepts, tbh
we're really talking about the keys equals method corresponding to stackability in inventory (ignoring maxStackSize for a second)
the main goal is that people need to learn a single set of abstractions instead of two
"you know IItemHandler? well IFluidHandler is the same thing"
that kind of stuff
They are separate concepts with some commonality
Understandable -- I've been wanting a general "Resource" concept for CM for a while
Defining what a resource is and how to handle it
that is one aspect
the other aspect is to give modders better control over how to store e.g. a map from "item types" to amounts
and in general to fix the viral mutability of stacks for people who are willing to move away from some of their usage of ItemStack
Yeah to start with that at all, you do need some common root interface/class that encapsulates which resources are considered equal
Ultimately I suppose a Tuple of (Type, Components[])
@elder swallow Does vanilla in 1.20.5 generally only allow stacking when all components are strictly equal?
Good
suppose we have ItemStack and ImmutableItemStack - how much value is there in having a shared interface between the two?
you'd be able to do something like
public boolean isEnchanted(ItemView itemView) {
return !itemView.isEmpty() && !itemView.getOrElse(DataComponentTypes.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
}
ItemStack extends ImmutableItemStack would be the most convienient (to use, not to implement), imo.
the problem is that you'll be forced to call .immutable() every time you want to store one, and that is quite error-prone
in what respect? If you're storage is required to be immutable, then type it to ImmutableItemStack
say
private final Set<ImmutableItemStack> stacks;
public boolean addToFilter(ImmutableItemStack stack) {
stacks.add(stack);
}
// Evil code
var stack = new ItemStack(Items.DIAMOND, 2);
addToFilter(stack);
stack.shrink(2);
ah, I was switching the inheritance in my head. both have issues I see
yeah
the main advantage of the new component system however is that it is quite cheap to convert between representations
IMHO there should be an interface for these stacks to get the resource, components and amount
Unless we do introduce a class to encapsulate resource type + components (what you call [Fluid,Item]Variant)
could have something like
public interface IResource {
boolean isBlank(); // check if this is air, empty, etc...
}
public record ResourceAmount<T extends IResource>(T resource, int amount) implements IResource {
public boolean isEmpty() {
return amount <= 0 || resource.isBlank();
}
}
public class FluidResource implements IResource, DataComponentHolder {
public boolean isBlank() { return getFluid() == Fluids.EMPTY }
public Fluid getFluid() { ... }
// We inherit .get(DataComponentType<T>, T) etc
}
public class FluidStack implements DataComponentHolder {
public static FluidResource of(FluidStack stack) { ... }
public FluidStack(FluidResource ) { ... }
public FluidStack(ResourceAmount<FluidResource> resourceAmount) { ... }
public FluidStack(Fluid, int amount) { ... }
// Other constructors
public int getAmount() { ... }
// Other getters
public void setAmount(int amount) { ... }
public <T> T set(DataComponentType<T> type, T component) { ... }
// Other setters
}
Is resource amount your immutable version? IDK if we need that
it's nice to have - I need it to implement NeoForge's FluidHandlerItemStack (fluid handler that stores its content in the "NBT")
but in general I suppose you'd have separate function parameters for resource and amount
interface IResource<T> {
T getResourceType();
... component getters ... (but not setters :P)
}
interface IResourceStack<T> {
IResource<T> getResource();
int getResourceAmount();
}
class ItemStack implements IResource<Item>, IResourceStack<Item> {
IResource<T> getResource() { return this }
}
class FluidStack implements IResource<Fluid>, IResourceStack<Fluid> {
IResource<T> getResource() { return this }
}
isAbsent as in it's a resource signifying the absence of a resource?
that means that you can't trust any IResource you receive to be immutable
well you can specify that on the interface contract. this is unlikely to be implemented by every cobble gen mod under the sun 😛
it's just a resource with Items.AIR or Fluids.EMPTY
you're also missing the immutable version of the resources here
I don't know if we need those in the base API
OTOH this is the minimum separation between mutable and non-mutable stack "views"
you still have this problem though with that design
yes, it is questionable if the stacks themselves should implement the resource type
I also don't think that having an IResourceStack<T> abstraction is that valuable
it would be if we could pull logic into it, but we can't exactly do that
so yeah I agree
the main benefits of a generic abstraction are:
- less code duplication
- generic transfer code
but generic transfer code needs very little abstraction, you only need a way to check if a resource is "empty"/"nothing"
tech can you move that to another thread since it is not strictly related to porting
Like. Specifically in neo or mojang erroneously marked it as fixed?
Specifically in neo
is the bug present in neo in 1.20.4?
Okay, now it works... weird
see this is the kind of thing where my idea of using an immutable advisory interface (i.e. where all concrete objects are mutable but you have to cast to actually modify it) like Component would help.
just having an indication in the type system of when you own the object and when you don't is useful enough, we don't necessarily need runtime enforcement and the design problems that come with that
if you can cast to mutable, people will, and it will break things in horribly annoying to debug ways in big modpacks
Getting the following error when running neoforge:publishToMavenLocal on the 24w11a branch:
> Task :neoforge:createUnixServerArgsFile FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':neoforge:createUnixServerArgsFile'.
> Could not copy file 'NeoForge-20.4/server_files/args.txt' to 'NeoForge-20.4/projects/neoforge/build/platform/platformJoined24w11a-20240314.182754/steps/createUnixServerArgsFile/args.txt'.
> class org.codehaus.groovy.runtime.GStringImpl cannot be cast to class java.lang.String (org.codehaus.groovy.runtime.GStringImpl is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @4bec1f0c; java.lang.String is in module java.base of loader 'bootstrap')
is anyone else able to reproduce?
Run it with J17
same issue
I set JAVA_HOME=/usr/lib/jvm/java-17-openjdk which should force the Gradle daemon to use 17
well it's true that you can't cast a GString to a String
adding a toString after setting the project version fixes this
project.version = "${project.neoforge_snapshot_next_stable}.0-alpha.${project.minecraft_version}.${(new Date()).format('yyyyMMdd.HHmmss', TimeZone.getTimeZone('UTC'))}".toString()
OK I reproduced it locally
the next question I have is why groovy does this
I suppose that it's not happy about the version being a GString
adding .toString() at the end of line 15 in the main build.gradle might fix it
that's what I did here
I can confirm it works
weird bug
userdev is still broken because of the log4j thing
looking at the stacktrace I wonder if Gradle is somehow dragging in 2 incompatible log4j versions?
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:222)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:140)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:123)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:117)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:149)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:46)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.LogManager.getLogger(LogManager.java:599)
at MC-BOOTSTRAP/[email protected]/org.apache.logging.log4j.LogManager.getLogger(LogManager.java:585)
prism pulls 2.22.1 so thats probably it
weird, I changed log4j_version in Neo's gradle.properties but it's still using 2.19 in userdev for some reason
We have 4 PRs for 1.20.5 should we update those to target the port branch
https://github.com/neoforged/NeoForge/pull/699
https://github.com/neoforged/NeoForge/pull/679
https://github.com/neoforged/NeoForge/pull/588
https://github.com/neoforged/NeoForge/pull/542
is it ok to push that workaround for now with a comment, so that the branch is buildable?
I mean I can port mine now
I don't think it's time to start accepting BCs
not to merge them but I mean porting is fine
Guess I need to rebase network changes again main repo branches soonish
Moving while sneaking is impossible with high generic.step_height attribute
lmao
how is it that we have had this attribute for so long and ironed out all the issues and then mojang just blows it up™️
no, one is about it being too easy to move, the other is about it being too hard to move
oh
well it's the 2 edge cases of the same impl
Seems like you can't have client-side only components
was client side only NBT possible?
NBT should always be synced entirely because of how creative mode works
That's my point, I don't feel like anything is lost by not having client side only components
Something I noticed with enchantment components: There's no order anymore. e.g. Enchant an item with enchant A and then enchant B, and for another of that item reverse the order of enchants, then reload the world. Now both enchant lists are in the same order. Anyone know if there's an existing bug report on the jira for this?
it's WAI
Thanks
why would even want that
yea the bug in that is probably that it is not already sorted on enchant and only changes on save and load
I was thinking about if a client side mod wanted to store a component based of information that a server that accepts vanilla clients sends
that wouldn't even work with nbt because stacks are overwritten by the server
What happens if a client receives an unknown component?
Doesn't it just drop it?
Or does it disconnect?
component types is a registry so you wouldn't be able to connect
So I guess server-side mods are stuck to CUSTOM_DATA
Or it uses custom components which get encoded into CUSTOM_DATA on send, then decoded on receive
Which sounds like something that would be in Polymer
I meant as a cache for parsing data stored with the item stack
that is a problem
we could special case that registry
That's fair
The mojira report isn't for that, but the "only sorted after world reload" might actually be something that should be reported 
or maybe we remove ours
people who want to use ItemStackFluidHandler and ItemStackFluidHandlerSimple will have to make their own data component
we could do a thing like milk where we only register it if at least one mod requests it to be registered
HEY WAIT A SECOND
1: https://bugs.mojang.com/browse/MC-259587 this is not fixed in NeoForge
- Why do I have the impression that two bars are rendered instead of one?
pin this pls
interesting
Note: The command is /give @s minecraft:iron_helmet[minecraft:damage=10000] in 23w11a
I wonder why they wouldn't just limit that on load since they already do validation
we could do something like requiring mods to manually enable the milk bucket 
[Reference to](#1184607569629675530 message) #1184607569629675530 [➤ ](#1184607569629675530 message)we could do a thing like milk where we only register it if at least one mod requests it to be registered
i wonder if we'll consider more features that might need to be enabled in that way (by a mod, in Java code)
and if so, if it's worth investing in a better way to do it than adding new methods to NeoForgeMod/NeoForge (or whereever the hook lives now) and calling it a day
could make it part of the forge config. there's also the case where a user may want to use milk like a fluid without a specific mod reason
Even if there's a config option mods should still probably be able to force it on if they have a hard dependency on milk existing
damn I forgot about ExtendedGui.leftHeight and rightHeight and nuked them entirely
... we have to patch those back in Gui
new snapshot today, I presume. I wonder if it will still be snapshot, or prerelease
snapshot probably because the race condition bug is not fixed yet and it is marked Important
I expect a snapshot with some changes around Codecs
Given all the DFU commits from yesterday
what race condition is that? not been keeping up
ah, fun
ooh that's a big one
dispatch now requires MapCodec instead of Codec as the result of the function
optional fields are now strict by default
yeah
it's very nice
BTW the vanilla gui layers are not enough - I have to chop them up again 😭
also assumeMap is gone

that's gonna be interesting
why is that
fuck me really
(tech)
this is a single layer
yes
and renderPlayerHealth handles health, armor, food, air bubbles
I mentioned the sublayering before lol
I love when they compartmentalise by putting a whole bunch of stuff in one compartment
request a problem causer to split it up
well do they care
we can split it up ourselves, it's just annoying
this time we'll patch it in Gui
some of them are (former) mod devs
gegi doesn't need that level of control for LT smh
well tbh I'm gonna be splitting up the main offenders
we can simply let people request more splits if necessary
we could just ask Gegy
@slow prism I want to add a test for gui layers
is there no way to do test.isEnabled()?
there is an on enabled hook
that's inconvenient, I want to check within a gui layer
ok there is test.framework().tests().isEnabled(test.id())
@elder swallow so did you decide on whether you'll remove attachments and replace them with components or remove stack attachments 
stack attachments are gone and I don't see a reason to add them back
and I think we'll keep attachments on the other kinds of objects
replacing attachments by components is problematic for 2 reasons:
- immutability sounds like a bad idea for large attachments (imagine immutable level attachments)
- components cannot capture a reference to their holder
might be a solution for the gui layer stuff 
that last one looks like a recipe for an incorrect patch on an MC update
what's the advantage of this approach over patching in if() blocks around each part of the function?
that would work here
unfortunately for renderPlayerHealth there is no such possible fix
technically if blocks are also a recipe for incorrect patch updates
I see my days of only using vanilla apis for itemstack data are coming to a middle 
well, components are closer to attachments than NBT 😄
components are vanilla apis tho
exactly
can probably revert bag of yurting to the original implementation too, where it just stored the blocks in the itemstack, now that copying itemstack data is supposed to be faster
a long time ago somebody PRd some code to it that had the itemstack store a reference id to saved blocks in world data and I accepted it because it's good for performance but never really liked it because I don't like having other people's code in my mods
just keep messing with it until it stops feeling like someone else's code :p
I store items in the stack in toolbelt, has never been an issue for that use pattern
the problem is, bag of yurting stores blocks and blockentitity data, and the blockentities can be chests, which can have shulker boxes with toolbelts in them 
oh yeah
in Packing Tape I have a hard limit
for data size
someone was crashing when trying to pack huge chests XD
now it goes "too big!"
backpack mods now use reference based storage so soaryn can't dupe stuff
I'd rather people dupe than entangle :p
Are the bugs they're fixing rn going to be in today's snapshot
wait n' see
I think the Fixed status is when they get merged into the branch for the next snapshot so probably
nice
ARGHHH
hi tech
the order between the air bar and the mounth health has been fucked on forge forever I think
do i need to call 112
I'll manage thanks 😛
Only 8291 bugs on Mojira
vanilla doesn't even draw the overlays in the right order
I thought it'd be higher
it's so dumb
vanilla draws:
- armor
- health
- food
- air
- mount health
but the correct order is: - health
- armor
- food
- mount health
- air
Distance from hotbar
ah
vanilla computes the distance in ugly ways so its exact order doesn't matter
but we have leftHeight and rightHeight, so it's essential that overlays are drawn in the right order
Armor is above health, but drawn before health
report it (or ping gegy)
Ask her to fix it sneakily
🎶No one has to know🎶
Aren't they all for fixing the codebase these days
Why does Neo have left and right height fields?
it's for the cumulative height or the elements on the left/right of the exp level number
ic
is it mean to be used like "put my bar at leftHeight + 5 pixels"
to add it to the top
yes
nice
so ic why mojang doesnt need them, they know exactly what bars they're adding
but
depending on how long it'd take to reorder the bars I still think that would be a change they could make
just for niceness purposes
can we make hud elements something proper? with size and position and a draw method?
not really
why?
we do a little testing
cause 1) vanilla doesn't do it and 2) it's kinda pointless
currently it is only a draw method
I disagree with that
make them batched /j
I literally have a library that does it (and makes some of them configurable)
How would that even work with something like additional bars since you cannot know the final position?
not quite there yet
Positions could be specified relative to another GUI element
instead of absolute positions I'd use relative with some kind of anchor system
it is such a headache to patch vanilla elements already to correctly support leftHeight and rightHeight
we're not going to patch all of them to support arbitrary relative movements
if implemented properly, this would be great
manually setting fields in your elements is sooo error prone tho
unfortunately it's relatively challenging to achieve
okay I think it works
it's not the worst part of the gui code
I don't think there's really a problem to solve
no problem != no space for improvements
doing gui.xxxHeight += <element size> + <padding>; is definitely not the end of the world
That's absurdly overcomplicated for little to no reason in my opinion. The kinds of things done with the overlay system are so varied that a generic anchoring system will most definitely conflict with some of those use cases. If you need fancy relative positioning and all that, then that's better suited to a purpose-built library IMO
will merge soon
what if we just used awt layout managers to position hud elements
I have a 3 letter answer: mac
I have a single symbol answer: 🍎
i do think it'd be nice if each gui overlay could declare the area it intends to use, and if they overlap they could push each other out of the way - like, currently, we don't really have a solution except for above-hotbar decorations, do we?
probably offtopic but what does mac/apple do w.r.t awt
awt works fine on mac, it doesn't work with opengl
something about event loops in the main thread
indeed we don't have a solution - "pushing elements" is of course non-trivial
I'd rather add more mutable variables in the same style as leftHeight/rightHeight for common placements
There's also some Macs which don't have AWT at all
iirc Curle has ran into it a couple of times
mac only allows 1 thread to do any drawing so awt + lwjgl is bad
eh, that doesn't really work since you don't know if two elements at the top left corner should be placed side by side or vertically, a 'push' system could make the decision based on their shapes
but yes it would be difficult to implement
what might be useful
well at least screen based guis are getting layout managers
you'd probably do a simple enough approximation
would be a simple anchoring system that doesn't attempt to prevent overlapping but simply provides the configurability for pack makers to move stuff around in a standardized way
you don't understand just how dynamic these elements are
5 parameters + size:
relative to
anchorA
anchorB
offsetX
offsetY
the alternative is to impose something like "there are 5 boxes you can stack elements vertically in, one at each corner and one at the top center and each has its associated height variable" and anyone who wants to place anything anywhere else is out of luck
7 counting the ones above the hotbar i suppose
except a lot of mods want to place things near the cross hairs too, stuff like create's goggles
I'm not talking about restricting placement
I'm talking about potentially helping modders avoid overlap in common cases
i guess, but 'you get a system you can't benefit from unless you work within this paradigm' is still a soft restriction
keep in mind that having 4 "crossbar huds" like create's is going to look ugly no matter what
I have a set of overlays that technically consist of two boxes, one on the right of the crosshair, one right above the status bar. You would not be able to do dynamic pushing or overlap avoidance with those unless they are split apart (which is annoying and there's no reason to do so)
design the system now so that it has two passes of events, one that gathers sizes and the other that tells things where to draw, so even if all we implement is a dead simple stack layout now we've got the flexibility of 'each thing is placed with the knowledge of the size of all active elements' to improve in the future without changing the api
that also means the actual mutation of height variables or whatever happens internally instead of each overlay being in charge of it
idk
we're not going to compute placement and size information about all the vanilla overlays
LayoutElements have something like that already: ScreenRectangle
It seems they're not used much in vanilla, though
it makes me wonder
will they release it, the second that I am on the bike back home, or wil they do it when I am sitting on my chair 
new snapshot
it begins
decent change
mojang made everything components 
every single thing?
I'm not checking the source so idk
MINECRAFT:RARITY
Controls the color of the item name
Format: enumerated value, one of:
common (default): white name, or aqua when enchanted
uncommon: yellow name, or aqua when enchanted
rare: aqua name, or light purple when enchanted
epic: light purple name
e.g. rarity=rare
Special items such as Golden Apples have an implicit default value
Minecraft 1.20.5: components update
MINECRAFT:TOOL
Controls the behavior of the item as a tool
Format: object with fields
rules: list of rule entries
blocks: single block, list of blocks, or #-prefixed block tag to match
speed (optional): float, overrides the mining speed if present and matched
correct_for_drops (optional): boolean, overrides whether this tool is considered 'correct' if present and matched
true will cause the block to mine at its most efficient speed, and drop items if the targeted block requires that
default_mining_speed: float, mining speed to use if no rules match and override mining speed (default: 1.0)
damage_per_block: non-negative int, amount of durability to remove each time a block is mined with this tool
e.g. tool={rules:[{blocks:"#mineable/pickaxe",speed:4.0,correct_for_drops:true}]}
Vanilla tool items will have an implicit default value based on their tier and tool type
so essentially is nbt being completely removed?
There will be blocks you can't mine with tools if the tools are too powerful.
huh?
if they're too powerful?
they're not going to remove NBT
Hippo, these are tags
Too high grade.
I don't know how to put it.
And I haven't tested it yet.
I thought they were going to nerf the mace a bit because of its high one shot potential. Ig mojang is scaling damage now
So is needs_<material>_tool.
but move things to data components, which can be lazily serialized to NBT, offer faster access, and facilitate better datapack/command syntax
there can be, not necessarily that they'll add that
it does open up some interesting possibilites for map makers though
so it works parallel to nbt?
Oh wow. So item properties just basically wraps common components now huh
Oh, minecraft:tool ought to be interesting
eh. more on top of NBT
NBT is still how things are serialized to disk
code?
You can do this pretty easily if you put an entity at the bottom of a mountain and jump off. Probably the hardest part is just timing the hit. The damage of the mace can scale really high
it's just that data components are better, more performant representation of things which used to be stored in NBT and had to be extracted from NBT tags directly (like, PotionUtils having to read the item stack's tag)
If my assumption is correct, I can see someone creating a datapack where blocks can only be broken with the minimum tool needed to break it. (E.G. Stone can only be broken and collected with a wooden pickaxe.)
I will say the name "components" is indicitive of something else as well
Component-based game engines
entity components
Yep
no way
And we already know they seem to be working on datadriven blocks and items
what's happening
Any item can be a tool now
Or edible
all of ems, they be tools
Reminds me of that time I made every item edible
Edible Tools Datapack
can't wait to nom on my obsidian
WTF they are moving item properties to components
I remember the Bear Grylls mod

Yep
They could have at least made the breaking changes in a major release instead of a minor release.
This isn't a hotfix version
"Minor" versions are tech updates
"Major" versions are content updates
Ok I have amended my message.
smh.
Why limit it to 99?
CanDestroy tag is dead.
they had a chance to make stacks bigger, chose not to
They made it so that it can go to the integer limit just last week
cos it's the biggest 2 digit number
that'd kinda destroy a lot of worlds I think
They could've at least capped it at the signed byte limit.
every item filter would probably break lol.
no it wouldn't
Interesting
items would still be 64 by default
Mojang: Destroyer of Worlds
The only reason it can't go to 2 billion is because of the component limit
I thought you meant increase the default stack size
no no
They raised the limit technically from 127 to 2 billion last week
Ah yeah I complained about that as well, it's definitely just UI things
now this is funny
Lol
Yeah probably
They could fix that. Or do what some mods do, which is show it with metric suffixes
nit enough space for it
it's quite funny that the max stack size is part of the stack itself
3 digits already overlap the next slot
I suppose: Items declare "default" components, right?
Isn't this just a step in the direction of having a generic Item that takes in the default components as a parameter and thus can be made datapack customizable?
yeah pretty much I think
So technically they are on the stack, yes
cant wait for fully custom items :p
it's quite unexpected for me
but they'll likely mostly take them from the item defaults
modders would never have used caps/data attachments for that
don't worry we'll patch it probably
why would we do that 😄
All the more reason for ItemVariant combining a concrete set of components 😄
which kind of item variant? the transfer kind?
Ya
do it mojang 😄
You can't just patch item stack size without finding all places they still serialize it as byte 😄
and potentially broken UI
because 128 stack size

64 is such a programmer number
99 is a shit number though
99 is the de facto default max item count for many MANY games 😄
make it 100!
😩
hmmm, edible anything...
Finally, edible AE2 storage cells
Err... that's an Ice Cream Sandwich.
It's an Oreo
well we already had that, though only in code
food was already on Item, something like FoodItem was not a thing before either
also why
why is that an empty object and not a boolean
they changed the way they do versions
I mean making an existing item edible required mixins now you just give it the food data
existing items yes
that's what I meant with edible anything
also it seems they are converting item properties to components
Based on existence. Doesn't need data, if it's there, it's fire resistant. A boolean would be redundant
An actual boolean component stands for 3 states. If it doesn't exist, do some default operation. If it exists and is true, do something, if it exists and is false, do something else
That said, are there any boolean components?
there are and they don't stand for 3 states as they use a default
I only see enchantment glint, it is in fact used as 3 states
i concur with Ratatosk; I see only enchantment glint as a component that is a single boolean, and it does have three states (absent means default behavior, present and true means force glint, present and false means force no glint)
also, according to the MC wiki at https://minecraft.wiki/w/Item_format/1.20.5#creative_slot_lock, there's a minecraft:creative_slot_lock component which is interally used by the creative inventory, which according to the entry make an item that "cannot be taken out of its slot"
I feel like there's a possible usecase for map devs
think limited inventory
Now what we need is an explosion resistance component for emulating the nether star. Or better, a general damage resistance component.
now we wait for NeoForm... pls ping when it's done (as long as that is before midnight CET)
wonder what the heck this packrat stuff is for. at first glance, it looks like it's for commands, possibly for suggestions to item components
I might want to disable netherite being fire resistant though?
then remove the component on the itemstack
hm
is (2) a problem for the weird way item fluid handlers work? iirc those needed a reference to the parent
This snapshot is really interesting....
with these you can almost fully add a custom item with data packs:
- Custom crafting
- Custom model data
- And behave like a pick with durability
gonna have so many modders refuse to update cus of the extent of the changes lol
eh, another type of 1.8.9 players
eh, they won't be missed 
more like the 1.19.2/1.19.4 players/devs
from the end users perspective there is now no noticeable difference between the obsidian pickaxe made with a datapack and made with a mod...
pretty cool
I intend on updating all my mods
mcreator in shambles rn
but I will almost definitely be whining a lot while doing it
specially when it's time to port JsonThings
because I'll have to figure out a way to define item components in json
I expect them to have shit updated on github within 3 weeks
many people contribute these days

they'll haveto rename it DCreator
I mean....
they have codes so...
and the person behind it is also in this server 👀
I don't use codecs in JsonThings though ;_;
rip
hold up
I know I am bringing it off toping here
but Mcreator is getting a debugger??
wouldnt this make mcreator kinda viable now ? if it simply becomes a frontend for datapack creation
!mcreator
Making mods with MCreator
There is little to no support here for MCreator. We recommend you to check out MCreator-specific Discord servers or official support page for help:
https://mcreator.net/wiki/unofficial-discord-servers https://mcreator.net/support

yeah except I don't see them going the datapack route
so it'll still be generating the same god-awful code
#builds
but now it'll not only be god-awful code, but completely unnecessary
eh, it has improved a lot over the years
yes, still not good
but shitty coders are using it, and making shit addons they don;t even understand
but hey, it is getting a debugger
so there is that
tbh some kind of frontend/gui helper for gigaherz's json things to quickly create datapacks would be kinda awesome. (getting a bit offtopic :P)
that's like saying it's not mcdonald's fault it's unhealthy food - it's because unhealthy people are buying it lol
let us stay on topic
someone was trying to implement support for jsonthings files in some datapack creation tool
no idea if it ever happened
(sorry
)
Yeah you wouldn't really store the fluid handler item directly
You'd instantiate one when you need it

Ping?
what ping?
you have the snapshot alarm role
and a ping has been made, like... 4 hours ago
wait, this isn't Squirrels 
Done
#builds message
[Jump to referenced message](#builds message) in #builds
24w12a-20240320.193028
1.20.5-dev
24w12a
I can fix the Gui patch tomorrow
hmmm were loot tables always a registry?
no
not in 1.20.4
they're just loaded arbitrarily from the folder into a manager
with statically cached RLs in a class for referencing them

Speaking of which, you see this?
Require MapCodec for key dispatch
This avoids the need for special treatment of MapCodecCodec. Any caller desiring the old behavior of the
valuesub-field should construct afieldOf("value")MapCodec.
Finally, KeyDispatchCodec is more sensible!
And that's the least of it
Tons of cools stuff here
Either.unwrap is a godsend
And Codec.dispatchedMap is amazing
dispatchedMap is weird
Plus all the lazy stuff seems to exist in DFU now, instead of just being in the extracodecs class
Oh yeah, and there's withAlternative too
it's like recordcodecbuilder but sideways
This is going to make half of my codecutils helpers obsolete
instead of every field having a different codec and different type, every field has a different codec but the same type
It's basically an unboundedMap crossed with a KeyDispatchCodec
it's a codec for a Map<K,V> but the codec for each V depends on its K
I don't understand the use case
yes MapDecorationType too
I saw! Very nice indeed
I suspect we're going to see MapCodec a lot more often
Hopefully ExtraCodecs is gone
Strict validation by default is amazing
Hmmm ok. Will be annoying for our loot table patches
Probably stuff where the keys are registry object locations, and the values are some sort of configuration data whose codec is stuck in the registry entry
JavaOps are now in DFU itself too
They've singlehandedly, in this DFU update, removed the need for most of ExtraCodecs and most of my own codec utility library, except maybe the Asymmetry stuff of mine
Oh yeah that's awesome, isn't it - wasn't someone complaining about that here just a few weeks ago?
yep
Yet another thing I can remove from my own utilities
I'll be left with only the few things that I can never imagine getting added to DFU itself, this is great
They haven't actually updated what MC uses yet it seems, so I guess we'll have to hope they do that for the next snapshot or so

Oh does mojang finally have a proper dynamic (reloadable) registry? I wonder how it compares to mine
did they make dynamic registries reloadable?
Probably not the worldgen registries
Presumably they're getting ready to make some registries reloadable at least
Should be exciting
This goes well with the more efficient datapack registry syncing stuff they added
advancement and recipe registry when?
It is difficult for recipes to be a registry
since being a registry means tag support
and recipes depend on tags
reloadable regs are janky
I was looking into it for my own uses
it appears to be possible but difficult due to some things being strongly-typed to Holder.Reference
So you would need a horribly cursed unbindable subclass of Reference
no no, their impl is janky
I wonder how much tier sorting is going to need to be rewritten
Components and sub-predicates are ones I can think of
The key is the sub-predicate ID, and the value is the sub-predicate args
Currently tools have a list of Tool.Rule where the first time a block is found it uses the rule it was found in which determines the mining speed and whether it can drop the items
And tool tiers are done by excluding the blocks from higher tiers
so, atm, the data component type registry event is fired far too late. in vanilla registration order, it's near the end, yet items depend on them. are porters aware of this and waiting to see whether vanilla fixes it first or has it been missed?
Is it just another case of the actual registry classload order not lining up with the listed registry order? There's a few of those. Which ordering does neoforge use again? Is it the classload order or freeze order?
We use the declared order by vanilla
But fix it as necessary
Vanilla has an explicit bootstrap order but due to static init the order is ignored when necessary
Should that go on the Feedback Site, Bug Tracker, or just be patched?
it's not important to vanilla, since they static init
Vanilla doesn't take non-player-facing issues
yeah, that
So patches then.
well, no
neo determines when they fire registry events, they just try to adhere to vanilla's order
until it breaks things
patches to neo, technically™️
just not patches to vanilla, which is what we generally call "patches"
this wouldn't need a patch, just a single line with a short explanation right here. hopefully that's all at least, most of the data components seem to use holders, so it should be fine that other things like enchantments and mob effects are initialized later
Well, some sort of modification to accomodate.
Currently there is an entity sensitive version of the getFoodProperties method which wouldn't work with the food component
well the Food component is just an override
so in theory we should take the component as the source-of-truth if present
(as it is unlikely to be present in the general case)
when registering a food item the FoodProperties is a component
Yes they do. The number of times I've seen this exact comment on fixed issues in the past year has been significant
Maybe they don't fix them as often, but they absolutely do fix them
So ReloadableServerRegistries exists now
Yeah I'm curious as to why honestly, since its only loot tables and not the others
its also exceptionally convoluted
Probably WIP still
unfortunately I asked about switching to addons and datapacks and received no response...
The remaining rejects are for food and tiers
what's the issue with tiers?
If the tier sorting registry is inoperable I think we can accomplish a redesign
its mostly internal code anyway
The goal of the creation is not complex, just place the tiers into an ordered or equivalent list, but the current mechanism is imo overcomplicated
not surprised in the slightest lol
The Tier interface now includes a method which returns a tag that says what blocks that Tier canNOT mine
The Tier interface also includes a method named createToolProperties which allows you to create a Tool instance which let's you specify a list of rules where the first time a certain block is found in the list of rules determines whether you get drops from it as well as the mining speed
what in the world
also vanilla doesn't use ints anymore for levels so the wooden pickaxe tag includes the tags: needs_stone_tool, needs_iron_tool, and needs_diamond_tool
whats the usecase
if I understand, the real check now is inverted, so the stone tool has a list of blocks that require iron and up
the can't mine tag includes the can mine tags for all highter tiers and the can't mine tags are used in the tool
incorrect for stone tool = requires iron | requires diamond
do they have an "incorrect for no tool at all" though?
I don't remember
in any case, it works the same as the tier sorting registry, just using tags explicitly, which makes it super annoying to handle for mods
That seems super backwards imo
since the tags are "requires X tier" testing tiers via "is it included in a higher tier's tag" makes sense. that way the highest tag wins. if it's in diamond and netherite, it is considered netherite.
Can ItemStacks now be > 64?
In latest snapshot?
Saw they did some changes to components again
itemstacks can stack up to 99 now
yes, but only until 99 which is like WHY
(the answer is because the GUI can only display 2 digits without overlapping)
How does one do it
NF could make a patch I suppose to fix that?
Due to being useful for modders
Unless its not a simple thing
COULD also goto Mojang and see if they choose to fix that themselves
Would the tier sorting registry still be needed? because you could add to the tag for lower tier tools and for higher tier tools you can avoid adding to their tag
we need something to ensure the compat between mod A and mod B
Huh I managed to do it with Mixins 😄
Something prevents it from rendering over 99 in some cases
Or idk
Some hardcoded stuff tho preventing it from going over 99 in some odd cases
I will patch it to 128 instead of 99 (since a 1 in the first place does not have the overlap issue)
128 is too big iirc, Isn't it sent as a byte in several places?
Also is this something we should be patching, won't it cause issues with vanilla compat?
or was it a short
it was a byte and please don't patch it
servers will be able to send big stacks and clients will crash
Yeah don't patch it without discussion, I don't see the point
Just finished the book I was reading, I'll fix the Gui patch in a moment
now you need to read a book to be able to patch guis?
The old-style guis
Anyone else noticed the changes to Enchantment?
You need to read a book to understand Maty gists /S
Oh what changed?
It is no longer sent as a byte since last week's snapshot
But if you're going to patch it, please set it to 999. However, it's an inlined constant used all over the code base
Still should not be changed without discussion imho
So a lot of patches would be involved
No it definitely shouldn't
Was it patched before?
The new stack limit?
Vanilla changed to 99
Now our friendly neighbourhood @fallen igloo wants to patch it to 128 
I only noticed that many subclasses are gone
Why should it be patched now if it wasn't patched before? Without good reason, I mean 😛
Certainly not as part of porting, I hope
It should not be done without discussion
the reason I said 128 is that that does not yet overlap outside of a slot in the ui
why not 199 then
because that is just as stupid of a number as 99 for the maximum
well, as stupid as it might be I don't think we should change it 😛
I anticipate that most mods will continue using 64
(as long as vanilla continues to use it)
hmmm when are we switching to the deinliner version of neoform
Imo don't change it at all? I don't se a reason to change this vanilla limit
the unpicked version?
we have to test the neoform build that coeh sent a while ago with some unpicked constants
yes
feel free to do it 😄
if coeh could make a build next week for the next snapshot then I can test it
What about for the current snapshot?
With it being on the snapshot maven
why do I have this compile error?
did the removed sources not get uncommitted?
that might be a problem with the action workflow
You certain about that? From memory and a quick search of Snowman commit, it looks like they didn't really touch Networking in this snapshot, unless they have already done that change previously / I missed it at some point, there's still code there that uses byte to represent it
OK I see what happened
it's simply not tracked, so git didn't know what to do with it and kept it in the checkout
I said last week's snapshot
ok, git clean -x -f projects/neoforge/src/main/java did the trick
Or maybe it was the week before that actually
codec is ExtraCodecs.intRange(1, 99) and stream codec is ByteBufCodecs.VAR_INT
the reloadable registries stuff is interesting
it's messy
doesn't seem messier than the rest of the registry inheritance soup
"ItemEntity" Would be an interesting idea, BlockEntities but for Items
If Im understanding this correctly they are trying to design Items to be more like blocks
Where there is a set of "properties" that can be used
Immutability basically
not quite
it doesn't work like blocks, it's a set of immutable objects that get attached
Yeah
that's called ItemStack
ItemStack is Immutable though for Components
That's the codec for the max stack size component. ExtraCodecs.POSITIVE_INT is the codec for the actual stack size
Also I think you can have a higher default max for your item than 99, since the default is never serialized
Not even over the network
This doesnt seem right?
damn you fix things as I am about to commit them 😛
fixing NeoForgeDataMapsProvider
only the GLM left for the game to launch in theory
made it to main menu
ok, made it in world too
[14:14:37] [Netty Server IO #1/WARN] [minecraft/ServerConfigurationPacketListenerImpl]: Ignoring unexpected custom payload received outside of the modded configuration phase: minecraft:brand pretty funny since we are the ones sending it
[14:14:31] [Render thread/WARN] [minecraft/MinecraftServer]: Missing data pack mod:neoforge a bit weird too
using direct probably won't work because that only does inline not from the registry
What does DIRECT_CODEC do?
it's used for values not linked to the registry
what is this crap
the new tool stuff
Ah huh
better but still off by one
ok fixed
good thing I already had to debug this yesterday and wrote a nice test 😄
@fallen igloo should I squash and push to the neoforge repo?
did you gen patches?
now yes
there is still the DiggerItem patch reject, but I think we'll have to reconsider the entire system anyway
and that itself shows why Mojang decided not to support it :p
couldn't that easily be solved by switching to half scale for the font rendering when the size exceeds 999
On mojangs side they are not gonna do that for UI / UX accessibility reasons
for us? we could
Yea xD
But could be a life saver for mods like RS/AE2/Simple Storage/etc
Then they wouldnt HAVE to do any annoying stuff, just to show a larger number
No, it really couldn't
And this is not at all related to the Snapshot. So in the spirit of Schurli: Let's keep it on topic 😛
/me looks at Ender-Rift code using longs for quantity
xD
My mod with infinite item stacks just uses its own class
Plain and simple
Making the component infinite doesn't really make anything simpler
Also InfiniteItemStack in my mod uses long, so it can have more than 2B items in a stack
Which is useful when there's at most one stack per item per container
i'd just make a new component and mixin to ItemStack for getting count and max 
is there anything that can break by extending ItemStack? It is final, so I would expect that there's some intrinsic reason to not extend it, like specific checks for the class or something
GUI patch is broken?
seems fine to me
At last it's not working properly
wait
No, it works...
wait... WHY
I'll try to compare with Minecraft Vanilla
It's also happening with Minecraft Vanilla... even though it's a bug that's supposed to be fixed...
why mojang
what bug?
well we only move the rendering code around but do not change how things are rendered in the Gui
the entity-sensitive getFoodProperties method is also stack-sensitive, so it's easy enough to change the default implementation to use the component if it doesn't already. presumably the vanilla method has been made stack-sensitive now so it'll need to be rewritten anyway since it delegates to the vanilla method
trivial compared to whatever's going to have to happen with tools
[the question i suppose becomes whether we should allow mod overrides to take precedence over the component, but that's really more of a mod design issue]
What stops mods from just using the component?
nothing - i don't think it's a real issue either way, the question is just whether mods overriding it will need to manually check for the component
Mods with custom items do not necessarily need to support the component
I in fact already did that
So, what is the best way to figure out what the version for the latest snapshot release of NF is? 🤔
Poke at the maven?
Oh. They are not available from [...] our Maven repository.
yep. you have to build it locally (for now)
@elder swallow Do we plan to publish to the snapshot repo at some point? I am a lazy man and I just want to plug this into AE2 😛
Not really
we can publish it to a separate repo like we do for PRs
Presumably there might be stretches of time where it just doesn't build
I mean, they only push it to the neoforge repo after they get it building
you can depend on a build from mavenLocal with 20.5.0-alpha.24w12a.+ to avoid hardcoding a timestamp, but you'll still need to arrange for your CI to compile it from source before doing anything with your actual mod
Well, I just don't want to get constant GH Action build failures in case I do decide to push it to GH (which I will)
And I really don't want to add a NF compile step into my own repo 👀
Disgusting 😄
I may even do it
But they should really just be published to https://maven.neoforged.net/snapshots/
We need to make the timestamp stable to do that
Do we?
Unless you want a local build to have a completely different version from what's on Maven
which I think is wrong
I find that acceptable for snapshots
Well in any case I think I should probably record my porting steps
Please do - that will be very valuable for the blog post
One of the major pain points right now is buildscript updates
and "just reference the MDK" is not a good enough answer
I basically need to extract the work done in this commit to text https://github.com/Shadows-of-Fire/Placebo/commit/cb8db7cb2156c0f93a9106ab52629d35985dfb5e
Organized in the following steps:
- Changes to the
pluginsblock (FG -> NG userdev, remove mixin plugin) - Changes to the
minecraftblock (removal of... basically everything, tbh) - How to apply parchment (this is described on NG's readme and in the MDK as well)
- Run configs (migrating from
minecraft/runsblock to top-levelrunsblock) - The MC dependency in
dependencies(changing from FG'sminecraftartifact) - Removal of reobf (any uses of
finalizedBy 'reobfJar', AT updates, Setting mixin remap=false) [We should publish a mixin AP with implicit remap=false] - Changes to
mods.toml
Yes, we do not have any real docs on that
It's probably easier to start from scratch using the MDK
I disagree for large mods
did you for ae2?
Nope
case and point
Then again, I started working on NeoGradle when I started porting to it 😛
No? shartte knows a lot more about gradle than the average mod
Myself I just "diffed" my build.gradle against the MDK's and removed stuff that didn't seem useful
Oooof. Adding HolderLookup.Provider to practically every method that touches NBT is very annoying 😄
But it's the price we have to pay for datapack defined items and blocks 😄
Why not just publish it as a SNAPSHOT version?
Otherwise though: timestamps should not be used in builds, like, in almost any scenario. Among other things, it'll mess up build caching if you're building multiple times locally
Can use the commit timestamp instead
#builds message
On the snapshot maven
[Jump to referenced message](#builds message) in #builds
24w12a-20240322.014551-unpick
unpick
24w12a
So far I have had to write practically no StreamCodecs 😅 But I like the system
StreamCodec.of/ofMember make the porting a lot smoother
ok so what do we do for the tier sorting 
uh
we could just toss it until someone needs it 
I'm not sure if anyone is actually inserting tiers between vanilla tiers anymore
Really the only mod that even comes to mind is like Iguana Tweaks from way way back
well the other thing is that we want mods that add tiers to work with each other
Why do we need the sorting for that?
i.e. what does "work together" mean
The only thing I would really like preserved is a registry of Tier(s) for naming them because I use such functionality for a config option (I would like to see one for ArmorMaterial as well tbh)
but with vanilla's tags being source-of-truth we might just have to live with that
I mean that ideally multiple mods could add blocks that require "tier 5" mining level
We could provide c: tags or a standard for levels incrementally beyond netherite?
really though I have no clue what lunatic decided that a tier would supply the incorrect blocks rather than the correct blocks
well the main advantage is that the ordering is in tags instead of in code
but this means that we cannot do any ordering ourselves
unless we add fucking blacklist tags
The best we can do is establish a convention for "tier above netherite" and see if people can sort their shit out
because that is the model vanilla has given us
c:incorrect_for_level_5_tool
it still could have been by establishing the order incrementally and having the next tag be a superset
but I suppose there are less blocks you need to list this way
the majority of blocks are breakable with the lowest tier
so I can understand the approach
because otherwise you need this "mineable with wood" tag that contains practically everything
Regardless, I still think it's crazy, the datagen could have been defined in terms of this inverse set for sanity and then generated to a proper forward syntax
but we're stuck with it I guess
So incorrect_for_level_X_tool convention it is
Still really kinda lost on the structure because there are now both needs_x_tool and incorrect_for_x_tool tags 
and it doesn't make any sense for both to exist because they should never be disjoint (as who knows what nonsense that would entail)
Based on usages, it looks like dynamic tool mods would still like to be able to determine the relative strength of a tier.
the former only exists for backwards compat I'm pretty sure
so they wouldn't have to redo their datagen
why didn't they just use that tag then, screm
just add the stupid needs_wooden_tool tag and superset them to eachother
Fabric has an API like this already, we should check the exact format
It will become effectively mandatory that mods adding custom tiers just use the vanilla tags though unless they are above netherite
We can just check fabric's conventions and add the TagKey(s) for a couple levels (maybe 5/6/7?) to our declarations
the module was disabled during the port
I suppose it makes sense 😛
lets go through the methods...
public static synchronized Tier registerTier(Tier tier, ResourceLocation name, List<Object> after, List<Object> before) gets deleted
getSortedTiers() can stay, but has to determine the order from the loaded tiers (and thus can only be called while a server is live)
I would prefer we keep the ID->Tier "registry" so the objects are named
the entire registry gets deleted and rewritten from scratch
pretty much
and injecting between vanilla tiers is no longer possible
I think a bunch of the util methods become unnecessary
i.e. the isCorrectToolForDrops override
and the entire network setup we have going on there becomes unnecessary (which, oh no, merge conflicts for network refactor, screm)
The thing that really irks me here, right
is that the tags are defined in reference to the needs_x tags
not the other incorrect_for tags
and because mojang has either not finished the transition from needs_x or is not going to transition from those tags
the logic for making a tier above diamond (netherite has no actual tier logic) is... "weird"
that's what I mean by "the module was disabled during the port"
this still needs fixing
Can we just supply level_x tags up to 7 and propogate them down the chain correctly?
because atm incorrect_for_diamond and incorrect_for_netherite aren't even linked
they have no reason to be linked
No, but if we support ordering they should be linked as netherite is a strict superset of diamond
if you want to add a level 7 block you need to add all the incorrect_for_xxx tags until level 6
No it's the opposite
you have to go back through all the vanilla tags and add your block to those
that's what I mean
which is just awful
let me map out the structure of the vanilla tags here - adding your block to 6 tags because you need to make it breakable by netherite only is miserable
gold is equivalent to wood
so we just have to make note that gold is level 0
I think we might end up with having a sideloaded set of level_x tags
well the biggest problem is that we're trying to be less flexible than vanilla
I mean, yeah, but ultimately that is the actual desired usecase when mods have to make Tier objects
Vanilla defines
0. wood, gold
- stone
- iron
- diamond, netherite
But vanilla never needs to compare if a tier is better than another tier (a common usecase in modland)
no it's
- 0 wood, gold
- 1 stone
- 2 iron
- 3 diamond
- 4 netherite
netherite and diamond have nothing different from a "things this tool can break"
they do
the tags are both
{
"values": []
}
maybe not with vanilla blocks specifically
yes but some mods want gold to be its own tier
I know mods will expect netherite > diamond
I was just listing the vanilla definitions as a baseline
which mods????
Any of them doing tool ordering, lol
why would they change a vanilla tier
There are mods that make blocks only breakable by netherite
i.e. explicitly setting a level 4 classification to netherite
yes that is a relatively common use case
oh you were talking to schurli
i have no idea who wants gold to be its own tier, lol
but that's fine, gold can be lv1
@elder swallow does anything use the needs_x_tool tags other than these tag definitions?
We have to determine if those are still relevant and need to be "correct"
because that is going to really complicate things...
each material has its own incorrect_for tag
I'm aware
they're only used in datagen
okay, so they don't need to be correct. We can probably deprecate them in code
So we should establish an authoritative set of sideloaded tags for the "ordered" levels
do we have selective removal tag entries?
like: this tag contains everything that was in her but not this
looking at the vanilla system I'd say just nuke it for now and add a system when needed
Nuking the ability to compare tiers represents a major feature regression
that is what vanilla did so ¯_(ツ)_/¯
vanilla never had this ability
it was always stapled onto it
just our existing method of stapling is not applicable
so we need new staples™️
but that ability in vanilla is gone
?
the blacklisting is so incredibly stupid
agreed
there is no more order there is just tags
there was never any order in vanilla schurli
in practice there is still an order
it was an enum
it still is an enum
plus the enum was never representative of the order
it means that if you want to make a "gold tool only" block you have to blacklist EVERY SINGLE OTHER TAG
gold is after diamond
Ye its awful
Give me like 10 mins
I can put together a better level_x solution with laddering, I think
But I will need to make invariant that the needs_x_tool tags are just total junk
well the problem is that laddering will be the only thing it supports
That is acceptable, imo - I do not know of nor could I find anyone inserting new tiers inbetween the vanilla tiers
there are more than enough vanilla "levels" for sensible game design
yes but for vanilla blacklist removes the need to sort
No it doesn't
it only removes the need for certain contexts
certain contexts where it really wasn't an issue already
Kits is holding the snapshot atm, right?
I can work there
Does anyone want to test the unpick build in #builds on the snapshot maven?
it removes vanilla's own need of sorting



