Skip to content

Commit

Permalink
Fix the compatibility of biomemakeover mod
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Aug 12, 2023
1 parent 5823263 commit 90827e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,9 @@ protected MixinWitch(EntityType<? extends Raider> entityType, Level level) {
// Paper end
}

@Redirect(method = "performRangedAttack", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/item/alchemy/PotionUtils;setPotion(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/alchemy/Potion;)Lnet/minecraft/world/item/ItemStack;"))
@Redirect(method = "performRangedAttack", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/alchemy/PotionUtils;setPotion(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/alchemy/Potion;)Lnet/minecraft/world/item/ItemStack;"))
private ItemStack banner$resetPotionStack(ItemStack stack, Potion potion) {
return paperPotion.get();
}

@Redirect(method = "aiStep", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/item/alchemy/PotionUtils;setPotion(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/alchemy/Potion;)Lnet/minecraft/world/item/ItemStack;"))
private ItemStack banner$useBukkitStack(ItemStack stack, Potion potion) {
// Paper start
org.bukkit.inventory.ItemStack bukkitStack =
com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), CraftItemStack.asCraftMirror(stack));
return CraftItemStack.asNMSCopy(bukkitStack);
// Paper end
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public MixinBowItem(Properties properties) {
super(properties);
}

EntityShootBowEvent event;

/**
* @author wdog5
* @reason bukkit
Expand Down Expand Up @@ -75,18 +77,18 @@ public void releaseUsing(ItemStack stack, Level level, LivingEntity livingEntity
}

// CraftBukkit start
EntityShootBowEvent event = CraftEventFactory.callEntityShootBowEvent(player, stack, itemStack,
event = CraftEventFactory.callEntityShootBowEvent(player, stack, itemStack,
abstractArrow, player.getUsedItemHand(), f, !bl2);
if (event.isCancelled()) {
event.getProjectile().remove();
return;
}
bl2 = !event.shouldConsumeItem();
// CraftBukkit end

stack.hurtAndBreak(1, player, (player2) -> {
player2.broadcastBreakEvent(player.getUsedItemHand());
});
bl2 = !event.shouldConsumeItem(); // Banner
if (bl2 || player.getAbilities().instabuild && (itemStack.is(Items.SPECTRAL_ARROW) || itemStack.is(Items.TIPPED_ARROW))) {
abstractArrow.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
}
Expand Down

0 comments on commit 90827e3

Please sign in to comment.