Removed unneeded Mixin
This commit is contained in:
parent
b37399523a
commit
74e465a68c
3 changed files with 2 additions and 25 deletions
|
@ -1,24 +0,0 @@
|
|||
package org.betterx.bclib.mixin.common;
|
||||
|
||||
import org.betterx.bclib.util.MethodReplace;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase;
|
||||
|
||||
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;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Mixin(BlockStateBase.class)
|
||||
public class BlockStateBaseMixin {
|
||||
@Inject(method = "is(Lnet/minecraft/world/level/block/Block;)Z", at = @At("HEAD"), cancellable = true)
|
||||
private void bclib_replaceFunction(Block block, CallbackInfoReturnable<Boolean> info) {
|
||||
Function<BlockStateBase, Boolean> replacement = MethodReplace.getBlockReplace(block);
|
||||
if (replacement != null) {
|
||||
info.setReturnValue(replacement.apply(BlockStateBase.class.cast(this)));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ public class MethodReplace {
|
|||
MethodReplace.item = item;
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void addBlockReplace(Block block, Function<BlockStateBase, Boolean> blockReplace) {
|
||||
MethodReplace.blockReplace = blockReplace;
|
||||
MethodReplace.block = block;
|
||||
|
@ -35,6 +36,7 @@ public class MethodReplace {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
@Deprecated(forRemoval = true)
|
||||
public static Function<BlockStateBase, Boolean> getBlockReplace(Block block) {
|
||||
if (MethodReplace.block != block) {
|
||||
return null;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
"BiomeGenerationSettingsAccessor",
|
||||
"BiomeMixin",
|
||||
"BiomeSourceMixin",
|
||||
"BlockStateBaseMixin",
|
||||
"BoneMealItemMixin",
|
||||
"ChunkGeneratorAccessor",
|
||||
"ChunkGeneratorMixin",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue