mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 15:03:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec694d2833 | ||
|
|
e878c8e276 | ||
|
|
b284f46d45 | ||
|
|
a4dc958482 | ||
|
|
6a762101ad | ||
|
|
9eb040ee6f | ||
|
|
3ef15ad081 | ||
|
|
1d92c0dd7f | ||
|
|
13d6533edc | ||
|
|
a4373ebe5c | ||
|
|
f91de79376 | ||
|
|
567cd3e78b | ||
|
|
84e23b3e8e | ||
|
|
eba2bf1f86 | ||
|
|
47bd83e29e | ||
|
|
f7b49fccdd |
No files matched your search
@@ -84,6 +84,8 @@ public final class Config {
|
|||||||
public static boolean reinforcedObsidianEnabled = true;
|
public static boolean reinforcedObsidianEnabled = true;
|
||||||
public static boolean reinforcedObsidianUseDarkSteelBlocks = false;
|
public static boolean reinforcedObsidianUseDarkSteelBlocks = false;
|
||||||
|
|
||||||
|
public static boolean enforceOfflinePlayerUUID = false;
|
||||||
|
|
||||||
public static boolean useAlternateBinderRecipe = false;
|
public static boolean useAlternateBinderRecipe = false;
|
||||||
|
|
||||||
public static boolean useAlternateTesseractModel = false;
|
public static boolean useAlternateTesseractModel = false;
|
||||||
@@ -1035,6 +1037,13 @@ public final class Config {
|
|||||||
"Enable per tick sampling on individual power inputs and outputs. This allows slightly more detailed messages from the RF Reader but has a negative impact on server performance.")
|
"Enable per tick sampling on individual power inputs and outputs. This allows slightly more detailed messages from the RF Reader but has a negative impact on server performance.")
|
||||||
.getBoolean(detailedPowerTrackingEnabled);
|
.getBoolean(detailedPowerTrackingEnabled);
|
||||||
|
|
||||||
|
enforceOfflinePlayerUUID = config.get(
|
||||||
|
sectionAdvanced.name,
|
||||||
|
"enforceOfflinePlayerUUID",
|
||||||
|
false,
|
||||||
|
"Enforces to use the players offline UUID. Recommendet to use before creating your world, otherwise it might breaks all secuity related things.")
|
||||||
|
.getBoolean(enforceOfflinePlayerUUID);
|
||||||
|
|
||||||
useSneakMouseWheelYetaWrench = config.get(
|
useSneakMouseWheelYetaWrench = config.get(
|
||||||
sectionPersonal.name,
|
sectionPersonal.name,
|
||||||
"useSneakMouseWheelYetaWrench",
|
"useSneakMouseWheelYetaWrench",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraftforge.common.UsernameCache;
|
import net.minecraftforge.common.UsernameCache;
|
||||||
|
|
||||||
import com.enderio.core.common.util.PlayerUtil;
|
import com.enderio.core.common.util.PlayerUtil;
|
||||||
@@ -13,6 +14,7 @@ import com.google.common.base.Charsets;
|
|||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import crazypants.enderio.Log;
|
import crazypants.enderio.Log;
|
||||||
|
import crazypants.enderio.config.Config;
|
||||||
|
|
||||||
public class UserIdent {
|
public class UserIdent {
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@ public class UserIdent {
|
|||||||
* changes, implement them and write a log message.
|
* changes, implement them and write a log message.
|
||||||
*/
|
*/
|
||||||
public static @Nonnull UserIdent create(@Nonnull String suuid, @Nullable String playerName) {
|
public static @Nonnull UserIdent create(@Nonnull String suuid, @Nullable String playerName) {
|
||||||
if (NONE_MARKER.equals(suuid)) {
|
if (NONE_MARKER.equals(suuid) || Config.enforceOfflinePlayerUUID) {
|
||||||
return new UserIdent(null, playerName);
|
return new UserIdent(null, playerName);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -110,8 +112,7 @@ public class UserIdent {
|
|||||||
*/
|
*/
|
||||||
public static @Nonnull UserIdent create(@Nullable GameProfile gameProfile) {
|
public static @Nonnull UserIdent create(@Nullable GameProfile gameProfile) {
|
||||||
if (gameProfile != null && (gameProfile.getId() != null || gameProfile.getName() != null)) {
|
if (gameProfile != null && (gameProfile.getId() != null || gameProfile.getName() != null)) {
|
||||||
if (gameProfile.getId() != null && gameProfile.getName() != null
|
if (gameProfile.getName() != null && (Config.enforceOfflinePlayerUUID || !isOnlineMode())) {
|
||||||
&& gameProfile.getId().equals(offlineUUID(gameProfile.getName()))) {
|
|
||||||
return new UserIdent(null, gameProfile.getName());
|
return new UserIdent(null, gameProfile.getName());
|
||||||
} else {
|
} else {
|
||||||
return new UserIdent(gameProfile.getId(), gameProfile.getName());
|
return new UserIdent(gameProfile.getId(), gameProfile.getName());
|
||||||
@@ -121,6 +122,11 @@ public class UserIdent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isOnlineMode() {
|
||||||
|
MinecraftServer server = MinecraftServer.getServer();
|
||||||
|
return server != null ? server.isServerInOnlineMode() : true;
|
||||||
|
}
|
||||||
|
|
||||||
private static @Nonnull UUID offlineUUID(String playerName) {
|
private static @Nonnull UUID offlineUUID(String playerName) {
|
||||||
UUID result = UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(Charsets.UTF_8));
|
UUID result = UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(Charsets.UTF_8));
|
||||||
return result != null ? result : new UUID(-1, -1);
|
return result != null ? result : new UUID(-1, -1);
|
||||||
@@ -221,6 +227,9 @@ public class UserIdent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
|
if (obj instanceof UUID) {
|
||||||
|
return getUUID().equals(obj);
|
||||||
|
}
|
||||||
return this == obj;
|
return this == obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user