-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed incompatibilities with DraconicEvolution, Mekanism, and a few o…
- Loading branch information
Showing
6 changed files
with
39 additions
and
10 deletions.
There are no files selected for viewing
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 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 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
23 changes: 23 additions & 0 deletions
23
src/main/java/org/dimdev/vanillafix/blockstates/mixins/MixinPropertyHelper.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,23 @@ | ||
package org.dimdev.vanillafix.blockstates.mixins; | ||
|
||
import net.minecraft.block.properties.IProperty; | ||
import net.minecraft.block.properties.PropertyHelper; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(PropertyHelper.class) | ||
public abstract class MixinPropertyHelper<T extends Comparable<T>> implements IProperty<T> { | ||
/** | ||
* Fix mods using duplicate property names. | ||
*/ | ||
@Inject(method = "equals", at = @At("RETURN"), cancellable = true) | ||
public void overrideEquals(Object obj, CallbackInfoReturnable<Boolean> cir) { | ||
if (cir.getReturnValue() && obj instanceof PropertyHelper) { | ||
if (!getClass().getName().startsWith("net.minecraft") && !getAllowedValues().equals(((PropertyHelper<?>) obj).getAllowedValues())) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} | ||
} |
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 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