-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Disabled recipes no longer count towards recipe limit #10235
base: version/main
Are you sure you want to change the base?
Conversation
@@ -210,11 +210,13 @@ else if(recipe.getIntermediate() != Blocks.AIR) | |||
{ | |||
rowPane.findPaneOfTypeByID("gradient", Gradient.class).setVisible(true); | |||
rowPane.findPaneOfTypeByID(BUTTON_TOGGLE, Button.class).setText(Component.translatable("com.minecolonies.coremod.gui.recipe.enable")); | |||
rowPane.findPaneOfTypeByID(BUTTON_TOGGLE, Button.class).setVisible(module.getActiveRecipes() < module.getMaxRecipes()); |
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.
An overall thought about our code, in how far do we want to rely solely on client side validations to ensure everything is valid.
I'm always used that (outside of here) that you want to double up client and server side validations.
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.
That's true, usually you should. I kinda deliberately didn't here because the consequences aren't all that bad (it just means the pre-PR behaviour still holds).
In order to actually exploit that you'd have to be running a modified client jar that omitted the check or that forged the packet. Which is not super hard to do with an addon. But why bother?
Now if it was a permissions check or something more serious, you absolutely want that on both sides.
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.
Could we have an extra flag for "pre-set recipes" and make them not count to the limit just?
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.
There kind of already is a preset flag (if it has a recipe id then it's a preset recipe). That's easy on client side since it has the recipe definition but on server side it only has a token so would have to enumerate and look up all the recipes instead of just doing a quick size calculation, so it will have perf consequences.
And I'm not sure that the presets shouldn't count towards the limit, though; they're still something that they can craft so it makes sense that they count -- when not disabled.
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 think, I would store on the serverside some additional information together (e.g. if preset) and then not count these towards the limit. So, we can have it fast on both sides. What do you think @someaddons ?
Closes discord thought
Changes proposed in this pull request
Testing
Review please (should port)
This is overall intended as a rebalance to make crafterrecipes (especially from datapacks) less likely to completely "starve out" a low-level crafter and make it impossible to teach additional recipes. But the player is still forced to pick and choose, apart from automatic additions.