Fix some compilation errors
This commit is contained in:
@@ -193,8 +193,8 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@Override
|
||||
public boolean isOnGround() {
|
||||
if (this.entity instanceof AbstractArrow) {
|
||||
return ((AbstractArrow) this.entity).isInGround();
|
||||
if (this.entity instanceof AbstractArrow abstractArrow) {
|
||||
return abstractArrow.isInGround();
|
||||
}
|
||||
return this.entity.onGround();
|
||||
}
|
||||
@@ -417,7 +417,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@Override
|
||||
public org.bukkit.entity.Entity getPassenger() {
|
||||
return this.isEmpty() ? null : this.getHandle().passengers.get(0).getBukkitEntity();
|
||||
return this.isEmpty() ? null : this.getHandle().getPassengers().getFirst().getBukkitEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -433,7 +433,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@Override
|
||||
public List<org.bukkit.entity.Entity> getPassengers() {
|
||||
return Lists.newArrayList(Lists.transform(this.getHandle().passengers, (Function<Entity, org.bukkit.entity.Entity>) input -> input.getBukkitEntity()));
|
||||
return Lists.newArrayList(Lists.transform(this.getHandle().getPassengers(), (Function<Entity, org.bukkit.entity.Entity>) Entity::getBukkitEntity));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -852,12 +852,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@Override
|
||||
public int getPortalCooldown() {
|
||||
return this.getHandle().portalCooldown;
|
||||
return this.getHandle().getPortalCooldown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortalCooldown(int cooldown) {
|
||||
this.getHandle().portalCooldown = cooldown;
|
||||
this.getHandle().setPortalCooldown(cooldown);;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -142,9 +142,9 @@ public class ActivationRange
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for the activation state of all entities in this chunk.
|
||||
* Tries to activate an entity.
|
||||
*
|
||||
* @param chunk
|
||||
* @param entity
|
||||
*/
|
||||
private static void activateEntity(Entity entity)
|
||||
{
|
||||
@@ -172,13 +172,13 @@ public class ActivationRange
|
||||
public static boolean checkEntityImmunities(Entity entity)
|
||||
{
|
||||
// quick checks.
|
||||
if ( entity.wasTouchingWater || entity.getRemainingFireTicks() > 0 )
|
||||
if ( entity.isInWater() || entity.getRemainingFireTicks() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( !( entity instanceof AbstractArrow ) )
|
||||
{
|
||||
if ( !entity.onGround() || !entity.passengers.isEmpty() || entity.isPassenger() )
|
||||
if ( !entity.onGround() || !entity.getPassengers().isEmpty() || entity.isPassenger() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user