Run code format

This commit is contained in:
Sollace 2018-08-01 12:38:02 +02:00
parent b9231a5bfd
commit 65a5fc230c
62 changed files with 248 additions and 228 deletions

View file

@ -8,14 +8,13 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* This annotation can be applied to a package, class or method to indicate that
* the method in that element are nonnull by default unless there is:
* This annotation can be applied to a package, class or method to indicate that the method in that
* element are nonnull by default unless there is:
* <ul>
* <li>An explicit nullness annotation
* <li>The method overrides a method in a superclass (in which case the
* annotation of the corresponding method in the superclass applies)
* <li> there is a default parameter annotation applied to a more tightly nested
* element.
* <li>The method overrides a method in a superclass (in which case the annotation of the
* corresponding method in the superclass applies)
* <li>there is a default parameter annotation applied to a more tightly nested element.
* </ul>
*
*/
@ -23,4 +22,5 @@ import java.lang.annotation.RetentionPolicy;
@Nonnull
@TypeQualifierDefault(ElementType.METHOD) // Note: This is a copy of javax.annotation.ParametersAreNonnullByDefault with target changed to METHOD
@Retention(RetentionPolicy.RUNTIME)
public @interface MethodsReturnNonnullByDefault {}
public @interface MethodsReturnNonnullByDefault {
}

View file

@ -13,8 +13,8 @@ import java.util.Map;
import javax.annotation.Nullable;
/**
* Manager for fetching preview textures. This ensures that multiple calls
* to the skin server aren't done when fetching preview textures.
* Manager for fetching preview textures. This ensures that multiple calls to the skin server aren't
* done when fetching preview textures.
*/
public class PreviewTextureManager {
@ -25,8 +25,7 @@ public class PreviewTextureManager {
}
@Nullable
public PreviewTexture getPreviewTexture(ResourceLocation location, MinecraftProfileTexture.Type type, ResourceLocation def,
@Nullable SkinManager.SkinAvailableCallback callback) {
public PreviewTexture getPreviewTexture(ResourceLocation location, MinecraftProfileTexture.Type type, ResourceLocation def, @Nullable SkinManager.SkinAvailableCallback callback) {
if (!textures.containsKey(type)) {
return null;
}

View file

@ -130,8 +130,7 @@ public class ThreadDownloadImageETag extends SimpleTexture {
// try to load from cache anyway
setLocalCache();
return;
} catch (IOException ignored) {
}
} catch (IOException ignored) {}
}
LOGGER.error("Couldn't load skin {} ", imageUrl, e);
} finally {

View file

@ -38,8 +38,7 @@ public class EntityPlayerModel extends EntityLivingBase {
EntityEquipmentSlot.CHEST, ItemStack.EMPTY,
EntityEquipmentSlot.LEGS, ItemStack.EMPTY,
EntityEquipmentSlot.FEET, ItemStack.EMPTY,
EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY
));
EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY));
private PreviewTexture remoteSkinTexture;
private ResourceLocation remoteSkinResource;

View file

