本文整理汇总了Java中net.minecraft.network.play.client.C02PacketUseEntity类的典型用法代码示例。如果您正苦于以下问题:Java C02PacketUseEntity类的具体用法?Java C02PacketUseEntity怎么用?Java C02PacketUseEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
C02PacketUseEntity类属于net.minecraft.network.play.client包,在下文中一共展示了C02PacketUseEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: attack
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
private void attack(final EntityLivingBase ent, final boolean crit) {
this.swingItem();
if (crit) {
this.crit();
}
else {
this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer());
}
final float sharpLevel = EnchantmentHelper.func_152377_a(this.mc.thePlayer.getHeldItem(), ent.getCreatureAttribute());
final boolean vanillaCrit = this.mc.thePlayer.fallDistance > 0.0f && !this.mc.thePlayer.onGround && !this.mc.thePlayer.isOnLadder() && !this.mc.thePlayer.isInWater() && !this.mc.thePlayer.isPotionActive(Potion.blindness) && this.mc.thePlayer.ridingEntity == null;
this.mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(ent, C02PacketUseEntity.Action.ATTACK));
if (crit || vanillaCrit) {
this.mc.thePlayer.onCriticalHit(ent);
}
if (sharpLevel > 0.0f) {
this.mc.thePlayer.onEnchantmentCritical(ent);
}
}
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:Aura.java
示例2: attackEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Attacks an entity
*/
public void attackEntity(EntityPlayer playerIn, Entity targetEntity)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK));
if (this.currentGameType != WorldSettings.GameType.SPECTATOR)
{
playerIn.attackTargetEntityWithCurrentItem(targetEntity);
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:PlayerControllerMP.java
示例3: interactWithEntitySendPacket
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Send packet to server - player is interacting with another entity (left click)
*/
public boolean interactWithEntitySendPacket(EntityPlayer playerIn, Entity targetEntity)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.INTERACT));
return this.currentGameType != WorldSettings.GameType.SPECTATOR && playerIn.interactWith(targetEntity);
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:PlayerControllerMP.java
示例4: func_178894_a
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public boolean func_178894_a(EntityPlayer p_178894_1_, Entity p_178894_2_, MovingObjectPosition p_178894_3_)
{
this.syncCurrentPlayItem();
Vec3 vec3 = new Vec3(p_178894_3_.hitVec.xCoord - p_178894_2_.posX, p_178894_3_.hitVec.yCoord - p_178894_2_.posY, p_178894_3_.hitVec.zCoord - p_178894_2_.posZ);
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_178894_2_, vec3));
return this.currentGameType != WorldSettings.GameType.SPECTATOR && p_178894_2_.interactAt(p_178894_1_, vec3);
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:PlayerControllerMP.java
示例5: onPostUpdate
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
@EventTarget
private void onPostUpdate(UpdateEvent event) {
if (event.state == Event.State.POST && (autoclicker && Mouse.isButtonDown((int)0) || !autoclicker) && this.mc.objectMouseOver != null && this.mc.objectMouseOver.entityHit != null && this.attackChecks(this.mc.objectMouseOver.entityHit) && this.timer.delay((float)(1000.0 / this.speed))) {
if (this.criticals) {
this.crit();
}
this.mc.thePlayer.swingItem();
this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C02PacketUseEntity(this.mc.objectMouseOver.entityHit, C02PacketUseEntity.Action.ATTACK));
this.timer.reset();
}
}
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:TriggerBot.java
示例6: onPacketSend
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
@EventTarget
private void onPacketSend(PacketSendEvent event) {
if (event.packet instanceof C0BPacketEntityAction || event.packet instanceof C03PacketPlayer || event.packet instanceof C02PacketUseEntity || event.packet instanceof C0APacketAnimation || event.packet instanceof C08PacketPlayerBlockPlacement) {
this.packetList.add(event.packet);
event.setCancelled(true);
}
}
开发者ID:SkidJava,项目名称:BaseClient,代码行数:8,代码来源:Blink.java
示例7: FriendProtect
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public FriendProtect() {
super("Friend Protect", 0xFFF6194A, ModuleCategory.COMBAT);
setHidden(true);
listeners.add(new Listener<SendPacket>() {
@Override
public void call(SendPacket event) {
if (event.getPacket() instanceof C02PacketUseEntity) {
C02PacketUseEntity useEntity = (C02PacketUseEntity) event.getPacket();
Entity entity = useEntity.getEntityFromWorld(mc.theWorld);
if (useEntity.getAction() == C02PacketUseEntity.Action.ATTACK && Serenity.getInstance().getFriendManager().isFriend(entity.getCommandSenderName())) {
ItemStack currentItem = mc.thePlayer.getCurrentEquippedItem();
Item item = currentItem == null ? null : currentItem.getItem();
if (minezHealing.getValue()) {
if (item != null && (item == Items.paper || (item == Items.dye) || item == Items.shears)) {
return;
}
}
if (swordsOnly.getValue() && (item instanceof ItemSword)) {
return;
}
if (notify.getValue()) {
Serenity.getInstance().addChatMessage(String.format("%s is your friend.", entity.getCommandSenderName()));
}
event.setCancelled(true);
}
}
}
});
setState(true);
}
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:36,代码来源:FriendProtect.java
示例8: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
* equipped item
*/
public void processUseEntity(C02PacketUseEntity p_147340_1_)
{
WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension);
Entity var3 = p_147340_1_.func_149564_a(var2);
this.playerEntity.func_143004_u();
if (var3 != null)
{
boolean var4 = this.playerEntity.canEntityBeSeen(var3);
double var5 = 36.0D;
if (!var4)
{
var5 = 9.0D;
}
if (this.playerEntity.getDistanceSqToEntity(var3) < var5)
{
if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.INTERACT)
{
this.playerEntity.interactWith(var3);
}
else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK)
{
if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity)
{
this.kickPlayerFromServer("Attempting to attack an invalid entity");
this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity");
return;
}
this.playerEntity.attackTargetEntityWithCurrentItem(var3);
}
}
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:41,代码来源:NetHandlerPlayServer.java
示例9: attackEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Attacks an entity
*/
public void attackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(par2Entity, C02PacketUseEntity.Action.ATTACK));
par1EntityPlayer.attackTargetEntityWithCurrentItem(par2Entity);
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:PlayerControllerMP.java
示例10: interactWithEntitySendPacket
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Send packet to server - player is interacting with another entity (left click)
*/
public boolean interactWithEntitySendPacket(EntityPlayer par1EntityPlayer, Entity par2Entity)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(par2Entity, C02PacketUseEntity.Action.INTERACT));
return par1EntityPlayer.interactWith(par2Entity);
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:PlayerControllerMP.java
示例11: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public void processUseEntity(C02PacketUseEntity p_147340_1_)
{
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
Entity entity = p_147340_1_.func_149564_a(worldserver);
this.playerEntity.func_143004_u();
if (entity != null)
{
boolean flag = this.playerEntity.canEntityBeSeen(entity);
double d0 = 36.0D;
if (!flag)
{
d0 = 9.0D;
}
if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
{
if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.INTERACT)
{
this.playerEntity.interactWith(entity);
}
else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK)
{
if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
{
this.kickPlayerFromServer("Attempting to attack an invalid entity");
this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity");
return;
}
this.playerEntity.attackTargetEntityWithCurrentItem(entity);
}
}
}
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:37,代码来源:NetHandlerPlayServer.java
示例12: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
* equipped item
*/
public void processUseEntity(C02PacketUseEntity packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
Entity entity = packetIn.getEntityFromWorld(worldserver);
this.playerEntity.markPlayerActive();
if (entity != null)
{
boolean flag = this.playerEntity.canEntityBeSeen(entity);
double d0 = 36.0D;
if (!flag)
{
d0 = 9.0D;
}
if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
{
if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT)
{
this.playerEntity.interactWith(entity);
}
else if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT_AT)
{
entity.interactAt(this.playerEntity, packetIn.getHitVec());
}
else if (packetIn.getAction() == C02PacketUseEntity.Action.ATTACK)
{
if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity)
{
this.kickPlayerFromServer("Attempting to attack an invalid entity");
this.serverController.logWarning("Player " + this.playerEntity.getName() + " tried to attack an invalid entity");
return;
}
this.playerEntity.attackTargetEntityWithCurrentItem(entity);
}
}
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:46,代码来源:NetHandlerPlayServer.java
示例13: attackEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_)
{
syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK));
p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:7,代码来源:PlayerControllerMP.java
示例14: interactWithEntitySendPacket
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_)
{
syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT));
return p_78768_1_.interactWith(p_78768_2_);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:7,代码来源:PlayerControllerMP.java
示例15: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
@Override
public void processUseEntity(C02PacketUseEntity p_147340_1_) {
}
开发者ID:makeoo,项目名称:Gadomancy,代码行数:4,代码来源:FakeNetServerHandler.java
示例16: attackEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK));
p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_);
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:7,代码来源:PlayerControllerMP.java
示例17: interactWithEntitySendPacket
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT));
return p_78768_1_.interactWith(p_78768_2_);
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:7,代码来源:PlayerControllerMP.java
示例18: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
* equipped item
*/
void processUseEntity(C02PacketUseEntity packetIn);
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:INetHandlerPlayServer.java
示例19: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
/**
* Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently
* equipped item
*/
void processUseEntity(C02PacketUseEntity var1);
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:6,代码来源:INetHandlerPlayServer.java
示例20: processUseEntity
import net.minecraft.network.play.client.C02PacketUseEntity; //导入依赖的package包/类
void processUseEntity(C02PacketUseEntity p_147340_1_);
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:INetHandlerPlayServer.java
注:本文中的net.minecraft.network.play.client.C02PacketUseEntity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论