diff --git a/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/StateHolderMixin.java b/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/StateHolderMixin.java index c8377b84..d2f58f14 100644 --- a/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/StateHolderMixin.java +++ b/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/StateHolderMixin.java @@ -101,7 +101,7 @@ public , V extends T> S setValue(final Property prope */ @Overwrite public , V extends T> S trySetValue(final Property property, final V value) { - final S ret = this.optimisedTable.trySet(this.tableIndex, property, value, (S)(StateHolder)(Object)this); + final S ret = property == null ? (S)(StateHolder)(Object)this : this.optimisedTable.trySet(this.tableIndex, property, value, (S)(StateHolder)(Object)this); if (ret == null) { throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner); } @@ -114,7 +114,7 @@ public , V extends T> S trySetValue(final Property pr */ @Overwrite public > Optional getOptionalValue(final Property property) { - return Optional.ofNullable(this.optimisedTable.get(this.tableIndex, property)); + return property == null ? Optional.empty() : Optional.ofNullable(this.optimisedTable.get(this.tableIndex, property)); } /** @@ -137,6 +137,6 @@ public > T getValue(final Property property) { */ @Overwrite public > boolean hasProperty(final Property property) { - return this.optimisedTable.hasProperty(property); + return property != null && this.optimisedTable.hasProperty(property); } } diff --git a/src/main/resources/moonrise.accesswidener b/src/main/resources/moonrise.accesswidener index b4f53fba..949deaf2 100644 --- a/src/main/resources/moonrise.accesswidener +++ b/src/main/resources/moonrise.accesswidener @@ -286,4 +286,4 @@ accessible method net/minecraft/world/level/chunk/storage/RegionFile write (Lnet # RegionFile$ChunkBuffer -accessible class net/minecraft/world/level/chunk/storage/RegionFile$ChunkBuffer \ No newline at end of file +accessible class net/minecraft/world/level/chunk/storage/RegionFile$ChunkBuffer