@ -210,8 +210,7 @@ public class GLWindow extends DropTarget {
ArrayList<Image> images = Lists.newArrayList(
ImageIO.read(pack.getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"))),
ImageIO.read(pack.getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png")))
);
ImageIO.read(pack.getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"))));
Frame[] frames = Frame.getFrames();

View file

@ -504,8 +504,7 @@ public class GuiSkins extends GuiScreen {
enableDepth();
}
private void renderPlayerModel(EntityPlayerModel thePlayer, float xPosition, float yPosition, float scale, float mouseY, float mouseX,
float partialTick) {
private void renderPlayerModel(EntityPlayerModel thePlayer, float xPosition, float yPosition, float scale, float mouseY, float mouseX, float partialTick) {
enableColorMaterial();
pushMatrix();
translate(xPosition, yPosition, 300);

View file

@ -24,8 +24,7 @@ public abstract class MixinSkullRenderer extends TileEntitySpecialRenderer<TileE
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/tileentity/TileEntitySkullRenderer;bindTexture(Lnet/minecraft/util/ResourceLocation;)V",
ordinal = 4))
private void onBindTexture(TileEntitySkullRenderer tesr, ResourceLocation rl, float x, float y, float z, EnumFacing facing, float rotation, int meta,
@Nullable GameProfile profile, int p_180543_8_, float ticks) {
private void onBindTexture(TileEntitySkullRenderer tesr, ResourceLocation rl, float x, float y, float z, EnumFacing facing, float rotation, int meta, @Nullable GameProfile profile, int p_180543_8_, float ticks) {
if (profile != null) {
Optional<ResourceLocation> skin = HDSkinManager.INSTANCE.getSkinLocation(profile, Type.SKIN, true);
if (skin.isPresent()) {

View file

@ -11,6 +11,7 @@ class SkinData {
List<Skin> skins;
}
@SuppressWarnings("unused")
class Skin {

View file

@ -12,9 +12,9 @@ import java.util.Map;
import java.util.UUID;
/**
* Use this to build a {@link MinecraftTexturesPayload} object. This is
* required because it has no useful constructor. This uses reflection
* via Gson to create a new instance and populate the fields.
* Use this to build a {@link MinecraftTexturesPayload} object. This is required because it has no
* useful constructor. This uses reflection via Gson to create a new instance and populate the
* fields.
*/
@SuppressWarnings("unused")
public class TexturesPayloadBuilder {

View file

@ -55,8 +55,7 @@ public class ValhallaSkinServer implements SkinServer {
@Override
public Optional<MinecraftTexturesPayload> loadProfileData(GameProfile profile) {
try (CloseableHttpClient client = HttpClients.createSystem();
CloseableHttpResponse response = client.execute(new HttpGet(getTexturesURI(profile)))) {
try (CloseableHttpClient client = HttpClients.createSystem(); CloseableHttpResponse response = client.execute(new HttpGet(getTexturesURI(profile)))) {
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
@ -88,9 +87,7 @@ public class ValhallaSkinServer implements SkinServer {
}, HDSkinManager.skinUploadExecutor);
}
private SkinUploadResponse upload(CloseableHttpClient client, Session session, @Nullable URI image,
MinecraftProfileTexture.Type type, Map<String, String> metadata)
throws IOException {
private SkinUploadResponse upload(CloseableHttpClient client, Session session, @Nullable URI image, MinecraftProfileTexture.Type type, Map<String, String> metadata) throws IOException {
GameProfile profile = session.getProfile();
if (image == null) {

View file

@ -25,8 +25,7 @@ public abstract class ThreadOpenFile extends Thread {
private static String lastChosenFile = null;
protected ThreadOpenFile(Minecraft minecraft, String dialogTitle, IOpenFileCallback callback)
throws IllegalStateException {
protected ThreadOpenFile(Minecraft minecraft, String dialogTitle, IOpenFileCallback callback) throws IllegalStateException {
if (minecraft.isFullScreen()) {
throw new IllegalStateException("Cannot open an awt window whilst minecraft is in full screen mode!");
}

View file

@ -12,8 +12,7 @@ import java.io.File;
*/
public class ThreadOpenFilePNG extends ThreadOpenFile {
public ThreadOpenFilePNG(Minecraft minecraft, String dialogTitle, IOpenFileCallback callback)
throws IllegalStateException {
public ThreadOpenFilePNG(Minecraft minecraft, String dialogTitle, IOpenFileCallback callback) throws IllegalStateException {
super(minecraft, dialogTitle, callback);
}

View file

@ -14,14 +14,21 @@ import com.mumfrey.liteloader.modconfig.ExposableOptions;
@ExposableOptions(filename = "minelittlepony", strategy = ConfigStrategy.Unversioned)
public class PonyConfig extends SensibleConfig implements Exposable {
@Expose private PonyLevel ponylevel = PonyLevel.PONIES;
@Expose
private PonyLevel ponylevel = PonyLevel.PONIES;
@Expose public boolean sizes = true;
@Expose public boolean snuzzles = true;
@Expose public boolean hd = true;
@Expose public boolean showscale = true;
@Expose public boolean fpsmagic = true;
@Expose public boolean ponyskulls = true;
@Expose
public boolean sizes = true;
@Expose
public boolean snuzzles = true;
@Expose
public boolean hd = true;
@Expose
public boolean showscale = true;
@Expose
public boolean fpsmagic = true;
@Expose
public boolean ponyskulls = true;
public enum PonySettings implements Setting {
SIZES,
@ -32,15 +39,22 @@ public class PonyConfig extends SensibleConfig implements Exposable {
PONYSKULLS;
}
@Expose public boolean villagers = true;
@Expose public boolean zombies = true;
@Expose public boolean pigzombies = true;
@Expose public boolean skeletons = true;
@Expose public boolean illagers = true;
@Expose public boolean guardians = true;
@Expose
public boolean villagers = true;
@Expose
public boolean zombies = true;
@Expose
public boolean pigzombies = true;
@Expose
public boolean skeletons = true;
@Expose
public boolean illagers = true;
@Expose
public boolean guardians = true;
/**
* Gets the current PonyLevel. That is the level of ponies you would like to see.
*
* @param ignorePony true to ignore whatever value the setting has.
*/
public PonyLevel getEffectivePonyLevel(boolean ignorePony) {
@ -59,6 +73,7 @@ public class PonyConfig extends SensibleConfig implements Exposable {
/**
* Sets the pony level. Want MOAR PONEHS? Well here you go.
*
* @param ponylevel
*/
public void setPonyLevel(PonyLevel ponylevel) {

View file

@ -28,7 +28,8 @@ import java.util.UUID;
import java.util.stream.Collectors;
/**
* The PonyManager is responsible for reading and recoding all the pony data associated with an entity of skin.
* The PonyManager is responsible for reading and recoding all the pony data associated with an
* entity of skin.
*
*/
public class PonyManager implements IResourceManagerReloadListener, ISkinCacheClearListener {
@ -76,8 +77,8 @@ public class PonyManager implements IResourceManagerReloadListener, ISkinCacheCl
}
/**
* Gets or creates a pony for the given player.
* Delegates to the background-ponies registry if no pony skins were available and client settings allows it.
* Gets or creates a pony for the given player. Delegates to the background-ponies registry if no
* pony skins were available and client settings allows it.
*
* @param player the player
*/
@ -111,7 +112,8 @@ public class PonyManager implements IResourceManagerReloadListener, ISkinCacheCl
*
* Whether is has slim arms is determined by the id.
*
* Delegates to the background-ponies registry if no pony skins were available and client settings allows it.
* Delegates to the background-ponies registry if no pony skins were available and client settings
* allows it.
*
* @param resource A texture resource
* @param uuid id of a player or entity

View file

@ -17,8 +17,8 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
/**
* Render manager responsible for replacing and restoring entity renderers when the client settings change.
* Old values are persisted internally.
* Render manager responsible for replacing and restoring entity renderers when the client settings
* change. Old values are persisted internally.
*/
public class PonyRenderManager {

View file

@ -4,7 +4,8 @@ import net.minecraft.client.network.NetworkPlayerInfo;
public interface IPlayerInfo {
/**
* Returns true if the vanilla skin (the one returned by NetworkPlayerInfo.getSkinLocation) uses the ALEX model type.
* Returns true if the vanilla skin (the one returned by NetworkPlayerInfo.getSkinLocation) uses the
* ALEX model type.
*/
boolean usesSlimArms();

View file

@ -24,7 +24,8 @@ public class Slider extends GuiSlider {
}
@Override
public void setEntryValue(int id, boolean value) { }
public void setEntryValue(int id, boolean value) {
}
@Override
public void setEntryValue(int id, float value) {
@ -32,7 +33,8 @@ public class Slider extends GuiSlider {
}
@Override
public void setEntryValue(int id, String value) { }
public void setEntryValue(int id, String value) {
}
}
}

View file

@ -27,6 +27,7 @@ public class ModelWrapper implements IModelWrapper {
/**
* Returns the contained armour model.
*
* @return
*/
public PonyArmor getArmor() {

View file

@ -2,8 +2,7 @@ package com.minelittlepony.model;
public final class PonyModelConstants {
public static final float
PI = (float)Math.PI,
public static final float PI = (float)Math.PI,
BODY_CENTRE_X = 0,
BODY_CENTRE_Y = 8,

View file

@ -10,6 +10,7 @@ public interface IModel extends ICapitated {
/**
* Sets up this model's initial values, like a constructor...
*
* @param yOffset YPosition for this model. Always 0.
* @param stretch Scaling factor for this model. Ranges above or below 0 (no change).
*/
@ -40,8 +41,8 @@ public interface IModel extends ICapitated {
boolean isFlying();
/**
* Returns true if the model is elytra flying. Elytra flying is different
* from regular flying in that there are actual "wings" involved.
* Returns true if the model is elytra flying. Elytra flying is different from regular flying in
* that there are actual "wings" involved.
*/
boolean isElytraFlying();

View file

@ -3,6 +3,7 @@ package com.minelittlepony.model.capabilities;
public interface IModelPart {
/**
* Initialises all of the boxes in this modelpart.
*
* @param yOffset
* @param stretch
*/

View file

@ -14,6 +14,7 @@ public interface IModelUnicorn extends IModel {
/**
* Returns true if this model is currently using magic (horn is lit).
*
* @return
*/
boolean isCasting();

View file

@ -2,6 +2,7 @@ package com.minelittlepony.pony.data;
/**
* Interface for enums that can be parsed from an image trigger pixel value.
*
* @author Chris Albers
*
* @param <T>
@ -13,8 +14,8 @@ public interface ITriggerPixelMapped<T extends Enum<T> & ITriggerPixelMapped<T>>
int getTriggerPixel();
/**
* Gets the enum value corresponding to the given enum type and pixel value.
* If none are found, the first parameter is returned as the default.
* Gets the enum value corresponding to the given enum type and pixel value. If none are found, the
* first parameter is returned as the default.
*
* @param type Return type and default value.
* @param pixelValue The pixel colour to search for.

View file

@ -98,7 +98,8 @@ public class PonyData implements IPonyData {
}
/**
* Parses an image buffer into a new IPonyData representing the values stored in it's individual trigger pixels.
* Parses an image buffer into a new IPonyData representing the values stored in it's individual
* trigger pixels.
*/
static IPonyData parse(BufferedImage image) {
return new PonyData(image);

View file

@ -100,8 +100,8 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
}
/**
* Positions a given model in space by setting its offset values divided
* by 16 to account for scaling applied inside the model.
* Positions a given model in space by setting its offset values divided by 16 to account for
* scaling applied inside the model.
*/
public static <T extends ModelRenderer> T at(T renderer, float x, float y, float z) {
renderer.offsetX = x / 16;
@ -133,8 +133,8 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
}
/**
* Gets or creates a new child model based on its unique index.
* New children will be of the same type and inherit the same textures and offsets of the original.
* Gets or creates a new child model based on its unique index. New children will be of the same
* type and inherit the same textures and offsets of the original.
*/
public T child(int index) {
if (childModels == null || index >= childModels.size()) {

View file

@ -30,8 +30,8 @@ public class PonySkullRenderer extends TileEntitySkullRenderer implements IRende
private static final Map<Integer, ISkull> skullMap = new HashMap<>();
/**
* Resolves the games skull renderer to either a specialised pony skull renderer
* or some other skull renderer depending on the ponyskulls state.
* Resolves the games skull renderer to either a specialised pony skull renderer or some other skull
* renderer depending on the ponyskulls state.
*
* Original/Existing renderer is stored to a backup variable as a fallback in case of mods.
*/

View file

@ -28,13 +28,16 @@ public abstract class AbstractPonyLayer<T extends EntityLivingBase> implements L
* Renders this layer.
*
* @param entity The entity we're being called for.
* @param move Entity motion parameter - i.e. velocity in no specific direction used in bipeds to calculate step amount.
* @param move Entity motion parameter - i.e. velocity in no specific direction used in
* bipeds to calculate step amount.
* @param swing Degree to which each 'limb' swings.
* @param partialTicks Render partial ticks
* @param ticks Total whole and partial ticks since the entity's existance. Used in animations together with {@code swing} and {@code move}.
* @param ticks Total whole and partial ticks since the entity's existance. Used in
* animations together with {@code swing} and {@code move}.
* @param headYaw Horizontal head motion in radians.
* @param headPitch Vertical head motion in radians.
* @param scale Scaling factor used to render this model. Determined by the return value of {@link RenderLivingBase.prepareScale}. Usually {@code 0.0625F}.
* @param scale Scaling factor used to render this model. Determined by the return value of
* {@link RenderLivingBase.prepareScale}. Usually {@code 0.0625F}.
*/
protected abstract void doPonyRender(T entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale);

View file

@ -1,7 +1,10 @@
package com.minelittlepony.render.plane;
enum Face {
NORTH, SOUTH,
UP, DOWN,
EAST, WEST;
NORTH,
SOUTH,
UP,
DOWN,
EAST,
WEST;
}

View file

@ -53,8 +53,7 @@ public abstract class SensibleConfig {
public boolean setValue(Setting key, boolean value) {
try {
this.getClass().getField(key.name().toLowerCase()).setBoolean(this, value);
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ignored) {
}
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ignored) {}
return value;
}
}