FuzzyAcornIndustries Posted November 3, 2017 Posted November 3, 2017 I have concept in my modification built off of the PetBats mod where when you drop a certain item on top of another item, something happens. Worked perfectly fine in 1.11.2. Now in 1.12.2, the same section of code doesn't work. Below is that particular section of code: public void revivePoketamable(ItemTossEvent event, TamablePokemon poketamable, EntityItem itemDropped) { final List nearEnts = event.getEntityItem().world.getEntitiesWithinAABBExcludingEntity(itemDropped, itemDropped.getEntityBoundingBox().expand(8D, 8D, 8D)); for (Object o : nearEnts) { if (o instanceof EntityItem) { EntityItem foundItem; foundItem = (EntityItem) o; if (foundItem.getItem().getItem() == KindredLegacyItems.revive_seed) { poketamable.setPosition(itemDropped.posX, itemDropped.posY, itemDropped.posZ); itemDropped.world.spawnEntity(poketamable); poketamable.setHealth(poketamable.getMaxHealth()); // set full entity health event.setCanceled(true); foundItem.getItem().shrink(1); // Decrease itemStack by 1 break; } } } } After various testing, I realized that getEntitiesWithinAABBExcludingEntity() no longer returns EntityItems like it did in 1.11.2. It does detect the player from the event so it is working at all. Is there a way to fix this so it does detect EntityItems again? Or some alternative? I've seen some user complaints on the PetBats mod for 1.12 that seem similar to the problem I am experiencing so I doubt the mod actually works as it was intended for this reason. Quote
desht Posted November 3, 2017 Posted November 3, 2017 (edited) This may or may not be relevant: https://www.reddit.com/r/feedthebeast/comments/6yi8l0/psa_modders_axisalignedbb_method_renames_causing/ The .expand() method doesn't do what it used to. Edited November 3, 2017 by desht Quote
The_Wabbit Posted November 3, 2017 Posted November 3, 2017 2 hours ago, desht said: This may or may not be relevant: https://www.reddit.com/r/feedthebeast/comments/6yi8l0/psa_modders_axisalignedbb_method_renames_causing/ The .expand() method doesn't do what it used to. Use the grow method instead...yea this name switch walloped me something good as well when I migrated. Quote
Draco18s Posted November 3, 2017 Posted November 3, 2017 2 hours ago, desht said: This may or may not be relevant: https://www.reddit.com/r/feedthebeast/comments/6yi8l0/psa_modders_axisalignedbb_method_renames_causing/ The .expand() method doesn't do what it used to. Thanks for that. Checking my code I had 1 instance of "expand" that was improper. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
FuzzyAcornIndustries Posted November 3, 2017 Author Posted November 3, 2017 2 hours ago, The_Wabbit said: Use the grow method instead...yea this name switch walloped me something good as well when I migrated. Thanks! Yes, this is a perfect fix for me too. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.