diff --git a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java index 8890715ec1..1d89762163 100644 --- a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java +++ b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java @@ -113,7 +113,12 @@ public boolean validate(String value) { try { final double d = Double.parseDouble(value); - return this.inBounds(d); + if (!this.inBounds(d)) { + return false; + } + + this.value = d; + return true; } catch (NumberFormatException ignored) { return false; } diff --git a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java index bf2fda2f73..6f7284de99 100644 --- a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java +++ b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java @@ -23,9 +23,10 @@ public interface ValidateableRule { /** * Validates if a rule can accept the input. + * If valid, the input will be set as the rule's value. * * @param value the value to validate - * @return true if the value can be accepted. + * @return true if the value was accepted. */ boolean validate(String value); } diff --git a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java index 588846c563..5d90b75844 100644 --- a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java +++ b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java @@ -69,10 +69,18 @@ protected FabricBlockSettings(AbstractBlock.Settings settings) { thisAccessor.setDynamicBounds(otherAccessor.getDynamicBounds()); thisAccessor.setOpaque(otherAccessor.getOpaque()); thisAccessor.setIsAir(otherAccessor.getIsAir()); + thisAccessor.setBurnable(otherAccessor.getBurnable()); + thisAccessor.setLiquid(otherAccessor.getLiquid()); + thisAccessor.setForceNotSolid(otherAccessor.getForceNotSolid()); + thisAccessor.setForceSolid(otherAccessor.getForceSolid()); + this.pistonBehavior(otherAccessor.getPistonBehavior()); thisAccessor.setToolRequired(otherAccessor.isToolRequired()); thisAccessor.setOffsetter(otherAccessor.getOffsetter()); thisAccessor.setBlockBreakParticles(otherAccessor.getBlockBreakParticles()); thisAccessor.setRequiredFeatures(otherAccessor.getRequiredFeatures()); + this.emissiveLighting(otherAccessor.getEmissiveLightingPredicate()); + this.instrument(otherAccessor.getInstrument()); + thisAccessor.setReplaceable(otherAccessor.getReplaceable()); // Not copied in vanilla: field definition order this.jumpVelocityMultiplier(otherAccessor.getJumpVelocityMultiplier()); @@ -82,7 +90,6 @@ protected FabricBlockSettings(AbstractBlock.Settings settings) { this.suffocates(otherAccessor.getSuffocationPredicate()); this.blockVision(otherAccessor.getBlockVisionPredicate()); this.postProcess(otherAccessor.getPostProcessPredicate()); - this.emissiveLighting(otherAccessor.getEmissiveLightingPredicate()); } public static FabricBlockSettings create() { diff --git a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/AbstractBlockSettingsAccessor.java b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/AbstractBlockSettingsAccessor.java index 31a9afb1d1..1c4cef0eaf 100644 --- a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/AbstractBlockSettingsAccessor.java +++ b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/AbstractBlockSettingsAccessor.java @@ -26,6 +26,8 @@ import net.minecraft.block.AbstractBlock; import net.minecraft.block.BlockState; import net.minecraft.block.MapColor; +import net.minecraft.block.enums.Instrument; +import net.minecraft.block.piston.PistonBehavior; import net.minecraft.entity.EntityType; import net.minecraft.resource.featuretoggle.FeatureSet; import net.minecraft.sound.BlockSoundGroup; @@ -106,6 +108,27 @@ public interface AbstractBlockSettingsAccessor { @Accessor FeatureSet getRequiredFeatures(); + @Accessor + boolean getBurnable(); + + @Accessor + boolean getLiquid(); + + @Accessor + boolean getForceNotSolid(); + + @Accessor + boolean getForceSolid(); + + @Accessor + PistonBehavior getPistonBehavior(); + + @Accessor + Instrument getInstrument(); + + @Accessor + boolean getReplaceable(); + /* SETTERS */ @Accessor void setCollidable(boolean collidable); @@ -139,4 +162,19 @@ public interface AbstractBlockSettingsAccessor { @Accessor void setOffsetter(Optional offsetter); + + @Accessor + void setBurnable(boolean burnable); + + @Accessor + void setLiquid(boolean liquid); + + @Accessor + void setForceNotSolid(boolean forceNotSolid); + + @Accessor + void setForceSolid(boolean forceSolid); + + @Accessor + void setReplaceable(boolean replaceable); } diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/fluid/CombinedProvidersImpl.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/fluid/CombinedProvidersImpl.java index 54ca2481da..0231d2007a 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/fluid/CombinedProvidersImpl.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/fluid/CombinedProvidersImpl.java @@ -82,10 +82,14 @@ public Storage find(ItemStack itemStack, ContainerItemContext cont } public static Event getOrCreateItemEvent(Item item) { - // register here is thread-safe, so the query below will return a valid provider (possibly one registered before or from another thread). - FluidStorage.ITEM.registerForItems(new Provider(), item); ItemApiLookup.ItemApiProvider, ContainerItemContext> existingProvider = FluidStorage.ITEM.getProvider(item); + if (existingProvider == null) { + FluidStorage.ITEM.registerForItems(new Provider(), item); + // The provider might not be new Provider() if a concurrent registration happened, re-query. + existingProvider = FluidStorage.ITEM.getProvider(item); + } + if (existingProvider instanceof Provider registeredProvider) { return registeredProvider.event; } else { diff --git a/gradle.properties b/gradle.properties index fc42544804..ddce05e96c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2560M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.90.0 +version=0.90.7 minecraft_version=1.20.1 yarn_version=+build.1 loader_version=0.14.21 @@ -28,7 +28,7 @@ fabric-dimensions-v1-version=2.1.53 fabric-entity-events-v1-version=1.5.22 fabric-events-interaction-v0-version=0.6.1 fabric-events-lifecycle-v0-version=0.2.62 -fabric-game-rule-api-v1-version=1.0.38 +fabric-game-rule-api-v1-version=1.0.39 fabric-gametest-api-v1-version=1.2.12 fabric-item-api-v1-version=2.1.27 fabric-item-group-api-v1-version=4.0.11 @@ -43,7 +43,7 @@ fabric-model-loading-api-v1-version=1.0.2 fabric-models-v0-version=0.4.1 fabric-networking-api-v1-version=1.3.10 fabric-networking-v0-version=0.3.50 -fabric-object-builder-api-v1-version=11.1.1 +fabric-object-builder-api-v1-version=11.1.2 fabric-particles-v1-version=1.1.1 fabric-recipe-api-v1-version=1.0.20 fabric-registry-sync-v0-version=2.3.2 @@ -59,7 +59,7 @@ fabric-resource-loader-v0-version=0.11.9 fabric-screen-api-v1-version=2.0.7 fabric-screen-handler-api-v1-version=1.3.29 fabric-sound-api-v1-version=1.0.12 -fabric-transfer-api-v1-version=3.3.1 +fabric-transfer-api-v1-version=3.3.2 fabric-transitive-access-wideners-v1-version=4.3.0 fabric-convention-tags-v1-version=1.5.4 fabric-client-tags-api-v1-version=1.1.1