Update PickupHandler.java

Removed redundant EntityTameable check from within code already covered by another EntityTameable check (would always be "true" anyways).
Removed redundant EntityTameable check and contents from within the "else" of same outer check (else means it's already failed, and will never succeed this check or run the code within it anyways).
This commit is contained in:
KandiPanda 2020-06-12 01:52:18 -05:00 committed by GitHub
parent b0e694f024
commit afe45abd1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,14 +231,9 @@ public class PickupHandler
double distance = pos.distanceSqToCenter(player.posX, player.posY + 0.5, player.posZ);
if (distance < Math.pow(CarryOnConfig.settings.maxDistance, 2))
{
if (toPickUp instanceof EntityTameable)
{
EntityTameable tame = (EntityTameable) toPickUp;
UUID owner = tame.getOwnerId();
UUID playerID = player.getUUID(player.getGameProfile());
if (owner != null && !owner.equals(playerID))
return false;
}
UUID playerID = player.getUUID(player.getGameProfile());
if (OwnerCheck != null && !OwnerCheck.equals(playerID))
return false;
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(toPickUp))
{
@ -299,15 +294,6 @@ public class PickupHandler
double distance = pos.distanceSqToCenter(player.posX, player.posY + 0.5, player.posZ);
if (distance < Math.pow(CarryOnConfig.settings.maxDistance, 2))
{
if (toPickUp instanceof EntityTameable)
{
EntityTameable tame = (EntityTameable) toPickUp;
UUID owner = tame.getOwnerId();
UUID playerID = player.getUUID(player.getGameProfile());
if (owner != null && !owner.equals(playerID))
return false;
}
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(toPickUp))
{
try