Using BiggerStacks with your mod

您所在的位置:网站首页 biggerstacks Using BiggerStacks with your mod

Using BiggerStacks with your mod

2024-06-13 09:37| 来源: 网络整理| 查看: 265

Maven repo

I don't have this mod on any maven repo. While codeberg (based on gitea) does allow you to upload packages, it does not actually work with gradle at the moment (see this gitea issue and this comment on a gradle issue. So you will have to use cursemaven for now.

Increasing the stack size of your items

You may want to use BiggerStacks to increase the stack size of one of your items to beyond 64. This is very simple - just include BiggerStacks as a dependency (and have it installed in production) and use Item.Properties.stacksTo() as you normally would. BiggerStacks will increase the slot size of containers as required.

ITEMS.register("example_block", () -> new Item(new Item.Properties() .tab(CreativeModeTab.TAB_BUILDING_BLOCKS) .stacksTo(700)) //or whatever you want your max stack size to be ); Using the rules system

You can also use the rules system via IMC.

Your rules will be added to the end of the rules list, so users can override them using the rules xml file.

Using XML public void enqueueIMC(final InterModEnqueueEvent event) { //you could also read an XML file in your jar as a string InterModComms.sendTo( "biggerstacks", "add_rule", () -> """ id mymod:example_block id mymod:another_block """); }

If you're only adding a single rule, you don't have to include the ruleset tag:

InterModComms.sendTo( "biggerstacks", "add_rule", () -> """ id mymod:example_block """); Using java objects

You can also create Rule objects using java code. I personally think using XML is much more readable.

Adding multiple rules:

import portb.configlib.xml.Condition; import portb.configlib.xml.Operator; import portb.configlib.xml.Property; import portb.configlib.xml.Rule; InterModComms.sendTo("biggerstacks", "add_rule", () -> Arrays.asList( new Rule( Collections.singletonList(new Condition( Property.ID, Operator.EQUALS, EXAMPLE_BLOCK.getId().toString() )), 100 ), new Rule( Collections.singletonList(new Condition( Property.ID, Operator.EQUALS, ANOTHER_BLOCK.getId().toString() )), 80 ) ));

Adding a single rule:

InterModComms.sendTo("biggerstacks", "add_rule", () -> new Rule( Collections.singletonList(new Condition( Property.ID, Operator.EQUALS, EXAMPLE_BLOCK.getId().toString() )), 100 ));


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3