Compare commits

...
Author SHA1 Message Date
miozune 1f55def09f Revert fluid animation fix for Quartz Tank to mitigate FPS issue (#157) 2023-08-27 17:58:49 +02:00
firenoo 4de0ee4b1a Fix gt++ fluid cells not extracting properly (#156)
* Fix gt++ fluid cells not extracting properly

If GT++ fluid tank item sees a stacksize > 1, it refuses to fill/drain the
tank item, so we need to set the tank size to 1 before performing tests.

* Fix GT cells not working with fluid terminal

GT cells use IFluidContainerItem, despite the fact that they act like
FluidContainerRegistry items. Unfortunately this threw off the test code;
need to extract the entire container at a time for the test.
2023-08-19 12:34:36 +02:00
Fox_white bcdd765870 Fix Crafting Input Bus Compatibility & fix general bugs (#154)
* fix: uses IInterfaceTerminalSupport for interface terminal

fix custom target not registered in ae2fc wireless interface terminal

* fix: empty string caused channel crash && check if custom name exist before getting

* fix: Fluid interface not registered

* Revert "fix: Fluid interface not registered"

This reverts commit bc21ee2673.

* fix: remove ASM in favor of the new API

* fix: remove zero size character bypass as checking hasCustomName is enough
2023-08-11 21:18:57 +02:00
firenoo 98ff754306 Fix doubling fluids for real now (#153)
If condition was inverted
2023-08-07 23:50:39 +02:00
firenoo 1ed32d46dc A collection of fixes (#152)
* Fix the adv blocking mode setting shown w/o upgrade

* Use else ifs instead of ifs when looking for button

* Register dual p2p interface to interface term

* Fix moving inventory region when space is held

* Fix scrollbars not initialized when terminal is empty

* Fix fluid handling for the 3rd time

Rearranges the steps to insertion and validates whether the tank can be
drained.

* Fix fluid extraction for the 3rd time
2023-08-07 09:28:11 +02:00
firenoo 3d01f50100 Fix fluid stack not doubling (#151) 2023-08-05 17:15:07 +02:00
Raven Szewczyk 64977b87a9 Lazy monitor updates (#150)
* Update buildscript and dependencies

* Implement getAvailableItem for faster network updates

* Use findPrecise
2023-08-05 09:39:12 +02:00
firenoo dd842a182c Save search string when search unfocuses (#149) 2023-08-02 18:02:12 +02:00
DancingSnow 3fa1b1e0e2 Update zh_CN.lang (#147) 2023-07-30 19:25:53 +02:00
firenoo 3fce70a406 Add pattern doubling to ae2fc terminals (#148)
* Brings pattern doubling to ae2fc pattern terms

Literally copied and pasted the code over

* Update dep
2023-07-30 12:59:03 +02:00
StrangeMan1580 3df15eae97 Update ru_RU.lang (#146) 2023-07-29 15:47:41 +02:00
firenoo 0374c1c521 Add null check for retrieving tank info (#145)
ThaumicTinkerer returns null for sides. Normally this is handled when
it is directly adjacent to the dual interface via a null check, but for
p2ps it is not checked, leading to a NPE. Adds a check for it
2023-07-28 13:35:52 +02:00
firenoo b0d67ac917 Render drops as fluids in GuiCraftConfirm (#144)
* Render drops as fluids in GuiCraftConfirm

The crafting tree feature changed where the itemstacks were being drawn
from `drawFG` to `drawListFG`. This changes the ASM to include that in
its visit.

* Render drops as fluid in GuiCraftingTree

Now look for fluid drops in crafting tree.
Temporarily permanent ASM.
2023-07-24 08:26:39 -07:00
firenoo f51f09845a Register dual p2p interface for pattern capacity upgrade (#143) 2023-07-24 09:14:18 +02:00
firenooandGitHub GTNH Actions c94876b02e Add the dual P2P interface (#139)
* Add the dual P2P interface

- Can be disabled in the config
- Updated dependencies
- We now require a hard inheritance dependency on beta-238+.
- CANNOT BE ATTUNED.

* Dependency cleanup (don't use pre)

* Fix dual interface background

* Fix null icon for p2p dual interface

BetterP2P needs this to properly display the icon.

* spotlessApply

---------

Co-authored-by: GitHub GTNH Actions <unknown>
2023-07-22 17:00:43 +02:00
miozune e8f069375f Fix another typo (#142) 2023-07-22 17:18:39 +09:00
Eraldoe b50fd74e9c Fix typo "encoded" pattern 2023-07-22 17:18:28 +09:00
33 changed files with 1295 additions and 355 deletions

No files matched your search

+141 -62
View File
@@ -1,4 +1,4 @@
//version: 1685785062
//version: 1692122114
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -69,7 +69,7 @@ plugins {
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.14'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -115,6 +115,8 @@ propertyDefaultIfUnset("usesMixinDebug", project.usesMixins)
propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("channel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12")
propertyDefaultIfUnset("usesMavenPublishing", true)
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
@@ -357,7 +359,27 @@ catch (Exception ignored) {
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
try {
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
if (versionOverride == null) {
def gitDetails = versionDetails()
def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning
String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git')
if (branchName.startsWith('origin/')) {
branchName = branchName.minus('origin/')
}
branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver
identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}'
if (gitDetails.commitDistance > 0) {
identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}"
if (isDirty) {
identifiedVersion += "-dirty"
}
} else if (isDirty) {
identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty"
}
} else {
identifiedVersion = versionOverride
}
}
catch (Exception ignored) {
out.style(Style.Failure).text(
@@ -379,9 +401,13 @@ if (identifiedVersion == versionOverride) {
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName
base {
archivesName = customArchiveBaseName
}
} else {
archivesBaseName = modId
base {
archivesName = modId
}
}
@@ -465,10 +491,19 @@ sourceSets {
}
}
if (file('addon.gradle').exists()) {
if (file('addon.gradle.kts').exists()) {
apply from: 'addon.gradle.kts'
} else if (file('addon.gradle').exists()) {
apply from: 'addon.gradle'
}
// File for local tweaks not commited to Git
if (file('addon.local.gradle.kts').exists()) {
apply from: 'addon.local.gradle.kts'
} else if (file('addon.local.gradle').exists()) {
apply from: 'addon.local.gradle'
}
// Allow unsafe repos but warn
repositories.configureEach { repo ->
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
@@ -479,7 +514,14 @@ repositories.configureEach { repo ->
}
}
apply from: 'repositories.gradle'
if (file('repositories.gradle.kts').exists()) {
apply from: 'repositories.gradle.kts'
} else if (file('repositories.gradle').exists()) {
apply from: 'repositories.gradle'
} else {
logger.error("Neither repositories.gradle.kts nor repositories.gradle was found, make sure you extracted the full ExampleMod template.")
throw new RuntimeException("Missing repositories.gradle[.kts]")
}
configurations {
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
@@ -520,9 +562,6 @@ repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
mavenContent {
excludeGroup("net.minecraftforge") // missing the `universal` artefact
}
}
maven {
name = "GTNH Maven"
@@ -537,13 +576,28 @@ repositories {
}
}
if (includeWellKnownRepositories.toBoolean()) {
maven {
name "CurseMaven"
url "https://cursemaven.com"
content {
exclusiveContent {
forRepository {
maven {
name "CurseMaven"
url "https://cursemaven.com"
}
}
filter {
includeGroup "curse.maven"
}
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
maven {
name = "ic2"
url = "https://maven.ic2.player.to/"
@@ -574,6 +628,8 @@ def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
dependencies {
if (usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
@@ -585,7 +641,7 @@ dependencies {
}
}
if (usesMixins.toBoolean()) {
implementation(mixinProviderSpec)
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
}
@@ -611,12 +667,32 @@ configurations.all {
}
}
apply from: 'dependencies.gradle'
dependencies {
constraints {
def minGtnhLibVersion = "0.0.13"
implementation("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
}
runtimeOnly("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
}
devOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
}
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
}
}
}
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg"
if (file('dependencies.gradle.kts').exists()) {
apply from: 'dependencies.gradle.kts'
} else if (file('dependencies.gradle').exists()) {
apply from: 'dependencies.gradle'
} else {
logger.error("Neither dependencies.gradle.kts nor dependencies.gradle was found, make sure you extracted the full ExampleMod template.")
throw new RuntimeException("Missing dependencies.gradle[.kts]")
}
tasks.register('generateAssets') {
group = "GTNH Buildscript"
@@ -648,46 +724,17 @@ tasks.register('generateAssets') {
}
if (usesMixins.toBoolean()) {
tasks.named("reobfJar", ReobfuscatedJar).configure {
extraSrgFiles.from(mixinSrg)
}
tasks.named("processResources").configure {
dependsOn("generateAssets")
}
tasks.named("compileJava", JavaCompile).configure {
doFirst {
new File(mixinTmpDir).mkdirs()
}
options.compilerArgs += [
"-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${refMap}",
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
"-XDenableSunApiLintControl",
"-XDignore.symbol.file"
]
}
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
kapt {
correctErrorTypes = true
javacOptions {
option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}")
option("-AoutSrgFile=$mixinSrg")
option("-AoutRefMapFile=$refMap")
}
}
tasks.configureEach { task ->
if (task.name == "kaptKotlin") {
task.doFirst {
new File(mixinTmpDir).mkdirs()
}
}
}
}
}
tasks.named("processResources", ProcessResources).configure {
@@ -705,7 +752,6 @@ tasks.named("processResources", ProcessResources).configure {
}
if (usesMixins.toBoolean()) {
from refMap
dependsOn("compileJava", "compileScala")
}
}
@@ -724,16 +770,16 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.3.5'
def lwjgl3ifyVersion = '1.4.0'
def asmVersion = '9.4'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.13')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false}
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
@@ -979,6 +1025,9 @@ idea {
}
}
runConfigurations {
"0. Build and Test"(Gradle) {
taskNames = ["build"]
}
"1. Run Client"(Gradle) {
taskNames = ["runClient"]
}
@@ -1098,6 +1147,14 @@ tasks.named("processIdeaSettings").configure {
dependsOn("injectTags")
}
tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
dependsOn("jar", "reobfJar")
if (!disableSpotless) {
dependsOn("spotlessCheck")
}
}
// workaround variable hiding in pom processing
def projectConfigs = project.configurations
@@ -1118,12 +1175,14 @@ publishing {
}
repositories {
maven {
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
allowInsecureProtocol = true
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
if (usesMavenPublishing.toBoolean()) {
maven {
url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
}
}
}
}
@@ -1238,7 +1297,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
def buildscriptGradleVersion = "8.1.1"
def buildscriptGradleVersion = "8.2.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
@@ -1344,8 +1403,14 @@ boolean isNewBuildScriptVersionAvailable() {
String currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript)
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
String availableBuildScriptHash = getVersionHash(availableBuildScript)
String availableBuildScriptHash
try {
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
availableBuildScriptHash = getVersionHash(availableBuildScript)
} catch (IOException e) {
logger.warn("Could not check for buildscript update availability: {}", e.message)
return false
}
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate
@@ -1510,3 +1575,17 @@ def getSecondaryArtifacts() {
if (apiPackage) secondaryArtifacts += [apiJar]
return secondaryArtifacts
}
// For easier scripting of things that require variables defined earlier in the buildscript
if (file('addon.late.gradle.kts').exists()) {
apply from: 'addon.late.gradle.kts'
} else if (file('addon.late.gradle').exists()) {
apply from: 'addon.late.gradle'
}
// File for local tweaks not commited to Git
if (file('addon.late.local.gradle.kts').exists()) {
apply from: 'addon.late.local.gradle.kts'
} else if (file('addon.late.local.gradle').exists()) {
apply from: 'addon.late.local.gradle'
}
+12 -10
View File
@@ -1,22 +1,24 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.3.50-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-234-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.3.80-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-247-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.6.0:dev')
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.9.0:dev")
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.9.3:dev")
compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.7:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.14:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.21:dev')
compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.13:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.24:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.162:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.4.2-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:GTplusplus:1.9.4:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.2.10:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.4.11-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:GTplusplus:1.9.72:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.2.27:dev") { transitive = false }
}
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+6 -5
View File
@@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
@@ -27,7 +27,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
modid = FluidCraft.MODID,
version = FluidCraft.VERSION,
name = FluidCraft.MODNAME,
dependencies = "required-after:appliedenergistics2;required-after:CoFHCore;required-after:Baubles;after:waila;after:thaumicenergistics;after:ae2wct")
dependencies = "required-after:appliedenergistics2@[rv3-beta-238,);required-after:CoFHCore;required-after:Baubles;after:waila;after:thaumicenergistics;after:ae2wct")
public class FluidCraft {
public static final String MODID = "GRADLETOKEN_MODID";
@@ -89,6 +89,7 @@ public class GuiDualInterface extends GuiUpgradeable {
Settings.ADVANCED_BLOCKING_MODE,
AdvancedBlockingMode.DEFAULT);
this.buttonList.add(this.advancedBlockingMode);
this.advancedBlockingMode.visible = this.bc.getInstalledUpgrades(Upgrades.ADVANCED_BLOCKING) > 0;
if (isTile()) {
this.sidelessMode = new GuiImgButton(
@@ -129,6 +130,7 @@ public class GuiDualInterface extends GuiUpgradeable {
protected String getBackground() {
if (!ModAndClassUtil.isBigInterface) return "guis/interface.png";
return switch (((ContainerInterface) this.cvb).getPatternCapacityCardsInstalled()) {
case -1 -> "guis/interfacenone.png";
case 1 -> "guis/interface2.png";
case 2 -> "guis/interface3.png";
case 3 -> "guis/interface4.png";
@@ -140,31 +142,19 @@ public class GuiDualInterface extends GuiUpgradeable {
protected void actionPerformed(final GuiButton btn) {
super.actionPerformed(btn);
final boolean backwards = Mouse.isButtonDown(1);
if (btn == null) {
return;
}
if (btn == this.priority) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(GuiType.PRIORITY));
}
if (btn == this.switcher) {
} else if (btn == this.switcher) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(GuiType.DUAL_INTERFACE_FLUID));
}
if (btn == this.interfaceMode) {
} else if (btn == this.interfaceMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(Settings.INTERFACE_TERMINAL, backwards));
}
if (btn == this.BlockMode) {
} else if (btn == this.BlockMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.BlockMode.getSetting(), backwards));
}
if (btn == this.insertionMode) {
} else if (btn == this.insertionMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.insertionMode.getSetting(), backwards));
}
if (btn == this.sidelessMode) {
} else if (btn == this.sidelessMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.sidelessMode.getSetting(), backwards));
}
if (btn == this.advancedBlockingMode) {
} else if (btn == this.advancedBlockingMode) {
NetworkHandler.instance
.sendToServer(new PacketConfigButton(this.advancedBlockingMode.getSetting(), backwards));
}
@@ -177,4 +167,12 @@ public class GuiDualInterface extends GuiUpgradeable {
private boolean isTile() {
return this.host instanceof TileFluidInterface;
}
@Override
protected void handleButtonVisibility() {
super.handleButtonVisibility();
if (this.advancedBlockingMode != null) {
this.advancedBlockingMode.setVisibility(this.bc.getInstalledUpgrades(Upgrades.ADVANCED_BLOCKING) > 0);
}
}
}
@@ -23,6 +23,7 @@ public class GuiFluidMonitor extends FCGuiMonitor<IAEFluidStack> {
final ContainerFluidMonitor c) {
super(inventoryPlayer, te, c);
this.repo = new FluidRepo(getScrollBar(), this);
this.setScrollBar();
}
@Override
@@ -339,10 +339,21 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
@Override
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
boolean focusIn = searchFieldInputs.isFocused();
boolean focusOut = searchFieldOutputs.isFocused();
boolean focusName = searchFieldNames.isFocused();
searchFieldInputs.mouseClicked(xCoord, yCoord, btn);
searchFieldOutputs.mouseClicked(xCoord, yCoord, btn);
searchFieldNames.mouseClicked(xCoord, yCoord, btn);
if (focusIn && !searchFieldInputs.isFocused()) {
searchFieldInputsText = searchFieldInputs.getText();
} else if (focusOut && !searchFieldOutputs.isFocused()) {
searchFieldOutputsText = searchFieldOutputs.getText();
} else if (focusName && !searchFieldNames.isFocused()) {
searchFieldNamesText = searchFieldNames.getText();
}
super.mouseClicked(xCoord, yCoord, btn);
}
@@ -509,8 +520,9 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
try {
final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX);
final NBTTagCompound invData = in.getCompoundTag(key);
int size = invData.getInteger("size");
final ClientDCInternalInv current = this
.getById(id, invData.getLong("sortBy"), invData.getString("un"));
.getById(id, invData.getLong("sortBy"), invData.getString("un"), size);
int X = invData.getInteger("x");
int Y = invData.getInteger("y");
int Z = invData.getInteger("z");
@@ -713,11 +725,12 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
: Integer.MAX_VALUE;
}
private ClientDCInternalInv getById(final long id, final long sortBy, final String unlocalizedName) {
private ClientDCInternalInv getById(final long id, final long sortBy, final String unlocalizedName,
final int sizeInit) {
ClientDCInternalInv o = this.byId.get(id);
if (o == null) {
this.byId.put(id, o = new ClientDCInternalInv(9, id, sortBy, unlocalizedName));
this.byId.put(id, o = new ClientDCInternalInv(sizeInit, id, sortBy, unlocalizedName));
this.refreshList = true;
}
@@ -13,6 +13,7 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
import com.glodblock.github.FluidCraft;
@@ -48,6 +49,18 @@ import appeng.util.item.AEItemStack;
public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
protected final IItemList<IAEFluidStack> fluids = AEApi.instance().storage().createFluidList();
/**
* Index of tuple which indicates remaining tanks that are remaining (not emptied/filled)
*/
protected static final int REM_IDX = 0;
/**
* Index of tuple which indicates remaining tanks that are acted upon (emptied/filled)
*/
protected static final int ACT_IDX = 1;
/**
* Index of tuple which indicates tanks that are partially emptied/filled
*/
protected static final int PARTIAL_IDX = 2;
public ContainerFluidMonitor(final InventoryPlayer ip, final ITerminalHost monitorable) {
this(ip, monitorable, true);
@@ -222,77 +235,140 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
}
/**
* The insert operation. For input, we have a filled container stack. For outputs, we have the following: 1.
* Leftover filled container stack - primary output. 2. Empty containers 3. Partially filled container x1 In order
* above, the itemstack at `slotIndex` is transformed into the output.
* Insert fluid into the ME system
*
* @param canSend the fluidstack to insert
* @param results a tuple of at least size 3 to indicate outputs (1), (2), (3). This will be mutated!
* @param numTanks number of tanks involved in the operation
* @param fluidInTank how much fluid is in the tank initially
* @return the amount of fluid remaining in output (3)
* @see #insertFluid(ItemStack, EntityPlayer, int, int)
*/
private int insertME(IAEFluidStack canSend, int[] results, int numTanks, int fluidInTank) {
final IAEFluidStack notInserted = this.host.getFluidInventory()
.injectItems(canSend, Actionable.MODULATE, this.getActionSource());
// Check if we need to handle partial insertion.
if (notInserted != null && notInserted.getStackSize() > 0) {
if (canSend.getStackSize() == notInserted.getStackSize()) {
// No-op for when system is full
results[REM_IDX] = numTanks;
return fluidInTank;
}
// Populate result list with outputs (1), (2), (3).
results[REM_IDX] = (int) (notInserted.getStackSize() / fluidInTank);
results[ACT_IDX] = numTanks - results[REM_IDX];
// If there is remaining fluid, set partial.
final int remainder = (int) (notInserted.getStackSize() % fluidInTank);
if (remainder > 0) {
results[PARTIAL_IDX] = 1;
results[ACT_IDX]--;
return remainder;
} else {
results[PARTIAL_IDX] = 0;
}
} else {
// Full operation successful
results[REM_IDX] = 0;
results[ACT_IDX] = numTanks;
results[PARTIAL_IDX] = 0;
}
return 0;
}
/**
* The insert operation. For input, we have a filled container stack. For outputs, we have the following:
* <ol>
* <li>Leftover filled container stack</li>
* <li>Empty containers</li>
* <li>Partially filled container x1</li>
* </ol>
* In order above, the itemstack at `slotIndex` is transformed into the output.
*/
private void insertFluid(ItemStack fluidContainer, EntityPlayer player, int slotIndex, int heldContainers) {
IAEFluidStack fluid;
int fluidInTank;
if (fluidContainer.getItem() instanceof IFluidContainerItem) {
fluid = AEFluidStack.create(((IFluidContainerItem) fluidContainer.getItem()).getFluid(fluidContainer));
fluidInTank = (int) fluid.getStackSize();
IAEFluidStack canSend;
int fluidPerContainer;
ItemStack partialStack = null;
ItemStack emptyStack = null;
int[] insertionResults = new int[3];
// 2 types of containers: IFluidContainerItem and FluidContainerRegistry
// IFluidContainerItem - items are filled w/ volume (portable tanks)
// FluidContainerRegistry - items are filled, or not (buckets)
// The former is easy, the latter takes a bit more work.
if (fluidContainer.getItem() instanceof IFluidContainerItem fcItem) {
// Step 1: Find out how much fluid we can insert.
canSend = AEFluidStack.create(fcItem.getFluid(fluidContainer));
fluidPerContainer = (int) canSend.getStackSize();
canSend.setStackSize((long) fluidPerContainer * fluidContainer.stackSize);
// Step 2: Find out how much fluid we can extract from the container. If this is null or 0, return.
ItemStack test = fluidContainer.copy();
test.stackSize = 1;
FluidStack fluidStack = fcItem.drain(test, fluidPerContainer, false);
if (fluidStack == null || fluidStack.amount == 0) {
return;
}
// Step 3: Find out how much fluid we can insert into the ME system
int partialAmount = insertME(canSend, insertionResults, fluidContainer.stackSize, fluidPerContainer);
// Step 4: Separate the outputs into no drain (1), fully drained (2), and partially drained (3)
// 4.1: Handle the partial stack
if (insertionResults[PARTIAL_IDX] > 0) {
partialStack = fluidContainer.copy();
partialStack.stackSize = 1;
fcItem.drain(partialStack, fluidPerContainer - partialAmount, true);
}
// 4.2: Handle empty output
if (insertionResults[ACT_IDX] > 0) {
emptyStack = fluidContainer.copy();
emptyStack.stackSize = 1;
fcItem.drain(emptyStack, fluidPerContainer, true);
emptyStack.stackSize = insertionResults[ACT_IDX];
}
} else if (FluidContainerRegistry.isContainer(fluidContainer)) {
fluid = AEFluidStack.create(FluidContainerRegistry.getFluidForFilledItem(fluidContainer));
fluidInTank = (int) fluid.getStackSize();
// Step 1: Find out how much fluid we can insert.
canSend = AEFluidStack.create(FluidContainerRegistry.getFluidForFilledItem(fluidContainer));
fluidPerContainer = (int) canSend.getStackSize();
canSend.setStackSize((long) fluidPerContainer * fluidContainer.stackSize);
// Step 2: Find out how much fluid we can extract from the container. If this is null or 0, return.
ItemStack emptyTank = FluidContainerRegistry.drainFluidContainer(fluidContainer);
if (emptyTank == null) {
return;
}
// Step 3: Find out how much fluid we can insert into the ME system
int partialAmount = insertME(canSend, insertionResults, fluidContainer.stackSize, fluidPerContainer);
// Step 4: Separate the outputs into no drain (1), fully drained (2), and partially drained (3)
// 4.1: Handle the partial stack
if (partialAmount > 0) {
// We now extract the extra amount from the ME system. Blame simulate not working :P
int extract = FluidContainerRegistry.getContainerCapacity(fluidContainer) - partialAmount;
if (extract > 0) {
IAEFluidStack toExtract = canSend.copy().setStackSize(extract);
this.host.getFluidInventory().extractItems(toExtract, Actionable.MODULATE, this.getActionSource());
}
insertionResults[PARTIAL_IDX] = 0;
}
// 4.2: Handle empty output
if (insertionResults[ACT_IDX] > 0) {
emptyStack = FluidContainerRegistry.drainFluidContainer(fluidContainer);
emptyStack.stackSize = insertionResults[ACT_IDX];
}
} else {
return;
}
// Simulate to know how much will not be inserted
IAEFluidStack canSend = fluid.copy();
canSend.setStackSize((long) fluidInTank * fluidContainer.stackSize);
final IAEFluidStack notInserted = this.host.getFluidInventory()
.injectItems(canSend, Actionable.MODULATE, this.getActionSource());
int emptyTanks = fluidContainer.stackSize;
ItemStack partialStack = fluidContainer.copy();
if (notInserted != null && notInserted.getStackSize() > 0) {
// Here, we cannot insert everything into the system.
if (canSend.getStackSize() == notInserted.getStackSize()) return; // System was full, no op
// Now "refill" the buckets that couldn't enter the system
int refilled = (int) (notInserted.getStackSize() / fluidInTank); // # of full tanks left
emptyTanks -= refilled;
final int remainder = (int) (notInserted.getStackSize() % fluidInTank); // partial tank
// Now handle remaining if applicable
if (remainder > 0) {
notInserted.setStackSize(remainder);
partialStack.stackSize = 1;
if (partialStack.getItem() instanceof IFluidContainerItem) {
((IFluidContainerItem) partialStack.getItem()).drain(partialStack, fluidInTank - remainder, true);
} else if (FluidContainerRegistry.isContainer(fluidContainer)) {
// For "whole containers" (need to round down, no remainders)
ItemStack container = FluidContainerRegistry
.fillFluidContainer(notInserted.getFluidStack(), fluidContainer);
if (container == null) {
// whatever, lets just not have the ME system get filled with any of its fluid
emptyTanks++;
notInserted.setStackSize(fluidInTank - remainder);
this.host.getFluidInventory()
.extractItems(notInserted, Actionable.MODULATE, this.getActionSource());
partialStack.stackSize = 0;
} else {
partialStack = container;
}
}
emptyTanks -= partialStack.stackSize;
} else {
partialStack.stackSize = 0;
}
} else {
partialStack.stackSize = 0;
}
// Now that the 3 outputs are handled, we can now actually put the fluids in
ItemStack emptyStack = fluidContainer.copy();
emptyStack.stackSize = 1;
if (emptyStack.getItem() instanceof IFluidContainerItem) {
((IFluidContainerItem) emptyStack.getItem()).drain(emptyStack, fluidInTank, true);
} else {
emptyStack = FluidContainerRegistry.drainFluidContainer(emptyStack);
}
emptyStack.stackSize = emptyTanks;
int extraTanks = heldContainers - emptyTanks - partialStack.stackSize;
// Done. Put the output in the inventory or ground, and update stack size.
boolean shouldSendStack = true;
int emptyTanks = insertionResults[ACT_IDX];
int extraTanks = heldContainers - emptyTanks - insertionResults[PARTIAL_IDX];
if (slotIndex == -1) {
// Item is in mouse hand
if (extraTanks > 0) {
ItemStack stack = player.inventory.getItemStack();
stack.stackSize = extraTanks;
@@ -303,13 +379,14 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
adjustStack(emptyStack);
player.inventory.setItemStack(emptyStack);
dropItem(partialStack);
} else if (partialStack.stackSize != 0) {
} else if (partialStack != null) {
player.inventory.setItemStack(partialStack);
} else {
player.inventory.setItemStack(null);
shouldSendStack = false;
}
} else {
// Shift clicked in
ItemStack stack = player.inventory.getStackInSlot(slotIndex);
if (extraTanks > 0) {
stack.stackSize = extraTanks;
@@ -320,7 +397,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
adjustStack(emptyStack);
player.inventory.setInventorySlotContents(slotIndex, emptyStack);
dropItem(partialStack);
} else if (partialStack.stackSize != 0) {
} else if (partialStack != null) {
player.inventory.setInventorySlotContents(slotIndex, partialStack);
} else {
player.inventory.setItemStack(null);
@@ -333,16 +410,35 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
(EntityPlayerMP) player);
} else {
FluidCraft.proxy.netHandler.sendTo(new SPacketFluidUpdate(new HashMap<>()), (EntityPlayerMP) player);
}
}
/**
* The extract operation. For input, we have an empty container stack. For outputs, we have the following: 1.
* Leftover empty container stack - primary output. 2. Filled containers (full) 3. Partially filled container x1 In
* order above, the itemstack at `slotIndex` is transformed into the output.
* The extract operation. For input, we have an empty container stack. For outputs, we have the following:
* <ol>
* <li>Leftover empty container stack</li>
* <li>Filled containers (full)</li>
* <li>Partially filled container x1</li>
* </ol>
* In order above, the itemstack at `slotIndex` is transformed into the output.
*/
private void extractFluid(IAEFluidStack fluid, ItemStack fluidContainer, EntityPlayer player, int heldContainers) {
// Step 1: Check if fluid can actually get filled into the fluidContainer
if (fluidContainer.getItem() instanceof IFluidContainerItem fcItem) {
ItemStack testStack = fluidContainer.copy();
testStack.stackSize = 1;
int test = fcItem.fill(testStack, fluid.getFluidStack(), false);
if (test == 0) {
return;
}
} else if (FluidContainerRegistry.isContainer(fluidContainer)) {
ItemStack test = FluidContainerRegistry.fillFluidContainer(fluid.getFluidStack(), fluidContainer);
if (test == null) {
return;
}
} else {
return;
}
IAEFluidStack storedFluid = this.monitor.getStorageList().findPrecise(fluid);
if (storedFluid == null || storedFluid.getStackSize() <= 0) return;
int capacity = Util.FluidUtil.getCapacity(fluidContainer, storedFluid.getFluid());
@@ -431,7 +527,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
}
void adjustStack(ItemStack stack) {
if (stack.stackSize > stack.getMaxStackSize()) {
if (stack != null && stack.stackSize > stack.getMaxStackSize()) {
dropItem(stack, stack.stackSize - stack.getMaxStackSize());
stack.stackSize = stack.getMaxStackSize();
}
@@ -11,27 +11,22 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import com.glodblock.github.client.gui.container.base.FCBaseContainer;
import com.glodblock.github.common.parts.PartFluidInterface;
import com.glodblock.github.common.tile.TileFluidInterface;
import com.glodblock.github.inventory.item.IWirelessTerminal;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import appeng.api.config.*;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridNode;
import appeng.api.networking.security.IActionHost;
import appeng.api.util.DimensionalCoord;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketCompressedNBT;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
import appeng.helpers.IInterfaceTerminalSupport;
import appeng.helpers.InterfaceTerminalSupportedClassProvider;
import appeng.helpers.InventoryAction;
import appeng.items.misc.ItemEncodedPattern;
import appeng.parts.AEBasePart;
import appeng.parts.misc.PartInterface;
import appeng.parts.p2p.PartP2PInterface;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.misc.TileInterface;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.inv.AdaptorIInventory;
@@ -46,7 +41,7 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
*/
private static long autoBase = Long.MIN_VALUE;
private final Multimap<IInterfaceHost, ContainerInterfaceWireless.InvTracker> diList = HashMultimap.create();
private final Multimap<IInterfaceTerminalSupport, InvTracker> supportedInterfaces = HashMultimap.create();
private final Map<Long, ContainerInterfaceWireless.InvTracker> byId = new HashMap<>();
private IGrid grid;
private NBTTagCompound data = new NBTTagCompound();
@@ -60,16 +55,6 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
this.bindPlayerInventory(ip, 14, 0);
}
private Set<IGridNode> getMachineNodes() {
Set<IGridNode> union = new HashSet<>();
this.grid.getMachines(TileFluidInterface.class).forEach(union::add);
this.grid.getMachines(TileInterface.class).forEach(union::add);
this.grid.getMachines(PartFluidInterface.class).forEach(union::add);
this.grid.getMachines(PartInterface.class).forEach(union::add);
this.grid.getMachines(PartP2PInterface.class).forEach(union::add);
return union;
}
@Override
public void detectAndSendChanges() {
if (Platform.isClient()) {
@@ -88,19 +73,28 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
if (host != null) {
final IGridNode agn = host.getActionableNode();
if (agn != null && agn.isActive()) {
for (final IGridNode gn : this.getMachineNodes()) {
ContainerInterfaceWireless.InterfaceCheck interfaceCheck = new ContainerInterfaceWireless.InterfaceCheck()
.invoke(gn);
total += interfaceCheck.getTotal();
missing |= interfaceCheck.isMissing();
for (var clz : InterfaceTerminalSupportedClassProvider.getSupportedClasses()) {
for (final IGridNode gn : this.grid.getMachines(clz)) {
final IInterfaceTerminalSupport interfaceTerminalSupport = (IInterfaceTerminalSupport) gn
.getMachine();
if (!gn.isActive() || !interfaceTerminalSupport.shouldDisplay()) continue;
final Collection<InvTracker> t = supportedInterfaces.get(interfaceTerminalSupport);
final String name = interfaceTerminalSupport.getName();
missing = t.isEmpty() || t.stream().anyMatch(it -> !it.unlocalizedName.equals(name));
total += interfaceTerminalSupport.getPatternsConfigurations().length;
if (missing) break;
}
// we can stop if any is missing. The value of `total` is not important if `missing == true`
if (missing) break;
}
}
}
if (total != this.diList.size() || missing) {
if (total != this.supportedInterfaces.size() || missing) {
this.regenList(this.data);
} else {
for (final ContainerInterfaceWireless.InvTracker inv : diList.values()) {
for (final ContainerInterfaceWireless.InvTracker inv : supportedInterfaces.values()) {
for (int x = 0; x < inv.client.getSizeInventory(); x++) {
if (this.isDifferent(inv.server.getStackInSlot(inv.offset + x), inv.client.getStackInSlot(x))) {
this.addItems(this.data, inv, x, 1);
@@ -244,25 +238,23 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
private void regenList(final NBTTagCompound data) {
this.byId.clear();
this.diList.clear();
this.supportedInterfaces.clear();
final IActionHost host = this.getActionHost();
if (host != null) {
final IGridNode agn = host.getActionableNode();
if (agn != null && agn.isActive()) {
for (final IGridNode gn : this.getMachineNodes()) {
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
final DualityInterface dual = ih.getInterfaceDuality();
if (gn.isActive() && dual.getConfigManager().getSetting(Settings.INTERFACE_TERMINAL) == YesNo.YES) {
for (int i = 0; i <= dual.getInstalledUpgrades(Upgrades.PATTERN_CAPACITY); ++i) {
this.diList.put(
ih,
new ContainerInterfaceWireless.InvTracker(
dual,
dual.getPatterns(),
dual.getTermName(),
i * 9,
9));
for (var clz : InterfaceTerminalSupportedClassProvider.getSupportedClasses()) {
for (final IGridNode gn : this.grid.getMachines(clz)) {
final IInterfaceTerminalSupport terminalSupport = (IInterfaceTerminalSupport) gn.getMachine();
if (!gn.isActive() || !terminalSupport.shouldDisplay()) continue;
final var configurations = terminalSupport.getPatternsConfigurations();
for (int i = 0; i < configurations.length; ++i) {
this.supportedInterfaces.put(
terminalSupport,
new ContainerInterfaceWireless.InvTracker(terminalSupport, configurations[i], i));
}
}
}
@@ -271,7 +263,7 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
data.setBoolean("clear", true);
for (final ContainerInterfaceWireless.InvTracker inv : this.diList.values()) {
for (final ContainerInterfaceWireless.InvTracker inv : this.supportedInterfaces.values()) {
this.byId.put(inv.which, inv);
this.addItems(data, inv, 0, inv.client.getSizeInventory());
}
@@ -307,6 +299,7 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
tag.setInteger("z", inv.Z);
tag.setInteger("dim", inv.dim);
tag.setInteger("side", inv.side.ordinal());
tag.setInteger("size", inv.client.getSizeInventory());
}
for (int x = 0; x < length; x++) {
@@ -341,22 +334,46 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
private final int dim;
private final ForgeDirection side;
public InvTracker(final DualityInterface dual, final IInventory patterns, final String unlocalizedName,
int offset, int size) {
public InvTracker(final DimensionalCoord coord, long sortValue, final IInventory patterns,
final String unlocalizedName, int offset, int size, ForgeDirection side) {
this(
coord.x,
coord.y,
coord.z,
coord.getDimension(),
sortValue,
patterns,
unlocalizedName,
offset,
size,
side);
}
public InvTracker(int x, int y, int z, int dim, long sortValue, final IInventory patterns,
final String unlocalizedName, int offset, int size, ForgeDirection side) {
this.server = patterns;
this.client = new AppEngInternalInventory(null, size);
this.unlocalizedName = unlocalizedName;
this.sortBy = dual.getSortValue() + offset << 16;
this.sortBy = sortValue + offset << 16;
this.offset = offset;
X = dual.getLocation().x;
Y = dual.getLocation().y;
Z = dual.getLocation().z;
dim = dual.getLocation().getDimension();
if (dual.getHost() instanceof AEBasePart) {
side = ((AEBasePart) dual.getHost()).getSide();
} else {
side = ForgeDirection.UNKNOWN;
}
this.X = x;
this.Y = y;
this.Z = z;
this.dim = dim;
this.side = side;
}
public InvTracker(IInterfaceTerminalSupport terminalSupport,
IInterfaceTerminalSupport.PatternsConfiguration configuration, int index) {
this(
terminalSupport.getLocation(),
terminalSupport.getSortValue(),
terminalSupport.getPatterns(index),
terminalSupport.getName(),
configuration.offset,
configuration.size,
terminalSupport instanceof AEBasePart ? ((AEBasePart) terminalSupport).getSide()
: ForgeDirection.UNKNOWN);
}
}
@@ -371,47 +388,4 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
return itemstack != null && itemstack.getItem() instanceof ItemEncodedPattern;
}
}
private class InterfaceCheck {
int total = 0;
boolean missing = false;
public InterfaceCheck() {}
public int getTotal() {
return total;
}
public boolean isMissing() {
return missing;
}
public ContainerInterfaceWireless.InterfaceCheck invoke(IGridNode gn) {
if (gn.isActive()) {
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
if (ih.getInterfaceDuality().getConfigManager().getSetting(Settings.INTERFACE_TERMINAL) == YesNo.NO
|| ih instanceof PartP2PInterface && ((PartP2PInterface) ih).isOutput()) {
return this;
}
final Collection<ContainerInterfaceWireless.InvTracker> t = ContainerInterfaceWireless.this.diList
.get(ih);
if (t.isEmpty()) {
missing = true;
} else {
final DualityInterface dual = ih.getInterfaceDuality();
for (ContainerInterfaceWireless.InvTracker it : t) {
if (!it.unlocalizedName.equals(dual.getTermName())) {
missing = true;
}
}
}
total += (ih.getInterfaceDuality().getInstalledUpgrades(Upgrades.PATTERN_CAPACITY) + 1);
}
return this;
}
}
}
@@ -115,7 +115,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
return;
}
if (action == InventoryAction.MOVE_REGION) {
super.doAction(player, InventoryAction.SPLIT_OR_PLACE_SINGLE, slotId, id);
super.doAction(player, InventoryAction.MOVE_REGION, slotId, id);
return;
}
if (action == InventoryAction.PICKUP_SINGLE) {
@@ -523,14 +523,51 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
return false;
}
static boolean canDouble(SlotFake[] slots, int mult) {
for (Slot s : slots) {
ItemStack st = s.getStack();
if (st != null) {
if (st.getItem() instanceof ItemFluidPacket) {
long result = (long) ItemFluidPacket.getFluidAmount(st) * mult;
if (result > Integer.MAX_VALUE) {
return false;
}
} else {
long result = (long) s.getStack().stackSize * mult;
if (result > Integer.MAX_VALUE) {
return false;
}
}
}
}
return true;
}
static void doubleStacksInternal(SlotFake[] slots, int mult) {
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
for (final Slot s : enabledSlots) {
ItemStack st = s.getStack();
if (st != null) {
if (st.getItem() instanceof ItemFluidPacket) {
ItemFluidPacket.setFluidAmount(st, ItemFluidPacket.getFluidAmount(st) * mult);
} else {
st.stackSize *= mult;
}
}
}
}
public void doubleStacks(boolean isShift) {
if (canDoubleStacks(craftingSlots) && canDoubleStacks(outputSlots)) {
doubleStacksInternal(this.craftingSlots);
doubleStacksInternal(this.outputSlots);
if (isShift && (containsItem(outputSlots) || containsItem(craftingSlots))) {
while (canDoubleStacks(craftingSlots) && canDoubleStacks(outputSlots)) {
doubleStacksInternal(this.craftingSlots);
doubleStacksInternal(this.outputSlots);
if (!isCraftingMode()) {
if (isShift) {
if (canDouble(this.craftingSlots, 8) && canDouble(this.outputSlots, 8)) {
doubleStacksInternal(this.craftingSlots, 8);
doubleStacksInternal(this.outputSlots, 8);
}
} else {
if (canDouble(this.craftingSlots, 2) && canDouble(this.outputSlots, 2)) {
doubleStacksInternal(this.craftingSlots, 2);
doubleStacksInternal(this.outputSlots, 2);
}
}
this.detectAndSendChanges();
@@ -3,11 +3,8 @@ package com.glodblock.github.client.render.tank;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
@@ -78,7 +75,7 @@ public class FluidTankRenderer {
return null;
}
Map<Fluid, int[]> cache = flowing ? flowingRenderCache : stillRenderCache;
int[] diplayLists = getCachedData(fluid, cache);
int[] diplayLists = cache.get(fluid);
if (diplayLists != null) {
return diplayLists;
}
@@ -122,11 +119,4 @@ public class FluidTankRenderer {
return diplayLists;
}
private static int[] getCachedData(@Nonnull Fluid fluid, Map<Fluid, int[]> cache) {
IIcon icon = fluid.getIcon();
if (icon instanceof TextureAtlasSprite sprite && sprite.hasAnimationMetadata()) {
return null;
}
return cache.get(fluid);
}
}
@@ -16,6 +16,7 @@ public class Config {
public static boolean fluidIOBus;
public static boolean removeRecipe;
public static double portableCellBattery;
public static boolean fluidP2PInterface;
public static int packetSize;
public static int packetRate;
public static boolean replaceEC2;
@@ -41,6 +42,11 @@ public class Config {
"Fluid Craft for AE2",
true,
"Enable this to add Fluid Import/Export Bus like EC2's one.");
fluidP2PInterface = Config.getBoolean(
"fluidP2PInterface",
"Fluid Craft for AE2",
true,
"Enable the P2P Tunnel - ME Dual Interface feature.");
removeRecipe = Config.getBoolean(
"Disable all recipes",
"Fluid Craft for AE2",
@@ -12,6 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
@@ -88,6 +89,22 @@ public class ItemFluidPacket extends FCBaseItem {
return stack != null ? getFluidStack(stack.getItemStack()) : null;
}
public static void setFluidAmount(ItemStack stack, int amount) {
if (stack == null || !stack.hasTagCompound()
|| !stack.getTagCompound().hasKey("FluidStack", Constants.NBT.TAG_COMPOUND)) {
return;
}
stack.getTagCompound().getCompoundTag("FluidStack").setInteger("Amount", amount);
}
public static int getFluidAmount(ItemStack stack) {
if (stack == null || !stack.hasTagCompound()) {
return 0;
}
// Default to 0 if no tag exists
return stack.getTagCompound().getCompoundTag("FluidStack").getInteger("Amount");
}
@Nullable
public static ItemStack newStack(@Nullable FluidStack fluid) {
if (fluid == null || fluid.amount == 0) {
@@ -0,0 +1,71 @@
package com.glodblock.github.common.item;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.Config;
import com.glodblock.github.common.parts.PartFluidP2PInterface;
import com.glodblock.github.common.tabs.FluidCraftingTabs;
import com.glodblock.github.util.NameConst;
import appeng.api.AEApi;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartItem;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemPartFluidP2PInterface extends FCBaseItem implements IPartItem {
private IIcon icon;
public ItemPartFluidP2PInterface() {
this.setMaxStackSize(64);
this.setUnlocalizedName(NameConst.ITEM_PART_FLUID_P2P_INTERFACE);
AEApi.instance().partHelper().setItemBusRenderer(this);
}
@Nullable
@Override
public IPart createPartFromItemStack(ItemStack is) {
return new PartFluidP2PInterface(is);
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
}
@Override
public ItemPartFluidP2PInterface register() {
if (!Config.fluidP2PInterface) return null;
GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_P2P_INTERFACE, FluidCraft.MODID);
setCreativeTab(FluidCraftingTabs.INSTANCE);
return this;
}
@Override
public IIcon getIconFromDamage(int dmg) {
return icon;
}
@Override
public void registerIcons(IIconRegister register) {
if (Config.fluidP2PInterface) {
this.icon = register.registerIcon("appliedenergistics2:ItemPart.P2PTunnel");
}
}
@Override
@SideOnly(Side.CLIENT)
public int getSpriteNumber() {
return 0;
}
}
@@ -0,0 +1,521 @@
package com.glodblock.github.common.parts;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Objects;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.inventory.AEFluidInventory;
import com.glodblock.github.inventory.IAEFluidTank;
import com.glodblock.github.inventory.IDualHost;
import com.glodblock.github.inventory.InventoryHandler;
import com.glodblock.github.inventory.gui.GuiType;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.util.BlockPos;
import com.glodblock.github.util.DualityFluidInterface;
import com.glodblock.github.util.Util;
import com.google.common.collect.ImmutableSet;
import appeng.api.config.Actionable;
import appeng.api.config.Upgrades;
import appeng.api.implementations.tiles.ITileStorageMonitorable;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.ICraftingLink;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.networking.crafting.ICraftingProviderHelper;
import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.events.MENetworkChannelsChanged;
import appeng.api.networking.events.MENetworkCraftingPatternChange;
import appeng.api.networking.events.MENetworkEventSubscribe;
import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.MachineSource;
import appeng.api.networking.storage.IStorageGrid;
import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPart;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.IConfigManager;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
import appeng.helpers.IPriorityHost;
import appeng.me.GridAccessException;
import appeng.parts.automation.UpgradeInventory;
import appeng.parts.p2p.PartP2PTunnelStatic;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.IAEAppEngInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.Platform;
import appeng.util.inv.IInventoryDestination;
import appeng.util.item.AEFluidStack;
public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInterface>
implements IGridTickable, IStorageMonitorable, IInventoryDestination, IDualHost, ISidedInventory,
IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost, IInterfaceHost {
private final DualityInterface duality = new DualityInterface(this.getProxy(), this) {
@Override
public void updateCraftingList() {
if (!isOutput()) {
super.updateCraftingList();
try {
for (PartFluidP2PInterface p2p : getOutputs()) p2p.duality.updateCraftingList();
} catch (GridAccessException e) {
// ?
}
} else {
PartFluidP2PInterface p2p = getInput();
if (p2p != null) {
this.craftingList = p2p.duality.craftingList;
try {
this.gridProxy.getGrid()
.postEvent(new MENetworkCraftingPatternChange(this, this.gridProxy.getNode()));
} catch (final GridAccessException e) {
// :P
}
}
}
}
@Override
public int getInstalledUpgrades(Upgrades u) {
if (isOutput() && u == Upgrades.PATTERN_CAPACITY) return -1;
return super.getInstalledUpgrades(u);
}
};
private final DualityFluidInterface dualityFluid = new DualityFluidInterface(this.getProxy(), this);
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, 6);
private final BaseActionSource ownActionSource = new MachineSource(this);
public PartFluidP2PInterface(ItemStack is) {
super(is);
}
@MENetworkEventSubscribe
public void stateChange(final MENetworkChannelsChanged c) {
dualityFluid.onChannelStateChange(c);
duality.notifyNeighbors();
}
@MENetworkEventSubscribe
public void stateChange(final MENetworkPowerStatusChange c) {
dualityFluid.onPowerStateChange(c);
duality.notifyNeighbors();
}
@Override
public void gridChanged() {
super.gridChanged();
dualityFluid.gridChanged();
}
@Override
public boolean onPartActivate(final EntityPlayer player, final Vec3 pos) {
AppEngInternalInventory patterns = (AppEngInternalInventory) duality.getPatterns();
if (super.onPartActivate(player, pos)) {
ArrayList<ItemStack> drops = new ArrayList<>();
for (int i = 0; i < patterns.getSizeInventory(); i++) {
if (patterns.getStackInSlot(i) == null) continue;
drops.add(patterns.getStackInSlot(i));
}
final IPart tile = this.getHost().getPart(this.getSide());
if (tile instanceof PartFluidP2PInterface dualTile) {
DualityInterface newDuality = dualTile.duality;
// Copy interface storage, upgrades, and settings over
UpgradeInventory upgrades = (UpgradeInventory) duality.getInventoryByName("upgrades");
dualTile.duality.getStorage();
UpgradeInventory newUpgrade = (UpgradeInventory) newDuality.getInventoryByName("upgrades");
for (int i = 0; i < upgrades.getSizeInventory(); ++i) {
newUpgrade.setInventorySlotContents(i, upgrades.getStackInSlot(i));
}
IInventory storage = duality.getStorage();
IInventory newStorage = newDuality.getStorage();
for (int i = 0; i < storage.getSizeInventory(); ++i) {
newStorage.setInventorySlotContents(i, storage.getStackInSlot(i));
}
IConfigManager config = duality.getConfigManager();
config.getSettings().forEach(
setting -> newDuality.getConfigManager().putSetting(setting, config.getSetting(setting)));
}
TileEntity te = getTileEntity();
Platform.spawnDrops(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, drops);
return true;
}
if (player.isSneaking()) {
return false;
}
if (Platform.isServer()) {
InventoryHandler.openGui(
player,
this.getHost().getTile().getWorldObj(),
new BlockPos(this.getHost().getTile()),
Objects.requireNonNull(this.getSide()),
GuiType.DUAL_INTERFACE);
}
return true;
}
@Override
public IIcon getTypeTexture() {
return ItemAndBlockHolder.INTERFACE.getBlockTextureFromSide(0);
}
@Override
public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src) {
return duality.getMonitorable(side, src, this);
}
@Override
public TickingRequest getTickingRequest(IGridNode node) {
TickingRequest item = duality.getTickingRequest(node);
TickingRequest fluid = dualityFluid.getTickingRequest(node);
return new TickingRequest(
Math.min(item.minTickRate, fluid.minTickRate),
Math.max(item.maxTickRate, fluid.maxTickRate),
item.isSleeping && fluid.isSleeping,
true);
}
@Override
public TickRateModulation tickingRequest(IGridNode node, int ticksSinceLastCall) {
TickRateModulation item = duality.tickingRequest(node, ticksSinceLastCall);
TickRateModulation fluid = dualityFluid.tickingRequest(node, ticksSinceLastCall);
if (item.ordinal() >= fluid.ordinal()) {
return item;
} else {
return fluid;
}
}
@Override
public int getInstalledUpgrades(Upgrades u) {
return duality.getInstalledUpgrades(u);
}
@Override
public IMEMonitor<IAEItemStack> getItemInventory() {
return duality.getItemInventory();
}
@Override
public IMEMonitor<IAEFluidStack> getFluidInventory() {
return duality.getFluidInventory();
}
@Override
public int getPriority() {
return duality.getPriority();
}
@Override
public void setPriority(int newValue) {
duality.setPriority(newValue);
}
@Override
public void onTunnelNetworkChange() {
duality.updateCraftingList();
}
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation op, ItemStack removedStack,
ItemStack newStack) {
duality.onChangeInventory(inv, slot, op, removedStack, newStack);
}
@Override
public boolean canInsert(ItemStack stack) {
return duality.canInsert(stack);
}
@Override
public int getSizeInventory() {
return duality.getStorage().getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slotIn) {
return duality.getStorage().getStackInSlot(slotIn);
}
@Override
public ItemStack decrStackSize(int index, int count) {
return duality.getStorage().decrStackSize(index, count);
}
@Override
public ItemStack getStackInSlotOnClosing(int index) {
return duality.getStorage().getStackInSlotOnClosing(index);
}
@Override
public void setInventorySlotContents(int index, ItemStack stack) {
duality.getStorage().setInventorySlotContents(index, stack);
}
@Override
public IInventory getInventoryByName(String name) {
return duality.getInventoryByName(name);
}
@Override
public IConfigManager getConfigManager() {
return duality.getConfigManager();
}
@Override
public IIcon getBreakingTexture() {
return getItemStack().getIconIndex();
}
@Override
public String getInventoryName() {
return duality.getStorage().getInventoryName();
}
@Override
public boolean hasCustomInventoryName() {
return duality.getStorage().hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit() {
return duality.getStorage().getInventoryStackLimit();
}
@Override
public void markDirty() {
duality.markDirty();
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return duality.getStorage().isUseableByPlayer(player);
}
@Override
public void openInventory() {
duality.getStorage().openInventory();
}
@Override
public void closeInventory() {
duality.getStorage().closeInventory();
}
@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
return duality.getStorage().isItemValidForSlot(index, stack);
}
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return duality.getAccessibleSlotsFromSide(side);
}
@Override
public boolean canInsertItem(int p_102007_1_, ItemStack itemStack, int p_102007_3_) {
return true;
}
@Override
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
return true;
}
private IMEMonitor<IAEFluidStack> getFluidGrid() {
try {
return getProxy().getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
} catch (GridAccessException e) {
return null;
}
}
private IEnergyGrid getEnergyGrid() {
try {
return getProxy().getGrid().getCache(IEnergyGrid.class);
} catch (GridAccessException e) {
return null;
}
}
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
IEnergyGrid energyGrid = getEnergyGrid();
if (energyGrid == null || fluidGrid == null || resource == null) return 0;
int ori = resource.amount;
IAEFluidStack remove;
if (doFill) {
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.MODULATE, ownActionSource);
} else {
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.SIMULATE, ownActionSource);
}
return remove == null ? ori : (int) (ori - remove.getStackSize());
}
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
return dualityFluid.drain(from, resource, doDrain);
}
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
return dualityFluid.drain(from, maxDrain, doDrain);
}
@Override
public boolean canFill(ForgeDirection from, Fluid fluid) {
return true;
}
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid) {
return true;
}
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
return dualityFluid.getTankInfo(from);
}
@Override
public void onFluidInventoryChanged(IAEFluidTank inv, int slot) {
saveChanges();
getTileEntity().markDirty();
dualityFluid.onFluidInventoryChanged(inv, slot);
}
@Override
public AEFluidInventory getInternalFluid() {
return dualityFluid.getInternalFluid();
}
@Override
public DualityFluidInterface getDualityFluid() {
return dualityFluid;
}
@Override
public AppEngInternalAEInventory getConfig() {
Util.mirrorFluidToPacket(config, dualityFluid.getConfig());
return config;
}
@Override
public void setConfig(int id, IAEFluidStack fluid) {
if (id >= 0 && id < 6) {
config.setInventorySlotContents(
id,
ItemFluidPacket.newDisplayStack(fluid == null ? null : fluid.getFluidStack()));
dualityFluid.getConfig().setFluidInSlot(id, dualityFluid.getStandardFluid(fluid));
}
}
@Override
public void setFluidInv(int id, IAEFluidStack fluid) {
if (id >= 0 && id < 6) {
dualityFluid.getInternalFluid().setFluidInSlot(id, fluid);
}
}
@Override
public DualityInterface getInterfaceDuality() {
return duality;
}
@Override
public EnumSet<ForgeDirection> getTargets() {
return EnumSet.of(this.getSide());
}
@Override
public TileEntity getTileEntity() {
return super.getHost().getTile();
}
@Override
public void provideCrafting(ICraftingProviderHelper craftingTracker) {
duality.provideCrafting(craftingTracker);
}
@Override
public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) {
return duality.pushPattern(patternDetails, table);
}
@Override
public boolean isBusy() {
return duality.isBusy();
}
@Override
public ImmutableSet<ICraftingLink> getRequestedJobs() {
return duality.getRequestedJobs();
}
@Override
public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode) {
return duality.injectCraftedItems(link, items, mode);
}
@Override
public void jobStateChange(ICraftingLink link) {
duality.jobStateChange(link);
}
@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
duality.readFromNBT(data);
}
@Override
public void writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);
duality.writeToNBT(data);
}
@Override
public void addToWorld() {
super.addToWorld();
this.duality.initialize();
}
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched) {
super.getDrops(drops, wrenched);
duality.addDrops(drops);
}
@Override
public boolean shouldDisplay() {
return IInterfaceHost.super.shouldDisplay() && !isOutput();
}
}
@@ -3,6 +3,8 @@ package com.glodblock.github.common.storage;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -385,6 +387,11 @@ public class FluidCellInventory implements IFluidCellInventory {
return out;
}
@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request) {
return this.getCellFluids().findPrecise(request);
}
@Override
public List<IAEFluidStack> getContents() {
List<IAEFluidStack> ret = new ArrayList<>();
@@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import com.glodblock.github.api.FluidCraftAPI;
import com.glodblock.github.common.item.ItemFluidDrop;
@@ -203,6 +205,24 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
return out;
}
@Override
public IAEItemStack getAvailableItem(@Nonnull IAEItemStack request) {
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
if (fluidGrid == null) {
return null;
}
IAEFluidStack fluidRequest = ItemFluidDrop.getAeFluidStack(request);
if (fluidRequest == null) {
return null;
}
IAEFluidStack availableFluid = fluidGrid.getAvailableItem(fluidRequest);
if (availableFluid == null || availableFluid.getFluid() == null
|| FluidCraftAPI.instance().isBlacklistedInDisplay(availableFluid.getFluid().getClass())) {
return null;
}
return ItemFluidDrop.newAeStack(availableFluid);
}
@Override
public StorageChannel getChannel() {
return StorageChannel.ITEMS;
@@ -277,6 +297,11 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
return out;
}
@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request) {
return null;
}
@Override
public StorageChannel getChannel() {
return StorageChannel.FLUIDS;
@@ -17,8 +17,7 @@ public class FCClassTransformer implements IClassTransformer {
case "appeng.crafting.CraftingTreeNode" -> tform = CraftingTreeNodeTransformer.INSTANCE;
case "appeng.me.cluster.implementations.CraftingCPUCluster" -> tform = CraftingCpuTransformer.INSTANCE;
case "appeng.helpers.DualityInterface" -> tform = DualityInterfaceTransformer.INSTANCE;
case "appeng.container.implementations.ContainerInterfaceTerminal" -> tform = ContainerInterfaceTerminalTransformer.INSTANCE;
case "appeng.client.gui.implementations.GuiCraftingCPU", "appeng.client.gui.implementations.GuiCraftConfirm", "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm" -> tform = GuiCraftingTransformer.INSTANCE;
case "appeng.client.gui.implementations.GuiCraftingCPU", "appeng.client.gui.implementations.GuiCraftConfirm", "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm", "appeng.client.gui.widgets.GuiCraftingTree" -> tform = GuiCraftingTransformer.INSTANCE;
case "appeng.integration.modules.NEI" -> tform = NEITransfermer.INSTANCE;
case "appeng.core.features.registries.ExternalStorageRegistry" -> tform = ExternalStorageRegistryTransformer.INSTANCE;
case "appeng.core.sync.packets.PacketCompressedNBT" -> tform = PacketCompressedNBTTransformer.INSTANCE;
@@ -1,60 +0,0 @@
package com.glodblock.github.coremod.transform;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import com.glodblock.github.coremod.FCClassTransformer;
public class ContainerInterfaceTerminalTransformer extends FCClassTransformer.ClassMapper {
public static final ContainerInterfaceTerminalTransformer INSTANCE = new ContainerInterfaceTerminalTransformer();
private ContainerInterfaceTerminalTransformer() {
// NO-OP
}
@Override
protected ClassVisitor getClassMapper(ClassVisitor downstream) {
return new TransformContainerInterfaceTerminal(Opcodes.ASM5, downstream);
}
private static class TransformContainerInterfaceTerminal extends ClassVisitor {
TransformContainerInterfaceTerminal(int api, ClassVisitor cv) {
super(api, cv);
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (name.equals("detectAndSendChanges") || name.equals("func_75142_b") || name.equals("regenList")) {
return new TransformDetectAndSendChanges(
api,
super.visitMethod(access, name, desc, signature, exceptions));
}
return super.visitMethod(access, name, desc, signature, exceptions);
}
}
private static class TransformDetectAndSendChanges extends MethodVisitor {
TransformDetectAndSendChanges(int api, MethodVisitor mv) {
super(api, mv);
}
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
if (opcode == Opcodes.INVOKEINTERFACE && owner.equals("appeng/api/networking/IGrid")
&& name.equals("getMachines")) {
super.visitMethodInsn(
Opcodes.INVOKESTATIC,
"com/glodblock/github/coremod/hooker/CoreModHooks",
"getMachines",
"(Lappeng/api/networking/IGrid;Ljava/lang/Class;)Lappeng/api/networking/IMachineSet;",
false);
} else {
super.visitMethodInsn(opcode, owner, name, desc, itf);
}
}
}
}
@@ -27,7 +27,7 @@ public class GuiCraftingTransformer extends FCClassTransformer.ClassMapper {
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if ("drawFG".equals(name)) {
if ("drawFG".equals(name) || "drawListFG".equals(name) || "drawStack".equals(name)) {
return new TransformFluidIcon(api, super.visitMethod(access, name, desc, signature, exceptions));
}
return super.visitMethod(access, name, desc, signature, exceptions);
@@ -17,6 +17,7 @@ import com.glodblock.github.common.Config;
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.common.parts.PartFluidExportBus;
import com.glodblock.github.common.parts.PartFluidInterface;
import com.glodblock.github.common.parts.PartFluidP2PInterface;
import com.glodblock.github.common.tile.TileFluidInterface;
import com.glodblock.github.util.Ae2Reflect;
import com.glodblock.github.util.BlockPos;
@@ -88,7 +89,8 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
capProvider.zCoord + face.offsetZ);
if (!Config.noFluidPacket && !(inter instanceof TileFluidInterface
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidInterface
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidExportBus))
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidExportBus
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidP2PInterface))
return InventoryAdaptor.getAdaptor(capProvider, face);
InventoryAdaptor item = InventoryAdaptor.getAdaptor(capProvider, face);
IFluidHandler fluid = capProvider instanceof IFluidHandler ? (IFluidHandler) capProvider : null;
@@ -391,7 +393,10 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
if (p2p == invFluidsP2P || p2p == null) continue;
IFluidHandler target = Ae2Reflect.getP2PLiquidTarget(p2p);
if (target == null) continue;
tankInfos.add(target.getTankInfo(p2p.getSide().getOpposite()));
FluidTankInfo[] info = target.getTankInfo(p2p.getSide().getOpposite());
if (info != null) {
tankInfos.add(info);
}
}
} catch (GridAccessException ignore) {}
} else {
@@ -2,6 +2,8 @@ package com.glodblock.github.inventory;
import java.util.*;
import javax.annotation.Nonnull;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
@@ -189,6 +191,11 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
return out;
}
@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request) {
return this.cache.findPrecise(request);
}
public IItemList<IAEFluidStack> getStorageList() {
return this.cache;
}
@@ -28,6 +28,7 @@ public class ItemAndBlockHolder {
public static ItemPartFluidPatternTerminal FLUID_TERMINAL = new ItemPartFluidPatternTerminal().register();
public static ItemPartFluidPatternTerminalEx FLUID_TERMINAL_EX = new ItemPartFluidPatternTerminalEx().register();
public static ItemPartFluidInterface FLUID_INTERFACE = new ItemPartFluidInterface().register();
public static ItemPartFluidP2PInterface FLUID_INTERFACE_P2P = new ItemPartFluidP2PInterface().register();
public static ItemFluidImportBus FLUID_IMPORT_BUS = new ItemFluidImportBus().register();
public static ItemFluidExportBus FLUID_EXPORT_BUS = new ItemFluidExportBus().register();
public static ItemPartFluidStorageBus FLUID_STORAGE_BUS = new ItemPartFluidStorageBus().register();
@@ -21,6 +21,7 @@ import com.glodblock.github.common.storage.CellType;
import com.glodblock.github.loader.recipe.WirelessTerminalRecipe;
import com.glodblock.github.util.ModAndClassUtil;
import appeng.api.AEApi;
import cpw.mods.fml.common.registry.GameRegistry;
import extracells.registries.ItemEnum;
@@ -102,6 +103,7 @@ public class RecipeLoader implements Runnable {
54);
public static final ItemStack AE2_WIRELESS_TERMINAL = GameRegistry
.findItemStack("appliedenergistics2", "item.ToolWirelessTerminal", 1);
public static final ItemStack AE2_P2P_ME = AEApi.instance().definitions().parts().p2PTunnelME().maybeStack(1).get();
public static final ItemStack AE2_ME_CHEST = GameRegistry
.findItemStack("appliedenergistics2", "tile.BlockChest", 1);
public static final ItemStack AE2_ENERGY_CELL = GameRegistry
@@ -146,6 +148,10 @@ public class RecipeLoader implements Runnable {
'E',
AE2_INTERFACE));
GameRegistry.addShapelessRecipe(FLUID_INTERFACE.stack(), INTERFACE.stack());
if (Config.fluidP2PInterface) {
GameRegistry.addShapelessRecipe(FLUID_INTERFACE_P2P.stack(), AE2_P2P_ME, INTERFACE.stack());
GameRegistry.addShapelessRecipe(FLUID_INTERFACE_P2P.stack(), AE2_P2P_ME, FLUID_INTERFACE.stack());
}
GameRegistry.addShapelessRecipe(INTERFACE.stack(), FLUID_INTERFACE.stack());
GameRegistry.addShapelessRecipe(WIRELESS_FLUID_TERM.stack(), AE2_WIRELESS_TERMINAL, BUCKET);
GameRegistry.addShapelessRecipe(WIRELESS_PATTERN_TERM.stack(), WIRELESS_FLUID_TERM, FLUID_TERMINAL);
@@ -97,11 +97,15 @@ public class CPacketRenamer implements IMessage {
public static class Handler implements IMessageHandler<CPacketRenamer, IMessage> {
private String getName(ICustomNameObject obj) {
return obj.hasCustomName() ? obj.getCustomName() : "";
}
private String getName(TileEntity tile, ForgeDirection side) {
if (tile instanceof TileCableBus) {
return ((ICustomNameObject) ((TileCableBus) tile).getPart(side)).getCustomName();
return getName((ICustomNameObject) ((TileCableBus) tile).getPart(side));
} else {
return ((ICustomNameObject) tile).getCustomName();
return getName((ICustomNameObject) tile);
}
}
@@ -4,6 +4,9 @@ import net.minecraft.item.ItemStack;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.Config;
import com.glodblock.github.common.parts.PartFluidInterface;
import com.glodblock.github.common.parts.PartFluidP2PInterface;
import com.glodblock.github.common.tile.TileFluidInterface;
import com.glodblock.github.common.tile.TileWalrus;
import com.glodblock.github.crossmod.extracells.EC2Replacer;
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
@@ -15,6 +18,7 @@ import com.glodblock.github.util.ModAndClassUtil;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.Upgrades;
import appeng.helpers.InterfaceTerminalSupportedClassProvider;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
@@ -43,6 +47,7 @@ public class CommonProxy {
if (ModAndClassUtil.isBigInterface) {
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 3);
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 3);
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE_P2P), 3);
}
Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 1);
Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 1);
@@ -62,6 +67,9 @@ public class CommonProxy {
Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_EXPORT_BUS), 1);
}
AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AEFluidInterfaceHandler());
InterfaceTerminalSupportedClassProvider.register(PartFluidP2PInterface.class);
InterfaceTerminalSupportedClassProvider.register(PartFluidInterface.class);
InterfaceTerminalSupportedClassProvider.register(TileFluidInterface.class);
}
public void registerRenderers() {}
@@ -165,7 +165,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
@Override
public IInventory getInventoryByName(String name) {
return null;
return iHost.getInventoryByName(name);
}
public IFluidHandler getFluidInventoryByName(String name) {
@@ -29,6 +29,7 @@ public class NameConst {
public static final String ITEM_PART_FLUID_PATTERN_TERMINAL = "part_fluid_pattern_terminal";
public static final String ITEM_PART_FLUID_PATTERN_TERMINAL_EX = "part_fluid_pattern_terminal_ex";
public static final String ITEM_PART_FLUID_INTERFACE = "part_fluid_interface";
public static final String ITEM_PART_FLUID_P2P_INTERFACE = "part_fluid_p2p_interface";
public static final String ITEM_PART_FLUID_IMPORT = "part_fluid_import";
public static final String ITEM_PART_FLUID_EXPORT = "part_fluid_export";
public static final String ITEM_PART_FLUID_STORAGE_BUS = "part_fluid_storage_bus";
@@ -1,9 +1,10 @@
item.fluid_drop.name=drop of %s
item.fluid_encoded_pattern.name=Encode Pattern
item.fluid_encoded_pattern.name=Encoded Pattern
item.part_fluid_terminal.name=ME Fluid Terminal
item.part_fluid_pattern_terminal.name=ME Fluid Pattern Terminal
item.part_fluid_pattern_terminal_ex.name=ME Fluid Processing Pattern Terminal
item.part_fluid_interface.name=ME Dual Interface
item.part_fluid_p2p_interface.name=P2P Tunnel - ME Dual Interface
item.part_fluid_import.name=ME Fluid Import Bus
item.part_fluid_export.name=ME Fluid Export Bus
item.part_fluid_storage_bus.name=ME Fluid Storage Bus
@@ -108,7 +109,7 @@ ae2fc.tooltip.cell_empty=Cell is empty
ae2fc.tooltip.cell_portable=Right click to open its GUI. It works like a backpack, but you need to charge it before using.
ae2fc.tooltip.fluid_terminal=uh So we don't need EC2 anymore?
ae2fc.tooltip.invalid_fluid=Invalid fluid!
ae2fc.tooltip.encode_pattern=Encode Patter
ae2fc.tooltip.encode_pattern=Encode Pattern
ae2fc.tooltip.fluid_packet=Use a Fluid Packet Decoder to\nconvert this back into fluid.
ae2fc.tooltip.empty=Empty
ae2fc.tooltip.dump_tank=Dump Tank Contents
+130 -1
View File
@@ -1,11 +1,28 @@
item.fluid_drop.name=Капля (%s)
item.fluid_encoded_pattern.name=Кодированный шаблон
item.part_fluid_terminal.name=МЭ жидкостный терминал
item.part_fluid_pattern_terminal.name=МЭ жидкостный терминал шаблонов
item.part_fluid_pattern_terminal_ex.name=МЭ жидкостный терминал шаблонов обработки
item.part_fluid_interface.name=Жидкостный интерфейс
item.part_fluid_interface.name=МЭ двойной интерфейс
item.part_fluid_p2p_interface.name=Туннель точка-точка - МЭ двойной интерфейс
item.part_fluid_import.name=МЭ жидкостная шина импорта
item.part_fluid_export.name=МЭ жидкостная шина экспорта
item.part_fluid_storage_bus.name=МЭ жидкостная шина хранения
item.part_fluid_level_emitter.name=МЭ жидкостный излучатель уровня
item.part_fluid_storage_monitor.name=МЭ жидкостный монитор хранения
item.part_fluid_conversion_monitor.name=МЭ жидкостный монитор преобразования
item.portable_fluid_cell.name=Переносная жидкостная ячейка
item.wireless_fluid_terminal.name=Беспроводной жидкостный терминал
item.wireless_fluid_pattern_terminal.name=Беспроводной жидкостный терминал шаблонов
item.wireless_interface_terminal.name=Беспроводной терминал интерфейсов
item.wireless_ultra_terminal.WIRELESS_CRAFTING_TERMINAL.name=Беспроводной универсальный терминал - Создание
item.wireless_ultra_terminal.WIRELESS_FLUID_PATTERN_TERMINAL.name=Беспроводной универсальный терминал - Шаблон
item.wireless_ultra_terminal.WIRELESS_FLUID_TERMINAL.name=Беспроводной универсальный терминал - Жидкость
item.wireless_ultra_terminal.WIRELESS_ESSENTIA_TERMINAL.name=Беспроводной универсальный терминал - Эссенция
item.wireless_ultra_terminal.WIRELESS_INTERFACE_TERMINAL.name=Беспроводной универсальный терминал - Интерфейс
item.wireless_ultra_terminal.WIRELESS_FLUID_PATTERN_TERMINAL_EX.name=Беспроводной универсальный терминал - Шаблон обработки
item.fluid_packet.name=Жидкостный пакет
item.creative_fluid_storage.name=Творческая МЭ жидкостная ячейка хранения
item.fluid_storage.1.name=%s1К%s МЭ жидкостная ячейка хранения
item.fluid_storage.4.name=%s4К%s МЭ жидкостная ячейка хранения
item.fluid_storage.16.name=%s16К%s МЭ жидкостная ячейка хранения
@@ -13,6 +30,17 @@ item.fluid_storage.64.name=%s64К%s МЭ жидкостная ячейка хр
item.fluid_storage.256.name=%s256К%s МЭ жидкостная ячейка хранения
item.fluid_storage.1024.name=%s1024К%s МЭ жидкостная ячейка хранения
item.fluid_storage.4096.name=%s4096К%s МЭ жидкостная ячейка хранения
item.fluid_storage.16384.name=%s16384К%s МЭ жидкостная ячейка хранения
item.multi_fluid_storage.1.name=%s1К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.4.name=%s4К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.16.name=%s16К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.64.name=%s64К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.256.name=%s256К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.1024.name=%s1024К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.4096.name=%s4096К%s МЭ мульти-жидкостная ячейка хранения
item.multi_fluid_storage.16384.name=%s16384К%s МЭ мульти-жидкостная ячейка хранения
item.fluid_storage.quantum.name=МЭ жидкостная квантовая ячейка хранения
item.fluid_storage.singularity.name=МЭ жидкостная цифровая сингулярность
item.fluid_part.0.name=%s1К%s МЭ жидкостный компонент хранения
item.fluid_part.1.name=%s4К%s МЭ жидкостный компонент хранения
item.fluid_part.2.name=%s16К%s МЭ жидкостный компонент хранения
@@ -20,21 +48,122 @@ item.fluid_part.3.name=%s64К%s МЭ жидкостный компонент х
item.fluid_part.4.name=%s256К%s МЭ жидкостный компонент хранения
item.fluid_part.5.name=%s1024К%s МЭ жидкостный компонент хранения
item.fluid_part.6.name=%s4096К%s МЭ жидкостный компонент хранения
item.fluid_part.7.name=%s16384К%s МЭ жидкостный компонент хранения
item.fluid_storage_housing.0.name=МЭ жидкостный корпус ячейки хранения
item.fluid_storage_housing.1.name=МЭ продвинутый жидкостный корпус ячейки хранения
item.fluid_storage_housing.2.name=МЭ мульти-жидкостный корпус ячейки хранения
item.fluid_storage_housing.3.name=МЭ продвинутый мульти-жидкостный корпус ячейки хранения
tile.fluid_discretizer.name=Дискретизатор жидкости
tile.fluid_pattern_encoder.name=Кодировщик жидкостных шаблонов
tile.fluid_packet_decoder.name=МЭ декодер жидкостных пакетов
tile.fluid_interface.name=Жидкостный интерфейс
tile.ingredient_buffer.name=Буфер ингредиентов
tile.large_ingredient_buffer.name=Большой буфер ингредиентов
tile.oc_pattern_editor.name=OC редактор шаблонов
tile.level_maintainer.name=МЭ поддерживатель уровня
tile.fluid_buffer.name=МЭ жидкостный буфер
tile.walrus.name=Морж
tile.fluid_auto_filler.name=МЭ жидкостный авто-заполнитель
tile.certus_quartz_tank.name=Резервуар из истинного кварца - %s
tile.certus_quartz_tank_empty.name=Резервуар из истинного кварца
ae2fc.waila.speed=Скорость
ae2fc.waila.enable=Включено
ae2fc.waila.disable=Выключено
ae2fc.tooltip.shift_for_more=§r> Удерживайте §3Shift§r для подробностей
ae2fc.tooltip.ctrl_for_more=§r> Удерживайте §3Ctrl§r для подробностей
ae2fc.tooltip.fluid_packet_decoder.desc=Жидкостный декодер может декодировать жидкостные пакеты. Он должен быть подключен к МЭ системе, в которой есть место для хранения жидкостей, иначе он не будет работать.
ae2fc.tooltip.discretizer.desc=Когда МЭ дискретизатор жидкости подключен к вашей МЭ системе, он будет представлять жидкости, которые хранятся в ваших МЭ жидкостных ячейках хранения (или шинах хранения) в виде капель. Они являются предметным эквивалентом жидкостей. Это просто ещё один способ показать жидкости, на самом деле, он не преобразует их в предметы.
ae2fc.tooltip.fluid_buffer.desc=Это высокоскоростной порт ввода\вывода жидкостей.
ae2fc.tooltip.walrus.desc=GTNH - это как работа.
ae2fc.tooltip.fluid_auto_filler=Автоматически создаёт шаблон заполняемой жидкости заданного контейнера.
ae2fc.tooltip.level_maintainer.Who_Am_I=Кто я?
ae2fc.tooltip.level_maintainer.title=§6Статус запроса§r
ae2fc.tooltip.level_maintainer.desc=Автоматически поддерживает заданное количество предметов и жидкостей в хранилище, запрашивая новые при необходимости. Должен быть подключен к МЭ сети.
ae2fc.tooltip.level_maintainer.current=Текущее состояние:
ae2fc.tooltip.level_maintainer.none=Запрос не настроен.
ae2fc.tooltip.level_maintainer.idle=§aБездействие§r
ae2fc.tooltip.level_maintainer.idle_desc=Запрашиватель бездействует, когда запрошенное количество уже достигнуто, нет шаблона создания этого предмета или жидкости или если недостаточно ингредиентов, чтобы запросить больше.
ae2fc.tooltip.level_maintainer.link=§eСоздание§r
ae2fc.tooltip.level_maintainer.link_desc=В данный момент система создаёт запрашиваемый предмет или жидкость.
ae2fc.tooltip.level_maintainer.export=§5Экспорт§r
ae2fc.tooltip.level_maintainer.export_desc=Запрашиватель пытается поместить результаты создания в систему. Если запрашиватель находится в этом состоянии длительное время, значит в системе недостаточно свободного места для экспорта.
ae2fc.tooltip.level_maintainer.batch_size=§6Размер партии создания§r
ae2fc.tooltip.level_maintainer.batch_size.hint=Запрашиватель будет использовать указанный размер партии при появлении запроса на создание. Использование больших значений увеличит скорость пополнения предметов, но потребует увеличение количества хранилищ создания.
ae2fc.tooltip.level_maintainer.request_size=§6Количество для поддержания§r
ae2fc.tooltip.level_maintainer.request_size.hint=Счетчик определяет, сколько предметов должно находится в хранилище, прежде чем запрашиватель отправит запрос на создание.
ae2fc.tooltip.ultra_terminal.WIRELESS_CRAFTING_TERMINAL=Режим: Терминал создания
ae2fc.tooltip.ultra_terminal.WIRELESS_FLUID_PATTERN_TERMINAL=Режим: Терминал шаблонов
ae2fc.tooltip.ultra_terminal.WIRELESS_FLUID_TERMINAL=Режим: Жидкостный терминал
ae2fc.tooltip.ultra_terminal.WIRELESS_ESSENTIA_TERMINAL=Режим: Терминал эссенции
ae2fc.tooltip.ultra_terminal.WIRELESS_INTERFACE_TERMINAL=Режим: Терминал интерфейсов
ae2fc.tooltip.ultra_terminal.WIRELESS_FLUID_PATTERN_TERMINAL_EX=Режим: Терминал шаблонов обработки
ae2fc.tooltip.ultra_terminal=ПКМ+Shift, чтобы изменить режим.
ae2fc.tooltip.ultra_terminal.tips=Подсказки:
ae2fc.tooltip.ultra_terminal.tips.desc=1. Вы можете поместить его в слот Baubles и открыть с помощью привязанной клавиши.\n2. Режим интерфейсов. Удерживайте §3Shift§7 для переключения между кнопками подсветки и переименовывания интерфейсов.\n3. Экран "План создания".\nУдерживая §3Shift§7 нажмите кнопку "Отмена", чтобы автоматически добавить все недостающие ингредиенты в панель закладок NEI.
ae2fc.tooltip.cell_contents=Содержит жидкость:
ae2fc.tooltip.cell_empty=Ячейка пуста
ae2fc.tooltip.cell_portable=Нажмите ПКМ для открытия её интерфейса. Работает как рюкзак, но её необходимо зарядить перед использованием.
ae2fc.tooltip.fluid_terminal=Эмм, нам больше не нужен EC2?
ae2fc.tooltip.invalid_fluid=Неверная жидкость!
ae2fc.tooltip.encode_pattern=Закодировать шаблон
ae2fc.tooltip.fluid_packet=Используйте декодер жидкостных пакетов,\nчтобы преобразовать это обратно в жидкость.
ae2fc.tooltip.empty=Пусто
ae2fc.tooltip.dump_tank=Слить содержимое резервуара
ae2fc.tooltip.switch_fluid_interface=Переключить GUI МЭ двойного интерфейса
ae2fc.tooltip.not_combine=Объединять одинаковые предметы
ae2fc.tooltip.not_combine.hint=Выключено
ae2fc.tooltip.combine=Объединять одинаковые предметы
ae2fc.tooltip.combine.hint=Включено
ae2fc.tooltip.fluid_terminal_w=Жидкостный терминал
ae2fc.tooltip.craft_terminal_w=Терминал создания
ae2fc.tooltip.pattern_terminal_w=Терминал шаблонов
ae2fc.tooltip.essentia_terminal_w=Терминал эссенции
ae2fc.tooltip.interface_terminal_w=Терминал интерфейсов
ae2fc.tooltip.pattern_terminal_ex_w=Терминал шаблонов обработки
ae2fc.tooltip.wireless.installed=Установленные карты:
ae2fc.tooltip.not_prio=Помещать жидкость первой
ae2fc.tooltip.not_prio.hint=Включено
ae2fc.tooltip.prio=Помещать жидкость первой
ae2fc.tooltip.prio.hint=Выключено
ae2fc.tooltip.submit=Подтвердить
ae2fc.tooltip.enable=Включено
ae2fc.tooltip.disable=Выключено
ae2fc.tooltip.edit=Редактировать
ae2fc.tooltip.fill_pattern=Разрешить авто-заполнение пустых шаблонов
ae2fc.tooltip.not_fill_pattern=Разрешить авто-заполнение пустых шаблонов
ae2fc.tooltip.fill_pattern.hint=Включено
ae2fc.tooltip.not_fill_pattern.hint=Выключено
ae2fc.gui.part_fluid_pattern_terminal=Жидкостный терминал шаблонов
ae2fc.gui.part_fluid_pattern_terminal_ex=Жидкостный терминал шаблонов обработки
ae2fc.gui.fluid_pattern_encoder=Кодировщик жидкостных шаблонов
ae2fc.gui.fluid_packet_decoder=МЭ декодер жидкостных пакетов
ae2fc.gui.ingredient_buffer=Буфер ингредиентов
ae2fc.gui.large_ingredient_buffer=Большой буфер ингредиентов
ae2fc.gui.fluid_interface=МЭ двойной интерфейс
ae2fc.gui.level_maintainer=МЭ поддерживатель уровня
ae2fc.gui.fluid_interface.0=Низ
ae2fc.gui.fluid_interface.1=Вер
ae2fc.gui.fluid_interface.2=Сев
ae2fc.gui.fluid_interface.3=Юг
ae2fc.gui.fluid_interface.4=Зап
ae2fc.gui.fluid_interface.5=Вос
ae2fc.gui.oc_pattern_editor=OC редактор шаблонов
ae2fc.gui.button.set=Задать
ae2fc.gui.part_fluid_level_emitter=МЭ излучатель уровня
ae2fc.gui.part_fluid_import=МЭ жидкостная шина импорта
ae2fc.gui.part_fluid_export=МЭ жидкостная шина экспорта
ae2fc.gui.part_fluid_terminal=МЭ жидкостный терминал
ae2fc.gui.part_fluid_storage_bus=МЭ жидкостная шина хранения
ae2fc.gui.fluid_auto_filler=МЭ жидкостный авто-заполнитель
error.unknown=Неизвестно
key.OpenTerminal=Открыть беспроводной универсальный терминал
itemGroup.ae2fc=Fluid Craft For AE2
@@ -4,6 +4,7 @@ item.part_fluid_terminal.name=ME流体终端
item.part_fluid_pattern_terminal.name=ME流体样板终端
item.part_fluid_pattern_terminal_ex.name=ME增广流体样板终端
item.part_fluid_interface.name=ME二合一接口
item.part_fluid_p2p_interface.name=P2P通道 - ME二合一接口
item.part_fluid_import.name=ME流体输入总线
item.part_fluid_export.name=ME流体输出总线
item.part_fluid_storage_bus.name=ME流体存储总线