Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
Fix comodification derpage
Browse files Browse the repository at this point in the history
  • Loading branch information
williewillus committed Aug 25, 2016
1 parent 14851e7 commit 90085c4
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.network.play.server.SPacketRemoveEntityEffect;
import net.minecraft.pathfinding.PathNavigateGround;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntityBeacon;
import net.minecraft.util.DamageSource;
Expand Down Expand Up @@ -90,6 +91,7 @@
import java.util.List;
import java.util.UUID;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {

Expand Down Expand Up @@ -565,14 +567,16 @@ public void onLivingUpdate() {
}
}

player.getActivePotionEffects().stream()
List<Potion> potionsToRemove = player.getActivePotionEffects().stream()
.filter(effect -> effect.getDuration() < 160 && effect.getIsAmbient() && !effect.getPotion().isBadEffect())
.map(PotionEffect::getPotion)
.distinct()
.forEach(potion -> {
player.removePotionEffect(potion);
((WorldServer) worldObj).getPlayerChunkMap().getEntry(posXInt >> 4, posZInt >> 4).sendPacket(new SPacketRemoveEntityEffect(player.getEntityId(), potion));
});
.collect(Collectors.toList());

potionsToRemove.forEach(potion -> {
player.removePotionEffect(potion);
((WorldServer) worldObj).getPlayerChunkMap().getEntry(posXInt >> 4, posZInt >> 4).sendPacket(new SPacketRemoveEntityEffect(player.getEntityId(), potion));
});

player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode;
if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(player.posX, player.posY, player.posZ, source.getX() + 0.5, source.getY() + 0.5, source.getZ() + 0.5) >= range) {
Expand Down

0 comments on commit 90085c4

Please sign in to comment.