diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index fe95c7bdeb..12e7916250 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -4,7 +4,6 @@ import com.google.common.base.Preconditions; import java.lang.ref.WeakReference; import java.util.Arrays; import java.util.Collection; -import net.minecraft.server.BiomeBase; import net.minecraft.server.BiomeStorage; import net.minecraft.server.BlockPosition; import net.minecraft.server.Blocks; @@ -286,7 +285,7 @@ public class CraftChunk implements Chunk { BiomeStorage biome = null; - if (includeBiome|| includeBiomeTempRain) { + if (includeBiome || includeBiomeTempRain) { biome = chunk.getBiomeIndex().b(); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java index 8345587b5e..a06741a783 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java @@ -12,7 +12,7 @@ import org.bukkit.potion.Potion; public class CraftEffect { public static int getDataValue(Effect effect, T data) { int datavalue; - switch(effect) { + switch (effect) { case VILLAGER_PLANT_GROW: datavalue = (Integer) data; break; @@ -24,7 +24,7 @@ public class CraftEffect { datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data)); break; case SMOKE: - switch((BlockFace) data) { // TODO: Verify (Where did these values come from...?) + switch ((BlockFace) data) { // TODO: Verify (Where did these values come from...?) case SOUTH_EAST: datavalue = 0; break; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftFluidCollisionMode.java b/src/main/java/org/bukkit/craftbukkit/CraftFluidCollisionMode.java index 5a51d6abd1..f403b33ba6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftFluidCollisionMode.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftFluidCollisionMode.java @@ -3,7 +3,7 @@ package org.bukkit.craftbukkit; import net.minecraft.server.RayTrace.FluidCollisionOption; import org.bukkit.FluidCollisionMode; -public class CraftFluidCollisionMode { +public final class CraftFluidCollisionMode { private CraftFluidCollisionMode() {} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java index d35b600de7..492a5bad85 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java @@ -18,7 +18,7 @@ import org.bukkit.Bukkit; public class CraftProfileBanList implements org.bukkit.BanList { private final GameProfileBanList list; - public CraftProfileBanList(GameProfileBanList list){ + public CraftProfileBanList(GameProfileBanList list) { this.list = list; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRaid.java b/src/main/java/org/bukkit/craftbukkit/CraftRaid.java index df40138f10..360a4901f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRaid.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRaid.java @@ -1,12 +1,12 @@ package org.bukkit.craftbukkit; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.UUID; import java.util.function.Function; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; import net.minecraft.server.BlockPosition; import net.minecraft.server.EntityRaider; import net.minecraft.server.World; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index e3d5b7bd25..1d7c64d2b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -17,6 +17,7 @@ import com.mojang.brigadier.tree.LiteralCommandNode; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; +import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; @@ -41,7 +42,6 @@ import java.util.function.Consumer; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; -import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; import jline.console.ConsoleReader; import net.minecraft.server.Advancement; import net.minecraft.server.ArgumentEntity; @@ -676,7 +676,7 @@ public final class CraftServer implements Server { // NOTE: Should only be called from DedicatedServer.ah() public boolean dispatchServerCommand(CommandSender sender, ServerCommand serverCommand) { if (sender instanceof Conversable) { - Conversable conversable = (Conversable)sender; + Conversable conversable = (Conversable) sender; if (conversable.isConversing()) { conversable.acceptConversationInput(serverCommand.command); @@ -933,7 +933,7 @@ public final class CraftServer implements Server { break; } } - } while(used); + } while (used); boolean hardcore = creator.hardcore(); WorldNBTStorage sdm = new WorldNBTStorage(getWorldContainer(), name, getServer(), getHandle().getServer().dataConverterManager); @@ -1409,7 +1409,7 @@ public final class CraftServer implements Server { public BanList getBanList(BanList.Type type) { Validate.notNull(type, "Type cannot be null"); - switch(type){ + switch (type) { case IP: return new CraftIpBanList(playerList.getIPBans()); case NAME: diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b8e0408370..65b92006b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -20,7 +21,6 @@ import java.util.Set; import java.util.UUID; import java.util.function.Predicate; import java.util.stream.Collectors; -import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import net.minecraft.server.ArraySetSorted; import net.minecraft.server.AxisAlignedBB; import net.minecraft.server.BiomeBase; @@ -102,10 +102,10 @@ import org.bukkit.FluidCollisionMode; import org.bukkit.GameRule; import org.bukkit.Location; import org.bukkit.Particle; +import org.bukkit.Raid; import org.bukkit.Sound; import org.bukkit.StructureType; import org.bukkit.TreeType; -import org.bukkit.Raid; import org.bukkit.World; import org.bukkit.WorldBorder; import org.bukkit.block.Biome; @@ -621,7 +621,7 @@ public class CraftWorld implements World { ((EntityTippedArrow) arrow).setType(CraftPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false))); } else if (SpectralArrow.class.isAssignableFrom(clazz)) { arrow = EntityTypes.SPECTRAL_ARROW.a(world); - } else if (Trident.class.isAssignableFrom(clazz)){ + } else if (Trident.class.isAssignableFrom(clazz)) { arrow = EntityTypes.TRIDENT.a(world); } else { arrow = EntityTypes.ARROW.a(world); @@ -1009,7 +1009,7 @@ public class CraftWorld implements World { @SuppressWarnings("unchecked") @Deprecated public Collection getEntitiesByClass(Class... classes) { - return (Collection)getEntitiesByClasses(classes); + return (Collection) getEntitiesByClasses(classes); } @Override @@ -1561,7 +1561,7 @@ public class CraftWorld implements World { entity = EntityTypes.HORSE.a(world); } } else if (Skeleton.class.isAssignableFrom(clazz)) { - if (Stray.class.isAssignableFrom(clazz)){ + if (Stray.class.isAssignableFrom(clazz)) { entity = EntityTypes.STRAY.a(world); } else if (WitherSkeleton.class.isAssignableFrom(clazz)) { entity = EntityTypes.WITHER_SKELETON.a(world); @@ -1633,7 +1633,7 @@ public class CraftWorld implements World { } else if (Endermite.class.isAssignableFrom(clazz)) { entity = EntityTypes.ENDERMITE.a(world); } else if (Guardian.class.isAssignableFrom(clazz)) { - if (ElderGuardian.class.isAssignableFrom(clazz)){ + if (ElderGuardian.class.isAssignableFrom(clazz)) { entity = EntityTypes.ELDER_GUARDIAN.a(world); } else { entity = EntityTypes.GUARDIAN.a(world); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index 7253b1a3a1..21c8a34a8b 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -156,8 +156,8 @@ public class Main { try { // This trick bypasses Maven Shade's clever rewriting of our getProperty call when using String literals - String jline_UnsupportedTerminal = new String(new char[] {'j','l','i','n','e','.','U','n','s','u','p','p','o','r','t','e','d','T','e','r','m','i','n','a','l'}); - String jline_terminal = new String(new char[] {'j','l','i','n','e','.','t','e','r','m','i','n','a','l'}); + String jline_UnsupportedTerminal = new String(new char[]{'j', 'l', 'i', 'n', 'e', '.', 'U', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', 'T', 'e', 'r', 'm', 'i', 'n', 'a', 'l'}); + String jline_terminal = new String(new char[]{'j', 'l', 'i', 'n', 'e', '.', 't', 'e', 'r', 'm', 'i', 'n', 'a', 'l'}); useJline = !(jline_UnsupportedTerminal).equals(System.getProperty(jline_terminal)); @@ -173,7 +173,6 @@ public class Main { System.setProperty(jline.TerminalFactory.JLINE_TERMINAL, jline.UnsupportedTerminal.class.getName()); } - if (options.has("noconsole")) { useConsole = false; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index eb0201ebe1..5c1c4d5837 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -254,10 +254,7 @@ public class CraftBlock implements Block { BlockFace[] values = BlockFace.values(); for (BlockFace face : values) { - if ((this.getX() + face.getModX() == block.getX()) && - (this.getY() + face.getModY() == block.getY()) && - (this.getZ() + face.getModZ() == block.getZ()) - ) { + if ((this.getX() + face.getModX() == block.getX()) && (this.getY() + face.getModY() == block.getY()) && (this.getZ() + face.getModZ() == block.getZ())) { return face; } } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index a4bc7f9701..2058859838 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -37,7 +37,7 @@ public class CraftSkull extends CraftBlockEntityState implement } static int getSkullType(SkullType type) { - switch(type) { + switch (type) { default: case SKELETON: return 0; diff --git a/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java b/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java index 4a7e5fde00..7771cd6d04 100644 --- a/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java +++ b/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java @@ -215,7 +215,7 @@ public class CraftBossBar implements BossBar { } } - private class FlagContainer { + private final class FlagContainer { private Supplier get; private Consumer set; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java index f155441945..779f34ad02 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java @@ -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; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index ed700e3980..1ec15f492a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -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())); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java index cd04a2b997..257ce11664 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java @@ -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; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java index 799036f268..2873ff9d1f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java @@ -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; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 4f20003193..9a259aa380 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -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; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java index 2d82ea40a4..d23f994f57 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java @@ -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 { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 405c8ba10b..729444c16c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -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)server.getHandle().players) { + for (EntityPlayer player : (List) server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle())); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java index 5dfa40dda1..bff9854f30 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java @@ -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() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index a73ebaa75f..fe726e7884 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java @@ -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; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 2021f4bdc2..4602d978a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -37,9 +37,9 @@ import net.minecraft.server.EntityLiving; import net.minecraft.server.EntityMonster; import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPotion; +import net.minecraft.server.EntityRaider; import net.minecraft.server.EntitySheep; import net.minecraft.server.EntitySlime; -import net.minecraft.server.EntityRaider; import net.minecraft.server.EntityTypes; import net.minecraft.server.EntityVillager; import net.minecraft.server.EntityWaterAnimal; @@ -81,8 +81,8 @@ import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.entity.CraftRaider; import org.bukkit.craftbukkit.entity.CraftPlayer; +import org.bukkit.craftbukkit.entity.CraftRaider; import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftMetaBook; @@ -192,12 +192,12 @@ import org.bukkit.event.player.PlayerLevelChangeEvent; import org.bukkit.event.player.PlayerRecipeDiscoverEvent; import org.bukkit.event.player.PlayerStatisticIncrementEvent; import org.bukkit.event.player.PlayerUnleashEntityEvent; +import org.bukkit.event.raid.RaidFinishEvent; +import org.bukkit.event.raid.RaidSpawnWaveEvent; +import org.bukkit.event.raid.RaidStopEvent; +import org.bukkit.event.raid.RaidTriggerEvent; import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.event.vehicle.VehicleCreateEvent; -import org.bukkit.event.raid.RaidTriggerEvent; -import org.bukkit.event.raid.RaidFinishEvent; -import org.bukkit.event.raid.RaidStopEvent; -import org.bukkit.event.raid.RaidSpawnWaveEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.meta.BookMeta; @@ -510,7 +510,7 @@ public class CraftEventFactory { return event; } - public static boolean doEntityAddEventCalling(World world, Entity entity, SpawnReason spawnReason){ + public static boolean doEntityAddEventCalling(World world, Entity entity, SpawnReason spawnReason) { if (entity == null) return false; org.bukkit.event.Cancellable event = null; @@ -532,7 +532,7 @@ public class CraftEventFactory { } else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Projectile) { // Not all projectiles extend EntityProjectile, so check for Bukkit interface instead event = CraftEventFactory.callProjectileLaunchEvent(entity); - } else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Vehicle){ + } else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Vehicle) { event = CraftEventFactory.callVehicleCreateEvent(entity); } else if (!(entity instanceof EntityPlayer)) { event = CraftEventFactory.callEntitySpawnEvent(entity); diff --git a/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java b/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java index cbf9d190af..2358ba5bdc 100644 --- a/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java +++ b/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java @@ -136,7 +136,7 @@ public class SimpleHelpMap implements HelpMap { if (t != null) addTopic(t); continue outer; } - if (command instanceof PluginCommand && c.isAssignableFrom(((PluginCommand)command).getExecutor().getClass())) { + if (command instanceof PluginCommand && c.isAssignableFrom(((PluginCommand) command).getExecutor().getClass())) { HelpTopic t = topicFactoryMap.get(c).createTopic(command); if (t != null) addTopic(t); continue outer; @@ -206,7 +206,7 @@ public class SimpleHelpMap implements HelpMap { return "Bukkit"; } if (command instanceof PluginIdentifiableCommand) { - return ((PluginIdentifiableCommand)command).getPlugin().getName(); + return ((PluginIdentifiableCommand) command).getPlugin().getName(); } return null; } @@ -215,7 +215,7 @@ public class SimpleHelpMap implements HelpMap { if ((command instanceof BukkitCommand) && ignoredPlugins.contains("Bukkit")) { return true; } - if (command instanceof PluginIdentifiableCommand && ignoredPlugins.contains(((PluginIdentifiableCommand)command).getPlugin().getName())) { + if (command instanceof PluginIdentifiableCommand && ignoredPlugins.contains(((PluginIdentifiableCommand) command).getPlugin().getName())) { return true; } return false; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java index 4f43f87cd4..454ec3c76e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -126,7 +126,7 @@ public class CraftContainer extends Container { case CHEST: case ENDER_CHEST: case BARREL: - switch(inventory.getSize()) { + switch (inventory.getSize()) { case 9: return Containers.GENERIC_9X1; case 18: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 0d637e207e..acc2a57ff2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -132,7 +132,7 @@ public class CraftInventory implements Inventory { return true; } for (ItemStack item : getStorageContents()) { - if (item != null && item.getType()== material) { + if (item != null && item.getType() == material) { if ((amount -= item.getAmount()) <= 0) { return true; } @@ -182,7 +182,7 @@ public class CraftInventory implements Inventory { ItemStack[] inventory = getStorageContents(); for (int i = 0; i < inventory.length; i++) { ItemStack item = inventory[i]; - if (item != null && item.getType()== material) { + if (item != null && item.getType() == material) { slots.put(i, item); } } @@ -210,7 +210,7 @@ public class CraftInventory implements Inventory { ItemStack[] inventory = getStorageContents(); for (int i = 0; i < inventory.length; i++) { ItemStack item = inventory[i]; - if (item != null && item.getType()== material) { + if (item != null && item.getType() == material) { return i; } } @@ -254,7 +254,7 @@ public class CraftInventory implements Inventory { ItemStack[] inventory = getStorageContents(); for (int i = 0; i < inventory.length; i++) { ItemStack item = inventory[i]; - if (item != null && item.getType()== material && item.getAmount() < item.getMaxStackSize()) { + if (item != null && item.getType() == material && item.getAmount() < item.getMaxStackSize()) { return i; } } @@ -396,7 +396,7 @@ public class CraftInventory implements Inventory { material = CraftLegacy.fromLegacy(material); ItemStack[] items = getStorageContents(); for (int i = 0; i < items.length; i++) { - if (items[i] != null && items[i].getType()== material) { + if (items[i] != null && items[i].getType() == material) { clear(i); } } @@ -460,7 +460,7 @@ public class CraftInventory implements Inventory { } else if (inventory instanceof TileEntityFurnace) { return InventoryType.FURNACE; } else if (this instanceof CraftInventoryEnchanting) { - return InventoryType.ENCHANTING; + return InventoryType.ENCHANTING; } else if (inventory instanceof TileEntityBrewingStand) { return InventoryType.BREWING; } else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) { @@ -472,7 +472,7 @@ public class CraftInventory implements Inventory { } else if (this instanceof CraftInventoryBeacon) { return InventoryType.BEACON; } else if (this instanceof CraftInventoryAnvil) { - return InventoryType.ANVIL; + return InventoryType.ANVIL; } else if (inventory instanceof IHopper) { return InventoryType.HOPPER; } else if (inventory instanceof TileEntityShulkerBox) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java index 25eff35e0e..3787b9f04a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java @@ -43,7 +43,7 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn List mcResultItems = getResultInventory().getContents(); int i = 0; - for (i = 0; i < mcResultItems.size(); i++ ) { + for (i = 0; i < mcResultItems.size(); i++) { items[i] = CraftItemStack.asCraftMirror(mcResultItems.get(i)); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java index a61405fe53..4d4323da20 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java @@ -11,7 +11,7 @@ public class CraftInventoryEnchanting extends CraftInventory implements Enchanti @Override public void setItem(ItemStack item) { - setItem(0,item); + setItem(0, item); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java index 0430125455..8ff7daa1d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java @@ -27,17 +27,17 @@ public class CraftInventoryFurnace extends CraftInventory implements FurnaceInve @Override public void setFuel(ItemStack stack) { - setItem(1,stack); + setItem(1, stack); } @Override public void setResult(ItemStack stack) { - setItem(2,stack); + setItem(2, stack); } @Override public void setSmelting(ItemStack stack) { - setItem(0,stack); + setItem(0, stack); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java index 7541e95b2b..87a19622cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java @@ -154,11 +154,11 @@ public class CraftMetaBanner extends CraftMetaItem implements BannerMeta { ImmutableMap.Builder serialize(ImmutableMap.Builder builder) { super.serialize(builder); - if(base != null){ + if (base != null) { builder.put(BASE.BUKKIT, base.toString()); } - if(!patterns.isEmpty()){ + if (!patterns.isEmpty()) { builder.put(PATTERNS.BUKKIT, ImmutableList.copyOf(patterns)); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java index f1fbf0576f..7d47e2615c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java @@ -184,7 +184,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta @Override boolean applicableTo(Material type) { - switch(type){ + switch (type) { case FURNACE: case CHEST: case TRAPPED_CHEST: @@ -459,58 +459,58 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta } return new CraftEnchantingTable(material, (TileEntityEnchantTable) te); case ENDER_CHEST: - if (te == null){ + if (te == null) { te = new TileEntityEnderChest(); } return new CraftEnderChest(material, (TileEntityEnderChest) te); case DAYLIGHT_DETECTOR: - if (te == null){ + if (te == null) { te = new TileEntityLightDetector(); } return new CraftDaylightDetector(material, (TileEntityLightDetector) te); case COMPARATOR: - if (te == null){ + if (te == null) { te = new TileEntityComparator(); } return new CraftComparator(material, (TileEntityComparator) te); case BARREL: - if (te == null){ + if (te == null) { te = new TileEntityBarrel(); } return new CraftBarrel(material, (TileEntityBarrel) te); case BELL: - if (te == null){ + if (te == null) { te = new TileEntityBell(); } return new CraftBell(material, (TileEntityBell) te); case BLAST_FURNACE: - if (te == null){ + if (te == null) { te = new TileEntityBlastFurnace(); } return new CraftBlastFurnace(material, (TileEntityBlastFurnace) te); case CAMPFIRE: - if (te == null){ + if (te == null) { te = new TileEntityCampfire(); } return new CraftCampfire(material, (TileEntityCampfire) te); case JIGSAW: - if (te == null){ + if (te == null) { te = new TileEntityJigsaw(); } return new CraftJigsaw(material, (TileEntityJigsaw) te); case LECTERN: - if (te == null){ + if (te == null) { te = new TileEntityLectern(); } return new CraftLectern(material, (TileEntityLectern) te); case SMOKER: - if (te == null){ + if (te == null) { te = new TileEntitySmoker(); } return new CraftSmoker(material, (TileEntitySmoker) te); case BEE_NEST: case BEEHIVE: - if (te == null){ + if (te == null) { te = new TileEntityBeehive(); } return new CraftBeehive(material, (TileEntityBeehive) te); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java index ab7e3ba637..cdd7342d0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -1,6 +1,5 @@ package org.bukkit.craftbukkit.inventory; -import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap.Builder; import java.util.ArrayList; @@ -97,7 +96,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { setTitle(SerializableMeta.getString(map, BOOK_TITLE.BUKKIT, true)); Iterable pages = SerializableMeta.getObject(Iterable.class, map, BOOK_PAGES.BUKKIT, true); - if(pages != null) { + if (pages != null) { for (Object page : pages) { if (page instanceof String) { addPage((String) page); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java index 7a1c4d6199..e57a0ebf32 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java @@ -254,7 +254,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @Override boolean applicableTo(Material type) { - switch(type) { + switch (type) { case FIREWORK_ROCKET: return true; default: @@ -268,7 +268,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { } boolean isFireworkEmpty() { - return !(hasEffects() || hasPower()); + return !(hasEffects() || hasPower()); } boolean hasPower() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 8d0e465c26..eedb8d4052 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -85,7 +85,7 @@ import org.bukkit.persistence.PersistentDataContainer; * *
  • Constructor(CraftMetaItem meta) *
  • Constructor(NBTTagCompound tag) - *
  • Constructor(Map map) + *
  • Constructor(Map<String, Object> map) *

    *
  • void applyToItem(NBTTagCompound tag) *
  • boolean applicableTo(Material type) @@ -99,7 +99,7 @@ import org.bukkit.persistence.PersistentDataContainer; *
  • int applyHash() *
  • public Class clone() *

    - *
  • Builder serialize(Builder builder) + *
  • Builder<String, Object> serialize(Builder<String, Object> builder) *
  • SerializableMeta.Deserializers deserializer() */ @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) @@ -132,7 +132,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } @SerializableAs("ItemMeta") - public static class SerializableMeta implements ConfigurationSerializable { + public static final class SerializableMeta implements ConfigurationSerializable { static final String TYPE_FIELD = "meta-type"; static final ImmutableMap, String> classMap; @@ -617,7 +617,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, NBTTagString.a(CraftChatMessage.toJSON(displayName))); } - if (hasLocalizedName()){ + if (hasLocalizedName()) { setDisplayTag(itemTag, LOCNAME.NBT, NBTTagString.a(CraftChatMessage.toJSON(locName))); } @@ -1131,7 +1131,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Overridden boolean equalsCommon(CraftMetaItem that) { return ((this.hasDisplayName() ? that.hasDisplayName() && this.displayName.equals(that.displayName) : !that.hasDisplayName())) - && (this.hasLocalizedName()? that.hasLocalizedName()&& this.locName.equals(that.locName) : !that.hasLocalizedName()) + && (this.hasLocalizedName() ? that.hasLocalizedName() && this.locName.equals(that.locName) : !that.hasLocalizedName()) && (this.hasEnchants() ? that.hasEnchants() && this.enchantments.equals(that.enchantments) : !that.hasEnchants()) && (this.hasLore() ? that.hasLore() && this.lore.equals(that.lore) : !that.hasLore()) && (this.hasCustomModelData() ? that.hasCustomModelData() && this.customModelData.equals(that.customModelData) : !that.hasCustomModelData()) @@ -1165,7 +1165,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { int applyHash() { int hash = 3; hash = 61 * hash + (hasDisplayName() ? this.displayName.hashCode() : 0); - hash = 61 * hash + (hasLocalizedName()? this.locName.hashCode() : 0); + hash = 61 * hash + (hasLocalizedName() ? this.locName.hashCode() : 0); hash = 61 * hash + (hasLore() ? this.lore.hashCode() : 0); hash = 61 * hash + (hasCustomModelData() ? this.customModelData.hashCode() : 0); hash = 61 * hash + (hasBlockData() ? this.blockData.hashCode() : 0); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java index e7b45310a5..01f6bef68a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java @@ -66,7 +66,7 @@ class CraftMetaLeatherArmor extends CraftMetaItem implements LeatherArmorMeta { @Override boolean applicableTo(Material type) { - switch(type) { + switch (type) { case LEATHER_HELMET: case LEATHER_HORSE_ARMOR: case LEATHER_CHESTPLATE: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java index 15bc3b3566..edfe1f773c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java @@ -100,7 +100,7 @@ class CraftMetaMap extends CraftMetaItem implements MapMeta { void applyToItem(NBTTagCompound tag) { super.applyToItem(tag); - if (hasMapId()){ + if (hasMapId()) { tag.setInt(MAP_ID.NBT, getMapId()); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java index 9fd4c2bc7f..f4374ac95b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java @@ -147,7 +147,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { @Override boolean applicableTo(Material type) { - switch(type) { + switch (type) { case POTION: case SPLASH_POTION: case LINGERING_POTION: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java index 7ebc488fae..00bacfe74c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java @@ -1,11 +1,11 @@ package org.bukkit.craftbukkit.inventory; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap.Builder; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap.Builder; import net.minecraft.server.NBTTagCompound; import net.minecraft.server.NBTTagList; import org.apache.commons.lang.Validate; diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java index 04b3ab0b4f..a4bf147e9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java +++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java @@ -98,8 +98,8 @@ public class CraftMapCanvas implements MapCanvas { color = Byte.parseByte(text.substring(i + 1, j)); i = j; continue; + } catch (NumberFormatException ex) { } - catch (NumberFormatException ex) {} } throw new IllegalArgumentException("Text contains unterminated color string"); } diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java index f44ef67afd..3725845761 100644 --- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java @@ -35,8 +35,7 @@ public final class CraftMapView implements MapView { if (text.startsWith("map_")) { try { return Integer.parseInt(text.substring("map_".length())); - } - catch (NumberFormatException ex) { + } catch (NumberFormatException ex) { throw new IllegalStateException("Map has non-numeric ID"); } } else { diff --git a/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java b/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java index 6441d0e043..b3659e4c13 100644 --- a/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java +++ b/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java @@ -32,7 +32,7 @@ public class BlockMetadataStore extends MetadataStoreBase implements Meta */ @Override protected String disambiguate(Block block, String metadataKey) { - return Integer.toString(block.getX()) + ":" + Integer.toString(block.getY()) + ":" + Integer.toString(block.getZ()) + ":" + metadataKey; + return Integer.toString(block.getX()) + ":" + Integer.toString(block.getY()) + ":" + Integer.toString(block.getZ()) + ":" + metadataKey; } /** @@ -42,7 +42,7 @@ public class BlockMetadataStore extends MetadataStoreBase implements Meta */ @Override public List getMetadata(Block block, String metadataKey) { - if(block.getWorld() == owningWorld) { + if (block.getWorld() == owningWorld) { return super.getMetadata(block, metadataKey); } else { throw new IllegalArgumentException("Block does not belong to world " + owningWorld.getName()); @@ -56,7 +56,7 @@ public class BlockMetadataStore extends MetadataStoreBase implements Meta */ @Override public boolean hasMetadata(Block block, String metadataKey) { - if(block.getWorld() == owningWorld) { + if (block.getWorld() == owningWorld) { return super.hasMetadata(block, metadataKey); } else { throw new IllegalArgumentException("Block does not belong to world " + owningWorld.getName()); @@ -70,7 +70,7 @@ public class BlockMetadataStore extends MetadataStoreBase implements Meta */ @Override public void removeMetadata(Block block, String metadataKey, Plugin owningPlugin) { - if(block.getWorld() == owningWorld) { + if (block.getWorld() == owningWorld) { super.removeMetadata(block, metadataKey, owningPlugin); } else { throw new IllegalArgumentException("Block does not belong to world " + owningWorld.getName()); @@ -84,7 +84,7 @@ public class BlockMetadataStore extends MetadataStoreBase implements Meta */ @Override public void setMetadata(Block block, String metadataKey, MetadataValue newMetadataValue) { - if(block.getWorld() == owningWorld) { + if (block.getWorld() == owningWorld) { super.setMetadata(block, metadataKey, newMetadataValue); } else { throw new IllegalArgumentException("Block does not belong to world " + owningWorld.getName()); diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java index c65fe0ac8f..084615e676 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java @@ -1,11 +1,11 @@ package org.bukkit.craftbukkit.persistence; +import com.google.common.primitives.Primitives; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.function.Function; -import com.google.common.primitives.Primitives; import net.minecraft.server.NBTBase; import net.minecraft.server.NBTTagByte; import net.minecraft.server.NBTTagByteArray; diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java index 834fc17834..46e9caf0fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java @@ -26,7 +26,6 @@ import org.bukkit.block.Block; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.potion.CraftPotionUtil; import org.bukkit.entity.AbstractArrow; -import org.bukkit.entity.Arrow; import org.bukkit.entity.Egg; import org.bukkit.entity.EnderPearl; import org.bukkit.entity.Fireball; diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncDebugger.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncDebugger.java index c33213124a..60feec6896 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncDebugger.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncDebugger.java @@ -2,14 +2,13 @@ package org.bukkit.craftbukkit.scheduler; import org.bukkit.plugin.Plugin; - class CraftAsyncDebugger { private CraftAsyncDebugger next = null; private final int expiry; private final Plugin plugin; private final Class clazz; - CraftAsyncDebugger(final int expiry, final Plugin plugin, final Class clazz) { + CraftAsyncDebugger(final int expiry, final Plugin plugin, final Class clazz) { this.expiry = expiry; this.plugin = plugin; this.clazz = clazz; diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java index 692aca0482..fd32d1450a 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java @@ -25,7 +25,7 @@ class CraftAsyncTask extends CraftTask { @Override public void run() { final Thread thread = Thread.currentThread(); - synchronized(workers) { + synchronized (workers) { if (getPeriod() == CraftTask.CANCEL) { // Never continue running after cancelled. // Checking this with the lock is important! @@ -63,7 +63,7 @@ class CraftAsyncTask extends CraftTask { thrown); } finally { // Cleanup is important for any async task, otherwise ghost tasks are everywhere - synchronized(workers) { + synchronized (workers) { try { final Iterator workers = this.workers.iterator(); boolean removed = false; diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index d694a2a24b..ce2e3d2824 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -82,7 +82,12 @@ public class CraftScheduler implements BukkitScheduler { private volatile CraftTask currentTask = null; private volatile int currentTick = -1; private final Executor executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %d").build()); - private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; + private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) { + @Override + StringBuilder debugTo(StringBuilder string) { + return string; + } + }; private CraftAsyncDebugger debugTail = debugHead; private static final int RECENT_TICKS; @@ -248,7 +253,8 @@ public class CraftScheduler implements BukkitScheduler { } } return false; - }}); + } + }); handle(task, 0L); for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) { if (taskPending == task) { @@ -465,8 +471,8 @@ public class CraftScheduler implements BukkitScheduler { // We split this because of the way things are ordered for all of the async calls in CraftScheduler // (it prevents race-conditions) for (task = head; task != lastTask; task = head) { - head = task.getNext(); - task.setNext(null); + head = task.getNext(); + task.setNext(null); } this.head = lastTask; } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java index 7cc9048517..73786eda78 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java @@ -12,7 +12,7 @@ final class CraftCriteria { static { ImmutableMap.Builder defaults = ImmutableMap.builder(); - for (Map.Entry entry : ((Map ) IScoreboardCriteria.criteria).entrySet()) { + for (Map.Entry entry : ((Map) IScoreboardCriteria.criteria).entrySet()) { String name = entry.getKey().toString(); IScoreboardCriteria criteria = (IScoreboardCriteria) entry.getValue(); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java index edd147fe65..f634135324 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java @@ -6,7 +6,7 @@ import net.minecraft.server.Scoreboard; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.RenderType; -class CraftScoreboardTranslations { +final class CraftScoreboardTranslations { static final int MAX_DISPLAY_SLOT = 3; static ImmutableBiMap SLOTS = ImmutableBiMap.of( DisplaySlot.BELOW_NAME, "belowName", diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index bc92089eab..67178e1387 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -149,7 +149,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { CraftScoreboard scoreboard = checkState(); ImmutableSet.Builder entries = ImmutableSet.builder(); - for (String playerName: team.getPlayerNameSet()){ + for (String playerName : team.getPlayerNameSet()) { entries.add(playerName); } return entries.build(); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java index 2d334a5944..9b4a0f0678 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -29,6 +29,7 @@ import org.objectweb.asm.Type; * * @author md_5 */ +// CHECKSTYLE:OFF public class Commodore { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java index e7a7417249..2e162b9ea3 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -37,7 +37,7 @@ public final class CraftChatMessage { return ChatColor.getByChar(format.character); } - private static class StringMessage { + private static final class StringMessage { private static final Pattern INCREMENTAL_PATTERN = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-or])|(\\n)|((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " \\n]|$))))", Pattern.CASE_INSENSITIVE); private final List list = new ArrayList(); @@ -47,10 +47,10 @@ public final class CraftChatMessage { private int currentIndex; private final String message; - private StringMessage(String message, boolean keepNewlines) { + private StringMessage(String message, boolean keepNewlines) { this.message = message; if (message == null) { - output = new IChatBaseComponent[] { currentChatComponent }; + output = new IChatBaseComponent[]{currentChatComponent}; return; } list.add(currentChatComponent); @@ -100,7 +100,7 @@ public final class CraftChatMessage { } break; case 3: - if ( !( match.startsWith( "http://" ) || match.startsWith( "https://" ) ) ) { + if (!(match.startsWith("http://") || match.startsWith("https://"))) { match = "http://" + match; } modifier.setChatClickable(new ChatClickable(EnumClickAction.OPEN_URL, match)); @@ -207,8 +207,7 @@ public final class CraftChatMessage { if (matcher.reset(msg).find()) { matcher.reset(); - ChatModifier modifier = text.getChatModifier() != null ? - text.getChatModifier() : new ChatModifier(); + ChatModifier modifier = text.getChatModifier() != null ? text.getChatModifier() : new ChatModifier(); List extras = new ArrayList(); List extrasOld = new ArrayList(text.getSiblings()); component = text = new ChatComponentText(""); @@ -217,7 +216,7 @@ public final class CraftChatMessage { while (matcher.find()) { String match = matcher.group(); - if ( !( match.startsWith( "http://" ) || match.startsWith( "https://" ) ) ) { + if (!(match.startsWith("http://") || match.startsWith("https://"))) { match = "http://" + match; } @@ -262,7 +261,7 @@ public final class CraftChatMessage { if (c.getChatModifier() != null && c.getChatModifier().getClickEvent() == null) { subs[i] = fixComponent(c, matcher); } - } else if (comp instanceof String && matcher.reset((String)comp).find()) { + } else if (comp instanceof String && matcher.reset((String) comp).find()) { subs[i] = fixComponent(new ChatComponentText((String) comp), matcher); } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java b/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java index 5c978a261c..6995e1bead 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java @@ -14,7 +14,7 @@ import org.bukkit.entity.Entity; import org.bukkit.util.RayTraceResult; import org.bukkit.util.Vector; -public class CraftRayTraceResult { +public final class CraftRayTraceResult { private CraftRayTraceResult() {} diff --git a/src/main/java/org/bukkit/craftbukkit/util/LazyHashSet.java b/src/main/java/org/bukkit/craftbukkit/util/LazyHashSet.java index 1b2b4fb590..34bfd633fe 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/LazyHashSet.java +++ b/src/main/java/org/bukkit/craftbukkit/util/LazyHashSet.java @@ -73,7 +73,7 @@ public abstract class LazyHashSet implements Set { } public Set getReference() { - Set reference = this.reference ; + Set reference = this.reference; if (reference != null) { return reference; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java index 166f4ee083..3c89468373 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java +++ b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java @@ -39,7 +39,7 @@ public final class WeakCollection implements Collection { @Override public boolean contains(Object object) { - if (object == null) { + if (object == null) { return false; } for (T compare : this) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java index 6bea250b86..75f8d47a20 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java +++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java @@ -4,7 +4,7 @@ import org.bukkit.permissions.Permission; import org.bukkit.util.permissions.DefaultPermissions; public final class CraftDefaultPermissions { - private static final String ROOT= "minecraft"; + private static final String ROOT = "minecraft"; private CraftDefaultPermissions() {} diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java index 50388c34a1..b7f67d73cf 100644 --- a/src/test/java/org/bukkit/DyeColorsTest.java +++ b/src/test/java/org/bukkit/DyeColorsTest.java @@ -15,7 +15,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class DyeColorsTest extends AbstractTestingBase { - @Parameters(name= "{index}: {0}") + @Parameters(name = "{index}: {0}") public static List data() { List list = new ArrayList(); for (DyeColor dye : DyeColor.values()) { diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java index ba289fae8a..fde64cff4a 100644 --- a/src/test/java/org/bukkit/PerMaterialTest.java +++ b/src/test/java/org/bukkit/PerMaterialTest.java @@ -40,7 +40,7 @@ public class PerMaterialTest extends AbstractTestingBase { fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "flameChances"); } - @Parameters(name= "{index}: {0}") + @Parameters(name = "{index}: {0}") public static List data() { List list = Lists.newArrayList(); for (Material material : Material.values()) { @@ -91,7 +91,7 @@ public class PerMaterialTest extends AbstractTestingBase { if (material == Material.AIR) { assertThat((int) material.getMaxDurability(), is(0)); - } else if (material.isBlock()){ + } else if (material.isBlock()) { Item item = CraftMagicNumbers.getItem(material); assertThat((int) material.getMaxDurability(), is(item.getMaxDurability())); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java index 7580eb290d..c279579c2b 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java @@ -41,7 +41,7 @@ public class FactoryItemMaterialTest extends AbstractTestingBase { return buffer.delete(0, Integer.MAX_VALUE).append(from.getClass().getName()).append('(').append(from.name()).append(") to ").append(to.getClass().getName()).append('(').append(to.name()).append(')').toString(); } - @Parameters(name="Material[{index}]:{0}") + @Parameters(name = "Material[{index}]:{0}") public static List data() { List list = new ArrayList(); for (Material material : materials) { diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java index 80be169551..61ac1fb7c5 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java @@ -19,7 +19,7 @@ import org.junit.runners.Parameterized.Parameters; public class ItemMetaImplementationOverrideTest { static final Class parent = CraftMetaItem.class; - @Parameters(name="[{index}]:{1}") + @Parameters(name = "[{index}]:{1}") public static List data() { final List testData = new ArrayList(); List> classes = new ArrayList>(); diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java index 6302339601..e4305ce522 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java @@ -56,22 +56,22 @@ public class ItemMetaTest extends AbstractTestingBase { static final int MAX_FIREWORK_POWER = 127; // Please update ItemStackFireworkTest if/when this gets changed. - @Test(expected=IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) public void testPowerLimitExact() { newFireworkMeta().setPower(MAX_FIREWORK_POWER + 1); } - @Test(expected=IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) public void testPowerLimitMax() { newFireworkMeta().setPower(Integer.MAX_VALUE); } - @Test(expected=IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) public void testPowerLimitMin() { newFireworkMeta().setPower(Integer.MIN_VALUE); } - @Test(expected=IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) public void testPowerLimitNegative() { newFireworkMeta().setPower(-1); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java index c8e8fbedf6..c7d10b0892 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java @@ -13,7 +13,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackBookTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.WRITTEN_BOOK, Material.WRITABLE_BOOK); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java index 27ce215563..157eef07ee 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java @@ -14,7 +14,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackEnchantStorageTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.ENCHANTED_BOOK); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java index eedc02b18c..1515ec2002 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java @@ -16,7 +16,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackFireworkChargeTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.FIREWORK_STAR); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java index 6caf4341e3..31fc6046af 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java @@ -16,7 +16,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackFireworkTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.FIREWORK_ROCKET); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java index b18ca7552f..9dea89e756 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java @@ -14,7 +14,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackLeatherTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.LEATHER_BOOTS, Material.LEATHER_CHESTPLATE, Material.LEATHER_HELMET, Material.LEATHER_LEGGINGS); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java index fe4680dcd8..339b45191d 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java @@ -14,7 +14,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackLoreEnchantmentTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, ItemStackTest.COMPOUND_MATERIALS); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java index 3d356095fd..fb36575b05 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java @@ -13,7 +13,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackMapTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.FILLED_MAP); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java index 06aea52121..f7cf39fdd1 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java @@ -14,7 +14,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackPotionsTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.POTION); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java index 3067f60320..0ac5e8cb57 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java @@ -13,7 +13,7 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ItemStackSkullTest extends ItemStackTest { - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.PLAYER_HEAD); } diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java index f9c67008a7..1add9c7d39 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java @@ -305,7 +305,7 @@ public class ItemStackTest extends AbstractTestingBase { } } - @Parameters(name="[{index}]:{" + NAME_PARAMETER + "}") + @Parameters(name = "[{index}]:{" + NAME_PARAMETER + "}") public static List data() { return ImmutableList.of(); // TODO, test basic durability issues } diff --git a/src/test/java/org/bukkit/entity/EntityTypesTest.java b/src/test/java/org/bukkit/entity/EntityTypesTest.java index 07d978c74b..af570ccfd6 100644 --- a/src/test/java/org/bukkit/entity/EntityTypesTest.java +++ b/src/test/java/org/bukkit/entity/EntityTypesTest.java @@ -16,7 +16,7 @@ public class EntityTypesTest extends AbstractTestingBase { public void testMaps() { Set allBukkit = Arrays.stream(EntityType.values()).filter((b) -> b.getName() != null).collect(Collectors.toSet()); - for (EntityTypes nms : IRegistry.ENTITY_TYPE) { + for (EntityTypes nms : IRegistry.ENTITY_TYPE) { MinecraftKey key = EntityTypes.getName(nms); EntityType bukkit = EntityType.fromName(key.getKey()); diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java index d310ffcc47..ebd2efa5ae 100644 --- a/src/test/java/org/bukkit/potion/PotionTest.java +++ b/src/test/java/org/bukkit/potion/PotionTest.java @@ -17,7 +17,7 @@ public class PotionTest extends AbstractTestingBase { public void testEffectCompleteness() throws Throwable { Map effects = new EnumMap(PotionType.class); for (Object reg : IRegistry.POTION) { - List eff = ((PotionRegistry)reg).a(); + List eff = ((PotionRegistry) reg).a(); if (eff.size() != 1) continue; int id = MobEffectList.getId(eff.get(0).getMobEffect()); PotionEffectType type = PotionEffectType.getById(id); diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java index 46539e87b3..78c9a315de 100644 --- a/src/test/java/org/bukkit/support/AbstractTestingBase.java +++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java @@ -19,9 +19,9 @@ import org.junit.Assert; /** * If you are getting: java.lang.ExceptionInInitializerError - * at net.minecraft.server.StatisticList.(SourceFile:58) - * at net.minecraft.server.Item.(SourceFile:252) - * at net.minecraft.server.Block.(Block.java:577) + * at net.minecraft.server.StatisticList.<clinit>(SourceFile:58) + * at net.minecraft.server.Item.<clinit>(SourceFile:252) + * at net.minecraft.server.Block.<clinit>(Block.java:577) * * extend this class to solve it. */ diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java index 912c139ff9..97eb5fa880 100644 --- a/src/test/java/org/bukkit/support/DummyServer.java +++ b/src/test/java/org/bukkit/support/DummyServer.java @@ -16,7 +16,7 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.craftbukkit.util.Versioning; -public class DummyServer implements InvocationHandler { +public final class DummyServer implements InvocationHandler { private static interface MethodHandler { Object handle(DummyServer server, Object[] args); }