net.minecraft.tileentity.TileEntityBeacon Java Examples

The following examples show how to use net.minecraft.tileentity.TileEntityBeacon. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CraftBeacon.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Collection<LivingEntity> getEntitiesInRange() {
    TileEntity tileEntity = this.getTileEntityFromWorld();
    if (tileEntity instanceof TileEntityBeacon) {
        TileEntityBeacon beacon = (TileEntityBeacon) tileEntity;

        Collection<EntityPlayer> nms = beacon.getHumansInRange();
        Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size());

        for (EntityPlayer human : nms) {
            bukkit.add(human.getBukkitEntity());
        }

        return bukkit;
    }

    // block is no longer a beacon
    return new ArrayList<LivingEntity>();
}
 
Example #2
Source File: CraftBeacon.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftBeacon(final Block block) {
    super(block, TileEntityBeacon.class);
}
 
Example #3
Source File: CraftBeacon.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftBeacon(final Material material, final TileEntityBeacon te) {
    super(material, te);
}
 
Example #4
Source File: CraftBeacon.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public String getCustomName() {
    TileEntityBeacon beacon = this.getSnapshot();
    return beacon.hasCustomName() ? beacon.getName() : null;
}
 
Example #5
Source File: CraftInventoryBeacon.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftInventoryBeacon(TileEntityBeacon beacon) {
    super(beacon);
}
 
Example #6
Source File: CraftBeacon.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public CraftBeacon(final Block block) {
    super(block);

    world = (CraftWorld) block.getWorld();
    beacon = (TileEntityBeacon) world.getTileEntityAt(getX(), getY(), getZ());
}
 
Example #7
Source File: AdapterBeacon.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
@Override
public Class<?> getTargetClass() {
	return TileEntityBeacon.class;
}
 
Example #8
Source File: AdapterBeacon.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
@ScriptCallable(returnTypes = ReturnType.STRING, description = "Get the primary effect of the beacon")
public String getPrimaryEffect(TileEntityBeacon beacon) {
	Integer effectId = beacon.getPrimaryEffect();
	return getEffectName(effectId);
}
 
Example #9
Source File: AdapterBeacon.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
@ScriptCallable(returnTypes = ReturnType.STRING, description = "Get the secondary effect of the beacon")
public String getSecondaryEffect(TileEntityBeacon beacon) {
	Integer effectId = beacon.getSecondaryEffect();
	return getEffectName(effectId);
}
 
Example #10
Source File: AdapterBeacon.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
@ScriptCallable(returnTypes = ReturnType.NUMBER, description = "Get the height of the beacon's pyramid")
public int getLevels(TileEntityBeacon beacon) {
	return beacon.getLevels();
}