Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Getter for original map in IntMap
Dieser Commit ist enthalten in:
Ursprung
1ad559212e
Commit
623cdaf881
@ -30,8 +30,8 @@ import java.util.Map.Entry;
|
|||||||
public class ConnectionData {
|
public class ConnectionData {
|
||||||
private static final BlockChangeRecord[] A = new BlockChangeRecord[0];
|
private static final BlockChangeRecord[] A = new BlockChangeRecord[0];
|
||||||
public static BlockConnectionProvider blockConnectionProvider;
|
public static BlockConnectionProvider blockConnectionProvider;
|
||||||
static IntObjectMap<String> idToKey = CollectionUtil.createIntObjectMap(8581);
|
static IntObjectMap<String> idToKey = CollectionUtil.createIntObjectMap(8582);
|
||||||
static Map<String, Integer> keyToId = new HashMap<>(8581);
|
static Map<String, Integer> keyToId = new HashMap<>(8582);
|
||||||
static IntObjectMap<ConnectionHandler> connectionHandlerMap = CollectionUtil.createIntObjectMap(1);
|
static IntObjectMap<ConnectionHandler> connectionHandlerMap = CollectionUtil.createIntObjectMap(1);
|
||||||
static IntObjectMap<BlockData> blockConnectionData = CollectionUtil.createIntObjectMap(1);
|
static IntObjectMap<BlockData> blockConnectionData = CollectionUtil.createIntObjectMap(1);
|
||||||
static IntSet occludingStates = CollectionUtil.createIntSet(377);
|
static IntSet occludingStates = CollectionUtil.createIntSet(377);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package us.myles.ViaVersion.util.fastutil;
|
package us.myles.ViaVersion.util.fastutil;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very simple wrapping interface to either be implemented by a HashMap or FastUtil's OpenHashMap.
|
* Very simple wrapping interface to either be implemented by a HashMap or FastUtil's OpenHashMap.
|
||||||
*/
|
*/
|
||||||
@ -32,4 +34,13 @@ public interface IntMap {
|
|||||||
* @see java.util.HashMap#remove(Object)
|
* @see java.util.HashMap#remove(Object)
|
||||||
*/
|
*/
|
||||||
int remove(int key);
|
int remove(int key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the underlying map for usage of not implemented methods of this class.
|
||||||
|
*
|
||||||
|
* @return original map
|
||||||
|
* @deprecated will cause wrapping if it is a FastUtil collection
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
Map<Integer, Integer> getMap();
|
||||||
}
|
}
|
||||||
|
@ -35,4 +35,9 @@ final class WrappedFUIntMap implements IntMap {
|
|||||||
public int remove(int key) {
|
public int remove(int key) {
|
||||||
return map.remove(key);
|
return map.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Integer, Integer> getMap() {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
@ -32,6 +32,12 @@ final class WrappedIntMap implements IntMap {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(int key) {
|
public int remove(int key) {
|
||||||
return map.remove(key);
|
Integer removed = map.remove(key);
|
||||||
|
return removed != null ? removed : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Integer, Integer> getMap() {
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren