-
Notifications
You must be signed in to change notification settings - Fork 96
Add infinite attribute to blocks #931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
In the current state, this is extremely hacky. In the xml syntax, adapt pgm so that Secondly, giving 1 item is a bad idea for several reasons. For one the user may not notice it's infinite or they have multiple, and may think they have just one. For this purpose either a stack with 64 or 127 (abusing mc a bit) may be a better. Another problem with single item is that client-server desyncs will be frequent, you click twice, clent-side you wasted your block, and you don't see it come back until after your 2nd click, where the block latee pops-up as a server-side place instead of a client-side one. Players fast-bridging will want to kill you. Giving more than one item should also make it easier as you can just change the amount of items in the stack back to 64 (or 127, or -1, whatever works best). Lastly, do not ever use lore string as a check, we're better than that. Look at how metadata for grenades or itemmods is done, pgm has some nice utils for it, it saves as an internal nbt metadata flag |
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
…o infinite-stacks
The PR now does everything smarter like you were saying. Players will see the infinite block as holding -1 items in it, when the block is placed they are given -1 blocks, which resets it back to -1. The other advantage of using -1 blocks is that it cannot be split, stacked, or dragged, so listeners aren't needed to deal with those events. <kits>
<kit id="the-kit" force="true">
<item slot="0">bow</item>
<item slot="2" amount="64">arrow</item>
<item slot="8" material="bedrock" amount="oo"/>
</kit>
</kits> |
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
@@ -422,7 +429,12 @@ public ItemStack parseItem(Element el, Material type, short damage) throws Inval | |||
throw new InvalidXMLException("Invalid item/block", el); | |||
} | |||
|
|||
if (amount == -1 && !itemStack.getType().isBlock()) { | |||
throw new InvalidXMLException("infinity can only be applied to a block material", el); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we support infinite snowballs or enderpearls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested them at the time, I'll see if works.
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Fixes #781 as suggested by @RuedigerLP
Example
This PR gives affected blocks
Infinite ∞
in the lore, which is unable to be created or edited in survival, to safely hold the trait. The infinity character on it's own does not look so well in game so I prefixed it with infinite to make it more clear. I tried expanding this to potions but it did not seem to work out well.