Skip to content

Commit

Permalink
Remove last usage of Trove
Browse files Browse the repository at this point in the history
Minecraft uses it internally, so we can rely on this always being
around. I do not belive Trove exists within 1.13.
  • Loading branch information
SquidDev committed Nov 22, 2018
1 parent 71ee692 commit 0829506
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

import dan200.computercraft.ComputerCraft;
import dan200.computercraft.client.gui.*;
import dan200.computercraft.client.render.ItemPocketRenderer;
import dan200.computercraft.client.render.ItemPrintoutRenderer;
import dan200.computercraft.client.render.RenderOverlayCable;
import dan200.computercraft.client.render.TileEntityCableRenderer;
import dan200.computercraft.client.render.TileEntityMonitorRenderer;
import dan200.computercraft.client.render.*;
import dan200.computercraft.shared.command.ContainerViewComputer;
import dan200.computercraft.shared.computer.blocks.ComputerState;
import dan200.computercraft.shared.computer.blocks.TileComputer;
Expand All @@ -35,7 +31,7 @@
import dan200.computercraft.shared.turtle.blocks.TileTurtle;
import dan200.computercraft.shared.turtle.entity.TurtleVisionCamera;
import dan200.computercraft.shared.util.Colour;
import gnu.trove.map.hash.TIntIntHashMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiNewChat;
Expand Down Expand Up @@ -75,7 +71,7 @@

public class ComputerCraftProxyClient extends ComputerCraftProxyCommon
{
private static TIntIntHashMap lastCounts = new TIntIntHashMap();
private static Int2IntOpenHashMap lastCounts = new Int2IntOpenHashMap();

private long m_tick;
private long m_renderFrame;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dan200.computercraft.core.tracking;

import dan200.computercraft.core.computer.Computer;
import gnu.trove.map.hash.TObjectLongHashMap;
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;

import javax.annotation.Nullable;
import java.lang.ref.WeakReference;
Expand All @@ -18,13 +18,13 @@ public class ComputerTracker
private long serverCount;
private long serverTime;

private final TObjectLongHashMap<TrackingField> fields;
private final Object2LongOpenHashMap<TrackingField> fields;

public ComputerTracker( Computer computer )
{
this.computer = new WeakReference<>( computer );
this.computerId = computer.getID();
this.fields = new TObjectLongHashMap<>();
this.fields = new Object2LongOpenHashMap<>();
}

ComputerTracker( ComputerTracker timings )
Expand All @@ -39,7 +39,7 @@ public ComputerTracker( Computer computer )
this.serverCount = timings.serverCount;
this.serverTime = timings.serverTime;

this.fields = new TObjectLongHashMap<>( timings.fields );
this.fields = new Object2LongOpenHashMap<>( timings.fields );
}

@Nullable
Expand Down Expand Up @@ -90,7 +90,7 @@ void addValue( TrackingField field, long change )
{
synchronized( fields )
{
fields.adjustOrPutValue( field, change, change );
fields.addTo( field, change );
}
}

Expand Down

0 comments on commit 0829506

Please sign in to comment.