本文整理汇总了Java中net.minecraft.network.NetServerHandler类的典型用法代码示例。如果您正苦于以下问题:Java NetServerHandler类的具体用法?Java NetServerHandler怎么用?Java NetServerHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetServerHandler类属于net.minecraft.network包,在下文中一共展示了NetServerHandler类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: func_71747_b
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public void func_71747_b() {
for(int var1 = 0; var1 < this.field_71748_d.size(); ++var1) {
NetServerHandler var2 = (NetServerHandler)this.field_71748_d.get(var1);
try {
var2.func_72570_d();
} catch (Exception var6) {
if(var2.field_72575_b instanceof MemoryConnection) {
CrashReport var4 = CrashReport.func_85055_a(var6, "Ticking memory connection");
CrashReportCategory var5 = var4.func_85058_a("Ticking connection");
var5.func_71500_a("Connection", new CallableConnectionName(this, var2));
throw new ReportedException(var4);
}
this.field_71750_c.func_98033_al().func_98235_b("Failed to handle packet for " + var2.field_72574_e.func_70023_ak() + "/" + var2.field_72574_e.func_71114_r() + ": " + var6, var6);
var2.func_72565_c("Internal server error");
}
if(var2.field_72576_c) {
this.field_71748_d.remove(var1--);
}
var2.field_72575_b.func_74427_a();
}
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:NetworkListenThread.java
示例2: handleServerPacket
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public void handleServerPacket(NetServerHandler handler, short id, byte[] data, EntityPlayerMP player)
{
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(data));
try
{
switch(id)
{
case 0:
{
stream.readByte();
break;
}
}
}
catch(IOException e)
{
}
}
开发者ID:iChun,项目名称:MobVsMob,代码行数:20,代码来源:MapPacketHandler.java
示例3: serverSendPacket
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
@Deprecated
public static void serverSendPacket(NetServerHandler handler, Packet packet)
{
if (handler != null)
{
PacketDispatcher.sendPacketToPlayer(packet, (Player)handler.getPlayer());
}
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:ModLoader.java
示例4: onServerChatEvent
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public static ChatMessageComponent onServerChatEvent(NetServerHandler net, String raw, ChatMessageComponent comp)
{
ServerChatEvent event = new ServerChatEvent(net.playerEntity, raw, comp);
if (MinecraftForge.EVENT_BUS.post(event))
{
return null;
}
return event.component;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:10,代码来源:ForgeHooks.java
示例5: getNetworkManager
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
/**
* gets the INetworkManager associated with the given NetHandler
*
* @param netHandler the NetHandler to get the INetworkManager from
* @return the INetworkManager
*/
public static INetworkManager getNetworkManager(NetHandler netHandler) {
if (!netHandler.isServerHandler()) {
return SevenCommons.proxy.getNetworkManagerFromClient(netHandler);
} else if (netHandler instanceof NetServerHandler) {
return ((NetServerHandler) netHandler).netManager;
} else {
return ((NetLoginHandler) netHandler).myTCPConnection;
}
}
开发者ID:diesieben07,项目名称:SevenCommons,代码行数:16,代码来源:Network.java
示例6: handle
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
@Override
public void handle(NetHandler handler, Packet131MapData mapData)
{
int id = mapData.uniqueID;
if(handler instanceof NetServerHandler)
{
handleServerPacket((NetServerHandler)handler, mapData.uniqueID, mapData.itemData, (EntityPlayerMP)handler.getPlayer());
}
else
{
handleClientPacket((NetClientHandler)handler, mapData.uniqueID, mapData.itemData);
}
}
开发者ID:iChun,项目名称:MobVsMob,代码行数:14,代码来源:MapPacketHandler.java
示例7: handle
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
@Override
public void handle(NetHandler handler, Packet131MapData mapData) {
if (handler instanceof NetServerHandler)
ChiselEventHandler.place(handler.getPlayer(),
handler.getPlayer().worldObj);
}
开发者ID:delta534,项目名称:Chisel,代码行数:7,代码来源:TinyChiselPacketHandler.java
示例8: serverCustomPayload
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
@Override
@Deprecated
public void serverCustomPayload(NetServerHandler handler, Packet250CustomPayload packet)
{
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:7,代码来源:BaseMod.java
示例9: serverChat
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
/**
* Called when a chat message is received. Return true to stop further processing
*/
@Override
@Deprecated
public void serverChat(NetServerHandler source, String message)
{
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:BaseMod.java
示例10: serverChat
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
@Override
public Packet3Chat serverChat(NetHandler handler, Packet3Chat message)
{
mod.serverChat((NetServerHandler)handler, message.field_73476_b);
return message;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:7,代码来源:ModLoaderChatListener.java
示例11: CallablePacketID
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
CallablePacketID(NetServerHandler p_i1528_1_, Packet p_i1528_2_) {
this.field_98244_b = p_i1528_1_;
this.field_98245_a = p_i1528_2_;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:CallablePacketID.java
示例12: CallableConnectionName
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
CallableConnectionName(NetworkListenThread p_i1531_1_, NetServerHandler p_i1531_2_) {
this.field_111200_b = p_i1531_1_;
this.field_111201_a = p_i1531_2_;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:CallableConnectionName.java
示例13: CallablePacketClass
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
CallablePacketClass(NetServerHandler p_i1529_1_, Packet p_i1529_2_) {
this.field_98226_b = p_i1529_1_;
this.field_98227_a = p_i1529_2_;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:CallablePacketClass.java
示例14: func_71745_a
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public void func_71745_a(NetServerHandler p_71745_1_) {
this.field_71748_d.add(p_71745_1_);
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:NetworkListenThread.java
示例15: func_72355_a
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public void func_72355_a(INetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) {
NBTTagCompound var3 = this.func_72380_a(p_72355_2_);
p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK));
p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p);
String var4 = "local";
if(p_72355_1_.func_74430_c() != null) {
var4 = p_72355_1_.func_74430_c().toString();
}
this.field_72400_f.func_98033_al().func_98233_a(p_72355_2_.func_70005_c_() + "[" + var4 + "] logged in with entity id " + p_72355_2_.field_70157_k + " at (" + p_72355_2_.field_70165_t + ", " + p_72355_2_.field_70163_u + ", " + p_72355_2_.field_70161_v + ")");
WorldServer var5 = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
ChunkCoordinates var6 = var5.func_72861_E();
this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, var5);
NetServerHandler var7 = new NetServerHandler(this.field_72400_f, p_72355_1_, p_72355_2_);
var7.func_72567_b(new Packet1Login(p_72355_2_.field_70157_k, var5.func_72912_H().func_76067_t(), p_72355_2_.field_71134_c.func_73081_b(), var5.func_72912_H().func_76093_s(), var5.field_73011_w.field_76574_g, var5.field_73013_u, var5.func_72800_K(), this.func_72352_l()));
var7.func_72567_b(new Packet250CustomPayload("MC|Brand", this.func_72365_p().getServerModName().getBytes(Charsets.UTF_8)));
var7.func_72567_b(new Packet6SpawnPosition(var6.field_71574_a, var6.field_71572_b, var6.field_71573_c));
var7.func_72567_b(new Packet202PlayerAbilities(p_72355_2_.field_71075_bZ));
var7.func_72567_b(new Packet16BlockItemSwitch(p_72355_2_.field_71071_by.field_70461_c));
this.func_96456_a((ServerScoreboard)var5.func_96441_U(), p_72355_2_);
this.func_72354_b(p_72355_2_, var5);
this.func_92062_k(ChatMessageComponent.func_111082_b("multiplayer.player.joined", new Object[]{p_72355_2_.func_96090_ax()}).func_111059_a(EnumChatFormatting.YELLOW));
this.func_72377_c(p_72355_2_);
var7.func_72569_a(p_72355_2_.field_70165_t, p_72355_2_.field_70163_u, p_72355_2_.field_70161_v, p_72355_2_.field_70177_z, p_72355_2_.field_70125_A);
this.field_72400_f.func_71212_ac().func_71745_a(var7);
var7.func_72567_b(new Packet4UpdateTime(var5.func_82737_E(), var5.func_72820_D(), var5.func_82736_K().func_82766_b("doDaylightCycle")));
if(this.field_72400_f.func_71202_P().length() > 0) {
p_72355_2_.func_71115_a(this.field_72400_f.func_71202_P(), this.field_72400_f.func_71227_R());
}
Iterator var8 = p_72355_2_.func_70651_bq().iterator();
while(var8.hasNext()) {
PotionEffect var9 = (PotionEffect)var8.next();
var7.func_72567_b(new Packet41EntityEffect(p_72355_2_.field_70157_k, var9));
}
p_72355_2_.func_71116_b();
if(var3 != null && var3.func_74764_b("Riding")) {
Entity var10 = EntityList.func_75615_a(var3.func_74775_l("Riding"), var5);
if(var10 != null) {
var10.field_98038_p = true;
var5.func_72838_d(var10);
p_72355_2_.func_70078_a(var10);
var10.field_98038_p = false;
}
}
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:50,代码来源:ServerConfigurationManager.java
示例16: serverChat
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
@Override
public Packet3Chat serverChat(NetHandler handler, Packet3Chat message)
{
mod.serverChat((NetServerHandler)handler, message.message);
return message;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:7,代码来源:ModLoaderChatListener.java
示例17: initializeConnectionToPlayer
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public void initializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP)
{
NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(par2EntityPlayerMP);
par2EntityPlayerMP.setWorld(this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension));
par2EntityPlayerMP.theItemInWorldManager.setWorld((WorldServer)par2EntityPlayerMP.worldObj);
String s = "local";
if (par1INetworkManager.getSocketAddress() != null)
{
s = par1INetworkManager.getSocketAddress().toString();
}
this.mcServer.getLogAgent().logInfo(par2EntityPlayerMP.getCommandSenderName() + "[" + s + "] logged in with entity id " + par2EntityPlayerMP.entityId + " at (" + par2EntityPlayerMP.posX + ", " + par2EntityPlayerMP.posY + ", " + par2EntityPlayerMP.posZ + ")");
WorldServer worldserver = this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension);
ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
this.func_72381_a(par2EntityPlayerMP, (EntityPlayerMP)null, worldserver);
NetServerHandler netserverhandler = new NetServerHandler(this.mcServer, par1INetworkManager, par2EntityPlayerMP);
netserverhandler.sendPacketToPlayer(new Packet1Login(par2EntityPlayerMP.entityId, worldserver.getWorldInfo().getTerrainType(), par2EntityPlayerMP.theItemInWorldManager.getGameType(), worldserver.getWorldInfo().isHardcoreModeEnabled(), worldserver.provider.dimensionId, worldserver.difficultySetting, worldserver.getHeight(), this.getMaxPlayers()));
netserverhandler.sendPacketToPlayer(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8)));
netserverhandler.sendPacketToPlayer(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ));
netserverhandler.sendPacketToPlayer(new Packet202PlayerAbilities(par2EntityPlayerMP.capabilities));
netserverhandler.sendPacketToPlayer(new Packet16BlockItemSwitch(par2EntityPlayerMP.inventory.currentItem));
this.func_96456_a((ServerScoreboard)worldserver.getScoreboard(), par2EntityPlayerMP);
this.updateTimeAndWeatherForPlayer(par2EntityPlayerMP, worldserver);
this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[] {par2EntityPlayerMP.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
this.playerLoggedIn(par2EntityPlayerMP);
netserverhandler.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
this.mcServer.getNetworkThread().addPlayer(netserverhandler);
netserverhandler.sendPacketToPlayer(new Packet4UpdateTime(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));
if (this.mcServer.getTexturePack().length() > 0)
{
par2EntityPlayerMP.requestTexturePackLoad(this.mcServer.getTexturePack(), this.mcServer.textureSize());
}
Iterator iterator = par2EntityPlayerMP.getActivePotionEffects().iterator();
while (iterator.hasNext())
{
PotionEffect potioneffect = (PotionEffect)iterator.next();
netserverhandler.sendPacketToPlayer(new Packet41EntityEffect(par2EntityPlayerMP.entityId, potioneffect));
}
par2EntityPlayerMP.addSelfToInternalCraftingInventory();
FMLNetworkHandler.handlePlayerLogin(par2EntityPlayerMP, netserverhandler, par1INetworkManager);
if (nbttagcompound != null && nbttagcompound.hasKey("Riding"))
{
Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver);
if (entity != null)
{
entity.forceSpawn = true;
worldserver.spawnEntityInWorld(entity);
par2EntityPlayerMP.mountEntity(entity);
entity.forceSpawn = false;
}
}
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:61,代码来源:ServerConfigurationManager.java
示例18: serverCustomPayload
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public abstract void serverCustomPayload(NetServerHandler handler, Packet250CustomPayload packet);
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:2,代码来源:BaseModProxy.java
示例19: serverChat
import net.minecraft.network.NetServerHandler; //导入依赖的package包/类
public abstract void serverChat(NetServerHandler source, String message);
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:2,代码来源:BaseModProxy.java
注:本文中的net.minecraft.network.NetServerHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论