Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.camellias.temporalmod.tileentities;
- import java.util.List;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.MobEffects;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.math.AxisAlignedBB;
- public class TileEntityTimeAnomaly extends TileEntity implements ITickable
- {
- public void setName(String displayName)
- {
- }
- private void addEffectsToPlayers()
- {
- List<EntityPlayer> itemsOnGround = getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(getPos()).grow(3, 0, 3));
- if (!this.world.isRemote)
- {
- double d0 = (double)(10 + 10);
- int i = 20;
- int j = 1;
- int k = this.pos.getX();
- int l = this.pos.getY();
- int i1 = this.pos.getZ();
- AxisAlignedBB axisalignedbb = (new AxisAlignedBB((double)k, (double)l, (double)i1, (double)(k + 1), (double)(l + 1), (double)(i1 + 1))).grow(d0).expand(0.0D, (double)this.world.getHeight(), 0.0D);
- List<EntityPlayer> list = getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(getPos()).grow(5, 3, 5));
- for (EntityPlayer entityplayer : list)
- {
- entityplayer.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, j, i, true, true));
- entityplayer.addPotionEffect(new PotionEffect(MobEffects.HUNGER, j, i, true, true));
- entityplayer.addPotionEffect(new PotionEffect(MobEffects.WITHER, j, i, true, true));
- }
- }
- }
- @Override
- public void update()
- {
- if (this.world.getTotalWorldTime() % 80L == 0L)
- {
- this.updateAnom();
- }
- }
- private void updateAnom()
- {
- if (this.world != null)
- {
- this.addEffectsToPlayers();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment