Begin implementation of CheckStyle style checking

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-04-23 14:00:30 +10:00
parent a0f2b74c8d
commit 7afe4d02f8
28 changed files with 144 additions and 97 deletions

View File

@@ -68,7 +68,7 @@ public class CraftProfileBanList implements org.bukkit.BanList {
@Override
public Set<org.bukkit.BanEntry> getBanEntries() {
ImmutableSet.Builder<org.bukkit.BanEntry> builder = ImmutableSet.builder();
for (JsonListEntry entry : list.getValues()) {
GameProfile profile = (GameProfile) entry.getKey();
builder.add(new CraftProfileBanEntry(profile, (GameProfileBanEntry) entry, list));

View File

@@ -1327,7 +1327,7 @@ public final class CraftServer implements Server {
for (JsonListEntry entry : playerList.getProfileBans().getValues()) {
result.add(getOfflinePlayer((GameProfile) entry.getKey()));
}
}
return result;
}

View File

@@ -45,14 +45,14 @@ public class CraftWorldBorder implements WorldBorder {
if (time > 0L) {
this.handle.transitionSizeBetween(this.handle.getSize(), newSize, time * 1000L);
} else {
this.handle.setSize(newSize);
this.handle.setSize(newSize);
}
}
@Override
public Location getCenter() {
double x = this.handle.getCenterX();
double z = this.handle.getCenterZ();
double x = this.handle.getCenterX();
double z = this.handle.getCenterZ();
return new Location(this.world, x, 0, z);
}
@@ -63,7 +63,7 @@ public class CraftWorldBorder implements WorldBorder {
x = Math.min(3.0E7D, Math.max(-3.0E7D, x));
z = Math.min(3.0E7D, Math.max(-3.0E7D, z));
this.handle.setCenter(x, z);
this.handle.setCenter(x, z);
}
@Override
@@ -108,7 +108,7 @@ public class CraftWorldBorder implements WorldBorder {
@Override
public void setWarningDistance(int distance) {
this.handle.setWarningDistance(distance);
this.handle.setWarningDistance(distance);
}
@Override

View File

@@ -273,4 +273,4 @@ public class CraftBlockState implements BlockState {
throw new IllegalStateException("The blockState must be placed to call this method");
}
}
}
}

View File

@@ -1,7 +1,6 @@
package org.bukkit.craftbukkit.block.data;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftWaterlogged extends CraftBlockData implements Waterlogged {

View File

@@ -61,11 +61,11 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
public void setPhase(Phase phase) {
getHandle().getDragonControllerManager().setControllerPhase(getMinecraftPhase(phase));
}
public static Phase getBukkitPhase(DragonControllerPhase phase) {
return Phase.values()[phase.b()];
}
public static DragonControllerPhase getMinecraftPhase(Phase phase) {
return DragonControllerPhase.getById(phase.ordinal());
}

View File

@@ -31,7 +31,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
@Override
public Type getRabbitType() {
int type = getHandle().getRabbitType();
int type = getHandle().getRabbitType();
return CraftMagicMapping.fromMagic(type);
}
@@ -46,7 +46,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
entity.initializePathFinderGoals();
}
entity.setRabbitType(CraftMagicMapping.toMagic(type));
entity.setRabbitType(CraftMagicMapping.toMagic(type));
}
private static class CraftMagicMapping {

View File

@@ -208,7 +208,7 @@ public class CraftContainer extends Container {
break;
case SMOKER:
delegate = new ContainerSmoker(windowId, bottom, top, new ContainerProperties(4));
break;
break;
case LOOM:
delegate = new ContainerLoom(windowId, bottom);
break;

View File

@@ -31,7 +31,7 @@ class CraftMetaCharge extends CraftMetaItem implements FireworkEffectMeta {
setEffect(SerializableMeta.getObject(FireworkEffect.class, map, EXPLOSION.BUKKIT, true));
}
CraftMetaCharge(NBTTagCompound tag) {
super(tag);

View File

@@ -102,7 +102,7 @@ class CraftMetaMap extends CraftMetaItem implements MapMeta {
if (hasMapId()){
tag.setInt(MAP_ID.NBT, getMapId());
}
if (hasScaling()) {
tag.setBoolean(MAP_SCALING.NBT, isScaling());
}

View File

@@ -61,4 +61,4 @@ public class InventoryIterator implements ListIterator<ItemStack> {
public void remove() {
throw new UnsupportedOperationException("Can't change the size of an inventory!");
}
}
}

View File

@@ -305,7 +305,7 @@ public class CraftScheduler implements BukkitScheduler {
return false;
}
if (task.isSync()) {
return (task == currentTask);
return (task == currentTask);
}
final CraftAsyncTask asyncTask = (CraftAsyncTask) task;
synchronized (asyncTask.getWorkers()) {

View File

@@ -11,8 +11,8 @@ import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.Ansi.Erase;
public class TerminalConsoleWriterThread extends Thread {
final private ConsoleReader reader;
final private OutputStream output;
private final ConsoleReader reader;
private final OutputStream output;
public TerminalConsoleWriterThread(OutputStream output, ConsoleReader reader) {
this.output = output;