-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
common/src/main/java/org/vivecraft/client_vr/extensions/StateHolderExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.vivecraft.client_vr.extensions; | ||
|
||
import net.minecraft.world.level.block.state.properties.Property; | ||
|
||
import java.util.Map; | ||
|
||
public interface StateHolderExtension { | ||
void vivecraft$setValues(Map<Property<?>, Comparable<?>> values); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...c/main/java/org/vivecraft/mixin/client_vr/world/level/block/state/StateHolderVRMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.vivecraft.mixin.client_vr.world.level.block.state; | ||
|
||
import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap; | ||
import net.minecraft.world.level.block.state.StateHolder; | ||
import net.minecraft.world.level.block.state.properties.Property; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.vivecraft.client_vr.extensions.StateHolderExtension; | ||
|
||
import java.util.Map; | ||
|
||
// low priority, because we want to apply before FerriteCore | ||
@Mixin(value = StateHolder.class, priority = 500) | ||
public class StateHolderVRMixin implements StateHolderExtension { | ||
|
||
@Shadow | ||
private Reference2ObjectArrayMap<Property<?>, Comparable<?>> values; | ||
|
||
@Override | ||
public void vivecraft$setValues(Map<Property<?>, Comparable<?>> values) { | ||
// this cast is fine, because the supplied map always comes from a StateHolder | ||
This comment has been minimized.
Sorry, something went wrong. |
||
this.values = (Reference2ObjectArrayMap<Property<?>, Comparable<?>>) values; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,8 @@ accessible class net/minecraft/world/level/biome/Biome$ClimateSettings | |
accessible field net/minecraft/world/level/biome/AmbientParticleSettings probability F | ||
extendable class net/minecraft/world/level/material/FluidState | ||
accessible field net/minecraft/world/level/block/state/StateHolder propertiesCodec Lcom/mojang/serialization/MapCodec; | ||
# to fix an issue with FerriteCore | ||
mutable field net/minecraft/world/level/block/state/StateHolder values Lit/unimi/dsi/fastutil/objects/Reference2ObjectArrayMap; | ||
This comment has been minimized.
Sorry, something went wrong.
Techjar
Collaborator
|
||
|
||
# to init VR | ||
accessible class net/minecraft/client/ResourceLoadStateTracker$ReloadState | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment should more specifically state that FerriteCore modifies the type of the resulting CHECKCAST instruction.