Gigantic warning cleanup

This commit is contained in:
CrushedPixel
2015-08-31 17:46:26 +02:00
parent dd1aab16ef
commit 03aead65b6
13 changed files with 31 additions and 20 deletions

View File

@@ -10,9 +10,6 @@ public class CustomObjectRepository {
public CustomObjectRepository() { public CustomObjectRepository() {
this.objects = new ArrayList<CustomImageObject>(); this.objects = new ArrayList<CustomImageObject>();
} }
public CustomObjectRepository(List<CustomImageObject> objects) {
setObjects(objects);
}
public void setObjects(List<CustomImageObject> objects) { public void setObjects(List<CustomImageObject> objects) {
this.objects = new ArrayList<CustomImageObject>(objects); this.objects = new ArrayList<CustomImageObject>(objects);

View File

@@ -28,6 +28,7 @@ public class ReplayImageAsset implements ReplayAsset<BufferedImage> {
private String name; private String name;
@Override
public ReplayImageAsset copy() { public ReplayImageAsset copy() {
ReplayImageAsset newReplay = new ReplayImageAsset(name); ReplayImageAsset newReplay = new ReplayImageAsset(name);
newReplay.object = object; newReplay.object = object;

View File

@@ -379,6 +379,7 @@ public class GuiObjectManager extends GuiScreen implements GuiReplayOverlay.NoOv
} }
ReplayHandler.setCustomImageObjects(objects); ReplayHandler.setCustomImageObjects(objects);
} }
private void updateValuesForTransformation(Transformation transformation) { private void updateValuesForTransformation(Transformation transformation) {

View File

@@ -22,6 +22,7 @@ public class GuiReplaySettings extends GuiScreen {
this.parentGuiScreen = parentGuiScreen; this.parentGuiScreen = parentGuiScreen;
} }
@Override
public void initGui() { public void initGui() {
this.screenTitle = I18n.format("replaymod.gui.settings.title"); this.screenTitle = I18n.format("replaymod.gui.settings.title");
@@ -107,7 +108,7 @@ public class GuiReplaySettings extends GuiScreen {
super.drawScreen(mouseX, mouseY, partialTicks); super.drawScreen(mouseX, mouseY, partialTicks);
} }
@Override
protected void actionPerformed(GuiButton button) throws IOException { protected void actionPerformed(GuiButton button) throws IOException {
if(button.enabled) { if(button.enabled) {
switch(button.id) { switch(button.id) {

View File

@@ -75,7 +75,7 @@ public class ComposedElement implements GuiElement {
//if GuiOutsideClickableElement, forward mouse clicks outside of that element //if GuiOutsideClickableElement, forward mouse clicks outside of that element
if(!clicked || (part instanceof GuiOutsideClickableElement && !part.isHovering(mouseX, mouseY))) { if(!clicked || (part instanceof GuiOutsideClickableElement && !part.isHovering(mouseX, mouseY))) {
boolean cl = part.mouseClick(mc, mouseX, mouseY, button); boolean cl = part.mouseClick(mc, mouseX, mouseY, button);
if(cl) clicked = cl; if(cl) clicked = true;
} }
} }
return clicked; return clicked;

View File

@@ -74,11 +74,12 @@ public class GuiTextArea extends Gui implements GuiElement, GuiOutsideClickableE
public int textColorEnabled = 0xE0E0E0; public int textColorEnabled = 0xE0E0E0;
public int textColorDisabled = 0x707070; public int textColorDisabled = 0x707070;
/*
public GuiTextArea(FontRenderer fontRenderer, int positionX, int positionY, int width, int height, public GuiTextArea(FontRenderer fontRenderer, int positionX, int positionY, int width, int height,
int maxTextWidth, int maxTextHeight) { int maxTextWidth, int maxTextHeight) {
this(0, fontRenderer, positionX, positionY, width, height, maxTextWidth, maxTextHeight, -1); this(0, fontRenderer, positionX, positionY, width, height, maxTextWidth, maxTextHeight, -1);
} }
*/
public GuiTextArea(FontRenderer fontRenderer, int positionX, int positionY, int width, int height, public GuiTextArea(FontRenderer fontRenderer, int positionX, int positionY, int width, int height,
int maxTextWidth, int maxTextHeight, int maxCharCount) { int maxTextWidth, int maxTextHeight, int maxCharCount) {

View File

@@ -367,8 +367,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
searchQuery.server = searchServerInput.getText().trim(); searchQuery.server = searchServerInput.getText().trim();
} }
Boolean order = searchSortToggle.getValue() == 0; searchQuery.order = searchSortToggle.getValue() == 0;
searchQuery.order = order;
SearchPagination searchPagination = new SearchPagination(searchQuery); SearchPagination searchPagination = new SearchPagination(searchQuery);
showReplaySearch(searchPagination); showReplaySearch(searchPagination);

View File

@@ -55,9 +55,6 @@ public class GuiReplayOverlay extends Gui {
return new GuiTexturedButton(0, x, y, size, size, replay_gui, u, v, TEXTURE_SIZE, TEXTURE_SIZE, action, I18n.format(hoverText)); return new GuiTexturedButton(0, x, y, size, size, replay_gui, u, v, TEXTURE_SIZE, TEXTURE_SIZE, action, I18n.format(hoverText));
} }
private final int displayWidth = mc.displayWidth;
private final int displayHeight = mc.displayHeight;
private final Point screenDimensions = MouseUtils.getScaledDimensions(); private final Point screenDimensions = MouseUtils.getScaledDimensions();
private final int WIDTH = screenDimensions.getX(); private final int WIDTH = screenDimensions.getX();
private final int HEIGHT = screenDimensions.getY(); private final int HEIGHT = screenDimensions.getY();

View File

@@ -25,10 +25,12 @@ public class GuiRenameReplay extends GuiScreen {
this.file = file; this.file = file;
} }
@Override
public void updateScreen() { public void updateScreen() {
this.replayNameInput.updateCursorCounter(); this.replayNameInput.updateCursorCounter();
} }
@Override
public void initGui() { public void initGui() {
Keyboard.enableRepeatEvents(true); Keyboard.enableRepeatEvents(true);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -42,10 +44,12 @@ public class GuiRenameReplay extends GuiScreen {
this.replayNameInput.setText(s); this.replayNameInput.setText(s);
} }
@Override
public void onGuiClosed() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(false); Keyboard.enableRepeatEvents(false);
} }
@Override
protected void actionPerformed(GuiButton button) throws IOException { protected void actionPerformed(GuiButton button) throws IOException {
if(button.enabled) { if(button.enabled) {
if(button.id == 1) { if(button.id == 1) {
@@ -70,6 +74,7 @@ public class GuiRenameReplay extends GuiScreen {
} }
} }
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException { protected void keyTyped(char typedChar, int keyCode) throws IOException {
this.replayNameInput.textboxKeyTyped(typedChar, keyCode); this.replayNameInput.textboxKeyTyped(typedChar, keyCode);
((GuiButton) this.buttonList.get(0)).enabled = this.replayNameInput.getText().trim().length() > 0; ((GuiButton) this.buttonList.get(0)).enabled = this.replayNameInput.getText().trim().length() > 0;
@@ -79,11 +84,13 @@ public class GuiRenameReplay extends GuiScreen {
} }
} }
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
super.mouseClicked(mouseX, mouseY, mouseButton); super.mouseClicked(mouseX, mouseY, mouseButton);
this.replayNameInput.mouseClicked(mouseX, mouseY, mouseButton); this.replayNameInput.mouseClicked(mouseX, mouseY, mouseButton);
} }
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground(); this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.viewer.rename.title"), this.width / 2, 20, 16777215); this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.viewer.rename.title"), this.width / 2, 20, 16777215);

View File

@@ -19,6 +19,7 @@ public class GenericLinearInterpolation<T extends KeyframeValue> implements Inte
@Override @Override
public void prepare() {} public void prepare() {}
@Override
public void addPoint(T point) { public void addPoint(T point) {
points.add(point); points.add(point);

View File

@@ -33,6 +33,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import javax.annotation.Nonnull;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@@ -166,12 +167,14 @@ public class PacketListener extends DataListener {
if (levelDir.isFile()) { if (levelDir.isFile()) {
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.ACCEPTED)); netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(mc.getResourcePackRepository().func_177319_a(levelDir), new FutureCallback() { Futures.addCallback(mc.getResourcePackRepository().func_177319_a(levelDir), new FutureCallback() {
@Override
public void onSuccess(Object result) { public void onSuccess(Object result) {
recordResourcePack(levelDir, requestId); recordResourcePack(levelDir, requestId);
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED)); netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
} }
public void onFailure(Throwable throwable) { @Override
public void onFailure(@Nonnull Throwable throwable) {
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD)); netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
} }
}); });
@@ -187,8 +190,10 @@ public class PacketListener extends DataListener {
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.DECLINED)); netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.DECLINED));
} else { } else {
mc.addScheduledTask(new Runnable() { mc.addScheduledTask(new Runnable() {
@Override
public void run() { public void run() {
mc.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() { mc.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
@Override
public void confirmClicked(boolean result, int id) { public void confirmClicked(boolean result, int id) {
if (serverData != null) { if (serverData != null) {
serverData.setResourceMode(result ? ServerData.ServerResourceMode.ENABLED : ServerData.ServerResourceMode.DISABLED); serverData.setResourceMode(result ? ServerData.ServerResourceMode.ENABLED : ServerData.ServerResourceMode.DISABLED);
@@ -224,11 +229,13 @@ public class PacketListener extends DataListener {
private void downloadResourcePackFuture(int requestId, String url, final String hash) { private void downloadResourcePackFuture(int requestId, String url, final String hash) {
Futures.addCallback(downloadResourcePack(requestId, url, hash), new FutureCallback() { Futures.addCallback(downloadResourcePack(requestId, url, hash), new FutureCallback() {
@Override
public void onSuccess(Object result) { public void onSuccess(Object result) {
mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED)); mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
} }
public void onFailure(Throwable throwable) { @Override
public void onFailure(@Nonnull Throwable throwable) {
mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD)); mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
} }
}); });
@@ -278,6 +285,7 @@ public class PacketListener extends DataListener {
final Minecraft mc = Minecraft.getMinecraft(); final Minecraft mc = Minecraft.getMinecraft();
Futures.getUnchecked(mc.addScheduledTask(new Runnable() { Futures.getUnchecked(mc.addScheduledTask(new Runnable() {
@Override
public void run() { public void run() {
mc.displayGuiScreen(guiScreen); mc.displayGuiScreen(guiScreen);
} }
@@ -286,12 +294,14 @@ public class PacketListener extends DataListener {
Map sessionInfo = Minecraft.getSessionInfo(); Map sessionInfo = Minecraft.getSessionInfo();
repo.field_177322_i = HttpUtil.func_180192_a(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy()); repo.field_177322_i = HttpUtil.func_180192_a(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy());
Futures.addCallback(repo.field_177322_i, new FutureCallback() { Futures.addCallback(repo.field_177322_i, new FutureCallback() {
@Override
public void onSuccess(Object value) { public void onSuccess(Object value) {
recordResourcePack(file, requestId); recordResourcePack(file, requestId);
repo.func_177319_a(file); repo.func_177319_a(file);
} }
public void onFailure(Throwable throwable) { @Override
public void onFailure(@Nonnull Throwable throwable) {
throwable.printStackTrace(); throwable.printStackTrace();
} }
}); });

View File

@@ -13,8 +13,6 @@ public class LightingHandler {
private static float initialGamma = 0; private static float initialGamma = 0;
private static boolean enabled = false;
public static void setLighting(boolean lighting) { public static void setLighting(boolean lighting) {
float gamma = mc.gameSettings.getOptionFloatValue(Options.GAMMA); float gamma = mc.gameSettings.getOptionFloatValue(Options.GAMMA);
@@ -25,8 +23,6 @@ public class LightingHandler {
if(lighting) mc.gameSettings.setOptionFloatValue(Options.GAMMA, AMBIENT_GAMMA); if(lighting) mc.gameSettings.setOptionFloatValue(Options.GAMMA, AMBIENT_GAMMA);
else mc.gameSettings.setOptionFloatValue(Options.GAMMA, initialGamma); else mc.gameSettings.setOptionFloatValue(Options.GAMMA, initialGamma);
enabled = lighting;
if(ReplayMod.replaySender.paused()) { if(ReplayMod.replaySender.paused()) {
mc.entityRenderer.lightmapUpdateNeeded = true; mc.entityRenderer.lightmapUpdateNeeded = true;
} }