Skip to content

Commit

Permalink
Fix #4771
Browse files Browse the repository at this point in the history
  • Loading branch information
Vazkii committed Apr 15, 2024
1 parent 27e3b63 commit 85f6d63
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.violetmoon.quark.mixin.mixins;

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 org.violetmoon.quark.content.building.module.ShearVinesModule;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ShearsItem;
import net.minecraft.world.level.block.state.BlockState;

@Mixin(ShearsItem.class)
public class ShearsItemMixin {

@Inject(method = "getDestroySpeed", at = @At("HEAD"), cancellable = true)
public void getDestroySpeed(ItemStack pStack, BlockState pState, CallbackInfoReturnable<Float> cbi) {
if(pState.is(ShearVinesModule.cut_vine))
cbi.setReturnValue(2F);
}

}
1 change: 1 addition & 0 deletions src/main/resources/quark.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"RegistrySetBuilderHackMixin",
"ServerAdvancementManagerMixin",
"ServerEntityMixin",
"ShearsItemMixin",
"SlimeMixin",
"SpawnerBlockEntityMixin",
"SpongeBlockMixin",
Expand Down

0 comments on commit 85f6d63

Please sign in to comment.