Skip to content

Commit

Permalink
Clear old code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Aug 12, 2023
1 parent e93e847 commit 5823263
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.mohistmc.banner.mixin.world.level.block.entity;

import com.destroystokyo.paper.event.block.BeaconEffectEvent;
import com.mohistmc.banner.bukkit.BukkitExtraConstants;
import com.mohistmc.banner.injection.world.level.block.entity.InjectionBeaconBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.player.Player;
Expand All @@ -28,7 +26,6 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

import java.util.Iterator;
import java.util.List;

@Mixin(BeaconBlockEntity.class)
Expand Down Expand Up @@ -161,26 +158,4 @@ private static void applyEffects(Level pLevel, BlockPos pPos, int pLevels, @Null

}
// CraftBukkit end

private static void applyEffect(List list, MobEffect mobeffectlist, int j, int b0, boolean isPrimary, BlockPos worldPosition) { // Paper - BeaconEffectEvent
{
if (!list.isEmpty()) { // Paper - BeaconEffectEvent
Iterator iterator = list.iterator();

Player entityhuman;

// Paper start - BeaconEffectEvent
org.bukkit.block.Block block = ((Player) list.get(0)).level().getWorld().getBlockAt(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ());
PotionEffect effect = CraftPotionUtil.toBukkit(new MobEffectInstance(mobeffectlist, j, b0, true, true));
// Paper end
while (iterator.hasNext()) {
// Paper start - BeaconEffectEvent
entityhuman = (ServerPlayer) iterator.next();
BeaconEffectEvent event = new BeaconEffectEvent(block, effect, (org.bukkit.entity.Player) entityhuman.getBukkitEntity(), isPrimary);
if (CraftEventFactory.callEvent(event).isCancelled()) continue;
entityhuman.addEffect(new MobEffectInstance(CraftPotionUtil.fromBukkit(event.getEffect())), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.BEACON);
}
}
}
}
}

0 comments on commit 5823263

Please sign in to comment.