mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52563aa5c2 |
No files matched your search
+28
-43
@@ -1,4 +1,4 @@
|
||||
//version: 1680120787
|
||||
//version: 1677938302
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -65,7 +65,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false
|
||||
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false
|
||||
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
|
||||
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version ,unused, available for addon.gradle
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
|
||||
id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version
|
||||
id 'de.undercouch.download' version '5.3.0'
|
||||
@@ -73,7 +73,7 @@ plugins {
|
||||
id 'com.diffplug.spotless' version '6.7.2' apply false
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.4'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.2'
|
||||
}
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
@@ -153,21 +153,13 @@ java {
|
||||
} else {
|
||||
languageVersion.set(projectJavaVersion)
|
||||
}
|
||||
vendor.set(JvmVendorSpec.AZUL)
|
||||
vendor.set(JvmVendorSpec.ADOPTIUM)
|
||||
}
|
||||
if (!noPublishedSources) {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
tasks.withType(ScalaCompile).configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
|
||||
// If Kotlin is enabled in the project
|
||||
kotlin {
|
||||
@@ -230,7 +222,7 @@ if (enableModernJavaSyntax.toBoolean()) {
|
||||
|
||||
javaCompiler.set(javaToolchains.compilerFor {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
vendor.set(JvmVendorSpec.AZUL)
|
||||
vendor.set(JvmVendorSpec.ADOPTIUM)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -405,6 +397,8 @@ minecraft {
|
||||
extraRunJvmArguments.add("-ea:${modGroup}")
|
||||
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
extraTweakClasses.add("org.spongepowered.asm.launch.MixinTweaker")
|
||||
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
extraRunJvmArguments.addAll([
|
||||
"-Dmixin.debug.countInjections=true",
|
||||
@@ -519,6 +513,14 @@ repositories {
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
maven {
|
||||
name = "Fabric Maven"
|
||||
url = "https://maven.fabricmc.net/"
|
||||
}
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
@@ -557,49 +559,29 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
def mixinProviderGroup = "io.github.legacymoddingmc"
|
||||
def mixinProviderModule = "unimixins"
|
||||
def mixinProviderVersion = "0.1.6"
|
||||
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
|
||||
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
|
||||
|
||||
dependencies {
|
||||
if (usesMixins.toBoolean()) {
|
||||
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
|
||||
annotationProcessor('com.google.guava:guava:24.1.1-jre')
|
||||
annotationProcessor('com.google.code.gson:gson:2.8.6')
|
||||
annotationProcessor(mixinProviderSpec)
|
||||
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
implementation(mixinProviderSpec)
|
||||
} else if (forceEnableMixins.toBoolean()) {
|
||||
runtimeOnlyNonPublishable(mixinProviderSpec)
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
implementation('com.gtnewhorizon:gtnhmixins:2.1.13')
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
if (usesMixins.toBoolean()) {
|
||||
dependencies {
|
||||
kapt(mixinProviderSpec)
|
||||
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replace old mixin mods with unimixins
|
||||
// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier
|
||||
configurations.all {
|
||||
resolutionStrategy.dependencySubstitution {
|
||||
substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
|
||||
substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
|
||||
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
|
||||
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
|
||||
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
@@ -713,13 +695,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.3.3'
|
||||
def lwjgl3ifyVersion = '1.1.35'
|
||||
def asmVersion = '9.4'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.4')
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40')
|
||||
}
|
||||
|
||||
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
|
||||
@@ -811,6 +793,10 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
|
||||
}
|
||||
this.classpath(project.java17DependenciesCfg)
|
||||
|
||||
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) {
|
||||
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1020,7 +1006,6 @@ idea {
|
||||
}
|
||||
compiler.javac {
|
||||
afterEvaluate {
|
||||
javacAdditionalOptions = "-encoding utf8"
|
||||
moduleJavacAdditionalOptions = [
|
||||
(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
|
||||
]
|
||||
@@ -1140,7 +1125,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) {
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
addModrinthDep("required", "project", "unimixins")
|
||||
addModrinthDep("required", "project", "gtnhmixins")
|
||||
}
|
||||
tasks.modrinth.dependsOn(build)
|
||||
tasks.publish.dependsOn(tasks.modrinth)
|
||||
@@ -1184,7 +1169,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
addCurseForgeRelation("requiredDependency", "unimixins")
|
||||
addCurseForgeRelation("requiredDependency", "gtnhmixins")
|
||||
}
|
||||
tasks.curseforge.dependsOn(build)
|
||||
tasks.publish.dependsOn(tasks.curseforge)
|
||||
@@ -1219,7 +1204,7 @@ def addCurseForgeRelation(String type, String name) {
|
||||
|
||||
// Updating
|
||||
|
||||
def buildscriptGradleVersion = "8.0.2"
|
||||
def buildscriptGradleVersion = "8.0.1"
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
gradleVersion = buildscriptGradleVersion
|
||||
|
||||
+8
-9
@@ -2,20 +2,19 @@
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.2.13:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.6.5:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
|
||||
implementation("com.github.GTNewHorizons:GTNHLib:0.0.13:dev")
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.33:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.5.8:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.35-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.27:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.24:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-195-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.23:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-168-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.14.1:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.13.6:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-GTNH:api') {transitive = false}
|
||||
implementation('com.github.GTNewHorizons:Chisel:2.10.17-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:api') {transitive = false}
|
||||
implementation('com.github.GTNewHorizons:Chisel:2.10.8-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.13-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
|
||||
@@ -248,7 +248,7 @@ public class ConduitUtil {
|
||||
|
||||
public static <T extends IConduit> Collection<T> getConnectedConduits(World world, int x, int y, int z,
|
||||
Class<T> type) {
|
||||
TileEntity te = world.blockExists(x, y, z) ? world.getTileEntity(x, y, z) : null;
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -155,16 +155,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public boolean canConnectToExternal(ForgeDirection dir, boolean ignoreDisabled) {
|
||||
World world = getBundle().getWorld();
|
||||
BlockCoord pos = getLocation();
|
||||
|
||||
final int exactPosX = pos.x + dir.offsetX;
|
||||
final int exactPosY = pos.y + dir.offsetY;
|
||||
final int exactPosZ = pos.z + dir.offsetZ;
|
||||
|
||||
if (!world.blockExists(exactPosX, exactPosY, exactPosZ)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity te = world.getTileEntity(exactPosX, exactPosY, exactPosZ);
|
||||
TileEntity te = world.getTileEntity(pos.x + dir.offsetX, pos.y + dir.offsetY, pos.z + dir.offsetZ);
|
||||
|
||||
if (te instanceof TileConduitBundle) {
|
||||
return false;
|
||||
@@ -314,11 +305,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
private void onNodeChanged(BlockCoord location) {
|
||||
World world = getBundle().getWorld();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
BlockCoord dirLocation = location.getLocation(dir);
|
||||
TileEntity te = null;
|
||||
if (world.blockExists(dirLocation.x, dirLocation.y, dirLocation.z)) {
|
||||
te = location.getLocation(dir).getTileEntity(world);
|
||||
}
|
||||
TileEntity te = location.getLocation(dir).getTileEntity(world);
|
||||
if (te != null && te instanceof IGridHost && !(te instanceof IConduitBundle)) {
|
||||
IGridNode node = ((IGridHost) te).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (node == null) {
|
||||
@@ -334,12 +321,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
@Override
|
||||
public void onAddedToBundle() {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
World world = getBundle().getWorld();
|
||||
BlockCoord dirLocation = getLocation().getLocation(dir);
|
||||
TileEntity te = null;
|
||||
if (world.blockExists(dirLocation.x, dirLocation.y, dirLocation.z)) {
|
||||
te = dirLocation.getTileEntity(world);
|
||||
}
|
||||
TileEntity te = getLocation().getLocation(dir).getTileEntity(getBundle().getWorld());
|
||||
if (te instanceof TileConduitBundle) {
|
||||
IMEConduit cond = ((TileConduitBundle) te).getConduit(IMEConduit.class);
|
||||
if (cond != null) {
|
||||
|
||||
@@ -84,8 +84,6 @@ public final class Config {
|
||||
public static boolean reinforcedObsidianEnabled = true;
|
||||
public static boolean reinforcedObsidianUseDarkSteelBlocks = false;
|
||||
|
||||
public static boolean enforceOfflinePlayerUUID = false;
|
||||
|
||||
public static boolean useAlternateBinderRecipe = false;
|
||||
|
||||
public static boolean useAlternateTesseractModel = false;
|
||||
@@ -103,7 +101,6 @@ public final class Config {
|
||||
public static int transceiverUpkeepCostRF = 10;
|
||||
public static int transceiverBucketTransmissionCostRF = 100;
|
||||
public static int transceiverMaxIoRF = 20480;
|
||||
public static int transceiverInternalBuffer = 500000;
|
||||
public static boolean transceiverUseEasyRecipe = false;
|
||||
|
||||
public static File configDirectory;
|
||||
@@ -1005,13 +1002,6 @@ public final class Config {
|
||||
transceiverMaxIoRF,
|
||||
"Maximum RF/t sent and received by a Dimensional Transceiver per tick. Input and output limits are not cumulative")
|
||||
.getInt(transceiverMaxIoRF);
|
||||
transceiverInternalBuffer = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"transceiverInternalBuffer",
|
||||
transceiverInternalBuffer,
|
||||
"Maximum RF for the send/receive buffer. Need to be at least transceiverMaxIoRF.")
|
||||
.getInt(transceiverInternalBuffer);
|
||||
transceiverBucketTransmissionCostRF = config
|
||||
.get(
|
||||
sectionEfficiency.name,
|
||||
@@ -1033,13 +1023,6 @@ 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.")
|
||||
.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(
|
||||
sectionPersonal.name,
|
||||
"useSneakMouseWheelYetaWrench",
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TileTransceiver extends AbstractPoweredTaskEntity
|
||||
private final ICapacitor capacitor = new BasicCapacitor(
|
||||
0,
|
||||
Config.transceiverMaxIoRF * 2,
|
||||
Config.transceiverInternalBuffer,
|
||||
500000,
|
||||
Config.transceiverMaxIoRF);
|
||||
private boolean sendChannelsDirty = false;
|
||||
private boolean recieveChannelsDirty = false;
|
||||
|
||||
@@ -15,10 +15,14 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovementInput;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -33,9 +37,7 @@ import com.enderio.core.common.vecmath.Vector2d;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.google.common.collect.MultimapBuilder;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
import com.gtnewhorizon.gtnhlib.GTNHLib;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
@@ -336,7 +338,7 @@ public class TravelController {
|
||||
}
|
||||
|
||||
if (displayOutOfRangeMessage && distanceMap.isEmpty()) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
}
|
||||
|
||||
return distanceMap.values().stream().findFirst();
|
||||
@@ -530,7 +532,7 @@ public class TravelController {
|
||||
TravelController.instance.selectedCoord.z);
|
||||
}
|
||||
} else {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +578,8 @@ public class TravelController {
|
||||
if (te instanceof ITravelAccessable) {
|
||||
ITravelAccessable ta = (ITravelAccessable) te;
|
||||
if (!ta.canBlockBeAccessed(player)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -590,13 +593,14 @@ public class TravelController {
|
||||
|
||||
if (!isInRangeTarget(player, coord, source.getMaxDistanceTravelledSq())) {
|
||||
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!isValidTarget(player, coord, source)) {
|
||||
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -626,7 +630,7 @@ public class TravelController {
|
||||
if (requiredPower > canUsePower) {
|
||||
// make sure chat is sent only once per trial
|
||||
if (!insufficientPower) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.itemTravelStaff.notEnoughPower"));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("enderio.itemTravelStaff.notEnoughPower"));
|
||||
insufficientPower = true;
|
||||
}
|
||||
return -1;
|
||||
@@ -741,16 +745,17 @@ public class TravelController {
|
||||
|
||||
if (Config.travelAnchorSkipWarning) {
|
||||
if (travelBlock.getRequiresPassword(player)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.skipLocked"));
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("enderio.gui.travelAccessable.skipLocked"));
|
||||
}
|
||||
|
||||
if (travelBlock.getAccessMode() == ITravelAccessable.AccessMode.PRIVATE
|
||||
&& !travelBlock.canUiBeAccessed(player)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.skipPrivate"));
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("enderio.gui.travelAccessable.skipPrivate"));
|
||||
}
|
||||
if (!isValidTarget(player, targetBlock, TravelSource.BLOCK)) {
|
||||
showMessage(
|
||||
player,
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("enderio.gui.travelAccessable.skipObstructed"));
|
||||
}
|
||||
}
|
||||
@@ -939,21 +944,4 @@ public class TravelController {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void showMessage(EntityPlayer player, IChatComponent chatComponent) {
|
||||
if (Loader.isModLoaded("gtnhlib")) {
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
chatComponent.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));
|
||||
GTNHLib.proxy.sendMessageAboveHotbar((EntityPlayerMP) player, chatComponent, 60, true, true);
|
||||
} else {
|
||||
GTNHLib.proxy.printMessageAboveHotbar(
|
||||
EnumChatFormatting.WHITE + chatComponent.getFormattedText(),
|
||||
60,
|
||||
true,
|
||||
true);
|
||||
}
|
||||
} else {
|
||||
player.addChatComponentMessage(chatComponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,12 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.UsernameCache;
|
||||
|
||||
import com.enderio.core.common.util.PlayerUtil;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class UserIdent {
|
||||
|
||||
@@ -78,7 +75,7 @@ public class UserIdent {
|
||||
* changes, implement them and write a log message.
|
||||
*/
|
||||
public static @Nonnull UserIdent create(@Nonnull String suuid, @Nullable String playerName) {
|
||||
if (NONE_MARKER.equals(suuid) || Config.enforceOfflinePlayerUUID) {
|
||||
if (NONE_MARKER.equals(suuid)) {
|
||||
return new UserIdent(null, playerName);
|
||||
}
|
||||
try {
|
||||
@@ -112,7 +109,8 @@ public class UserIdent {
|
||||
*/
|
||||
public static @Nonnull UserIdent create(@Nullable GameProfile gameProfile) {
|
||||
if (gameProfile != null && (gameProfile.getId() != null || gameProfile.getName() != null)) {
|
||||
if (gameProfile.getName() != null && (Config.enforceOfflinePlayerUUID || !isOnlineMode())) {
|
||||
if (gameProfile.getId() != null && gameProfile.getName() != null
|
||||
&& gameProfile.getId().equals(offlineUUID(gameProfile.getName()))) {
|
||||
return new UserIdent(null, gameProfile.getName());
|
||||
} else {
|
||||
return new UserIdent(gameProfile.getId(), gameProfile.getName());
|
||||
@@ -122,11 +120,6 @@ public class UserIdent {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isOnlineMode() {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
return server != null ? server.isServerInOnlineMode() : true;
|
||||
}
|
||||
|
||||
private static @Nonnull UUID offlineUUID(String playerName) {
|
||||
UUID result = UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(Charsets.UTF_8));
|
||||
return result != null ? result : new UUID(-1, -1);
|
||||
@@ -227,9 +220,6 @@ public class UserIdent {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof UUID) {
|
||||
return getUUID().equals(obj);
|
||||
}
|
||||
return this == obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user