Misc checkstyle fixes

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-04-14 12:34:43 +10:00
parent 5833b4d35c
commit 18886036f4
72 changed files with 149 additions and 151 deletions

View File

@@ -9,7 +9,6 @@ import net.minecraft.server.EntityEnderDragon;
import org.bukkit.boss.BossBar;
import org.bukkit.boss.DragonBattle;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.boss.CraftBossBar;
import org.bukkit.craftbukkit.boss.CraftDragonBattle;
import org.bukkit.entity.ComplexEntityPart;
import org.bukkit.entity.EnderDragon;

View File

@@ -180,9 +180,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
public static CraftEntity getEntity(CraftServer server, Entity entity) {
/**
/*
* Order is *EXTREMELY* important -- keep it right! =D
*/
// CHECKSTYLE:OFF
if (entity instanceof EntityLiving) {
// Players
if (entity instanceof EntityHuman) {
@@ -368,6 +369,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityAreaEffectCloud) { return new CraftAreaEffectCloud(server, (EntityAreaEffectCloud) entity); }
else if (entity instanceof EntityEvokerFangs) { return new CraftEvokerFangs(server, (EntityEvokerFangs) entity); }
else if (entity instanceof EntityLlamaSpit) { return new CraftLlamaSpit(server, (EntityLlamaSpit) entity); }
// CHECKSTYLE:ON
throw new AssertionError("Unknown entity " + (entity == null ? null : entity.getClass()));
}

View File

@@ -54,9 +54,9 @@ public class CraftFishHook extends AbstractProjectile implements FishHook {
if (this.biteChance == -1) {
if (hook.world.isRainingAt(new BlockPosition(MathHelper.floor(hook.locX()), MathHelper.floor(hook.locY()) + 1, MathHelper.floor(hook.locZ())))) {
return 1/300.0;
return 1 / 300.0;
}
return 1/500.0;
return 1 / 500.0;
}
return this.biteChance;
}

View File

@@ -48,7 +48,7 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
old.die();
EntityItemFrame frame = new EntityItemFrame(world,position,direction);
EntityItemFrame frame = new EntityItemFrame(world, position, direction);
frame.setItem(item);
world.addEntity(frame);
this.entity = frame;

View File

@@ -45,11 +45,11 @@ import org.bukkit.attribute.AttributeInstance;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.memory.CraftMemoryKey;
import org.bukkit.craftbukkit.entity.memory.CraftMemoryMapper;
import org.bukkit.craftbukkit.inventory.CraftEntityEquipment;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
import org.bukkit.craftbukkit.entity.memory.CraftMemoryKey;
import org.bukkit.craftbukkit.entity.memory.CraftMemoryMapper;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.entity.DragonFireball;
import org.bukkit.entity.Egg;

View File

@@ -75,7 +75,7 @@ public abstract class CraftMinecart extends CraftVehicle implements Minecart {
@Override
public void setDisplayBlock(MaterialData material) {
if(material != null) {
if (material != null) {
IBlockData block = CraftMagicNumbers.getBlock(material);
this.getHandle().setDisplayBlock(block);
} else {

View File

@@ -229,7 +229,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
name = getName();
}
getHandle().listName = name.equals(getName()) ? null : CraftChatMessage.fromStringOrNull(name);
for (EntityPlayer player : (List<EntityPlayer>)server.getHandle().players) {
for (EntityPlayer player : (List<EntityPlayer>) server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) {
player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle()));
}

View File

@@ -14,7 +14,7 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat
@Override
public EntityTameableAnimal getHandle() {
return (EntityTameableAnimal)super.getHandle();
return (EntityTameableAnimal) super.getHandle();
}
public UUID getOwnerUUID() {

View File

@@ -2,12 +2,12 @@ package org.bukkit.craftbukkit.entity;
import com.google.common.base.Preconditions;
import java.util.Locale;
import net.minecraft.server.BlockBed;
import net.minecraft.server.BlockPosition;
import net.minecraft.server.EntityVillager;
import net.minecraft.server.IBlockData;
import net.minecraft.server.IRegistry;
import net.minecraft.server.VillagerProfession;
import net.minecraft.server.IBlockData;
import net.minecraft.server.BlockPosition;
import net.minecraft.server.BlockBed;
import org.apache.commons.lang.Validate;
import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer;