From 1ae68c2c3a3931fe855e028f00f8a0133c5142b9 Mon Sep 17 00:00:00 2001 From: MegumiKasuga <1926195023@qq.com> Date: Mon, 2 Dec 2024 21:35:28 +0800 Subject: [PATCH] - fix: BucketItemReg works abnormal. --- .../registrations/common/BucketItemReg.java | 31 +++++++++++++++++++ .../lib/registrations/common/FluidReg.java | 1 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main/java/kasuga/lib/registrations/common/BucketItemReg.java b/src/main/java/kasuga/lib/registrations/common/BucketItemReg.java index 4c57a6cc..03f6219d 100644 --- a/src/main/java/kasuga/lib/registrations/common/BucketItemReg.java +++ b/src/main/java/kasuga/lib/registrations/common/BucketItemReg.java @@ -1,6 +1,8 @@ package kasuga.lib.registrations.common; import kasuga.lib.core.annos.Mandatory; +import kasuga.lib.core.annos.Optional; +import kasuga.lib.core.base.SimpleCreativeTab; import kasuga.lib.core.base.item_helper.ExternalProperties; import kasuga.lib.registrations.Reg; import kasuga.lib.registrations.registry.SimpleRegistry; @@ -118,6 +120,35 @@ public BucketItemReg itemType(BucketBuilder builder) { return this; } + @Optional + public ItemReg tab(CreativeTabReg tab) { + properties.tab(tab.getTab()); + return this; + } + + @Optional + public ItemReg tab(SimpleCreativeTab tab) { + properties.tab(tab); + return this; + } + + @Optional + public ItemReg stackTo(int size) { + properties.stacksTo(size); + return this; + } + + /** + * Customize your item's property. + * @param identifier Item property customizer. + * @return self. + */ + @Optional + public ItemReg withProperty(PropertyIdentifier identifier) { + identifier.apply(properties); + return this; + } + /** * Submit your config to minecraft and forge registry. * @param registry the mod SimpleRegistry. diff --git a/src/main/java/kasuga/lib/registrations/common/FluidReg.java b/src/main/java/kasuga/lib/registrations/common/FluidReg.java index 3cb8b958..70a1db12 100644 --- a/src/main/java/kasuga/lib/registrations/common/FluidReg.java +++ b/src/main/java/kasuga/lib/registrations/common/FluidReg.java @@ -391,7 +391,6 @@ public FluidReg typeProperty(PropertyBuilder builder) { @Mandatory public FluidReg basicFluidProperties(int lightLevel, int density, int viscosity, boolean canSupportBoating) { return lightLevel(lightLevel).canSupportBoating(canSupportBoating).density(density).viscosity(viscosity); - } public FluidReg lightLevel(int lightLevel) {