当前位置: 首页>>代码示例>>Java>>正文


Java S3FPacketCustomPayload类代码示例

本文整理汇总了Java中net.minecraft.network.play.server.S3FPacketCustomPayload的典型用法代码示例。如果您正苦于以下问题:Java S3FPacketCustomPayload类的具体用法?Java S3FPacketCustomPayload怎么用?Java S3FPacketCustomPayload使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


S3FPacketCustomPayload类属于net.minecraft.network.play.server包,在下文中一共展示了S3FPacketCustomPayload类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: displayVillagerTradeGui

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void displayVillagerTradeGui(IMerchant villager)
{
    this.getNextWindowId();
    this.openContainer = new ContainerMerchant(this.inventory, villager, this.worldObj);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.onCraftGuiOpened(this);
    IInventory iinventory = ((ContainerMerchant)this.openContainer).getMerchantInventory();
    IChatComponent ichatcomponent = villager.getDisplayName();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:villager", ichatcomponent, iinventory.getSizeInventory()));
    MerchantRecipeList merchantrecipelist = villager.getRecipes(this);

    if (merchantrecipelist != null)
    {
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.currentWindowId);
        merchantrecipelist.writeToBuf(packetbuffer);
        this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", packetbuffer));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:EntityPlayerMP.java

示例2: channelRead0

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
@Override
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
{
    boolean handled = false;
    if (msg instanceof C17PacketCustomPayload)
    {
        handled = handleServerSideCustomPacket((C17PacketCustomPayload) msg, ctx);
    }
    else if (msg instanceof S3FPacketCustomPayload)
    {
        handled = handleClientSideCustomPacket((S3FPacketCustomPayload)msg, ctx);
    }
    else if (state != ConnectionState.CONNECTED && state != ConnectionState.HANDSHAKECOMPLETE)
    {
        handled = handleVanilla(msg);
    }
    if (!handled)
    {
        ctx.fireChannelRead(msg);
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:22,代码来源:NetworkDispatcher.java

示例3: displayGUIMerchant

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str)
{
    this.getNextWindowId();
    this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
    InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null));
    MerchantRecipeList var4 = par1IMerchant.getRecipes(this);

    if (var4 != null)
    {
        try
        {
            PacketBuffer var5 = new PacketBuffer(Unpooled.buffer());
            var5.writeInt(this.currentWindowId);
            var4.func_151391_a(var5);
            this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", var5));
        }
        catch (IOException var6)
        {
            logger.error("Couldn\'t send trade list", var6);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:EntityPlayerMP.java

示例4: sendNameUpdate

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void sendNameUpdate() {
	String name = this.dataWatcher.getWatchableObjectString(19);
	if (owner != null && name != null) {
		EntityPlayer o = (EntityPlayer) this.worldObj.getPlayerEntityByName(owner);
		if (o != null) {
			PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
			try {
				pb.writeInt(1);
				pb.writeInt(name.getBytes().length);
				pb.writeBytes(name.getBytes());
			} catch (Exception ex) {
				ex.printStackTrace();
			}

			S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarFam", pb);
			
			((EntityPlayerMP) o).playerNetServerHandler.sendPacket(packet);
		}
	}
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:21,代码来源:EntityFamiliar.java

示例5: sendDeathUpdate

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void sendDeathUpdate() {
	if (owner != null) {
		EntityPlayer o = (EntityPlayer) this.worldObj.getPlayerEntityByName(owner);
		if (o != null) {
			PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
			try {
				pb.writeInt(4);
			} catch (Exception ex) {
				ex.printStackTrace();
			}

			S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarFam", pb);
			
			((EntityPlayerMP) o).playerNetServerHandler.sendPacket(packet);
		}

	}
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:19,代码来源:EntityFamiliar.java

示例6: sendHealthUpdate

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void sendHealthUpdate() {
	if (owner != null) {
		EntityPlayer o = (EntityPlayer) this.worldObj.getPlayerEntityByName(owner);
		if (o != null) {
			PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
			try {
				pb.writeInt(2);
				pb.writeInt((int) this.getHealth());
			} catch (Exception ex) {
				ex.printStackTrace();
			}

			S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarFam", pb);
			
			((EntityPlayerMP) o).playerNetServerHandler.sendPacket(packet);
			
			this.healthlastsent = (int) this.getHealth();
		}
	}
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:21,代码来源:EntityFamiliar.java

示例7: sendMoodUpdate

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void sendMoodUpdate() {
	if (owner != null) {
		EntityPlayer o = (EntityPlayer) this.worldObj.getPlayerEntityByName(owner);
		if (o != null) {
			PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
			try {
				pb.writeInt(3);
				pb.writeInt(this.mood);
			} catch (Exception ex) {
				ex.printStackTrace();
			}

			S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarFam", pb);
			
			((EntityPlayerMP) o).playerNetServerHandler.sendPacket(packet);
			
			this.moodlastsent = this.mood;
		}
		
		
	}
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:23,代码来源:EntityFamiliar.java

示例8: syncGlidingSERVER

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void syncGlidingSERVER(int type, String name){ /*0 - add, 1 - remove*/
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("gliderdata".getBytes().length);
		pb.writeBytes("gliderdata".getBytes());
		pb.writeInt(type);
		pb.writeInt(name.getBytes().length);
		pb.writeBytes(name.getBytes());
	} catch (Exception ex) {
		ex.printStackTrace();
	}

	S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarMisc", pb);
	
	MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:17,代码来源:Data.java

示例9: spawnParticle

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public static void spawnParticle(String particle, World w, double x, double y, double z, int total, double size) {

		PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
		try {
			pb.writeInt(particle.getBytes().length);
			pb.writeBytes(particle.getBytes());
			pb.writeDouble(x);
			pb.writeDouble(y);
			pb.writeDouble(z);
			pb.writeInt(total);
			pb.writeDouble(size);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarPar", pb);
		
		MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);

	}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:21,代码来源:PacketSender.java

示例10: sendShield

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
/**
 * 
 * @param location - where the shield will spawn around
 * @param height - of the shield
 * @param radius - of the shield
 * @param yquality - Y axis quality, don't mess with please. Higher is better quality.
 * @param xzquality - XZ axis quality, feel free to experiment. It is the number of degrees between particle spawns in the circle. Lower is better quality. 6 is a good value.
 * @param chance - The chance of particles spawning, feel free to experiment. eg 10 is one tenth. Lower is better quality. 10 is a good value.
 * @param element - Element of the shield (water, air or fire)
 */
public static void sendShield(Location location, int height, int radius, int yquality, int xzquality, int chance, int element){
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("Avatar_shield".getBytes().length);
		pb.writeBytes("Avatar_shield".getBytes());
		pb.writeDouble(location.getX());
		pb.writeDouble(location.getY());
		pb.writeDouble(location.getZ());
		pb.writeInt(0);
		pb.writeDouble(0);
		pb.writeInt(height);
		pb.writeInt(radius);
		pb.writeInt(yquality); 
		pb.writeInt(xzquality); 
		pb.writeInt(chance); 
		pb.writeInt(element);
	} catch (Exception ex) {
		ex.printStackTrace();
	}

	S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarPar", pb);

	MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);	
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:35,代码来源:PacketSender.java

示例11: sendCircle

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public static void sendCircle(Location location, double radius, int xzquality, int chance, int element){
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("Avatar_circle".getBytes().length);
		pb.writeBytes("Avatar_circle".getBytes());
		pb.writeDouble(location.getX());
		pb.writeDouble(location.getY());
		pb.writeDouble(location.getZ());
		pb.writeInt(0);
		pb.writeDouble(0);
		pb.writeDouble(radius);
		pb.writeInt(xzquality); //XZ axis quality, feel free to experiment. It is the number of degrees between particle spawns in the circle. Lower is better quality. 6 is a good value.
		pb.writeInt(chance); //The chance of particles spawning, feel free to experiment. eg 10 is one tenth. Lower is better quality. 10 is a good value.
		pb.writeInt(element); //Element
	} catch (Exception ex) {
		ex.printStackTrace();
	}

	S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarPar", pb);

	MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);	
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:23,代码来源:PacketSender.java

示例12: sendDisc

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public static void sendDisc(Location location, int radius, int xzquality, int chance, int element){
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("Avatar_disc".getBytes().length);
		pb.writeBytes("Avatar_disc".getBytes());
		pb.writeDouble(location.getX());
		pb.writeDouble(location.getY());
		pb.writeDouble(location.getZ());
		pb.writeInt(0);
		pb.writeDouble(0);
		pb.writeInt(radius);
		pb.writeInt(xzquality); //XZ axis quality, feel free to experiment. It is the number of degrees between particle spawns in the circle. Lower is better quality. 6 is a good value.
		pb.writeInt(chance); //The chance of particles spawning, feel free to experiment. eg 10 is one tenth. Lower is better quality. 10 is a good value.
		pb.writeInt(element); //Element
	} catch (Exception ex) {
		ex.printStackTrace();
	}

	S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarPar", pb);

	MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);	
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:23,代码来源:PacketSender.java

示例13: sendVelocity

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public static void sendVelocity(Entity entity, double x, double y, double z) {

		PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
		try {
			pb.writeInt("velocity".getBytes().length);
			pb.writeBytes("velocity".getBytes());
			pb.writeInt(entity.getEntityId());
			pb.writeDouble(x);
			pb.writeDouble(y);
			pb.writeDouble(z);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarMisc", pb);

		MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);		

		entity.motionX = x;
		entity.motionY = y;
		entity.motionZ = z;
	}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:23,代码来源:PacketSender.java

示例14: sendIsBending

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public static void sendIsBending(Entity entity, boolean isBending, int element) {
	
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("isBending".getBytes().length);
		pb.writeBytes("isBending".getBytes());
		pb.writeBoolean(isBending);
		pb.writeInt(entity.getEntityId());
		pb.writeInt(element);
	} catch (Exception ex) {
		ex.printStackTrace();
	}

	S3FPacketCustomPayload packet = new S3FPacketCustomPayload("AvatarMisc", pb);

	MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(packet);
	
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:19,代码来源:PacketSender.java

示例15: sendSupportedChannels

import net.minecraft.network.play.server.S3FPacketCustomPayload; //导入依赖的package包/类
public void sendSupportedChannels(){
    if(netHandler == null){
        return;
    }
    Set<String> listening = NailedPlatform.instance().getMessenger().getIncomingChannels();
    if(!listening.isEmpty()){
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        for (String channel : listening) {
            try{
                stream.write(channel.getBytes(CharsetUtil.UTF_8));
                stream.write((byte) 0);
            }catch(IOException e){
                logger.error("Could not send Plugin Channel REGISTER to " + getName(), e);
            }
        }
        sendPacket(new S3FPacketCustomPayload("REGISTER", Unpooled.copiedBuffer(stream.toByteArray())));
    }
}
 
开发者ID:nailed,项目名称:nailed,代码行数:19,代码来源:NailedPlayer.java


注:本文中的net.minecraft.network.play.server.S3FPacketCustomPayload类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。