TF2BulletHandler.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:Mods 作者:
@Override
public IMessage onMessage(final BulletMessage message, MessageContext ctx) {
    /*
     * final EntityPlayer shooter=ctx.getServerHandler().player;
     * ((WorldServer)shooter.world).addScheduledTask(new Runnable(){
     * 
     * @Override public void run() { ItemStack
     * stack=message.hand==EnumHand.MAIN_HAND?shooter.inventory.
     * getStackInSlot(message.slot):shooter.getHeldItemOffhand(); if(stack
     * == null || !(stack.getItem() instanceof ItemBulletWeapon)) return;
     * ItemBulletWeapon item=(ItemBulletWeapon) stack.getItem(); int
     * totalCrit=0;
     * if((!item.rapidFireCrits(stack)&&item.hasRandomCrits(stack,shooter)
     * && shooter.getRNG().nextFloat()<item.critChance(stack,
     * shooter))||stack.getTagCompound().getShort("crittime")>0){
     * totalCrit=2; } for(Object[] obj:message.readData){ Entity
     * target=shooter.world.getEntityByID((Integer) obj[0]);
     * if(target==null) continue;
     * 
     * if(!shotInfo.containsKey(target)||shotInfo.get(target)==null){
     * shotInfo.put(target, new float[3]); } int critical=totalCrit;
     * //System.out.println(var4.hitInfo); if((Boolean)obj[1]){ critical=2;
     * } critical=item.setCritical(stack, shooter, target, critical);
     * if(critical>0){ totalCrit=critical; }
     * //ItemRangedWeapon.critical=critical; float[]
     * values=shotInfo.get(target);
     * //System.out.println(obj[2]+" "+critical); values[0]++;
     * values[1]+=TF2weapons.calculateDamage(target,shooter.world,
     * shooter, stack, critical, (Float) obj[2]); }
     * ItemBulletWeapon.handleShoot(shooter, stack, shooter.world,
     * shotInfo,totalCrit); ItemBulletWeapon.processShotServer=true;
     * ((ItemBulletWeapon)stack.getItem()).use(stack, shooter,
     * shooter.world, message.hand, message);
     * ItemBulletWeapon.processShotServer=false; shotInfo.clear(); }
     * 
     * });
     */
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号