Пример #1
0
 @SubscribeEvent
 public void onFOVUpdateEvent(FOVUpdateEvent evt) {
   if (evt.getEntity().getItemStackFromSlot(EntityEquipmentSlot.FEET) != null
       && evt.getEntity().getItemStackFromSlot(EntityEquipmentSlot.FEET).getItem()
           == ObjHandler.gemFeet) {
     evt.setNewfov(evt.getFov() - 0.4F);
   }
 }
Пример #2
0
 /*
 	protected int getModelVariation(int useTime) {
     	if(useTime >= 21) {
     		return 2;
         } else if(useTime > 10) {
             return 1;
         } else {
             return 0;
         }
 	}
 */
 @SubscribeEvent
 public void fovUpdate(FOVUpdateEvent event) {
   if (event.getEntity() instanceof EntityPlayer) {
     if (event.getEntity().isHandActive()
         && event.getEntity().getActiveItemStack().getItem() == this) {
       float fovModifier =
           getNewFovModifier(
               event
                   .getEntity()
                   .getItemInUseMaxCount()); // getItemInUseMaxCount() seems to be mis-named.
       // functionally, it is like the old
       // getItemUseDuration()
       float fov = 1.0f;
       fov *= 1.0F - fovModifier * 0.15F;
       //				MEMLogger.info("ItemCustomBow fovUpdate(): itemUseDuration = " +
       // event.entity.getItemInUseDuration() + "; fovModifier = " + fovModifier + "; newfov = " +
       // fov);
       event.setNewfov(fov);
     }
   }
 }