Skip to content

Commit

Permalink
Fix mixin conflict with lets do meadow (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Dec 10, 2023
1 parent 0149472 commit 5e70607
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import io.izzel.arclight.common.bridge.core.entity.EntityBridge;
import io.izzel.arclight.common.bridge.core.entity.player.ServerPlayerEntityBridge;
import io.izzel.arclight.common.bridge.core.world.WorldBridge;
import io.izzel.arclight.common.mod.util.Blackhole;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.animal.Chicken;
import net.minecraft.world.entity.projectile.ThrownEgg;
import net.minecraft.world.phys.HitResult;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -47,6 +49,11 @@ protected void onHit(final HitResult result) {
if (hatching) {
for (int i = 0; i < b0; ++i) {
Entity entity = ((WorldBridge) this.level()).bridge$getWorld().createEntity(new Location(((WorldBridge) this.level()).bridge$getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0f), hatchingType.getEntityClass());
// Let's do: Meadow mixin compatibility https://github.com/IzzelAliz/Arclight/issues/1149
if (entity instanceof Chicken) {
Chicken chicken = (Chicken) entity;
Blackhole.consume(chicken);
}
if (entity != null) {
if (((EntityBridge) entity).bridge$getBukkitEntity() instanceof Ageable) {
((Ageable) ((EntityBridge) entity).bridge$getBukkitEntity()).setBaby();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.izzel.arclight.common.mod.util;

public class Blackhole {

public static void consume(Object o) {
}
}

0 comments on commit 5e70607

Please sign in to comment.