本文整理汇总了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));
}
开发者ID:Maxopoly,项目名称:OreLogger,代码行数:14,代码来源:Listener.java
示例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){
}
}
开发者ID:tiffit,项目名称:TaleCraft,代码行数:23,代码来源:SendMessage.java
示例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;
}
}
开发者ID:Semx11,项目名称:Autotip,代码行数:12,代码来源:HypixelListener.java
示例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()));
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:10,代码来源:VanillaPacketInterceptorInjector.java
示例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();
}
});
}
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:11,代码来源:ProxyClient.java
示例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());
}
开发者ID:mchorse,项目名称:blockbuster,代码行数:10,代码来源:ModelHandler.java
示例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;
}
开发者ID:EdwinMindcraft,项目名称:SeasonsAPI,代码行数:9,代码来源:WorldHandler.java
示例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();
}
开发者ID:therealfarfetchd,项目名称:IngameAccountSwitcher,代码行数:16,代码来源:VersionChecker.java
示例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);
}
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:DSurround.java
示例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!
}
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:4,代码来源:Proxy.java
示例11: onClientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; //导入依赖的package包/类
@SubscribeEvent
public void onClientConnect(ClientConnectedToServerEvent event)
{
TFC.proxy.onClientLogin();
}
开发者ID:Deadrik,项目名称:TFC2,代码行数:6,代码来源:PlayerTracker.java
示例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();
}
开发者ID:MrNobody98,项目名称:morecommands,代码行数:9,代码来源:ClientHandler.java
示例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; }
开发者ID:copygirl,项目名称:WearableBackpacks,代码行数:6,代码来源:BackpacksConfig.java
注:本文中的net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论