(WorldTickEvent aEvent)
| 598 | } |
| 599 | |
| 600 | @SubscribeEvent(priority = EventPriority.LOWEST) |
| 601 | public void onWorldTick(WorldTickEvent aEvent) { |
| 602 | TOOL_SOUNDS = TOOL_SOUNDS_SETTING; |
| 603 | |
| 604 | if (aEvent.side.isServer() && aEvent.phase == Phase.END) { |
| 605 | ArrayListNoNulls<EntityXPOrb> tOrbs = (XP_ORB_COMBINING && SERVER_TIME % 40 == 31 ? new ArrayListNoNulls<EntityXPOrb>(128) : null); |
| 606 | |
| 607 | for (int i = 0; i < aEvent.world.loadedEntityList.size(); i++) { |
| 608 | Entity aEntity = (Entity)aEvent.world.loadedEntityList.get(i); |
| 609 | if (aEntity == null || aEntity.isDead) continue; |
| 610 | if (aEntity instanceof EntityXPOrb) { |
| 611 | if (tOrbs != null) tOrbs.add((EntityXPOrb)aEntity); |
| 612 | } else if (aEntity instanceof EntityItem) { |
| 613 | ItemStack aStack = ((EntityItem)aEntity).getEntityItem(); |
| 614 | if (ST.valid(aStack)) { |
| 615 | ItemStack rStack = ST.copy(aStack); |
| 616 | boolean tBreak = F, tFireProof = F; |
| 617 | |
| 618 | // TODO make a case for Armor too whenever I decide to even add Armor. |
| 619 | if (rStack.getItem() instanceof MultiItemTool) { |
| 620 | if (MultiItemTool.getPrimaryMaterial (aStack).contains(TD.Properties.UNBURNABLE)) tFireProof = T; |
| 621 | if (MultiItemTool.getSecondaryMaterial(aStack).contains(TD.Properties.UNBURNABLE)) tFireProof = T; |
| 622 | } |
| 623 | |
| 624 | OreDictItemData aData = OM.anydata_(rStack); |
| 625 | if (aData != null) { |
| 626 | if (aData.validPrefix()) for (IOreDictListenerItem tListener : aData.mPrefix.mListenersItem) { |
| 627 | rStack = tListener.onTickWorld(aData.mPrefix, aData.mMaterial.mMaterial, rStack, (EntityItem)aEntity); |
| 628 | if (!ST.equal(rStack, aStack) || rStack.stackSize != aStack.stackSize) {tBreak = T; break;} |
| 629 | } |
| 630 | if (!tBreak && aData.validMaterial()) for (OreDictMaterialStack tMaterial : aData.getAllMaterialStacks()) { |
| 631 | if (tBreak) break; |
| 632 | if (tMaterial.mMaterial.contains(TD.Properties.UNBURNABLE)) tFireProof = T; |
| 633 | for (IOreDictListenerItem tListener : tMaterial.mMaterial.mListenersItem) { |
| 634 | rStack = tListener.onTickWorld(aData.mPrefix, tMaterial.mMaterial, rStack, (EntityItem)aEntity); |
| 635 | if (!ST.equal(rStack, aStack) || rStack.stackSize != aStack.stackSize) {tBreak = T; break;} |
| 636 | } |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | if (rStack == null || rStack.stackSize <= 0) { |
| 641 | ((EntityItem)aEntity).setEntityItemStack(NI); |
| 642 | ((EntityItem)aEntity).setDead(); |
| 643 | } else if (!ST.equal(rStack, aStack) || rStack.stackSize != aStack.stackSize) { |
| 644 | ((EntityItem)aEntity).setEntityItemStack(rStack); |
| 645 | ((EntityItem)aEntity).delayBeforeCanPickup = 40; |
| 646 | } |
| 647 | |
| 648 | if (!aEntity.isDead && aEntity.isBurning() && (tBreak || (tFireProof && !MD.MC.owns(rStack)))) { |
| 649 | UT.Reflection.setField(EntityItem.class, aEntity, "health", 250, F); |
| 650 | UT.Reflection.setField(EntityItem.class, aEntity, "field_70291_e", 250, F); |
| 651 | aEntity.extinguish(); |
| 652 | } |
| 653 | } |
| 654 | } else if (aEntity instanceof EntityLivingBase) { |
| 655 | if (ENTITY_CRAMMING > 0 && SERVER_TIME % 50 == 0 && !(aEntity instanceof EntityPlayer) && ((EntityLivingBase)aEntity).canBePushed() && ((EntityLivingBase)aEntity).getHealth() > 0) { |
| 656 | List<?> tList = aEntity.worldObj.getEntitiesWithinAABBExcludingEntity(aEntity, aEntity.boundingBox.expand(0.2, 0.0, 0.2)); |
| 657 | Class<? extends Entity> tClass = aEntity.getClass(); |
nothing calls this directly
no test coverage detected