mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
The Great Reformat; moving to google-java-style w/ 4 space indent and 120 column line wrap
This commit is contained in:
1 parent
c632cc6af9
commit
e0b7ea62a4
933 files changed
+95734
-108818
No files matched your search
@@ -4,70 +4,58 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class KeySync
|
||||
{
|
||||
public static int ASCEND = 0;
|
||||
public static int DESCEND = 1;
|
||||
public class KeySync {
|
||||
|
||||
public Map<EntityPlayer, KeySet> keys = new HashMap<>();
|
||||
public static int ASCEND = 0;
|
||||
public static int DESCEND = 1;
|
||||
|
||||
public static class KeySet
|
||||
{
|
||||
public Set<Integer> keysActive = new HashSet<>();
|
||||
public Map<EntityPlayer, KeySet> keys = new HashMap<>();
|
||||
|
||||
public KeySet(int key)
|
||||
{
|
||||
keysActive.add(key);
|
||||
}
|
||||
}
|
||||
public KeySet getPlayerKeys(EntityPlayer player) {
|
||||
return keys.get(player);
|
||||
}
|
||||
|
||||
public KeySet getPlayerKeys(EntityPlayer player)
|
||||
{
|
||||
return keys.get(player);
|
||||
}
|
||||
public void add(EntityPlayer player, int key) {
|
||||
if (!keys.containsKey(player)) {
|
||||
keys.put(player, new KeySet(key));
|
||||
return;
|
||||
}
|
||||
|
||||
public void add(EntityPlayer player, int key)
|
||||
{
|
||||
if(!keys.containsKey(player))
|
||||
{
|
||||
keys.put(player, new KeySet(key));
|
||||
return;
|
||||
}
|
||||
keys.get(player).keysActive.add(key);
|
||||
}
|
||||
|
||||
keys.get(player).keysActive.add(key);
|
||||
}
|
||||
public void remove(EntityPlayer player, int key) {
|
||||
if (!keys.containsKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
public void remove(EntityPlayer player, int key)
|
||||
{
|
||||
if(!keys.containsKey(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
keys.get(player).keysActive.remove(key);
|
||||
}
|
||||
|
||||
keys.get(player).keysActive.remove(key);
|
||||
}
|
||||
public boolean has(EntityPlayer player, int key) {
|
||||
if (!keys.containsKey(player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean has(EntityPlayer player, int key)
|
||||
{
|
||||
if(!keys.containsKey(player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return keys.get(player).keysActive.contains(key);
|
||||
}
|
||||
|
||||
return keys.get(player).keysActive.contains(key);
|
||||
}
|
||||
public void update(EntityPlayer player, int key, boolean add) {
|
||||
if (add) {
|
||||
add(player, key);
|
||||
} else {
|
||||
remove(player, key);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(EntityPlayer player, int key, boolean add)
|
||||
{
|
||||
if(add)
|
||||
{
|
||||
add(player, key);
|
||||
}
|
||||
else {
|
||||
remove(player, key);
|
||||
}
|
||||
}
|
||||
public static class KeySet {
|
||||
|
||||
public Set<Integer> keysActive = new HashSet<>();
|
||||
|
||||
public KeySet(int key) {
|
||||
keysActive.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user