Various warning fixes

This commit is contained in:
Raven Szewczyk committed 2022-09-22 09:46:01 +01:00
1 parent 5f216b5d3e
commit 8b275cc5a3
13 files changed
+30 -25

No files matched your search

@@ -13,9 +13,9 @@ public class MonitoredTileList<E> extends MonitoredList<E> {
// private Map<String, Integer> count = new HashMap<String, Integer>();
private Table<Block, Integer, Integer> count = HashBasedTable.create();
private Map<Object, BlockData> blockdata = new WeakHashMap();
private Map<Object, BlockData> blockdata = new WeakHashMap<>();
private class BlockData {
private static class BlockData {
public final Block block;
public final int meta;
@@ -81,7 +81,7 @@ public class MonitoredTileList<E> extends MonitoredList<E> {
@Override
public void printCount() {
for (Cell c : this.count.cellSet())
for (Cell<Block, Integer, Integer> c : this.count.cellSet())
CoreDescription.log.info(String.format("%s | %s : %s", c.getRowKey(), c.getColumnKey(), c.getValue()));
}
@@ -50,7 +50,11 @@ public enum TabPanelRegistrar implements ChangeListener {
}
public void refreshAll() {
for (ITabPanel panel : this.lookup.values()) if (panel.refreshOnString()) panel.refresh();
for (ITabPanel panel : this.lookup.values()) {
if (panel.refreshOnString()) {
panel.refresh();
}
}
}
@Override
@@ -28,6 +28,7 @@ public class CommandChunkDump extends CommandBase implements IOpisCommand {
}
@Override
@SuppressWarnings("unchecked")
public void processCommand(ICommandSender icommandsender, String[] astring) {
modOpis.log.log(Level.INFO, "== CHUNK DUMP ==");
@@ -37,7 +37,7 @@ public class CommandKill extends CommandBase implements IOpisCommand {
World world = DimensionManager.getWorld(dim);
if (world == null) {
icommandsender.addChatMessage(
new ChatComponentText(String.format("\u00A7oCannot find dim %d in world %d", dim)));
new ChatComponentText(String.format("\u00A7oCannot find dim %d in world", dim)));
return;
}
@@ -107,8 +107,8 @@ public enum DataType {
return type;
}
public static Class getForOrdinal(int ordinal) {
Class retVal;
public static Class<?> getForOrdinal(int ordinal) {
Class<?> retVal;
try {
DataType type = DataType.values()[ordinal];
retVal = bimap.get(type);
@@ -9,7 +9,7 @@ import mcp.mobius.opis.data.profilers.ProfilerRenderEntity;
import net.minecraft.entity.Entity;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
public class DataEntityRender implements Comparable {
public class DataEntityRender implements Comparable<DataEntityRender> {
public int eid;
public long npoints;
@@ -32,7 +32,7 @@ public class DataEntityRender implements Comparable {
}
@Override
public int compareTo(Object o) {
return this.update.compareTo(((DataEntityRender) o).update);
public int compareTo(DataEntityRender o) {
return this.update.compareTo(o.update);
}
}
@@ -12,7 +12,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
public class DataBlockTileEntity implements ISerializable, Comparable {
public class DataBlockTileEntity implements ISerializable, Comparable<DataBlockTileEntity> {
public short id;
public short meta;
@@ -52,7 +52,7 @@ public class DataBlockTileEntity implements ISerializable, Comparable {
}
@Override
public int compareTo(Object o) {
return this.update.compareTo(((DataBlockTileEntity) o).update);
public int compareTo(DataBlockTileEntity o) {
return this.update.compareTo(o.update);
}
}
@@ -11,7 +11,7 @@ import mcp.mobius.opis.data.profilers.ProfilerEntityUpdate;
import net.minecraft.entity.Entity;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
public class DataEntity implements ISerializable, Comparable {
public class DataEntity implements ISerializable, Comparable<DataEntity> {
public int eid;
public long npoints;
@@ -53,7 +53,7 @@ public class DataEntity implements ISerializable, Comparable {
}
@Override
public int compareTo(Object o) {
return this.update.compareTo(((DataEntity) o).update);
public int compareTo(DataEntity o) {
return this.update.compareTo(o.update);
}
}
@@ -6,7 +6,7 @@ import mcp.mobius.opis.data.holders.basetypes.CoordinatesBlock;
import mcp.mobius.opis.data.holders.basetypes.CoordinatesChunk;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
public abstract class StatAbstract implements Comparable, ISerializable {
public abstract class StatAbstract implements Comparable<StatAbstract>, ISerializable {
protected DescriptiveStatistics dstat = new DescriptiveStatistics();
public Long dataPoints = 0L;
protected Double geomMean = null;
@@ -63,8 +63,8 @@ public abstract class StatAbstract implements Comparable, ISerializable {
}
@Override
public int compareTo(Object o) {
double value = ((StatAbstract) o).getGeometricMean() - this.getGeometricMean();
public int compareTo(StatAbstract o) {
double value = o.getGeometricMean() - this.getGeometricMean();
if (value > 0) return 1;
if (value < 0) return -1;
return 0;
@@ -54,8 +54,8 @@ public class StatsChunk extends StatAbstract {
}
@Override
public int compareTo(Object o) {
double value = ((StatAbstract) o).getDataSum() - this.getDataSum();
public int compareTo(StatAbstract o) {
double value = o.getDataSum() - this.getDataSum();
if (value > 0) return 1;
if (value < 0) return -1;
return 0;
@@ -30,7 +30,7 @@ public class TrueTypeFont {
private IntObject[] charArray = new IntObject[256];
/** Map of user defined font characters (Character <-> IntObject) */
private Map customChars = new HashMap();
private Map<Character, IntObject> customChars = new HashMap<>();
/** Boolean flag on whether AntiAliasing is enabled or not */
private boolean antiAlias;
@@ -39,7 +39,7 @@ public abstract class PacketBase {
throw new RuntimeException("Packet is not going the right way ! Client side packet seen server side.");
}
protected ISerializable dataRead(Class datatype, ByteArrayDataInput istream) {
protected ISerializable dataRead(Class<?> datatype, ByteArrayDataInput istream) {
if (datatype == null) return new DataError();
try {
@@ -58,12 +58,12 @@ public class PacketReqData extends PacketBase {
this.dataReq = Message.values()[input.readInt()];
if (input.readBoolean()) {
Class datatype = DataType.getForOrdinal(input.readInt());
Class<?> datatype = DataType.getForOrdinal(input.readInt());
this.param1 = dataRead(datatype, input);
}
if (input.readBoolean()) {
Class datatype = DataType.getForOrdinal(input.readInt());
Class<?> datatype = DataType.getForOrdinal(input.readInt());
this.param2 = dataRead(datatype, input);
}
}