當前位置: 首頁>>代碼示例>>Java>>正文


Java Order.PRE屬性代碼示例

本文整理匯總了Java中org.spongepowered.api.event.Order.PRE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Order.PRE屬性的具體用法?Java Order.PRE怎麽用?Java Order.PRE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.spongepowered.api.event.Order的用法示例。


在下文中一共展示了Order.PRE屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onIncomingMessage

@Listener(order = Order.PRE, beforeModifications = true)
@IsCancelled(Tristate.UNDEFINED)
public void onIncomingMessage(MessageChannelEvent.Chat event, @Root Player player) {
    if (getView(player).handleIncoming(event.getRawMessage())) {
        // No plugins should interpret this as chat
        event.setCancelled(true);
        event.setChannel(MessageChannel.TO_NONE);
    }
}
 
開發者ID:simon816,項目名稱:ChatUI,代碼行數:9,代碼來源:ChatUILib.java

示例2: onPreInitialize

@Listener(order = Order.PRE)
public void onPreInitialize(GamePreInitializationEvent event) {
    InfernoCore.initialize();
    CommonDataFiles.createCoreDataFiles();
    registerEventListeners();
    this.stats.start();
}
 
開發者ID:caseif,項目名稱:Inferno,代碼行數:7,代碼來源:InfernoPlugin.java

示例3: onPlayerJoin

/**
 * Link the connection and the player objects as soon as possible.
 * @param event The event
 */
@Listener(order = Order.PRE)
public void onPlayerJoin(ClientConnectionEvent.Join event) {
    Player player = event.getTargetEntity();
    SpongeConnection connection = SpongeConnection.get(player.getConnection());
    connection.setPlayer(player);
}
 
開發者ID:ReplayMod,項目名稱:SpongeRecording,代碼行數:10,代碼來源:SpongeImplementation.java

示例4: onPlayerDeath

@Listener(order = Order.PRE)
public void onPlayerDeath(DestructEntityEvent.Death event) {
  Optional<DamageSource> optDmgSrc = event.getCause().first(DamageSource.class);
  if (optDmgSrc.isPresent() && event.getTargetEntity() instanceof Player) {
    if (event.getMessage().toPlain().contains(DAMAGE_TYPE.getId())) {
      event.setMessage(Text.of(((Player) event.getTargetEntity()).getName(), " was killed by an ancient enchantment"));
    }
  }
}
 
開發者ID:Skelril,項目名稱:Skree,代碼行數:9,代碼來源:WildernessTeleportCommand.java

示例5: onPlayerAuth

@Listener(order = Order.PRE)
public void onPlayerAuth(ClientConnectionEvent.Auth event) {
  try (Connection con = SQLHandle.getConnection()) {
    DSLContext create = DSL.using(con);

    UUID uuid = event.getProfile().getUniqueId();

    Record1<Timestamp> result = create.select(PLAYERS.LAST_LOGIN).from(PLAYERS).where(PLAYERS.UUID.equal(uuid.toString())).fetchOne();
    Timestamp timestamp = result.getValue(PLAYERS.LAST_LOGIN);

    lastPlayerLogin.put(uuid, timestamp.getTime());
  } catch (SQLException e) {
    e.printStackTrace();
  }
}
 
開發者ID:Skelril,項目名稱:Skree,代碼行數:15,代碼來源:WorldServiceImpl.java

示例6: onPlayerDisconnectPre

@Listener(order=Order.PRE)
public void onPlayerDisconnectPre(final ClientConnectionEvent.Disconnect event) {
	this.plugin.getEServer().disconnects.add(event.getTargetEntity().getUniqueId());
}
 
開發者ID:EverCraft,項目名稱:EverAPI,代碼行數:4,代碼來源:EAListener.java

示例7: onGamePreInit

@Listener(order = Order.PRE)
public void onGamePreInit(GamePreInitializationEvent event) {
    this.server = this.game.getServer();
    new FaweSponge(this);
    Settings.IMP.QUEUE.PARALLEL_THREADS = 1;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:6,代碼來源:SpongeMain.java

示例8: onPlayerCombat

@Listener(order = Order.PRE)
public void onPlayerCombat(DamageEntityEvent event) {
  createFor(event).parse(event);
}
 
開發者ID:Skelril,項目名稱:Skree,代碼行數:4,代碼來源:PactScroll.java


注:本文中的org.spongepowered.api.event.Order.PRE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。