本文整理汇总了Java中net.minecraft.network.play.server.S1DPacketEntityEffect类的典型用法代码示例。如果您正苦于以下问题:Java S1DPacketEntityEffect类的具体用法?Java S1DPacketEntityEffect怎么用?Java S1DPacketEntityEffect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
S1DPacketEntityEffect类属于net.minecraft.network.play.server包,在下文中一共展示了S1DPacketEntityEffect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transferPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
/**
* moves provided player from overworld to nether or vice versa
*/
public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension)
{
int i = playerIn.dimension;
WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension);
playerIn.dimension = dimension;
WorldServer worldserver1 = this.mcServer.worldServerForDimension(playerIn.dimension);
playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, playerIn.worldObj.getDifficulty(), playerIn.worldObj.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType()));
worldserver.removePlayerEntityDangerously(playerIn);
playerIn.isDead = false;
this.transferEntityToWorld(playerIn, i, worldserver, worldserver1);
this.preparePlayer(playerIn, worldserver);
playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch);
playerIn.theItemInWorldManager.setWorld(worldserver1);
this.updateTimeAndWeatherForPlayer(playerIn, worldserver1);
this.syncPlayerInventory(playerIn);
for (PotionEffect potioneffect : playerIn.getActivePotionEffects())
{
playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect));
}
}
示例2: transferPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
{
int var3 = par1EntityPlayerMP.dimension;
WorldServer var4 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
par1EntityPlayerMP.dimension = par2;
WorldServer var5 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S07PacketRespawn(par1EntityPlayerMP.dimension, par1EntityPlayerMP.worldObj.difficultySetting, par1EntityPlayerMP.worldObj.getWorldInfo().getTerrainType(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
var4.removePlayerEntityDangerously(par1EntityPlayerMP);
par1EntityPlayerMP.isDead = false;
this.transferEntityToWorld(par1EntityPlayerMP, var3, var4, var5);
this.func_72375_a(par1EntityPlayerMP, var4);
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
par1EntityPlayerMP.theItemInWorldManager.setWorld(var5);
this.updateTimeAndWeatherForPlayer(par1EntityPlayerMP, var5);
this.syncPlayerInventory(par1EntityPlayerMP);
Iterator var6 = par1EntityPlayerMP.getActivePotionEffects().iterator();
while (var6.hasNext())
{
PotionEffect var7 = (PotionEffect)var6.next();
par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(par1EntityPlayerMP.getEntityId(), var7));
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:24,代码来源:ServerConfigurationManager.java
示例3: teleportPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public static void teleportPlayerToDimension(EntityPlayerMP player, int dimension, ServerConfigurationManager manager) {
int oldDim = player.dimension;
WorldServer worldserver = manager.getServerInstance().worldServerForDimension(player.dimension);
player.dimension = dimension;
WorldServer worldserver1 = manager.getServerInstance().worldServerForDimension(player.dimension);
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
worldserver.removePlayerEntityDangerously(player);
player.isDead = false;
teleportEntityToWorld(player, worldserver, worldserver1);
manager.func_72375_a(player, worldserver);
player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
player.theItemInWorldManager.setWorld(worldserver1);
manager.updateTimeAndWeatherForPlayer(player, worldserver1);
manager.syncPlayerInventory(player);
Iterator<PotionEffect> iterator = player.getActivePotionEffects().iterator();
while (iterator.hasNext()) {
PotionEffect potioneffect = iterator.next();
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDim, dimension);
}
示例4: transferPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public void transferPlayerToDimension(EntityPlayerMP p_72356_1_, int p_72356_2_, Teleporter teleporter)
{
int j = p_72356_1_.dimension;
WorldServer worldserver = this.mcServer.worldServerForDimension(p_72356_1_.dimension);
p_72356_1_.dimension = p_72356_2_;
WorldServer worldserver1 = this.mcServer.worldServerForDimension(p_72356_1_.dimension);
p_72356_1_.playerNetServerHandler.sendPacket(new S07PacketRespawn(p_72356_1_.dimension, p_72356_1_.worldObj.difficultySetting, p_72356_1_.worldObj.getWorldInfo().getTerrainType(), p_72356_1_.theItemInWorldManager.getGameType()));
worldserver.removePlayerEntityDangerously(p_72356_1_);
p_72356_1_.isDead = false;
this.transferEntityToWorld(p_72356_1_, j, worldserver, worldserver1, teleporter);
this.func_72375_a(p_72356_1_, worldserver);
p_72356_1_.playerNetServerHandler.setPlayerLocation(p_72356_1_.posX, p_72356_1_.posY, p_72356_1_.posZ, p_72356_1_.rotationYaw, p_72356_1_.rotationPitch);
p_72356_1_.theItemInWorldManager.setWorld(worldserver1);
this.updateTimeAndWeatherForPlayer(p_72356_1_, worldserver1);
this.syncPlayerInventory(p_72356_1_);
Iterator iterator = p_72356_1_.getActivePotionEffects().iterator();
while (iterator.hasNext())
{
PotionEffect potioneffect = (PotionEffect)iterator.next();
p_72356_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(p_72356_1_.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, j, p_72356_2_);
}
示例5: transferPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
/**
* Transfers a player to a new dimension preserving potion effects and motion.
*/
public static void transferPlayerToDimension(EntityPlayerMP player, int dim) {
ServerConfigurationManager configManager = player.mcServer.getConfigurationManager();
int oldDimension = player.dimension;
WorldServer oldWorldServer = configManager.getServerInstance().worldServerForDimension(oldDimension);
WorldServer newWorldServer = configManager.getServerInstance().worldServerForDimension(dim);
player.dimension = dim;
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
oldWorldServer.removePlayerEntityDangerously(player);
player.isDead = false;
transferPlayerToWorld(player, oldWorldServer, newWorldServer);
configManager.func_72375_a(player, oldWorldServer);
player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
player.theItemInWorldManager.setWorld(newWorldServer);
configManager.updateTimeAndWeatherForPlayer(player, newWorldServer);
configManager.syncPlayerInventory(player);
for (PotionEffect potioneffect : (Iterable<PotionEffect>) player.getActivePotionEffects()) {
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDimension, dim);
}
示例6: handleEntityEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public void handleEntityEffect(S1DPacketEntityEffect packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityLivingBase)
{
PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f());
potioneffect.setPotionDurationMax(packetIn.func_149429_c());
((EntityLivingBase)entity).addPotionEffect(potioneffect);
}
}
示例7: handleEntityEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public void handleEntityEffect(S1DPacketEntityEffect packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityLivingBase) {
PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(),
packetIn.getAmplifier(), false, packetIn.func_179707_f());
potioneffect.setPotionDurationMax(packetIn.func_149429_c());
((EntityLivingBase) entity).addPotionEffect(potioneffect);
}
}
示例8: teleportPlayerTo
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public static void teleportPlayerTo(EntityPlayerMP player, Coord4D coord, TileEntityTeleporter teleporter)
{
if(player.dimension != coord.dimensionId)
{
int id = player.dimension;
WorldServer oldWorld = player.mcServer.worldServerForDimension(player.dimension);
player.dimension = coord.dimensionId;
WorldServer newWorld = player.mcServer.worldServerForDimension(player.dimension);
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorld.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
oldWorld.removePlayerEntityDangerously(player);
player.isDead = false;
if(player.isEntityAlive())
{
newWorld.spawnEntityInWorld(player);
player.setLocationAndAngles(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
newWorld.updateEntityWithOptionalForce(player, false);
player.setWorld(newWorld);
}
player.mcServer.getConfigurationManager().func_72375_a(player, oldWorld);
player.playerNetServerHandler.setPlayerLocation(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
player.theItemInWorldManager.setWorld(newWorld);
player.mcServer.getConfigurationManager().updateTimeAndWeatherForPlayer(player, newWorld);
player.mcServer.getConfigurationManager().syncPlayerInventory(player);
Iterator iterator = player.getActivePotionEffects().iterator();
while(iterator.hasNext())
{
PotionEffect potioneffect = (PotionEffect)iterator.next();
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, id, coord.dimensionId);
}
else {
player.playerNetServerHandler.setPlayerLocation(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
}
}
示例9: handleEntityEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public void handleEntityEffect(S1DPacketEntityEffect p_147260_1_)
{
Entity var2 = this.clientWorldController.getEntityByID(p_147260_1_.func_149426_d());
if (var2 instanceof EntityLivingBase)
{
PotionEffect var3 = new PotionEffect(p_147260_1_.func_149427_e(), p_147260_1_.func_149425_g(), p_147260_1_.func_149428_f());
var3.setPotionDurationMax(p_147260_1_.func_149429_c());
((EntityLivingBase)var2).addPotionEffect(var3);
}
}
示例10: transferPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public static void transferPlayerToDimension(EntityPlayerMP player, int newDim, Coord6D dest)
{
int j = player.dimension;
ServerConfigurationManager manager = MinecraftServer.getServer().getConfigurationManager();
WorldServer oldServer = MinecraftServer.getServer().worldServerForDimension(player.dimension);
player.dimension = newDim;
WorldServer newServer = MinecraftServer.getServer().worldServerForDimension(player.dimension);
// Let's load the chunk for the player. That would probably be swell.
Chunk c = newServer.getChunkFromBlockCoords((int)Math.floor(dest.x), (int)Math.floor(dest.y));
int cX = c.xPosition;
int cZ = c.zPosition;
newServer.getChunkProvider().loadChunk(cX, cZ);
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
oldServer.removePlayerEntityDangerously(player);
player.isDead = false;
transferEntityToWorld(player, j, oldServer, newServer, dest);
manager.func_72375_a(player, oldServer);
player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
player.theItemInWorldManager.setWorld(newServer);
manager.updateTimeAndWeatherForPlayer(player, newServer);
manager.syncPlayerInventory(player);
Iterator iterator = player.getActivePotionEffects().iterator();
while (iterator.hasNext())
{
PotionEffect potioneffect = (PotionEffect)iterator.next();
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, j, newDim);
}
示例11: handleEntityEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public void handleEntityEffect(S1DPacketEntityEffect p_147260_1_)
{
Entity entity = this.clientWorldController.getEntityByID(p_147260_1_.func_149426_d());
if (entity instanceof EntityLivingBase)
{
PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e(), p_147260_1_.func_149425_g(), p_147260_1_.func_149428_f());
potioneffect.setPotionDurationMax(p_147260_1_.func_149429_c());
((EntityLivingBase)entity).addPotionEffect(potioneffect);
}
}
示例12: onNewPotionEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
protected void onNewPotionEffect(PotionEffect id)
{
super.onNewPotionEffect(id);
this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), id));
}
示例13: onChangedPotionEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
protected void onChangedPotionEffect(PotionEffect id, boolean p_70695_2_)
{
super.onChangedPotionEffect(id, p_70695_2_);
this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), id));
}
示例14: teleportPlayerToDim
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public static Entity teleportPlayerToDim(World oldWorld, int newWorldID, double d, double e, double f, Entity entity) {
if (entity != null) {
if (entity.timeUntilPortal <= 0) {
WorldServer oldWorldServer = MinecraftServer.getServer().worldServerForDimension(entity.dimension);
WorldServer newWorldServer = MinecraftServer.getServer().worldServerForDimension(newWorldID);
if (entity instanceof EntityPlayer) {
EntityPlayerMP player = (EntityPlayerMP) entity;
if (!player.worldObj.isRemote) {
player.worldObj.theProfiler.startSection("portal");
player.worldObj.theProfiler.startSection("changeDimension");
ServerConfigurationManager config = player.mcServer.getConfigurationManager();
player.closeScreen();
player.dimension = newWorldServer.provider.dimensionId;
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorldServer.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
oldWorldServer.removeEntity(player);
player.isDead = false;
player.setLocationAndAngles(d, e, f, player.rotationYaw, player.rotationPitch);
newWorldServer.spawnEntityInWorld(player);
player.setWorld(newWorldServer);
config.func_72375_a(player, oldWorldServer);
player.playerNetServerHandler.setPlayerLocation(d, e, f, entity.rotationYaw, entity.rotationPitch);
player.theItemInWorldManager.setWorld(newWorldServer);
config.updateTimeAndWeatherForPlayer(player, newWorldServer);
config.syncPlayerInventory(player);
player.worldObj.theProfiler.endSection();
oldWorldServer.resetUpdateEntityTick();
newWorldServer.resetUpdateEntityTick();
player.worldObj.theProfiler.endSection();
for (Iterator<PotionEffect> potion = player.getActivePotionEffects().iterator(); potion.hasNext(); ) {
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potion.next()));
}
player.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel));
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldWorldServer.provider.dimensionId, player.dimension);
player.timeUntilPortal = 150;
}
player.worldObj.theProfiler.endSection();
return player;
}
}
}
return null;
}
示例15: transferPlayerToDimension
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入依赖的package包/类
public static void transferPlayerToDimension(EntityPlayerMP player, int dim, ServerConfigurationManager manager, Environment environ) {
int oldDim = player.dimension;
WorldServer worldserver = manager.getServerInstance().worldServerForDimension(player.dimension);
player.dimension = dim;
WorldServer worldserver1 = manager.getServerInstance().worldServerForDimension(player.dimension);
// Cauldron dont crash the client, let 'em know there's a new dimension in town
if (DimensionManager.isBukkitDimension(dim))
{
FMLEmbeddedChannel serverChannel = ForgeNetworkHandler.getServerChannel();
serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
serverChannel.writeOutbound(new ForgeMessage.DimensionRegisterMessage(dim, environ.getId()));
}
// Cauldron end
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(dim, worldserver1.difficultySetting, worldserver1.getWorldInfo()
.getTerrainType(), player.theItemInWorldManager.getGameType()));
player.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel));
worldserver.removePlayerEntityDangerously(player);
if (player.riddenByEntity != null) {
player.riddenByEntity.mountEntity(null);
}
if (player.ridingEntity != null) {
player.mountEntity(null);
}
player.isDead = false;
transferEntityToWorld(player, worldserver, worldserver1);
manager.func_72375_a(player, worldserver);
player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
player.theItemInWorldManager.setWorld(worldserver1);
manager.updateTimeAndWeatherForPlayer(player, worldserver1);
manager.syncPlayerInventory(player);
Iterator<PotionEffect> iterator = player.getActivePotionEffects().iterator();
while (iterator.hasNext()) {
PotionEffect potioneffect = iterator.next();
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDim, dim);
}