All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.BlockEnderPortal Maven / Gradle / Ivy

package net.minecraft.server;

import org.bukkit.event.entity.EntityPortalEnterEvent;

import java.util.List;
import java.util.Random;

public class BlockEnderPortal extends BlockContainer {

  protected BlockEnderPortal(Material material) {
    super(material);
    this.a(1.0F);
  }

  public TileEntity a(World world, int i) {
    return new TileEntityEnderPortal();
  }

  public void updateShape(IBlockAccess iblockaccess, BlockPosition blockposition) {
    float f = 0.0625F;

    this.a(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
  }

  public void a(World world, BlockPosition blockposition, IBlockData iblockdata, AxisAlignedBB axisalignedbb, List list, Entity entity) {
  }

  public boolean c() {
    return false;
  }

  public boolean d() {
    return false;
  }

  public int a(Random random) {
    return 0;
  }

  public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null && !world.isClientSide) {
      // CraftBukkit start - Entity in portal
      EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
      world.getServer().getPluginManager().callEvent(event);
      // CraftBukkit end
      entity.c(1);
    }

  }

  public MaterialMapColor g(IBlockData iblockdata) {
    return MaterialMapColor.E;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy