Compare commits

...
8 Commits
Author SHA1 Message Date
Martin Robertz 5b46f376eb Update dependencies.gradle 2023-04-23 11:12:50 +02:00
miozune 1a14946abb Show travel message above hotbar (#117) 2023-04-10 11:21:39 +02:00
Pilzinsel64 8ca820f71c prevent ghostloading (#115)
* prevent ghostloading by MEConduit

* prevent more ghostloading by MEConduit

* spottlessApply

* prevent ghostloading by ConduitUtil
2023-04-01 15:10:20 +02:00
D-Cysteine 4e40230bf3 Try to fix energy overflow (#114) 2023-03-29 17:25:43 +02:00
Pilzinsel64 76708883c0 needUpdateConnections only while updating cons (#113) 2023-03-23 21:12:11 +01:00
Pilzinsel64 0a1ee81780 Add comments for needUpdateConnections (#112)
* imrpove canConnectToExternal()

* needUpdateConnections

* add comments for needUpdateconnections
2023-03-23 06:46:13 +01:00
Pilzinsel64 1fd7ae7567 Improve canConnectToExternal() (#111)
* imrpove canConnectToExternal()

* needUpdateConnections
2023-03-22 23:43:32 +01:00
Pilzinsel64 251fcc26b0 Ultra Dense ME Conduits (#105)
* basic MEConduit DenseUltra implementation

* add assets for ME Conduit Dense Ultra

* fix icon array count

* fix previous commit

* finalize ultra dense me conduits

* add configu for Ultra Dense ME Conduits

* edit texture a little bit more

* adjust meConduitCoreDenseUltra.png

* fix enableMEUltraDenseConduits

* spottlessApply

* fix texture

* improve canConnectToExternal()
2023-03-19 10:35:42 +01:00
20 changed files with 234 additions and 80 deletions

No files matched your search

+43 -28
View File
@@ -1,4 +1,4 @@
//version: 1677938302
//version: 1680120787
/*
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.2'
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.4'
}
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
@@ -153,13 +153,21 @@ java {
} else {
languageVersion.set(projectJavaVersion)
}
vendor.set(JvmVendorSpec.ADOPTIUM)
vendor.set(JvmVendorSpec.AZUL)
}
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 {
@@ -222,7 +230,7 @@ if (enableModernJavaSyntax.toBoolean()) {
javaCompiler.set(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.ADOPTIUM)
vendor.set(JvmVendorSpec.AZUL)
})
}
}
@@ -397,8 +405,6 @@ 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",
@@ -513,14 +519,6 @@ 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/'
@@ -559,29 +557,49 @@ 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('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
annotationProcessor(mixinProviderSpec)
if (usesMixinDebug.toBoolean()) {
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
}
}
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
implementation('com.gtnewhorizon:gtnhmixins:2.1.13')
if (usesMixins.toBoolean()) {
implementation(mixinProviderSpec)
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
}
}
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
if (usesMixins.toBoolean()) {
dependencies {
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
kapt(mixinProviderSpec)
}
}
}
// 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'
@@ -695,13 +713,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.1.35'
def lwjgl3ifyVersion = '1.3.3'
def asmVersion = '9.4'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.4')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -793,10 +811,6 @@ 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")
}
}
}
@@ -1006,6 +1020,7 @@ idea {
}
compiler.javac {
afterEvaluate {
javacAdditionalOptions = "-encoding utf8"
moduleJavacAdditionalOptions = [
(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
]
@@ -1125,7 +1140,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) {
}
}
if (usesMixins.toBoolean()) {
addModrinthDep("required", "project", "gtnhmixins")
addModrinthDep("required", "project", "unimixins")
}
tasks.modrinth.dependsOn(build)
tasks.publish.dependsOn(tasks.modrinth)
@@ -1169,7 +1184,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null
}
}
if (usesMixins.toBoolean()) {
addCurseForgeRelation("requiredDependency", "gtnhmixins")
addCurseForgeRelation("requiredDependency", "unimixins")
}
tasks.curseforge.dependsOn(build)
tasks.publish.dependsOn(tasks.curseforge)
@@ -1204,7 +1219,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
def buildscriptGradleVersion = "8.0.1"
def buildscriptGradleVersion = "8.0.2"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
+9 -8
View File
@@ -2,19 +2,20 @@
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.2.13: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')
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')
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.23:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-168-GTNH:api') {transitive = false}
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:Baubles:1.0.1.14:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.13.6:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.14.1:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-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}
implementation('com.github.GTNewHorizons:Chisel:2.10.17-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-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
@@ -84,6 +84,18 @@ public abstract class AbstractConduit implements IConduit {
protected boolean connectionsDirty = true;
/**
* This shows if the currently running connection update should not finish with settings connectionsDirty to false.
* If this is true, it will trigger a reconnection on the next Tick.
* <p>
* Use the method needUpdateConnections() instead of setting this to true.
*
* @see needUpdateConnections()
*/
private boolean needUpdateConnections = false;
private boolean isUpdatingConnections = false;
protected AbstractConduit() {}
@Override
@@ -434,10 +446,13 @@ public abstract class AbstractConduit implements IConduit {
}
private void updateConnections() {
if (!connectionsDirty) {
if (!connectionsDirty && !needUpdateConnections) {
return;
}
isUpdatingConnections = true;
needUpdateConnections = false;
boolean externalConnectionsChanged = false;
List<ForgeDirection> copy = new ArrayList<ForgeDirection>(externalConnections);
// remove any no longer valid connections
@@ -462,6 +477,21 @@ public abstract class AbstractConduit implements IConduit {
}
connectionsDirty = false;
isUpdatingConnections = false;
}
/**
* This method prevents connection update from getting completed successfully by not settings connectionsDirty to
* false. This will trigger an connection update at the next Tick.
* <p>
* Only use this while executing updateConnections().
* <p>
* See this PR for more info: https://github.com/GTNewHorizons/EnderIO/pull/111
*/
protected void needUpdateConnections() {
if (isUpdatingConnections) {
needUpdateConnections = true;
}
}
@Override
@@ -682,6 +682,11 @@ public class ConduitRecipes {
addShaped(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', pureFluix, 'q', quartzFiber);
res.stackSize = 1;
addShaped(new ItemStack(EnderIO.itemMEConduit, 1, 1), "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
ItemStack resDense = new ItemStack(EnderIO.itemMEConduit, 1, 1);
ItemStack resUltra = new ItemStack(EnderIO.itemMEConduit, 1, 2);
addShaped(resDense, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
if (Config.enableMEUltraDenseConduits) {
addShaped(resUltra, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', resDense);
}
}
}
@@ -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.getTileEntity(x, y, z);
TileEntity te = world.blockExists(x, y, z) ? world.getTileEntity(x, y, z) : null;
if (!(te instanceof IConduitBundle)) {
return Collections.emptyList();
}
@@ -14,5 +14,7 @@ public interface IMEConduit extends IConduit {
boolean isDense();
boolean isDenseUltra();
int getChannelsInUse();
}
@@ -15,7 +15,8 @@ public class ItemMEConduit extends AbstractItemConduit {
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
new ItemConduitSubtype(ModObject.itemMEConduit.name(), "enderio:itemMeConduit"),
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense") };
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense"),
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "DenseUltra", "enderio:itemMeConduitDenseUltra") };
public static ItemMEConduit create() {
ItemMEConduit result = new ItemMEConduit();
@@ -13,6 +13,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridConnection;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
@@ -44,6 +45,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
public static IIcon[] longTextures;
private boolean isDense;
private boolean isDenseUltra;
private int playerID = -1;
public MEConduit() {
@@ -51,6 +53,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
}
public MEConduit(int itemDamage) {
isDenseUltra = itemDamage == 2;
isDense = itemDamage == 1;
}
@@ -59,14 +62,16 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
@Override
public void registerIcons(IIconRegister register) {
coreTextures = new IIcon[2];
longTextures = new IIcon[2];
coreTextures = new IIcon[3];
longTextures = new IIcon[3];
coreTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCore");
coreTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDense");
coreTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDenseUltra");
longTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduit");
longTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDense");
longTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDenseUltra");
}
@Override
@@ -76,8 +81,14 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
});
}
public static int getDamageForState(boolean isDense) {
return isDense ? 1 : 0;
public static int getDamageForState(boolean isDense, boolean isDenseUltra) {
if (isDenseUltra) {
return 2;
}
if (isDense) {
return 1;
}
return 0;
}
@Override
@@ -87,7 +98,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
@Override
public ItemStack createItem() {
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense));
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense, isDenseUltra));
}
@Override
@@ -105,6 +116,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
public void writeToNBT(NBTTagCompound nbtRoot) {
super.writeToNBT(nbtRoot);
nbtRoot.setBoolean("isDense", isDense);
nbtRoot.setBoolean("isDenseUltra", isDenseUltra);
nbtRoot.setInteger("playerID", playerID);
}
@@ -117,6 +129,9 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
} else {
playerID = -1;
}
if (nbtRoot.hasKey("isDenseUltra")) {
isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
}
}
public void setPlayerID(int playerID) {
@@ -140,7 +155,16 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
public boolean canConnectToExternal(ForgeDirection dir, boolean ignoreDisabled) {
World world = getBundle().getWorld();
BlockCoord pos = getLocation();
TileEntity te = world.getTileEntity(pos.x + dir.offsetX, pos.y + dir.offsetY, pos.z + dir.offsetZ);
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);
if (te instanceof TileConduitBundle) {
return false;
@@ -148,26 +172,44 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
// because the AE2 API doesn't allow an easy query like "which side can connect to an ME cable" it needs this
// mess
IGridNode node = null;
if (te instanceof IPartHost) {
IPart part = ((IPartHost) te).getPart(dir.getOpposite());
if (part == null) {
part = ((IPartHost) te).getPart(ForgeDirection.UNKNOWN);
return part != null;
}
if (part.getExternalFacingNode() != null) {
return true;
if (part != null) {
node = part.getExternalFacingNode();
if (node == null) {
node = part.getGridNode();
}
if (node == null) {
// The GridNode has not been initialized yet, let's try on the next Tick.
needUpdateConnections();
}
}
String name = part.getClass().getSimpleName();
return "PartP2PTunnelME".equals(name) || "PartQuartzFiber".endsWith(name)
|| "PartToggleBus".equals(name)
|| "PartInvertedToggleBus".equals(name);
} else if (te instanceof IGridHost) {
IGridNode node = ((IGridHost) te).getGridNode(dir.getOpposite());
node = ((IGridHost) te).getGridNode(dir.getOpposite());
if (node == null) {
node = ((IGridHost) te).getGridNode(ForgeDirection.UNKNOWN);
}
if (node != null) {
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
}
if (node != null) {
return canConnectToGridNode(node, dir);
}
return false;
}
@Method(modid = "appliedenergistics2")
private Boolean canConnectToGridNode(IGridNode node, ForgeDirection dir) {
if (node.getGridBlock().getConnectableSides().contains(dir.getOpposite())) {
if (isDenseUltra()) {
return node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)
|| ((node.hasFlag(GridFlags.DENSE_CAPACITY)) && !node.hasFlag(GridFlags.CANNOT_CARRY));
} else if (isDense()) {
return true;
} else {
return !node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY);
}
}
return false;
@@ -175,7 +217,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
@Override
public IIcon getTextureForState(CollidableComponent component) {
int state = getDamageForState(isDense);
int state = getDamageForState(isDense, isDenseUltra);
if (component.dir == ForgeDirection.UNKNOWN) {
return coreTextures[state];
} else {
@@ -272,7 +314,11 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
private void onNodeChanged(BlockCoord location) {
World world = getBundle().getWorld();
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity te = location.getLocation(dir).getTileEntity(world);
BlockCoord dirLocation = location.getLocation(dir);
TileEntity te = null;
if (world.blockExists(dirLocation.x, dirLocation.y, dirLocation.z)) {
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) {
@@ -288,7 +334,12 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
@Override
public void onAddedToBundle() {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity te = getLocation().getLocation(dir).getTileEntity(getBundle().getWorld());
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);
}
if (te instanceof TileConduitBundle) {
IMEConduit cond = ((TileConduitBundle) te).getConduit(IMEConduit.class);
if (cond != null) {
@@ -343,4 +394,9 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
public boolean isDense() {
return isDense;
}
@Override
public boolean isDenseUltra() {
return isDenseUltra;
}
}
@@ -43,7 +43,13 @@ public class MEConduitGrid implements IGridBlock {
@Override
public EnumSet<GridFlags> getFlags() {
return conduit.isDense() ? EnumSet.of(GridFlags.DENSE_CAPACITY) : EnumSet.noneOf(GridFlags.class);
if (conduit.isDenseUltra()) {
return EnumSet.of(GridFlags.ULTRA_DENSE_CAPACITY);
}
if (conduit.isDense()) {
return EnumSet.of(GridFlags.DENSE_CAPACITY);
}
return EnumSet.noneOf(GridFlags.class);
}
@Override
@@ -438,6 +438,7 @@ public final class Config {
public static boolean isGasConduitEnabled = true;
public static boolean enableMEConduits = true;
public static boolean enableMEUltraDenseConduits = false;
public static boolean enableOCConduits = true;
public static boolean enableOCConduitsAnimatedTexture = true;
@@ -2298,6 +2299,11 @@ public final class Config {
sectionItems.name,
enableMEConduits,
"Allows ME conduits. Only has an effect with AE2 installed.");
enableMEUltraDenseConduits = config.getBoolean(
"enableMEUltraDenseConduits",
sectionItems.name,
enableMEUltraDenseConduits,
"Allows ME Ultra Dense conduits. Only has an effect with AE2 installed.");
enableOCConduits = config.getBoolean(
"enableOCConduits",
sectionItems.name,
@@ -131,6 +131,10 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
@Override
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
if (maxReceive < 0) {
return 0;
}
int res = super.receiveEnergy(container, maxReceive, simulate);
if (res != 0 && !simulate) {
updateDamage(container);
@@ -148,6 +152,10 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
}
public int extractEnergyInternal(ItemStack container, int maxExtract, boolean simulate) {
if (maxExtract < 0) {
return 0;
}
int res = super.extractEnergy(container, maxExtract, simulate);
if (res != 0 && !simulate) {
updateDamage(container);
@@ -67,6 +67,12 @@ public class ItemTeleportStaff extends ItemTravelStaff {
return equipped;
}
@Override
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
// Don't allow receiving energy, since we have infinite energy.
return 0;
}
@Override
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
// Don't allow extracting energy.
@@ -103,6 +103,10 @@ public class ItemTravelStaff extends ItemEnergyContainer implements IItemOfTrave
@Override
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
if (maxReceive < 0) {
return 0;
}
int res = super.receiveEnergy(container, maxReceive, simulate);
if (res != 0 && !simulate) {
updateDamage(container);
@@ -112,6 +116,10 @@ public class ItemTravelStaff extends ItemEnergyContainer implements IItemOfTrave
@Override
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
if (maxExtract < 0) {
return 0;
}
int res = super.extractEnergy(container, maxExtract, simulate);
if (res != 0 && !simulate) {
updateDamage(container);
@@ -17,12 +17,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
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.util.*;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.common.MinecraftForge;
@@ -37,7 +32,9 @@ 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;
@@ -338,7 +335,7 @@ public class TravelController {
}
if (displayOutOfRangeMessage && distanceMap.isEmpty()) {
player.addChatComponentMessage(new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
}
return distanceMap.values().stream().findFirst();
@@ -532,7 +529,7 @@ public class TravelController {
TravelController.instance.selectedCoord.z);
}
} else {
player.addChatComponentMessage(new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
}
}
@@ -578,8 +575,7 @@ public class TravelController {
if (te instanceof ITravelAccessable) {
ITravelAccessable ta = (ITravelAccessable) te;
if (!ta.canBlockBeAccessed(player)) {
player.addChatComponentMessage(
new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
return false;
}
}
@@ -593,14 +589,13 @@ public class TravelController {
if (!isInRangeTarget(player, coord, source.getMaxDistanceTravelledSq())) {
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
player.addChatComponentMessage(new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
}
return false;
}
if (!isValidTarget(player, coord, source)) {
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
player.addChatComponentMessage(
new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
}
return false;
}
@@ -630,7 +625,7 @@ public class TravelController {
if (requiredPower > canUsePower) {
// make sure chat is sent only once per trial
if (!insufficientPower) {
player.addChatComponentMessage(new ChatComponentTranslation("enderio.itemTravelStaff.notEnoughPower"));
showMessage(player, new ChatComponentTranslation("enderio.itemTravelStaff.notEnoughPower"));
insufficientPower = true;
}
return -1;
@@ -745,17 +740,16 @@ public class TravelController {
if (Config.travelAnchorSkipWarning) {
if (travelBlock.getRequiresPassword(player)) {
player.addChatComponentMessage(
new ChatComponentTranslation("enderio.gui.travelAccessable.skipLocked"));
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.skipLocked"));
}
if (travelBlock.getAccessMode() == ITravelAccessable.AccessMode.PRIVATE
&& !travelBlock.canUiBeAccessed(player)) {
player.addChatComponentMessage(
new ChatComponentTranslation("enderio.gui.travelAccessable.skipPrivate"));
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.skipPrivate"));
}
if (!isValidTarget(player, targetBlock, TravelSource.BLOCK)) {
player.addChatComponentMessage(
showMessage(
player,
new ChatComponentTranslation("enderio.gui.travelAccessable.skipObstructed"));
}
}
@@ -944,4 +938,16 @@ public class TravelController {
}
return null;
}
private static void showMessage(EntityPlayer player, IChatComponent chatComponent) {
if (Loader.isModLoaded("gtnhlib")) {
GTNHLib.proxy.printMessageAboveHotbar(
EnumChatFormatting.WHITE + chatComponent.getFormattedText(),
60,
true,
true);
} else {
player.addChatComponentMessage(chatComponent);
}
}
}
@@ -353,13 +353,14 @@ public class WailaCompat implements IWailaDataProvider {
} else if (itemStack.getItem() == EnderIO.itemMEConduit) {
NBTTagCompound nbtRoot = _accessor.getNBTData();
if (nbtRoot.hasKey("isDense")) {
boolean isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
boolean isDense = nbtRoot.getBoolean("isDense");
int channelsInUse = nbtRoot.getInteger("channelsInUse");
currenttip.add(
MessageFormat.format(
EnderIO.lang.localize("itemMEConduit.channelsUsed"),
channelsInUse,
isDense ? 32 : 8));
isDenseUltra ? 128 : (isDense ? 32 : 8)));
}
}
}
@@ -395,6 +396,7 @@ public class WailaCompat implements IWailaDataProvider {
if (mec != null) {
tag.setInteger("channelsInUse", mec.getChannelsInUse());
tag.setBoolean("isDense", mec.isDense());
tag.setBoolean("isDenseUltra", mec.isDenseUltra());
}
} else if (te instanceof IInternalPoweredTile) {
IInternalPoweredTile ipte = (IInternalPoweredTile) te;
@@ -130,6 +130,7 @@ enderio.itemGasConduit.tooltip.detailed.line1=Transportiert Mekanism-kompatible
enderio.itemMEConduit.name=ME-Leitung
enderio.itemMEConduitDense.name=Dichte ME-Leitung
enderio.itemMEConduitDenseUltra.name=Extrem Dichte ME-Leitungen
enderio.itemMEConduit.channelsUsed={0,number} von {1,number} Kanälen
enderio.itemOCConduit.name=Netzwerkleitung (OC)
@@ -131,6 +131,7 @@ enderio.itemGasConduit.tooltip.detailed.line1=Transfers Mekanism-compatible gase
enderio.itemMEConduit.name=ME Conduit
enderio.itemMEConduitDense.name=Dense ME Conduit
enderio.itemMEConduitDenseUltra.name=Ultra Dense ME Conduit
enderio.itemMEConduit.channelsUsed={0,number} of {1,number} Channels
enderio.itemOCConduit.name=Network Conduit (OC)
Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB