本文整理汇总了Java中net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent类的典型用法代码示例。如果您正苦于以下问题:Java ClientConnectedToServerEvent类的具体用法?Java ClientConnectedToServerEvent怎么用?Java ClientConnectedToServerEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientConnectedToServerEvent类属于net.minecraftforge.fml.common.network.FMLNetworkEvent包,在下文中一共展示了ClientConnectedToServerEvent类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConnect(ClientConnectedToServerEvent event) {
VersionChecker.checkVersion();
// forges api doesnt offer a listener for block breaks client side only, so we resort to dirty hacks. To understand
// how this works,
// you need a basic understanding of netty
// We insert our own outbound manager inbetween forge's packet handler and minecrafts packet handler. At this point
// decryption, decompression and deserialization are done and the data being passed is an event with which we can
// work
event.getManager().channel().pipeline()
.addAfter("fml:packet_handler", "processBreaks", new BlockBreakHandler(sbCounter));
}
示例2: onClientConnection
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void onClientConnection(ClientConnectedToServerEvent event){
try{
final TCVersion latest = VersionParser.getLatestVersion();
final String current = Reference.MOD_VERSION; //to be easily changeable for debugging
if(latest.isGreaterVersion(current)){
final ClientProxy cproxy = TaleCraft.proxy.asClient();
cproxy.sheduleClientTickTask(new Runnable(){
Minecraft mc = ClientProxy.mc;
@Override
public void run() {
while(mc.player == null){}
String message = TextFormatting.YELLOW + "TaleCraft version is outdated! Your version is " + TextFormatting.GOLD + current + TextFormatting.YELLOW + ". The latest is " + TextFormatting.GOLD + latest.getVersion() + TextFormatting.YELLOW + ".";
mc.player.sendMessage(new TextComponentString(message));
TaleCraft.logger.warn(TextFormatting.getTextWithoutFormattingCodes(message));
}
});
}
}catch(Exception e){
}
}
示例3: playerLoggedIn
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerLoggedIn(ClientConnectedToServerEvent event) {
lastIp = UniversalUtil.getRemoteAddress(event).toString().toLowerCase();
if (lastIp.contains(".hypixel.net") || lastIp.contains("209.222.115.14")) {
Autotip.onHypixel = true;
Tipper.waveCounter = 910;
Autotip.THREAD_POOL.submit(new StartLogin());
} else {
Autotip.onHypixel = false;
}
}
示例4: onClientConnectedToServerEvent
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onClientConnectedToServerEvent(ClientConnectedToServerEvent event)
{
Util.logger.info("Injecting vanilla packet interceptors...");
event.getManager().channel().pipeline().addBefore("packet_handler", "universalremote_join_game_handler", new JoinGameInterceptor(event.getManager()));
event.getManager().channel().pipeline().addBefore("packet_handler", "universalremote_respawn_handler", new RespawnInterceptor(event.getManager()));
}
示例5: clientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@Override
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) {
Minecraft.getMinecraft().addScheduledTask(new Runnable() {
public void run() {
EffectManager.register();
GuiHUDHandler.register();
ProxyClient.this.connectionTime = System.currentTimeMillis();
}
});
}
示例6: onClientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
/**
* Loads local models when connecting to the server
*/
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onClientConnect(ClientConnectedToServerEvent event)
{
Blockbuster.proxy.loadModels(Blockbuster.proxy.getPack());
}
示例7: clientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void clientConnect (ClientConnectedToServerEvent e) {
if (e.getConnectionType().equalsIgnoreCase("vanilla")) {
Seasons.enabled = false;
return;
} else
Seasons.enabled = true;
}
示例8: onPlayerJoinClient
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerJoinClient(final ClientConnectedToServerEvent event){
(new Thread(){
@Override
public void run(){
while(FMLClientHandler.instance().getClientPlayerEntity() == null)
try{
Thread.sleep(100);
}catch(InterruptedException e){
}
tryNotifyClient(FMLClientHandler.instance().getClientPlayerEntity());
}
}).start();
}
示例9: clientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) {
proxy.clientConnect(event);
}
示例10: clientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) {
// NOTHING SHOULD BE HERE - OVERRIDE IN ProxyClient!
}
示例11: onClientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void onClientConnect(ClientConnectedToServerEvent event)
{
TFC.proxy.onClientLogin();
}
示例12: playerConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
/**
* Invoked when the player joins a server. Starts the startup commands execution thread if
* the server is not the integrated server.
*/
@SubscribeEvent
public void playerConnect(ClientConnectedToServerEvent event) {
PacketHandlerClient.runStartupCommandsThread();
}
示例13: onDisconnectedFromServer
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
/** Resets all synced values of the settings after disconnecting. */
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onDisconnectedFromServer(ClientConnectedToServerEvent event)
{ _connected = true; }