本文整理汇总了Java中net.minecraft.network.play.server.S12PacketEntityVelocity类的典型用法代码示例。如果您正苦于以下问题:Java S12PacketEntityVelocity类的具体用法?Java S12PacketEntityVelocity怎么用?Java S12PacketEntityVelocity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
S12PacketEntityVelocity类属于net.minecraft.network.play.server包,在下文中一共展示了S12PacketEntityVelocity类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
/**
* Sets the velocity of the specified entity to the specified value
*/
public void handleEntityVelocity(S12PacketEntityVelocity packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());
if (Minecraft.getMinecraft().thePlayer == entity) {
EventPlayerVelocity eventPlayerVelocity = new EventPlayerVelocity(100, 100);
eventPlayerVelocity.call();
if (eventPlayerVelocity.isCancelled()) {
return;
}
} else if (entity != null) {
entity.setVelocity((packetIn.getMotionX() * 100 / 100) / 8000.0D,
(packetIn.getMotionY() * 100 / 100) / 8000.0D, (packetIn.getMotionZ() * 100 / 100) / 8000.0D);
}
}
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:NetHandlerPlayClient.java
示例2: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
/**
* Sets the velocity of the specified entity to the specified value
*/
public void handleEntityVelocity(S12PacketEntityVelocity p_147244_1_)
{
final EventPacketReceive eventPacket = new EventPacketReceive(p_147244_1_);
eventPacket.onEvent();
if(eventPacket.isCancelled()){
eventPacket.setCancelled(false);
return;
}
Entity var2 = this.clientWorldController.getEntityByID(p_147244_1_.func_149412_c());
if (var2 != null)
{
var2.setVelocity((double)p_147244_1_.func_149411_d() / 8000.0D, (double)p_147244_1_.func_149410_e() / 8000.0D, (double)p_147244_1_.func_149409_f() / 8000.0D);
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:22,代码来源:NetHandlerPlayClient.java
示例3: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
/**
* Sets the velocity of the specified entity to the specified value
*/
public void handleEntityVelocity(S12PacketEntityVelocity packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());
if (entity != null)
{
entity.setVelocity((double)packetIn.getMotionX() / 8000.0D, (double)packetIn.getMotionY() / 8000.0D, (double)packetIn.getMotionZ() / 8000.0D);
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:NetHandlerPlayClient.java
示例4: onPacketReceive
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
@EventTarget
private void onPacketReceive(PacketReceiveEvent event) {
S12PacketEntityVelocity packet;
if (event.packet instanceof S12PacketEntityVelocity && this.mc.theWorld.getEntityByID((packet = (S12PacketEntityVelocity)event.packet).getEntityID()) == this.mc.thePlayer) {
if (this.percent > 0.0) {
packet.motionX = (int)((double)packet.motionX * (this.percent / 100.0));
packet.motionY = (int)((double)packet.motionY * (this.percent / 100.0));
packet.motionZ = (int)((double)packet.motionZ * (this.percent / 100.0));
} else {
event.setCancelled(true);
}
}
}
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:Velocity.java
示例5: onPacketReceive
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
@Override
public void onPacketReceive(EventPacketReceive event){
Packet eventPacket = event.getPacket();
if(eventPacket instanceof S12PacketEntityVelocity){
event.setCancelled(true);
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:8,代码来源:ModuleNoKnockback.java
示例6: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
public void handleEntityVelocity(S12PacketEntityVelocity p_147244_1_)
{
Entity entity = this.clientWorldController.getEntityByID(p_147244_1_.func_149412_c());
if (entity != null)
{
entity.setVelocity((double)p_147244_1_.func_149411_d() / 8000.0D, (double)p_147244_1_.func_149410_e() / 8000.0D, (double)p_147244_1_.func_149409_f() / 8000.0D);
}
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:10,代码来源:NetHandlerPlayClient.java
示例7: onImpact
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
@Override
protected void onImpact(MovingObjectPosition mop) {
if (mop.typeOfHit == MovingObjectType.BLOCK) {
BlockPos pos = mop.getBlockPos();
Material m = worldObj.getBlockState(pos).getBlock().getMaterial();
if (m == Material.leaves) {
if (!worldObj.isRemote && canGrief && Config.canDekuDenude()) {
worldObj.destroyBlock(pos, true);
}
} else if (m.blocksMovement()) {
if (mop.sideHit == EnumFacing.UP) {
posY = pos.getY() + 1;
rotationPitch = 0.0F;
motionY = 0.0D;
} else {
setDead();
releaseDrops();
}
}
} else if (mop.entityHit != null && (mop.entityHit != getThrower() || ticksExisted >= 5)) {
if (getDamage() > 0.0F && !affectedEntities.contains(mop.entityHit.getEntityId())) {
mop.entityHit.attackEntityFrom(getDamageSource(), getDamage());
affectedEntities.add(mop.entityHit.getEntityId());
}
if (!(mop.entityHit instanceof EntityLivingBase) || rand.nextFloat() > ((EntityLivingBase) mop.entityHit).getAttributeMap().getAttributeInstance(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) {
mop.entityHit.motionX = this.motionX * 1.8D;
mop.entityHit.motionY = this.motionY + 0.5D;
mop.entityHit.motionZ = this.motionZ * 1.8D;
mop.entityHit.rotationYaw += 30.0F * this.ticksExisted;
if (mop.entityHit instanceof EntityPlayerMP && !worldObj.isRemote) {
((EntityPlayerMP) mop.entityHit).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(mop.entityHit));
}
}
}
}
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:36,代码来源:EntityCyclone.java
示例8: onImpact
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
/**
* Called on the server from {@link DashImpactPacket} to process the impact data from the client
* @param player Player's motionX and motionZ have been set by the packet, so the values may be used
* @param mop Null assumes a block was hit (none of the block data is needed, so it is not sent),
* or a valid MovingObjectPosition for the entity hit
*/
public void onImpact(World world, EntityPlayer player, MovingObjectPosition mop) {
if (mop != null && mop.typeOfHit == MovingObjectType.ENTITY) {
target = mop.entityHit;
double dist = target.getDistance(initialPosition.xCoord, initialPosition.yCoord, initialPosition.zCoord);
// Subtract half the width for each entity to account for their bounding box size
dist -= (target.width / 2.0F) + (player.width / 2.0F);
// Base player speed is 0.1D; heavy boots = 0.04D, pegasus = 0.13D
double speed = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.movementSpeed).getAttributeValue();
double sf = (1.0D + (speed - BASE_MOVE)); // speed factor
if (speed > 0.075D && dist > getMinDistance() && player.getDistanceSqToEntity(target) < 6.0D) {
float dmg = (float) getDamage() + (float)((dist / 2.0D) - 2.0D);
impactTime = 5; // time player will be immune to damage from the target entity
target.attackEntityFrom(DamageUtils.causeNonSwordDamage(player), (float)(dmg * sf * sf));
double resist = 1.0D;
if (target instanceof EntityLivingBase) {
resist -= ((EntityLivingBase) target).getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue();
}
double k = sf * resist * (distance / 3.0F) * 0.6000000238418579D;
target.addVelocity(player.motionX * k * (0.2D + (0.1D * level)), 0.1D + k * (level * 0.025D), player.motionZ * k * (0.2D + (0.1D * level)));
// if player, send velocity update to client
if (target instanceof EntityPlayerMP && !player.worldObj.isRemote) {
((EntityPlayerMP) target).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(target));
}
}
}
WorldUtils.playSoundAtEntity(player, Sounds.SLAM, 0.4F, 0.5F);
setNotDashing();
}
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:35,代码来源:Dash.java
示例9: getPacketVelocityEntityId
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
public int getPacketVelocityEntityId(S12PacketEntityVelocity p){
return p.func_149412_c();
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:4,代码来源:MethodInvoker.java
示例10: getXMovePacketVel
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
public int getXMovePacketVel(S12PacketEntityVelocity p){
return p.func_149411_d();
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:4,代码来源:MethodInvoker.java
示例11: getYMovePacketVel
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
public int getYMovePacketVel(S12PacketEntityVelocity p){
return p.func_149410_e();
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:4,代码来源:MethodInvoker.java
示例12: getZMovePacketVel
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
public int getZMovePacketVel(S12PacketEntityVelocity p){
return p.func_149409_f();
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:4,代码来源:MethodInvoker.java
示例13: entityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
@Override
public Packet entityVelocity(int entityID, double motX, double motY, double motZ) {
return (Packet) new S12PacketEntityVelocity(entityID, motX, motY, motZ);
}
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:NeptunePacketFactory.java
示例14: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
/**
* Sets the velocity of the specified entity to the specified value
*/
void handleEntityVelocity(S12PacketEntityVelocity packetIn);
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:INetHandlerPlayClient.java
示例15: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
/**
* Sets the velocity of the specified entity to the specified value
*/
void handleEntityVelocity(S12PacketEntityVelocity var1);
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:INetHandlerPlayClient.java
示例16: handleEntityVelocity
import net.minecraft.network.play.server.S12PacketEntityVelocity; //导入依赖的package包/类
void handleEntityVelocity(S12PacketEntityVelocity p_147244_1_);
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:INetHandlerPlayClient.java
注:本文中的net.minecraft.network.play.server.S12PacketEntityVelocity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论