Java 7 and 8 cleanup

Diamond operator <>
Lambdas and method references
This commit is contained in:
Tom Elfring committed 2017-08-05 17:50:38 +02:00
1 parent 3db03edbc9
commit b72d6efab3
234 files changed
+1614 -2253

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ import net.minecraftforge.oredict.OreDictionary;
public class MekanismAPI
{
//Add a BlockInfo value here if you don't want a certain block to be picked up by cardboard boxes
private static Set<BlockInfo> cardboardBoxIgnore = new HashSet<BlockInfo>();
private static Set<BlockInfo> cardboardBoxIgnore = new HashSet<>();
/** Mekanism debug mode */
public static boolean debug = false;
+1 -1
View File
@@ -83,7 +83,7 @@ public class Range4D
public Set<Chunk3D> getIntersectingChunks()
{
Set<Chunk3D> set = new HashSet<Chunk3D>();
Set<Chunk3D> set = new HashSet<>();
for(int chunkX = xMin >> 4; chunkX <= xMax-1 >> 4; chunkX++)
{
@@ -7,7 +7,7 @@ import net.minecraftforge.fluids.Fluid;
public class GasRegistry
{
private static ArrayList<Gas> registeredGasses = new ArrayList<Gas>();
private static ArrayList<Gas> registeredGasses = new ArrayList<>();
/**
* Register a new gas into GasRegistry.
@@ -13,10 +13,10 @@ import net.minecraft.item.ItemStack;
public class InfuseRegistry
{
/** The (private) map of ItemStacks and their related InfuseObjects. */
private static Map<ItemStack, InfuseObject> infuseObjects = new HashMap<ItemStack, InfuseObject>();
private static Map<ItemStack, InfuseObject> infuseObjects = new HashMap<>();
/** The (private) map of infuse names and their corresponding InfuseTypes. */
private static Map<String, InfuseType> infuseTypes = new HashMap<String, InfuseType>();
private static Map<String, InfuseType> infuseTypes = new HashMap<>();
/**
* Registers an InfuseType into the registry. Call this in PreInit!
@@ -31,11 +31,11 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
public LinkedHashSet<IGridTransmitter<A, N>> transmittersToAdd = Sets.newLinkedHashSet();
public LinkedHashSet<IGridTransmitter<A, N>> transmittersAdded = Sets.newLinkedHashSet();
public HashMap<Coord4D, A> possibleAcceptors = new HashMap<Coord4D, A>();
public HashMap<Coord4D, EnumSet<EnumFacing>> acceptorDirections = new HashMap<Coord4D, EnumSet<EnumFacing>>();
public HashMap<Coord4D, A> possibleAcceptors = new HashMap<>();
public HashMap<Coord4D, EnumSet<EnumFacing>> acceptorDirections = new HashMap<>();
public HashMap<IGridTransmitter<A, N>, EnumSet<EnumFacing>> changedAcceptors = Maps.newHashMap();
private Set<DelayQueue> updateQueue = new LinkedHashSet<DelayQueue>();
private Set<DelayQueue> updateQueue = new LinkedHashSet<>();
protected Range4D packetRange = null;
@@ -148,15 +148,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
public void invalidate()
{
//Remove invalid transmitters first for share calculations
for(Iterator<IGridTransmitter<A, N>> iter = transmitters.iterator(); iter.hasNext();)
{
IGridTransmitter<A, N> transmitter = iter.next();
if(!transmitter.isValid())
{
iter.remove();
}
}
transmitters.removeIf(transmitter -> !transmitter.isValid());
//Clamp the new buffer
clampBuffer();
@@ -160,7 +160,7 @@ public class TransmitterNetworkRegistry
{
if(startOrphan.isValid() && startOrphan.isOrphan())
{
OrphanPathFinder<A, N> finder = new OrphanPathFinder<A, N>(startOrphan);
OrphanPathFinder<A, N> finder = new OrphanPathFinder<>(startOrphan);
finder.start();
N network;