Skip to content

Commit

Permalink
Add blocking injection method to MixinLivingEntity.java.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekkan committed Dec 16, 2020
1 parent 6fd635e commit b4cd952
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityPose;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.SwordItem;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -50,8 +49,7 @@ public final float getEyeHeight(EntityPose pose, EntityDimensions dimensions) {

@Inject(at = @At(value = "HEAD"), method = "isBlocking", cancellable = true)
public void processSwordBlock(CallbackInfoReturnable<Boolean> cir) {
Item item = this.activeItemStack.getItem();
if(item instanceof SwordItem) {
if(this.activeItemStack.getItem() instanceof SwordItem) {
cir.setReturnValue(false);
}
}
Expand Down

0 comments on commit b4cd952

Please sign in to comment.