Java Code Examples for com.velocitypowered.api.event.PostOrder#LAST

The following examples show how to use com.velocitypowered.api.event.PostOrder#LAST . 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: ElytraPatch.java    From ViaVersion with MIT License 6 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onServerConnected(ServerConnectedEvent event) {
    UserConnection user = Via.getManager().getConnection(event.getPlayer().getUniqueId());
    if (user == null) return;

    try {
        if (user.getProtocolInfo().getPipeline().contains(Protocol1_9To1_8.class)) {
            int entityId = user.get(EntityTracker1_9.class).getProvidedEntityId();

            PacketWrapper wrapper = new PacketWrapper(0x39, null, user);

            wrapper.write(Type.VAR_INT, entityId);
            wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0)));

            wrapper.send(Protocol1_9To1_8.class);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 2
Source File: PlayerOnlineListener.java    From Plan with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onPostLogin(PostLoginEvent event) {
    try {
        actOnLogin(event);
    } catch (Exception e) {
        errorLogger.log(L.ERROR, e, ErrorContext.builder().related(event).build());
    }
}
 
Example 3
Source File: PlayerOnlineListener.java    From Plan with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onLogout(DisconnectEvent event) {
    try {
        actOnLogout(event);
    } catch (Exception e) {
        errorLogger.log(L.ERROR, e, ErrorContext.builder().related(event).build());
    }
}
 
Example 4
Source File: PlayerOnlineListener.java    From Plan with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onServerSwitch(ServerConnectedEvent event) {
    try {
        actOnServerSwitch(event);
    } catch (Exception e) {
        errorLogger.log(L.ERROR, e, ErrorContext.builder().related(event).build());
    }
}
 
Example 5
Source File: MonitoringPermissionCheckListener.java    From LuckPerms with MIT License 5 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onOtherPermissionSetup(PermissionsSetupEvent e) {
    // players are handled separately
    if (e.getSubject() instanceof Player) {
        return;
    }

    e.setProvider(new MonitoredPermissionProvider(e.getProvider()));
}
 
Example 6
Source File: VelocitySparkPlugin.java    From spark with GNU General Public License v3.0 4 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onDisable(ProxyShutdownEvent e) {
    this.platform.disable();
}
 
Example 7
Source File: VelocityPlugin.java    From ViaVersion with MIT License 4 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onProxyLateInit(ProxyInitializeEvent e) {
    Via.getManager().init();
}
 
Example 8
Source File: VelocityConnectionListener.java    From LuckPerms with MIT License 4 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onPlayerQuit(DisconnectEvent e) {
    handleDisconnect(e.getPlayer().getUniqueId());
}
 
Example 9
Source File: LPVelocityBootstrap.java    From LuckPerms with MIT License 4 votes vote down vote up
@Subscribe(order = PostOrder.LAST)
public void onDisable(ProxyShutdownEvent e) {
    this.plugin.disable();
}