
org.bukkit.craftbukkit.entity.CraftFallingSand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityFallingBlock;
import org.bukkit.Material;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingSand;
public class CraftFallingSand extends CraftEntity implements FallingSand {
public CraftFallingSand(CraftServer server, EntityFallingBlock entity) {
super(server, entity);
}
@Override
public EntityFallingBlock getHandle() {
return (EntityFallingBlock) entity;
}
@Override
public String toString() {
return "CraftFallingSand";
}
public EntityType getType() {
return EntityType.FALLING_BLOCK;
}
public Material getMaterial() {
return Material.getMaterial(getBlockId());
}
public int getBlockId() {
return CraftMagicNumbers.getId(getHandle().getBlock().getBlock());
}
public byte getBlockData() {
return (byte) getHandle().getBlock().getBlock().toLegacyData(getHandle().getBlock());
}
public boolean getDropItem() {
return getHandle().dropItem;
}
public void setDropItem(boolean drop) {
getHandle().dropItem = drop;
}
@Override
public boolean canHurtEntities() {
return getHandle().hurtEntities;
}
@Override
public void setHurtEntities(boolean hurtEntities) {
getHandle().hurtEntities = hurtEntities;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy