本文整理匯總了Java中org.bukkit.entity.FallingBlock.getMaterial方法的典型用法代碼示例。如果您正苦於以下問題:Java FallingBlock.getMaterial方法的具體用法?Java FallingBlock.getMaterial怎麽用?Java FallingBlock.getMaterial使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.entity.FallingBlock
的用法示例。
在下文中一共展示了FallingBlock.getMaterial方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onEntityChangeBlockEvent
import org.bukkit.entity.FallingBlock; //導入方法依賴的package包/類
@EventHandler
public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) {
if (event.getEntityType() == EntityType.FALLING_BLOCK) {
FallingBlock fallingBlock = (FallingBlock) event.getEntity();
if (fallingBlock.getMaterial() == Material.STAINED_CLAY) {
event.setCancelled(true);
}
if (fallingBlock.getMaterial() == Material.WOOL) {
event.setCancelled(true);
}
}
}
示例2: FallingBlockInfo
import org.bukkit.entity.FallingBlock; //導入方法依賴的package包/類
public FallingBlockInfo(FallingBlock entity, @Nullable ParticipantState owner) {
super(entity, owner);
this.material = entity.getMaterial();
}
示例3: onDisable
import org.bukkit.entity.FallingBlock; //導入方法依賴的package包/類
public void onDisable() {
for(XPlayer xp : getManagers().getPlayerManager().getPlayers()) {
xp.save();
}
if(getUUIDManager().isExecutorServiceRunning()) {
getUUIDManager().shutdownExecutorService();
}
getManagers().getPlayerManager().clear();
if(conf.getEntityConfig().isRealisticGlassEnabled()) {
getManagers().getRealisticGlassManager().saveGlassBlocks();
}
if(conf.getChatConfig().isRssBroadcastEnabled()) {
getManagers().getRssManager().saveLastFeed();
}
if(getManagers().getGreylistManager().isRunning()) {
SimpleServer server = getManagers().getGreylistManager();
log("stopping server " + server.getName() + " at port " + server.getPort(), LogType.INFO);
try {
server.stopServer();
log("server successfully stopped!", LogType.INFO);
} catch (IOException e) {
e.printStackTrace();
}
}
if(getManagers().getBroadcastManager().isRunning()) {
getManagers().getBroadcastManager().stop();
}
if(conf.getEntityConfig().isExplosionRegenEnabled()) {
for(World w : Bukkit.getWorlds()) {
for(Entity entity : w.getEntities()) {
if(entity instanceof FallingBlock) {
FallingBlock fb = (FallingBlock)entity;
if(fb.getMaterial() != Material.GRAVEL || fb.getMaterial() != Material.SAND || fb.getMaterial() != Material.TNT) {
fb.remove();
}
}
}
}
getManagers().getExplosionRegenManager().saveRegenObjects();
if(conf.getMiscConfig().isChairsEnabled()) {
getManagers().getChairManager().killAll();
}
}
if(conf.getEntityConfig().isRealisticWaterEnabled()) {
getManagers().getRealisticWaterManager().stop();
}
log("has been disabled!", LogType.INFO);
getManagers().getMinigamesManager().disablePlugins();
}