mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 06:53:24 +00:00
#781 Enabled Dim. Trans. to work on offline servers.
This commit is contained in:
1 parent
9040a64dd0
commit
296bd08514
9 files changed
+24
-24
No files matched your search
@@ -198,9 +198,9 @@ public class BlockHyperCube extends BlockEio implements IGuiHandler, IResourceTo
|
||||
return null;
|
||||
}
|
||||
|
||||
UUID user = null;
|
||||
String user = null;
|
||||
if(!tag.getBoolean("channelIsPublic")) {
|
||||
user = UUID.fromString(tag.getString("channelUser"));
|
||||
user = tag.getString("channelUser");
|
||||
}
|
||||
return new Channel(channelName, user);
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import java.util.UUID;
|
||||
public class Channel {
|
||||
|
||||
final String name;
|
||||
final UUID user;
|
||||
final String user;
|
||||
|
||||
Channel(String name, UUID uuid) {
|
||||
Channel(String name, String uuid) {
|
||||
this.name = trim(name);
|
||||
this.user = uuid;
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ public class GuiHyperCube extends GuiScreenBase {
|
||||
|
||||
Channel c;
|
||||
if(privateButton.isSelected()) {
|
||||
c = new Channel(newChannelTF.getText(), Minecraft.getMinecraft().thePlayer.getGameProfile().getId());
|
||||
c = new Channel(newChannelTF.getText(), Minecraft.getMinecraft().thePlayer.getGameProfile().getName());
|
||||
} else {
|
||||
c = new Channel(newChannelTF.getText(), null);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class HyperCubeConfig {
|
||||
|
||||
private final List<Channel> publicChannels = new ArrayList<Channel>();
|
||||
|
||||
private final Map<UUID, List<Channel>> userChannels = new HashMap<UUID, List<Channel>>();
|
||||
private final Map<String, List<Channel>> userChannels = new HashMap<String, List<Channel>>();
|
||||
|
||||
private final File file;
|
||||
|
||||
@@ -53,11 +53,11 @@ public class HyperCubeConfig {
|
||||
publicChannels.addAll(chans);
|
||||
}
|
||||
|
||||
public Map<UUID, List<Channel>> getUserChannels() {
|
||||
public Map<String, List<Channel>> getUserChannels() {
|
||||
return userChannels;
|
||||
}
|
||||
|
||||
public void setUserChannels(Map<UUID, List<Channel>> channels) {
|
||||
public void setUserChannels(Map<String, List<Channel>> channels) {
|
||||
userChannels.clear();
|
||||
userChannels.putAll(channels);
|
||||
}
|
||||
@@ -68,10 +68,10 @@ public class HyperCubeConfig {
|
||||
setChannelListProperty(KEY_PUBLIC_CHANNELS, publicChannels);
|
||||
|
||||
StringBuilder userListStr = new StringBuilder();
|
||||
Iterator<Entry<UUID, List<Channel>>> itr = userChannels.entrySet().iterator();
|
||||
Iterator<Entry<String, List<Channel>>> itr = userChannels.entrySet().iterator();
|
||||
while (itr.hasNext()) {
|
||||
Entry<UUID, List<Channel>> entry = itr.next();
|
||||
UUID user = entry.getKey();
|
||||
Entry<String, List<Channel>> entry = itr.next();
|
||||
String user = entry.getKey();
|
||||
|
||||
List<Channel> channels = entry.getValue();
|
||||
if(user != null && channels != null && !channels.isEmpty()) {
|
||||
@@ -134,15 +134,15 @@ public class HyperCubeConfig {
|
||||
loadChannelList(KEY_PUBLIC_CHANNELS, null, publicChannels);
|
||||
|
||||
userChannels.clear();
|
||||
List<UUID> users = new ArrayList<UUID>();
|
||||
List<String> users = new ArrayList<String>();
|
||||
String usersStr = props.getProperty(KEY_USERS, "");
|
||||
String[] usersSplit = usersStr.split(DELIM);
|
||||
for (String user : usersSplit) {
|
||||
if(user != null) {
|
||||
users.add(UUID.fromString(user));
|
||||
users.add(user);
|
||||
}
|
||||
}
|
||||
for (UUID user : users) {
|
||||
for (String user : users) {
|
||||
List<Channel> channels = new ArrayList<Channel>();
|
||||
loadChannelList(user + KEY_USER_CHANNEL, user, channels);
|
||||
if(!channels.isEmpty()) {
|
||||
@@ -152,7 +152,7 @@ public class HyperCubeConfig {
|
||||
|
||||
}
|
||||
|
||||
private void loadChannelList(String key, UUID user, List<Channel> channels) {
|
||||
private void loadChannelList(String key, String user, List<Channel> channels) {
|
||||
String chans = props.getProperty(key, "");
|
||||
//chans = chans.replaceAll(DELIM_ESC, DELIM);
|
||||
String[] chanSplit = chans.split(DELIM);
|
||||
|
||||
@@ -24,7 +24,7 @@ public class HyperCubeRegister {
|
||||
private final List<Channel> publicChannels = new ArrayList<Channel>();
|
||||
private final List<Channel> publicChannelsRO = Collections.unmodifiableList(publicChannels);
|
||||
|
||||
private final Map<UUID, List<Channel>> userChannels = new HashMap<UUID, List<Channel>>();
|
||||
private final Map<String, List<Channel>> userChannels = new HashMap<String, List<Channel>>();
|
||||
|
||||
//private Configuration config;
|
||||
private HyperCubeConfig conf;
|
||||
@@ -45,7 +45,7 @@ public class HyperCubeRegister {
|
||||
userChannels.putAll(conf.getUserChannels());
|
||||
}
|
||||
|
||||
public synchronized List<Channel> getChannelsForUser(UUID user) {
|
||||
public synchronized List<Channel> getChannelsForUser(String user) {
|
||||
List<Channel> result = userChannels.get(user);
|
||||
if(result == null) {
|
||||
result = new ArrayList<Channel>();
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PacketAddRemoveChannel implements IMessage, IMessageHandler<PacketA
|
||||
if(!isPublic) {
|
||||
user = ByteBufUtils.readUTF8String(data);
|
||||
}
|
||||
channel = new Channel(name, user == null ? null : UUID.fromString(user));
|
||||
channel = new Channel(name, user == null ? null : user);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,16 +16,16 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
|
||||
|
||||
private boolean isPrivate;
|
||||
private List<Channel> channels;
|
||||
private UUID userId;
|
||||
private String userId;
|
||||
|
||||
public PacketChannelList() {
|
||||
}
|
||||
|
||||
public PacketChannelList(EntityPlayer player, boolean isPrivate) {
|
||||
this(player.getGameProfile().getId(), isPrivate);
|
||||
this(player.getGameProfile().getName(), isPrivate);
|
||||
}
|
||||
|
||||
public PacketChannelList(UUID uuid, boolean isPrivate) {
|
||||
public PacketChannelList(String uuid, boolean isPrivate) {
|
||||
this.userId = uuid;
|
||||
this.isPrivate = isPrivate;
|
||||
if(isPrivate && uuid == null) {
|
||||
@@ -63,7 +63,7 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
|
||||
public void fromBytes(ByteBuf buffer) {
|
||||
isPrivate = buffer.readBoolean();
|
||||
if(isPrivate) {
|
||||
userId = UUID.fromString(ByteBufUtils.readUTF8String(buffer));
|
||||
userId = ByteBufUtils.readUTF8String(buffer);
|
||||
} else {
|
||||
userId = null;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class PacketClientState implements IMessage, IMessageHandler<PacketClient
|
||||
selectedChannel = null;
|
||||
if(name != null && name.trim().length() > 0) {
|
||||
if(user != null && user.trim().length() > 0) {
|
||||
selectedChannel = new Channel(name, UUID.fromString(user));
|
||||
selectedChannel = new Channel(name, user);
|
||||
} else {
|
||||
selectedChannel = new Channel(name, null);
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ public class TileHyperCube extends TileEntityEio implements IInternalPowerRecept
|
||||
String channelName = nbtRoot.getString("channelName");
|
||||
String channelUser = nbtRoot.getString("channelUser");
|
||||
if(channelName != null && !channelName.isEmpty()) {
|
||||
channel = new Channel(channelName, channelUser == null || channelUser.isEmpty() ? null : UUID.fromString(channelUser));
|
||||
channel = new Channel(channelName, channelUser == null || channelUser.isEmpty() ? null : channelUser);
|
||||
} else {
|
||||
channel = null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user