Cleaned up a lot of different inspections

This commit is contained in:
Nicholas Ignoffo 2018-03-01 19:27:38 -08:00
parent 0dd0854bd9
commit 70d98455b7
207 changed files with 603 additions and 731 deletions

View file

@ -17,7 +17,6 @@ public class TileAlchemyArray extends TileInventory implements ITickable, IAlche
public boolean isActive = false;
public int activeCounter = 0;
public EnumFacing rotation = EnumFacing.HORIZONTALS[0];
;
private String key = "empty";
private AlchemyArrayEffect arrayEffect;

View file

@ -168,7 +168,7 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory,
}
public List<Integer> getAccessibleInputSlots(EnumFacing direction) {
List<Integer> list = new ArrayList<Integer>();
List<Integer> list = new ArrayList<>();
for (int i = 0; i < 6; i++) {
if (isInputSlotAccessible(i)) {
@ -185,7 +185,7 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory,
return;
}
List<ItemStack> inputList = new ArrayList<ItemStack>();
List<ItemStack> inputList = new ArrayList<>();
for (int i = 0; i < 6; i++) {
if (!getStackInSlot(i).isEmpty()) {

View file

@ -17,7 +17,7 @@ import java.util.Map.Entry;
public class TileDemonCrucible extends TileInventory implements ITickable, IDemonWillConduit, ISidedInventory {
public final int maxWill = 100;
public final double gemDrainRate = 10;
public HashMap<EnumDemonWillType, Double> willMap = new HashMap<EnumDemonWillType, Double>(); //TODO: Change to DemonWillHolder
public HashMap<EnumDemonWillType, Double> willMap = new HashMap<>(); //TODO: Change to DemonWillHolder
public int internalCounter = 0;
public TileDemonCrucible() {

View file

@ -22,7 +22,7 @@ import java.util.Map.Entry;
public class TileIncenseAltar extends TileInventory implements ITickable {
public static int maxCheckRange = 5;
public AreaDescriptor incenseArea = new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11);
public Map<EnumTranquilityType, Double> tranquilityMap = new HashMap<EnumTranquilityType, Double>();
public Map<EnumTranquilityType, Double> tranquilityMap = new HashMap<>();
public double incenseAddition = 0; //Self-sacrifice is multiplied by 1 plus this value.
public double tranquility = 0;
@ -55,7 +55,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable {
if (hasPerformed) {
if (getWorld().rand.nextInt(4) == 0 && getWorld() instanceof WorldServer) {
WorldServer server = (WorldServer) getWorld();
server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0, new int[0]);
server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0);
}
}
}
@ -80,7 +80,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable {
int maxLength = 11; //Max length of the path. The path starts two blocks away from the center block.
int yOffset = 0;
Map<EnumTranquilityType, Double> tranquilityMap = new HashMap<EnumTranquilityType, Double>();
Map<EnumTranquilityType, Double> tranquilityMap = new HashMap<>();
for (int currentDistance = 2; currentDistance < currentDistance + maxLength; currentDistance++) {
boolean canFormRoad = false;
@ -116,7 +116,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable {
continue; //TODO: Can make this just set j to currentDistance to speed it up.
}
for (int y = 0 + yOffset; y <= 2 + yOffset; y++) {
for (int y = yOffset; y <= 2 + yOffset; y++) {
BlockPos offsetPos = pos.add(i, y, j);
IBlockState state = getWorld().getBlockState(offsetPos);
Block block = state.getBlock();

View file

@ -19,7 +19,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraftforge.common.animation.Event;
import net.minecraftforge.common.animation.ITimeValue;
import net.minecraftforge.common.animation.TimeValues.VariableValue;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.model.animation.CapabilityAnimation;
@ -64,7 +63,7 @@ public class TileInversionPillar extends TileTicking {
public TileInversionPillar(EnumDemonWillType type) {
this.type = type;
asm = BloodMagic.proxy.load(new ResourceLocation(BloodMagic.MODID.toLowerCase(), "asms/block/inversion_pillar.json"), ImmutableMap.<String, ITimeValue>of("offset", animationOffset, "cycle_length", cycleLength));
asm = BloodMagic.proxy.load(new ResourceLocation(BloodMagic.MODID.toLowerCase(), "asms/block/inversion_pillar.json"), ImmutableMap.of("offset", animationOffset, "cycle_length", cycleLength));
animationOffsetValue = -1;
}

View file

@ -40,7 +40,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
private Ritual currentRitual;
private EnumFacing direction = EnumFacing.NORTH;
private boolean inverted;
private List<EnumDemonWillType> currentActiveWillConfig = new ArrayList<EnumDemonWillType>();
private List<EnumDemonWillType> currentActiveWillConfig = new ArrayList<>();
@Override
public void onUpdate() {
@ -322,7 +322,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
@Override
public List<EnumDemonWillType> getActiveWillConfig() {
return new ArrayList<EnumDemonWillType>(currentActiveWillConfig);
return new ArrayList<>(currentActiveWillConfig);
}
@Override
@ -330,17 +330,17 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
//There is probably an easier way to make expanded chat messages
if (typeList.size() >= 1) {
Object[] translations = new TextComponentTranslation[typeList.size()];
String constructedString = "%s";
StringBuilder constructedString = new StringBuilder("%s");
for (int i = 1; i < typeList.size(); i++) {
constructedString = constructedString + ", %s";
constructedString.append(", %s");
}
for (int i = 0; i < typeList.size(); i++) {
translations[i] = new TextComponentTranslation("tooltip.bloodmagic.currentBaseType." + typeList.get(i).name.toLowerCase());
}
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.set", new TextComponentTranslation(constructedString, translations)));
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.set", new TextComponentTranslation(constructedString.toString(), translations)));
} else {
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.void"));
}

View file

@ -339,9 +339,7 @@ public class TileMimic extends TileInventory implements ITickable {
try {
_blockMetadata.setInt(tile, replacementMeta);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
} catch (IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}

View file

@ -57,7 +57,7 @@ public class TilePurificationAltar extends TileInventory implements ITickable {
if (hasPerformed) {
if (getWorld().rand.nextInt(4) == 0 && getWorld() instanceof WorldServer) {
WorldServer server = (WorldServer) getWorld();
server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0, new int[0]);
server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0);
}
}
}

View file

@ -72,7 +72,7 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil
double soulsInGem = getWill(EnumDemonWillType.DEFAULT);
List<ItemStack> inputList = new ArrayList<ItemStack>();
List<ItemStack> inputList = new ArrayList<>();
for (int i = 0; i < 4; i++)
if (!getStackInSlot(i).isEmpty())

View file

@ -20,10 +20,10 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
public static final int tickRate = 20;
private int currentInput;
// A list of connections
private TreeMap<BlockPos, List<BlockPos>> connectionMap = new TreeMap<BlockPos, List<BlockPos>>();
private List<BlockPos> generalNodeList = new LinkedList<BlockPos>();
private List<BlockPos> outputNodeList = new LinkedList<BlockPos>();
private List<BlockPos> inputNodeList = new LinkedList<BlockPos>();
private TreeMap<BlockPos, List<BlockPos>> connectionMap = new TreeMap<>();
private List<BlockPos> generalNodeList = new LinkedList<>();
private List<BlockPos> outputNodeList = new LinkedList<>();
private List<BlockPos> inputNodeList = new LinkedList<>();
public TileMasterRoutingNode() {
super(0, "masterRoutingNode");
@ -43,12 +43,12 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
return;
}
Map<Integer, List<IItemFilter>> outputMap = new TreeMap<Integer, List<IItemFilter>>();
Map<Integer, List<IFluidFilter>> outputFluidMap = new TreeMap<Integer, List<IFluidFilter>>();
Map<Integer, List<IItemFilter>> outputMap = new TreeMap<>();
Map<Integer, List<IFluidFilter>> outputFluidMap = new TreeMap<>();
for (BlockPos outputPos : outputNodeList) {
TileEntity outputTile = getWorld().getTileEntity(outputPos);
if (this.isConnected(new LinkedList<BlockPos>(), outputPos)) {
if (this.isConnected(new LinkedList<>(), outputPos)) {
if (outputTile instanceof IOutputItemRoutingNode) {
IOutputItemRoutingNode outputNode = (IOutputItemRoutingNode) outputTile;
@ -63,7 +63,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
if (outputMap.containsKey(priority)) {
outputMap.get(priority).add(filter);
} else {
List<IItemFilter> filterList = new LinkedList<IItemFilter>();
List<IItemFilter> filterList = new LinkedList<>();
filterList.add(filter);
outputMap.put(priority, filterList);
}
@ -85,7 +85,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
if (outputMap.containsKey(priority)) {
outputFluidMap.get(priority).add(filter);
} else {
List<IFluidFilter> filterList = new LinkedList<IFluidFilter>();
List<IFluidFilter> filterList = new LinkedList<>();
filterList.add(filter);
outputFluidMap.put(priority, filterList);
}
@ -95,12 +95,12 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
}
}
Map<Integer, List<IItemFilter>> inputMap = new TreeMap<Integer, List<IItemFilter>>();
Map<Integer, List<IFluidFilter>> inputFluidMap = new TreeMap<Integer, List<IFluidFilter>>();
Map<Integer, List<IItemFilter>> inputMap = new TreeMap<>();
Map<Integer, List<IFluidFilter>> inputFluidMap = new TreeMap<>();
for (BlockPos inputPos : inputNodeList) {
TileEntity inputTile = getWorld().getTileEntity(inputPos);
if (this.isConnected(new LinkedList<BlockPos>(), inputPos)) {
if (this.isConnected(new LinkedList<>(), inputPos)) {
if (inputTile instanceof IInputItemRoutingNode) {
IInputItemRoutingNode inputNode = (IInputItemRoutingNode) inputTile;
@ -115,7 +115,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
if (inputMap.containsKey(priority)) {
inputMap.get(priority).add(filter);
} else {
List<IItemFilter> filterList = new LinkedList<IItemFilter>();
List<IItemFilter> filterList = new LinkedList<>();
filterList.add(filter);
inputMap.put(priority, filterList);
}
@ -137,7 +137,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
if (inputMap.containsKey(priority)) {
inputFluidMap.get(priority).add(filter);
} else {
List<IFluidFilter> filterList = new LinkedList<IFluidFilter>();
List<IFluidFilter> filterList = new LinkedList<>();
filterList.add(filter);
inputFluidMap.put(priority, filterList);
}
@ -315,7 +315,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
if (connectionMap.containsKey(pos1) && !connectionMap.get(pos1).contains(pos2)) {
connectionMap.get(pos1).add(pos2);
} else {
List<BlockPos> list = new LinkedList<BlockPos>();
List<BlockPos> list = new LinkedList<>();
list.add(pos2);
connectionMap.put(pos1, list);
}
@ -323,7 +323,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
if (connectionMap.containsKey(pos2) && !connectionMap.get(pos2).contains(pos1)) {
connectionMap.get(pos2).add(pos1);
} else {
List<BlockPos> list = new LinkedList<BlockPos>();
List<BlockPos> list = new LinkedList<>();
list.add(pos1);
connectionMap.put(pos2, list);
}
@ -360,7 +360,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
@Override
public List<BlockPos> getConnected() {
return new LinkedList<BlockPos>();
return new LinkedList<>();
}
@Override

View file

@ -21,7 +21,7 @@ import java.util.List;
public class TileRoutingNode extends TileInventory implements IRoutingNode, IItemRoutingNode, ITickable {
private int currentInput;
private BlockPos masterPos = BlockPos.ORIGIN;
private List<BlockPos> connectionList = new LinkedList<BlockPos>();
private List<BlockPos> connectionList = new LinkedList<>();
public TileRoutingNode(int size, String name) {
super(size, name);