Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ebe3341bfe | |||
| 7566b3e2fc | |||
| 30c074021b | |||
| e6586ac360 | |||
| 0429fe5f21 | |||
| e16d90333b | |||
| 59c7dd1285 | |||
| 13ba399418 | |||
| 8d152afcd3 | |||
| 9fdfbbea54 | |||
| f4303fc1ec | |||
| 3c62ac79c3 | |||
| e42863643d | |||
| ace7c7d660 | |||
| 35f2aa7d51 | |||
| 926a4a87c6 | |||
| d1d2c415bf | |||
| f631858be6 | |||
| d407ec4922 | |||
| 3587fce218 | |||
| 7464647bb8 | |||
| 0848f5db70 | |||
| 822e394966 | |||
| 68ed4c9c0f | |||
| f13d7f351d | |||
| 086ddd5a67 | |||
| acb1d00197 | |||
| 4aaa3f8929 | |||
| cba89b0323 | |||
| da39d81d5f |
@@ -8,6 +8,7 @@
|
||||
!gradlew.bat
|
||||
!build.gradle
|
||||
!gradle.properties
|
||||
!settings.gradle
|
||||
!.travis.yml
|
||||
|
||||
# include markdowns
|
||||
|
||||
+992
-91
File diff suppressed because it is too large
Load Diff
+119
-4
@@ -3,8 +3,6 @@ aechannel=stable
|
||||
aebuild=7
|
||||
aegroup=appeng
|
||||
aebasename=appliedenergistics2
|
||||
extended=extended_life
|
||||
extendedversion=v0.55.15
|
||||
#########################################################
|
||||
# Versions #
|
||||
#########################################################
|
||||
@@ -22,8 +20,7 @@ jei_version=4.16.1.302
|
||||
tesla_version=1.0.63
|
||||
ic2_version=2.8.73-ex112
|
||||
top_version=1.12-1.4.23-16
|
||||
cofhcore_version=1.12.2-4.5.2.19
|
||||
crafttweaker_version=4.1.8.9
|
||||
crafttweaker_version=4.1.20.684
|
||||
ctm_version=MC1.12.2-0.3.1.16
|
||||
forestry_version=5.8.2.387
|
||||
#########################################################
|
||||
@@ -31,3 +28,121 @@ forestry_version=5.8.2.387
|
||||
#########################################################
|
||||
website_version=1.12.2
|
||||
curse_versions=1.12.2
|
||||
mapping_channel=snapshot
|
||||
mapping_version=20171003
|
||||
# Run Configurations
|
||||
minecraft_username=Developer
|
||||
extra_jvm_args=
|
||||
modName=Applied Energistics 2
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
modId=appliedenergistics2
|
||||
modGroup=appeng
|
||||
# Version of your mod.
|
||||
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
|
||||
modVersion=rv6-stable-7-extended_life-v0.55.21
|
||||
# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
|
||||
includeMCVersionJar=false
|
||||
# The name of your jar when you produce builds, not including any versioning info
|
||||
modArchivesBaseName=appliedenergistics2
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
autoUpdateBuildScript=false
|
||||
minecraftVersion=1.12.2
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
# Alternatively this can be set with the 'DEV_USERNAME' environment variable.
|
||||
developmentEnvironmentUserName=Developer
|
||||
# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
# Using this requires that you use a Java 17 JDK for development.
|
||||
enableModernJavaSyntax=true
|
||||
# Generate a class with String fields for the mod id, name and version named with the fields below
|
||||
generateGradleTokenClass=appeng.Tags
|
||||
gradleTokenModId=
|
||||
gradleTokenModName=
|
||||
gradleTokenVersion=VERSION
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
apiPackage=api
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/
|
||||
# There can be multiple files in a comma-separated list.
|
||||
# Example value: mymodid_at.cfg,jei_at.cfg
|
||||
accessTransformersFile=appliedenergistics2_at.cfg
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins=false
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage=
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass=core.AE2ELCore
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod (meaning that
|
||||
# there is no class annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly=false
|
||||
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||
forceEnableMixins=false
|
||||
# Adds CurseMaven, Modrinth Maven, BlameJared maven, and some more well-known 1.12.2 repositories
|
||||
includeWellKnownRepositories=true
|
||||
# Adds JEI and TheOneProbe to your development environment. Adds them as 'implementation', meaning they will
|
||||
# be available at compiletime and runtime for your mod (in-game and in-code).
|
||||
# Overrides the above setting to be always true, as these repositories are needed to fetch the mods
|
||||
includeCommonDevEnvMods=true
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
usesShadowedDependencies=false
|
||||
# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access
|
||||
# their own classes, making the minimization unreliable.
|
||||
minimizeShadowedDependencies=true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies=true
|
||||
# Publishing to modrinth requires you to set the MODRINTH_API_KEY environment variable to your current modrinth API token.
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish on Modrinth.
|
||||
# Alternatively this can be set with the 'MODRINTH_PROJECT_ID' environment variable.
|
||||
modrinthProjectId=
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:jei;optional-project:top;incompatible-project:gregtech
|
||||
modrinthRelations=
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_API_KEY environment variable to one of your CurseForge API tokens.
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
# Alternatively this can be set with the 'CURSEFORGE_PROJECT_ID' environment variable.
|
||||
curseForgeProjectId=
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
curseForgeRelations=
|
||||
# This project's release type on CurseForge and/or Modrinth
|
||||
# Allowed types: release, beta, alpha
|
||||
releaseType=beta
|
||||
# Generate a default changelog for releases. Requires git to be installed, as it uses it to generate a changelog of
|
||||
# commits since the last tagged release.
|
||||
generateDefaultChangelog=false
|
||||
# Prevent the source code from being published
|
||||
noPublishedSources=false
|
||||
# Enable spotless checks
|
||||
# Enforces code formatting on your source code
|
||||
# By default this will use the files found here: https://github.com/GregTechCEu/Buildscripts/tree/master/spotless
|
||||
# to format your code. However, you can create your own version of these files and place them in your project's
|
||||
# root directory to apply your own formatting options instead.
|
||||
enableSpotless=false
|
||||
# Enable JUnit testing platform used for testing your code.
|
||||
# Uses JUnit 5. See guide and documentation here: https://junit.org/junit5/docs/current/user-guide/
|
||||
enableJUnit=true
|
||||
# Deployment debug setting
|
||||
# Uncomment this to test deployments to CurseForge and Modrinth
|
||||
# Alternatively, you can set the 'DEPLOYMENT_DEBUG' environment variable.
|
||||
deploymentDebug=false
|
||||
# Gradle Settings
|
||||
# Effectively applies the '--stacktrace' flag by default
|
||||
org.gradle.logging.stacktrace=all
|
||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
// Suppresses warnings/errors when building javadocs
|
||||
allprojects {
|
||||
tasks.withType(Javadoc) {
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.encoding = 'UTF-8'
|
||||
options.charSet = 'UTF-8'
|
||||
}
|
||||
|
||||
task javadocs(type: Javadoc) {
|
||||
source = sourceSets.api.java
|
||||
include "appeng/api/**"
|
||||
|
||||
// Due to ForgeGradle having to be a special snowflake,
|
||||
// we have to add some custom configurations to the normal compile configuration and hope it does not break.
|
||||
classpath = configurations.compile + configurations.forgeGradleMc + configurations.forgeGradleMcDeps
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadocs) {
|
||||
from javadoc.destinationDir
|
||||
|
||||
classifier = 'javadoc'
|
||||
}
|
||||
|
||||
task apiJar(type: Jar) {
|
||||
from sourceSets.api.java
|
||||
include "appeng/api/**"
|
||||
|
||||
from sourceSets.api.output
|
||||
include "appeng/api/**"
|
||||
|
||||
classifier = 'api'
|
||||
}
|
||||
|
||||
task sourceJar(type: Jar, overwrite: true) {
|
||||
from sourceSets.api.allSource
|
||||
from sourceSets.main.allSource
|
||||
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
task devJar(type: Jar, overwrite: true) {
|
||||
from sourceSets.api.output
|
||||
from sourceSets.main.output
|
||||
|
||||
classifier = 'dev'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives apiJar
|
||||
archives javadocJar
|
||||
archives sourceJar
|
||||
archives devJar
|
||||
}
|
||||
@@ -81,11 +81,11 @@ configurations {
|
||||
dependencies {
|
||||
// deobfCompile "gregtechce:gregtech:1.12.2:1.15.1.735"
|
||||
// installable runtime dependencies
|
||||
deobfCompile "curse.maven:gregtechceu-557242:4429261"
|
||||
implementation rfg.deobf("curse.maven:gregtechceu-557242:4429261")
|
||||
|
||||
compileOnly "curse.maven:chisel-235279:2915375"
|
||||
|
||||
deobfCompile "curse.maven:baubles-227083:2518667"
|
||||
implementation rfg.deobf("curse.maven:baubles-227083:2518667")
|
||||
//mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
mods "curse.maven:hwyla-253449:2568751"
|
||||
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
||||
@@ -96,7 +96,7 @@ dependencies {
|
||||
//compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
compileOnly "curse.maven:hwyla-253449:2568751"
|
||||
//Code chicken lib, GTCE dependency
|
||||
deobfCompile "curse.maven:CCL-242818:2779848"
|
||||
implementation rfg.deobf("curse.maven:CCL-242818:2779848")
|
||||
|
||||
compileOnly "curse.maven:recipe-stages-280554:3405072"
|
||||
compileOnly "curse.maven:item-stages-280316:2696769"
|
||||
@@ -104,17 +104,17 @@ dependencies {
|
||||
compileOnly "net.darkhax.tesla:Tesla-1.12.2:${tesla_version}"
|
||||
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
|
||||
compileOnly "cofh:CoFHCore:${cofhcore_version}:deobf"
|
||||
compileOnly "curse.maven:CoFHCore-69162:2920433"
|
||||
compileOnly "CraftTweaker2:CraftTweaker2-API:${crafttweaker_version}"
|
||||
compileOnly "curse.maven:inventory-tweaks-223094:2482482"
|
||||
compileOnly "curse.maven:inventory-bogo-sorter-632327:4399738"
|
||||
compileOnly "team.chisel.ctm:CTM:${ctm_version}"
|
||||
compileOnly "de.ellpeck.actuallyadditions:ActuallyAdditions:1.12.2-r152.16:api"
|
||||
deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:$forestry_version"
|
||||
implementation rfg.deobf("net.sengir.forestry:forestry_${minecraft_version}:$forestry_version")
|
||||
|
||||
// at runtime, use the full JEI jar
|
||||
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
||||
runtimeOnly "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
||||
|
||||
// unit test dependencies
|
||||
testCompile "junit:junit:4.12"
|
||||
testImplementation "junit:junit:4.12"
|
||||
}
|
||||
|
||||
@@ -15,41 +15,40 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = "2.14"
|
||||
}
|
||||
|
||||
// HWYLA
|
||||
task installHwyla(type: Copy, dependsOn: "deinstallHwyla") {
|
||||
tasks.register('installHwyla', Copy) {
|
||||
dependsOn "deinstallHwyla"
|
||||
from { configurations.mods }
|
||||
include "**/*Hwyla*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
into file("/run/mods")
|
||||
}
|
||||
|
||||
task deinstallHwyla(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Hwyla*.jar")
|
||||
tasks.register('deinstallHwyla', Delete) {
|
||||
delete fileTree(dir: "/run/mods", include: "*Hwyla*.jar")
|
||||
}
|
||||
|
||||
// IC2
|
||||
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||
tasks.register('installIC2', Copy) {
|
||||
dependsOn "deinstallIC2"
|
||||
from { configurations.mods }
|
||||
include "**/*industrialcraft-2*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
into file("/run/mods")
|
||||
}
|
||||
|
||||
task deinstallIC2(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
|
||||
tasks.register('deinstallIC2', Delete) {
|
||||
delete fileTree(dir: "/run/mods", include: "*industrialcraft-2*.jar")
|
||||
}
|
||||
|
||||
// TOP
|
||||
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
|
||||
tasks.register('installTop', Copy) {
|
||||
dependsOn["deinstallTop"]
|
||||
from { configurations.mods }
|
||||
include "**/*TheOneProbe*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
into file("/run/mods")
|
||||
}
|
||||
|
||||
task deinstallTop(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*TheOneProbe*.jar")
|
||||
tasks.register('deinstallTop', Delete) {
|
||||
delete fileTree(dir: "/run/mods", include: "*TheOneProbe*.jar")
|
||||
}
|
||||
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,5 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
|
||||
|
||||
@@ -1,78 +1,129 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
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=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
@@ -89,84 +140,105 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
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
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# 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
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name 'GTNH Maven'
|
||||
//noinspection HttpUrlsUsage
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol = true
|
||||
//noinspection GroovyAssignabilityCheck
|
||||
mavenContent {
|
||||
includeGroup 'com.gtnewhorizons'
|
||||
includeGroup 'com.gtnewhorizons.retrofuturagradle'
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
// Automatic toolchain provisioning
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0'
|
||||
}
|
||||
|
||||
rootProject.name = rootProject.projectDir.getName()
|
||||
@@ -22,7 +22,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
@API( apiVersion = "@aeversion@", owner = "appliedenergistics2", provides = "appliedenergistics2|API" )
|
||||
@API(apiVersion = "rv6", owner = "appliedenergistics2", provides = "appliedenergistics2|API")
|
||||
package appeng.api;
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class GuiOreDictStorageBus extends AEBaseGui {
|
||||
private GuiImgButton partition;
|
||||
private GuiImgButton storageFilter;
|
||||
private GuiImgButton rwMode;
|
||||
private static final Pattern ORE_DICTIONARY_FILTER = Pattern.compile("[(!]* *[0-9a-zA-Z*]* *\\)*( *[&|^]? *[(!]* *[0-9a-zA-Z*]* *\\)*)*");
|
||||
private static final Pattern ORE_DICTIONARY_FILTER = Pattern.compile("[0-9a-zA-Z* &|^!()]*");
|
||||
private MEGuiTextField searchFieldInputs;
|
||||
|
||||
public GuiOreDictStorageBus(final InventoryPlayer inventoryPlayer, final PartOreDicStorageBus te) {
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ItemRepo {
|
||||
|
||||
public void setViewCell(final ItemStack[] list) {
|
||||
this.myPartitionList = ItemViewCell.createFilter(list);
|
||||
this.updateView();
|
||||
this.changed = true;
|
||||
}
|
||||
|
||||
public void updateView() {
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.render.cablebus;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.AEConfig;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
@@ -327,8 +328,8 @@ class CableBuilder {
|
||||
TextureAtlasSprite texture = this.connectionTextures.get(AECableType.SMART).get(cableColor);
|
||||
cubeBuilder.setTexture(texture);
|
||||
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels(channels);
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels((int) (channels / (AEConfig.instance().getNormalChannelCapacity() / 8)));
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels((int) (channels / (AEConfig.instance().getNormalChannelCapacity() / 8)));
|
||||
|
||||
// For to-machine connections, use a thicker end-cap for the connection
|
||||
if (connectionType != AECableType.GLASS && !cableBusAdjacent) {
|
||||
@@ -374,8 +375,8 @@ class CableBuilder {
|
||||
|
||||
addStraightCoveredCableSizedCube(facing, cubeBuilder);
|
||||
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels(channels);
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels((int) (channels / (AEConfig.instance().getNormalChannelCapacity() / 8)));
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels((int) (channels / (AEConfig.instance().getNormalChannelCapacity() / 8)));
|
||||
|
||||
// Render the channel indicators brightly lit at night
|
||||
cubeBuilder.setRenderFullBright(true);
|
||||
@@ -403,8 +404,8 @@ class CableBuilder {
|
||||
|
||||
addCoveredCableSizedCube(facing, distanceFromEdge, cubeBuilder);
|
||||
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels(channels);
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels((int) (channels / (AEConfig.instance().getNormalChannelCapacity() / 8)));
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels((int) (channels / (AEConfig.instance().getNormalChannelCapacity() / 8)));
|
||||
|
||||
// Render the channel indicators brightly lit at night
|
||||
cubeBuilder.setRenderFullBright(true);
|
||||
@@ -464,7 +465,7 @@ class CableBuilder {
|
||||
addDenseCableSizedCube(facing, cubeBuilder);
|
||||
|
||||
// Dense cables show used channels in groups of 4, rounded up
|
||||
channels = (channels + 3) / 4;
|
||||
channels = (int) ((channels + 3) / 4) / (AEConfig.instance().getDenseChannelCapacity() / 32);
|
||||
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels(channels);
|
||||
@@ -508,7 +509,7 @@ class CableBuilder {
|
||||
addStraightDenseCableSizedCube(facing, cubeBuilder);
|
||||
|
||||
// Dense cables show used channels in groups of 4, rounded up
|
||||
channels = (channels + 3) / 4;
|
||||
channels = (int) ((channels + 3) / 4) / (AEConfig.instance().getDenseChannelCapacity() / 32);
|
||||
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForChannels(channels);
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.client.render.model;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
@@ -31,22 +30,19 @@ import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraftforge.client.model.pipeline.IVertexConsumer;
|
||||
import net.minecraftforge.client.model.pipeline.QuadGatheringTransformer;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Tuple4f;
|
||||
import javax.vecmath.Vector4f;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static net.minecraft.util.EnumFacing.DOWN;
|
||||
|
||||
|
||||
public class AutoRotatingModel implements IBakedModel, IResourceManagerReloadListener {
|
||||
|
||||
@@ -68,34 +64,171 @@ public class AutoRotatingModel implements IBakedModel, IResourceManagerReloadLis
|
||||
FacingToRotation f2r = FacingToRotation.get(forward, up);
|
||||
List<BakedQuad> original = AutoRotatingModel.this.parent.getQuads(state, f2r.resultingRotate(side), 0);
|
||||
List<BakedQuad> rotated = new ArrayList<>(original.size());
|
||||
for (BakedQuad quad : original) {
|
||||
VertexFormat format = quad.getFormat();
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format);
|
||||
VertexRotator rot = new VertexRotator(f2r, quad.getFace());
|
||||
rot.setParent(builder);
|
||||
quad.pipe(rot);
|
||||
if (quad.getFace() != null) {
|
||||
builder.setQuadOrientation(f2r.rotate(quad.getFace()));
|
||||
} else {
|
||||
builder.setQuadOrientation(null);
|
||||
|
||||
}
|
||||
BakedQuad unpackedQuad = builder.build();
|
||||
final Matrix4f transformMatrix = new Matrix4f();
|
||||
final Tuple4f vertexTransformingVec = new Vector4f();
|
||||
|
||||
// Make a copy of it to resolve the vertex data and throw away the unpacked stuff
|
||||
// This also fixes a bug in Forge's UnpackedBakedQuad, which unpacks a byte-based normal like 0,0,-1
|
||||
// to 0,0,-0.99607843. We replace these normals with the proper 0,0,-1 when rotation, which
|
||||
// causes a bug in the AO lighter, if an unpacked quad pipes this value back to it.
|
||||
// Packing it back to the vanilla vertex format will fix this inconsistency because it converts
|
||||
// the normal back to a byte-based format, which then re-applies Forge's own bug when piping it
|
||||
// to the AO lighter, thus fixing our problem.
|
||||
BakedQuad packedQuad = new BakedQuad(unpackedQuad.getVertexData(), quad.getTintIndex(), unpackedQuad.getFace(), quad.getSprite(), quad
|
||||
.shouldApplyDiffuseLighting(), quad.getFormat());
|
||||
rotated.add(packedQuad);
|
||||
// Transform the matrix so the top and front facings of the model matches the block in-world
|
||||
transformMatrixByFacings(transformMatrix, up, forward);
|
||||
|
||||
for (BakedQuad b : original) {
|
||||
EnumFacing newFace = f2r.rotate(b.getFace());
|
||||
rotated.add(rebakeQuad(b, newFace, transformMatrix, vertexTransformingVec));
|
||||
}
|
||||
return rotated;
|
||||
}
|
||||
|
||||
private void transformMatrixByFacings(Matrix4f transformMatrix, EnumFacing topFacing, EnumFacing frontFacing) {
|
||||
Matrix4f intermediaryMatrix = new Matrix4f();
|
||||
transformMatrix.setIdentity();
|
||||
moveToPivot(transformMatrix, intermediaryMatrix, true);
|
||||
if (topFacing.getAxis() == EnumFacing.Axis.Y) {
|
||||
switch (frontFacing) {
|
||||
case NORTH:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (0));
|
||||
break;
|
||||
case SOUTH:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI));
|
||||
break;
|
||||
case EAST:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
break;
|
||||
case WEST:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
break;
|
||||
}
|
||||
if (topFacing == DOWN) {
|
||||
rotateX(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
}
|
||||
} else {
|
||||
switch (topFacing) {
|
||||
case WEST:
|
||||
rotateZ(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
switch (frontFacing) {
|
||||
case DOWN:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
break;
|
||||
case UP:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (+Math.PI / 2));
|
||||
break;
|
||||
case SOUTH:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
}
|
||||
break;
|
||||
case EAST:
|
||||
rotateZ(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
switch (frontFacing) {
|
||||
case DOWN:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
break;
|
||||
case UP:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
break;
|
||||
case SOUTH:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI));
|
||||
}
|
||||
break;
|
||||
case NORTH:
|
||||
rotateX(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
switch (frontFacing) {
|
||||
case DOWN:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
break;
|
||||
case EAST:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
break;
|
||||
case WEST:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
rotateX(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
switch (frontFacing) {
|
||||
case UP:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
break;
|
||||
case EAST:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (-Math.PI / 2));
|
||||
break;
|
||||
case SOUTH:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
break;
|
||||
case WEST:
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI / 2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (frontFacing.getAxis() == EnumFacing.Axis.Y) {
|
||||
//rotateX(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
rotateY(transformMatrix, intermediaryMatrix, (float) (Math.PI));
|
||||
}
|
||||
}
|
||||
moveToPivot(transformMatrix, intermediaryMatrix, false);
|
||||
}
|
||||
|
||||
private void moveToPivot(Matrix4f matrix, Matrix4f intermediary, boolean positive) {
|
||||
intermediary.setIdentity();
|
||||
float pivot = positive ? .5F : -.5F;
|
||||
intermediary.m03 = pivot;
|
||||
intermediary.m13 = pivot;
|
||||
intermediary.m23 = pivot;
|
||||
matrix.mul(intermediary);
|
||||
}
|
||||
|
||||
private void rotateX(Matrix4f matrix, Matrix4f intermediary, float angle) {
|
||||
intermediary.setIdentity();
|
||||
intermediary.rotX(angle);
|
||||
matrix.mul(intermediary);
|
||||
}
|
||||
|
||||
private void rotateY(Matrix4f matrix, Matrix4f intermediary, float angle) {
|
||||
intermediary.setIdentity();
|
||||
intermediary.rotY(angle);
|
||||
matrix.mul(intermediary);
|
||||
}
|
||||
|
||||
private void rotateZ(Matrix4f matrix, Matrix4f intermediary, float angle) {
|
||||
intermediary.setIdentity();
|
||||
intermediary.rotZ(angle);
|
||||
matrix.mul(intermediary);
|
||||
}
|
||||
|
||||
private BakedQuad rebakeQuad(BakedQuad b, EnumFacing newFacing, Matrix4f transformMatrix, Tuple4f vertexTransformingVec) {
|
||||
int[] newQuad = new int[28];
|
||||
int[] quadData = b.getVertexData();
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
// Getting the offset for the current vertex.
|
||||
int vertexIndex = k * 7;
|
||||
vertexTransformingVec.x = Float.intBitsToFloat(quadData[vertexIndex]);
|
||||
vertexTransformingVec.y = Float.intBitsToFloat(quadData[vertexIndex + 1]);
|
||||
vertexTransformingVec.z = Float.intBitsToFloat(quadData[vertexIndex + 2]);
|
||||
vertexTransformingVec.w = 1;
|
||||
|
||||
// Transforming it by the model matrix.
|
||||
transformMatrix.transform(vertexTransformingVec);
|
||||
|
||||
// Converting the new data to ints.
|
||||
int x = Float.floatToRawIntBits(vertexTransformingVec.x);
|
||||
int y = Float.floatToRawIntBits(vertexTransformingVec.y);
|
||||
int z = Float.floatToRawIntBits(vertexTransformingVec.z);
|
||||
|
||||
// Vertex position data
|
||||
newQuad[vertexIndex] = x;
|
||||
newQuad[vertexIndex + 1] = y;
|
||||
newQuad[vertexIndex + 2] = z;
|
||||
|
||||
newQuad[vertexIndex + 3] = quadData[vertexIndex + 3];
|
||||
|
||||
newQuad[vertexIndex + 4] = quadData[vertexIndex + 4]; //texture
|
||||
newQuad[vertexIndex + 5] = quadData[vertexIndex + 5];
|
||||
|
||||
// Vertex brightness
|
||||
newQuad[vertexIndex + 6] = 0x81818181;
|
||||
}
|
||||
return new BakedQuad(newQuad, b.getTintIndex(), newFacing, b.getSprite(), b.shouldApplyDiffuseLighting(), b.getFormat());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return this.parent.isAmbientOcclusion();
|
||||
@@ -159,140 +292,4 @@ public class AutoRotatingModel implements IBakedModel, IResourceManagerReloadLis
|
||||
this.quadCache.invalidateAll();
|
||||
}
|
||||
|
||||
public static class VertexRotator extends QuadGatheringTransformer {
|
||||
private final FacingToRotation f2r;
|
||||
private final EnumFacing face;
|
||||
|
||||
public VertexRotator(FacingToRotation f2r, EnumFacing face) {
|
||||
this.f2r = f2r;
|
||||
this.face = face;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(IVertexConsumer parent) {
|
||||
super.setParent(parent);
|
||||
if (Objects.equal(this.getVertexFormat(), parent.getVertexFormat())) {
|
||||
return;
|
||||
}
|
||||
this.setVertexFormat(parent.getVertexFormat());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processQuad() {
|
||||
VertexFormat format = this.parent.getVertexFormat();
|
||||
int count = format.getElementCount();
|
||||
|
||||
for (int v = 0; v < 4; v++) {
|
||||
for (int e = 0; e < count; e++) {
|
||||
VertexFormatElement element = format.getElement(e);
|
||||
if (element.getUsage() == VertexFormatElement.EnumUsage.POSITION) {
|
||||
this.parent.put(e, this.transform(this.quadData[e][v]));
|
||||
} else if (element.getUsage() == VertexFormatElement.EnumUsage.NORMAL) {
|
||||
this.parent.put(e, this.transformNormal(this.quadData[e][v]));
|
||||
} else {
|
||||
this.parent.put(e, this.quadData[e][v]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float[] transform(float[] fs) {
|
||||
switch (fs.length) {
|
||||
case 3:
|
||||
Vector3f vec = new Vector3f(fs[0], fs[1], fs[2]);
|
||||
vec.x -= 0.5f;
|
||||
vec.y -= 0.5f;
|
||||
vec.z -= 0.5f;
|
||||
this.f2r.getMat().transform(vec);
|
||||
vec.x += 0.5f;
|
||||
vec.y += 0.5f;
|
||||
vec.z += 0.5f;
|
||||
return new float[]{vec.x, vec.y, vec.z
|
||||
};
|
||||
case 4:
|
||||
Vector4f vecc = new Vector4f(fs[0], fs[1], fs[2], fs[3]);
|
||||
vecc.x -= 0.5f;
|
||||
vecc.y -= 0.5f;
|
||||
vecc.z -= 0.5f;
|
||||
this.f2r.getMat().transform(vecc);
|
||||
vecc.x += 0.5f;
|
||||
vecc.y += 0.5f;
|
||||
vecc.z += 0.5f;
|
||||
return new float[]{vecc.x, vecc.y, vecc.z, vecc.w
|
||||
};
|
||||
|
||||
default:
|
||||
return fs;
|
||||
}
|
||||
}
|
||||
|
||||
private float[] transformNormal(float[] fs) {
|
||||
if (this.face == null) {
|
||||
switch (fs.length) {
|
||||
case 3:
|
||||
Vector3f vec = new Vector3f(fs);
|
||||
this.f2r.getMat().transform(vec);
|
||||
return new float[]{
|
||||
vec.getX(),
|
||||
vec.getY(),
|
||||
vec.getZ()
|
||||
};
|
||||
case 4:
|
||||
Vector4f vec4 = new Vector4f(fs);
|
||||
this.f2r.getMat().transform(vec4);
|
||||
return new float[]{
|
||||
vec4.getX(),
|
||||
vec4.getY(),
|
||||
vec4.getZ(),
|
||||
0
|
||||
};
|
||||
|
||||
default:
|
||||
return fs;
|
||||
}
|
||||
} else {
|
||||
switch (fs.length) {
|
||||
case 3:
|
||||
Vec3i vec = this.f2r.rotate(this.face).getDirectionVec();
|
||||
return new float[]{
|
||||
vec.getX(),
|
||||
vec.getY(),
|
||||
vec.getZ()
|
||||
};
|
||||
case 4:
|
||||
Vector4f veccc = new Vector4f(fs[0], fs[1], fs[2], fs[3]);
|
||||
Vec3i vecc = this.f2r.rotate(this.face).getDirectionVec();
|
||||
return new float[]{
|
||||
vecc.getX(),
|
||||
vecc.getY(),
|
||||
vecc.getZ(),
|
||||
veccc.w
|
||||
};
|
||||
|
||||
default:
|
||||
return fs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuadTint(int tint) {
|
||||
this.parent.setQuadTint(tint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuadOrientation(EnumFacing orientation) {
|
||||
this.parent.setQuadOrientation(orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplyDiffuseLighting(boolean diffuse) {
|
||||
this.parent.setApplyDiffuseLighting(diffuse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTexture(TextureAtlasSprite texture) {
|
||||
this.parent.setTexture(texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,26 +21,33 @@ package appeng.client.render.model;
|
||||
import appeng.block.storage.BlockDrive;
|
||||
import appeng.block.storage.DriveSlotState;
|
||||
import appeng.block.storage.DriveSlotsState;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Tuple4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Vector4f;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class DriveBakedModel implements IBakedModel {
|
||||
public class DriveBakedModel implements IBakedModel, IResourceManagerReloadListener {
|
||||
private final IBakedModel bakedBase;
|
||||
private final Map<DriveSlotState, IBakedModel> bakedCells;
|
||||
private final Int2ObjectMap<Map<DriveSlotState, List<BakedQuad>>> slot2DSMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
public DriveBakedModel(IBakedModel bakedBase, Map<DriveSlotState, IBakedModel> bakedCells) {
|
||||
this.bakedBase = bakedBase;
|
||||
@@ -52,8 +59,7 @@ public class DriveBakedModel implements IBakedModel {
|
||||
|
||||
List<BakedQuad> result = new ArrayList<>(this.bakedBase.getQuads(state, side, rand));
|
||||
|
||||
if (side == null && state instanceof IExtendedBlockState) {
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
if (side == null && state instanceof IExtendedBlockState extState) {
|
||||
|
||||
if (!extState.getUnlistedNames().contains(BlockDrive.SLOTS_STATE)) {
|
||||
return result;
|
||||
@@ -61,31 +67,38 @@ public class DriveBakedModel implements IBakedModel {
|
||||
|
||||
DriveSlotsState slotsState = extState.getValue(BlockDrive.SLOTS_STATE);
|
||||
|
||||
|
||||
for (int row = 0; row < 5; row++) {
|
||||
for (int col = 0; col < 2; col++) {
|
||||
DriveSlotState slotState = slotsState.getState(row * 2 + col);
|
||||
int slot = row * 2 + col;
|
||||
|
||||
IBakedModel bakedCell = this.bakedCells.get(slotState);
|
||||
DriveSlotState slotState = slotsState.getState(slot);
|
||||
|
||||
Matrix4f transform = new Matrix4f();
|
||||
transform.setIdentity();
|
||||
slot2DSMap.putIfAbsent(slot, new Object2ObjectOpenHashMap<>());
|
||||
int finalCol = col;
|
||||
int finalRow = row;
|
||||
List<BakedQuad> lbq = slot2DSMap.get(slot).computeIfAbsent(slotState, q -> {
|
||||
List<BakedQuad> res = new ArrayList<>();
|
||||
IBakedModel bakedCell = this.bakedCells.get(slotState);
|
||||
|
||||
// Position this drive model copy at the correct slot. The transform is based on
|
||||
// the
|
||||
// cell-model being in slot 0,0 at the top left of the drive.
|
||||
float xOffset = -col * 8 / 16.0f;
|
||||
float yOffset = -row * 3 / 16.0f;
|
||||
final Matrix4f transformMatrix = new Matrix4f();
|
||||
transformMatrix.setIdentity();
|
||||
final Tuple4f transform = new Vector4f();
|
||||
|
||||
transform.setTranslation(new Vector3f(xOffset, yOffset, 0));
|
||||
// Position this drive model copy at the correct slot. The transform is based on
|
||||
// the
|
||||
// cell-model being in slot 0,0 at the top left of the drive.
|
||||
float xOffset = -finalCol * 8 / 16.0f;
|
||||
float yOffset = -finalRow * 3 / 16.0f;
|
||||
|
||||
MatrixVertexTransformer transformer = new MatrixVertexTransformer(transform);
|
||||
for (BakedQuad bakedQuad : bakedCell.getQuads(state, null, rand)) {
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(bakedQuad.getFormat());
|
||||
transformer.setParent(builder);
|
||||
transformer.setVertexFormat(builder.getVertexFormat());
|
||||
bakedQuad.pipe(transformer);
|
||||
result.add(builder.build());
|
||||
}
|
||||
transformMatrix.setTranslation(new Vector3f(xOffset, yOffset, 0));
|
||||
|
||||
for (BakedQuad bakedQuad : bakedCell.getQuads(state, null, rand)) {
|
||||
res.add(rebakeQuad(bakedQuad, transformMatrix, transform));
|
||||
}
|
||||
return res;
|
||||
});
|
||||
result.addAll(lbq);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,6 +106,41 @@ public class DriveBakedModel implements IBakedModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
private BakedQuad rebakeQuad(BakedQuad b, Matrix4f transformMatrix, Tuple4f vertexTransformingVec) {
|
||||
int[] newQuad = new int[28];
|
||||
int[] quadData = b.getVertexData();
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
// Getting the offset for the current vertex.
|
||||
int vertexIndex = k * 7;
|
||||
vertexTransformingVec.x = Float.intBitsToFloat(quadData[vertexIndex]);
|
||||
vertexTransformingVec.y = Float.intBitsToFloat(quadData[vertexIndex + 1]);
|
||||
vertexTransformingVec.z = Float.intBitsToFloat(quadData[vertexIndex + 2]);
|
||||
vertexTransformingVec.w = 1;
|
||||
|
||||
// Transforming it by the model matrix.
|
||||
transformMatrix.transform(vertexTransformingVec);
|
||||
|
||||
// Converting the new data to ints.
|
||||
int x = Float.floatToRawIntBits(vertexTransformingVec.x);
|
||||
int y = Float.floatToRawIntBits(vertexTransformingVec.y);
|
||||
int z = Float.floatToRawIntBits(vertexTransformingVec.z);
|
||||
|
||||
// Vertex position data
|
||||
newQuad[vertexIndex] = x;
|
||||
newQuad[vertexIndex + 1] = y;
|
||||
newQuad[vertexIndex + 2] = z;
|
||||
|
||||
newQuad[vertexIndex + 3] = quadData[vertexIndex + 3];
|
||||
|
||||
newQuad[vertexIndex + 4] = quadData[vertexIndex + 4]; //texture
|
||||
newQuad[vertexIndex + 5] = quadData[vertexIndex + 5];
|
||||
|
||||
// Vertex brightness
|
||||
newQuad[vertexIndex + 6] = 0x81818181;
|
||||
}
|
||||
return new BakedQuad(newQuad, b.getTintIndex(), b.getFace(), b.getSprite(), b.shouldApplyDiffuseLighting(), b.getFormat());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return this.bakedBase.isAmbientOcclusion();
|
||||
@@ -122,4 +170,9 @@ public class DriveBakedModel implements IBakedModel {
|
||||
public ItemOverrideList getOverrides() {
|
||||
return this.bakedBase.getOverrides();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
slot2DSMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingCPU;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
import appeng.api.networking.crafting.ICraftingJob;
|
||||
@@ -125,7 +126,19 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
||||
return;
|
||||
}
|
||||
|
||||
final ICraftingGrid cc = this.getGrid().getCache(ICraftingGrid.class);
|
||||
final IActionHost h = ((IActionHost) this.getTarget());
|
||||
if (h == null) {
|
||||
this.setValidContainer(false);
|
||||
return;
|
||||
}
|
||||
IGridNode node = h.getActionableNode();
|
||||
if (node == null) {
|
||||
this.setValidContainer(false);
|
||||
return;
|
||||
}
|
||||
IGrid grid = node.getGrid();
|
||||
|
||||
final ICraftingGrid cc = grid.getCache(ICraftingGrid.class);
|
||||
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
|
||||
int matches = 0;
|
||||
@@ -199,7 +212,7 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
||||
p.reset();
|
||||
p.setStackSize(out.getCountRequestable());
|
||||
|
||||
final IStorageGrid sg = this.getGrid().getCache(IStorageGrid.class);
|
||||
final IStorageGrid sg = grid.getCache(IStorageGrid.class);
|
||||
final IMEInventory<IAEItemStack> items = sg.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
|
||||
IAEItemStack m = null;
|
||||
@@ -252,11 +265,6 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
||||
this.verifyPermissions(SecurityPermissions.CRAFT, false);
|
||||
}
|
||||
|
||||
private IGrid getGrid() {
|
||||
final IActionHost h = ((IActionHost) this.getTarget());
|
||||
return h.getActionableNode().getGrid();
|
||||
}
|
||||
|
||||
private boolean cpuMatches(final ICraftingCPU c) {
|
||||
return c.getAvailableStorage() >= this.getUsedBytes() && !c.isBusy();
|
||||
}
|
||||
@@ -301,12 +309,22 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
||||
originalGui = GuiBridge.GUI_EXPANDED_PROCESSING_PATTERN_TERMINAL;
|
||||
}
|
||||
|
||||
final IActionHost h = ((IActionHost) this.getTarget());
|
||||
if (h == null) {
|
||||
return;
|
||||
}
|
||||
IGridNode node = h.getActionableNode();
|
||||
if (node == null) {
|
||||
return;
|
||||
}
|
||||
IGrid grid = node.getGrid();
|
||||
|
||||
if (this.result != null && !this.isSimulation()) {
|
||||
final ICraftingGrid cc = this.getGrid().getCache(ICraftingGrid.class);
|
||||
final ICraftingGrid cc = grid.getCache(ICraftingGrid.class);
|
||||
final ICraftingLink g = cc.submitJob(this.result, null, this.getSelectedCpu() == -1 ? null : this.cpus.get(this.getSelectedCpu()).getCpu(), true, this.getActionSrc());
|
||||
this.setAutoStart(false);
|
||||
if (g == null) {
|
||||
this.setJob(cc.beginCraftingJob(this.getWorld(), this.getGrid(), this.getActionSrc(), this.result.getOutput(), null));
|
||||
this.setJob(cc.beginCraftingJob(this.getWorld(), grid, this.getActionSrc(), this.result.getOutput(), null));
|
||||
} else if (originalGui != null && this.getOpenContext() != null) {
|
||||
final TileEntity te = this.getOpenContext().getTile();
|
||||
if (te != null) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable implements I
|
||||
private int ticks = 0;
|
||||
|
||||
public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell guiObject) {
|
||||
super(ip, guiObject, guiObject, true);
|
||||
super(ip, guiObject, guiObject, false);
|
||||
if (guiObject != null) {
|
||||
final int slotIndex = ((IInventorySlotAware) guiObject).getInventorySlot();
|
||||
if (!((IInventorySlotAware) guiObject).isBaubleSlot()) {
|
||||
@@ -47,6 +47,9 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable implements I
|
||||
this.slot = -1;
|
||||
this.lockPlayerInventorySlot(ip.currentItem);
|
||||
}
|
||||
|
||||
this.bindPlayerInventory(ip, 0, 0);
|
||||
|
||||
this.portableCell = guiObject;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ public class ContainerMEPortableTerminal extends ContainerMEMonitorable implemen
|
||||
this.slot = -1;
|
||||
this.lockPlayerInventorySlot(ip.currentItem);
|
||||
}
|
||||
|
||||
this.bindPlayerInventory(ip, 0, 0);
|
||||
|
||||
this.wirelessTerminalGUIObject = guiObject;
|
||||
this.upgrades = new StackUpgradeInventory(wirelessTerminalGUIObject.getItemStack(), this, 2);
|
||||
this.loadFromNBT();
|
||||
@@ -107,7 +110,7 @@ public class ContainerMEPortableTerminal extends ContainerMEMonitorable implemen
|
||||
if (wirelessTerminalGUIObject.isBaubleSlot()) {
|
||||
BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack());
|
||||
} else {
|
||||
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack());
|
||||
this.getPlayerInv().setInventorySlotContents(this.slot, this.wirelessTerminalGUIObject.getItemStack());
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
|
||||
@@ -191,6 +191,9 @@ public abstract class ContainerPatternEncoder extends ContainerMEMonitorable imp
|
||||
}
|
||||
this.detectAndSendChanges();
|
||||
}
|
||||
if (s == this.craftSlot && Platform.isClient()) {
|
||||
this.getAndUpdateOutput();
|
||||
}
|
||||
}
|
||||
|
||||
public void encodeAndMoveToInventory() {
|
||||
|
||||
+3
-1
@@ -50,7 +50,7 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEPortableTermin
|
||||
private IRecipe currentRecipe;
|
||||
|
||||
public ContainerWirelessCraftingTerminal(final InventoryPlayer ip, final WirelessTerminalGuiObject gui) {
|
||||
super(ip, gui, true);
|
||||
super(ip, gui, false);
|
||||
|
||||
final IItemHandler crafting = this.craftingGrid;
|
||||
|
||||
@@ -63,6 +63,8 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEPortableTermin
|
||||
this.addSlotToContainer(this.outputSlot = new SlotCraftingTerm(this.getPlayerInv().player, this.getActionSource(), this
|
||||
.getPowerSource(), this.wirelessTerminalGUIObject, crafting, crafting, this.output, 131, -72 + 18, this));
|
||||
|
||||
this.bindPlayerInventory(ip, 0, 0);
|
||||
|
||||
this.onCraftMatrixChanged(new WrapperInvItemHandler(crafting));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ public class ContainerWirelessPatternTerminal extends ContainerPatternEncoder im
|
||||
if (wirelessTerminalGUIObject.isBaubleSlot()) {
|
||||
BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack());
|
||||
} else {
|
||||
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack());
|
||||
this.getPlayerInv().setInventorySlotContents(this.slot, this.wirelessTerminalGUIObject.getItemStack());
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
|
||||
@@ -26,6 +26,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
public class ContainerWirelessTerm extends ContainerMEPortableTerminal {
|
||||
|
||||
public ContainerWirelessTerm(final InventoryPlayer ip, final WirelessTerminalGuiObject gui) {
|
||||
super(ip, gui, true);
|
||||
super(ip, gui, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ import java.util.stream.Stream;
|
||||
|
||||
public final class AEConfig extends Configuration implements IConfigurableObject, IConfigManagerHost {
|
||||
|
||||
public static final String VERSION = "@version@";
|
||||
public static final String CHANNEL = "@aechannel@";
|
||||
public static final String VERSION = appeng.Tags.VERSION;
|
||||
public static final String CHANNEL = appeng.Tags.AECHANNEL;
|
||||
public static final String PACKET_CHANNEL = "AE";
|
||||
// Tunnels
|
||||
public static final double TUNNEL_POWER_LOSS = 0.05;
|
||||
@@ -83,6 +83,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
private int craftingCalculationTimePerTick = 5;
|
||||
private PowerUnits selectedPowerUnit = PowerUnits.AE;
|
||||
private boolean showCraftableTooltip = true;
|
||||
|
||||
// Spatial IO/Dimension
|
||||
private int storageProviderID = -1;
|
||||
private int storageDimensionID = -1;
|
||||
@@ -122,6 +123,9 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
private int maxControllerSizeY = 7;
|
||||
private int maxControllerSizeZ = 7;
|
||||
|
||||
private int normalChannelCapacity = 8;
|
||||
private int denseChannelCapacity = 32;
|
||||
|
||||
private AEConfig(final File configFile) {
|
||||
super(configFile);
|
||||
this.configFile = configFile;
|
||||
@@ -139,6 +143,8 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
CondenserOutput.SINGULARITY.requiredPower = this.get("Condenser", "Singularity", 256000).getInt(256000);
|
||||
|
||||
this.removeCrashingItemsOnLoad = this.get("general", "removeCrashingItemsOnLoad", false, "Will auto-remove items that crash when being loaded from storage. This will destroy those items instead of crashing the game!").getBoolean();
|
||||
this.normalChannelCapacity = Math.min(this.get("general", "normalChannelCapacity", this.normalChannelCapacity, "Max channel number may not exceed 256").getInt(this.normalChannelCapacity), 256);
|
||||
this.denseChannelCapacity = Math.min(this.get("general", "denseChannelCapacity", this.denseChannelCapacity, "Max channel number may not exceed 256").getInt(this.denseChannelCapacity), 256);
|
||||
|
||||
this.setCategoryComment("BlockingMode", "Map of items to not block when blockingmode is enabled.\n[modid]\nmodid:item:metadata(optional,default:0)\nSupports more than one modid, so you can block different things between, for example, gregtech or enderio");
|
||||
this.nonBlockingItems = this.get("BlockingMode", "nonBlockingItems", nonBlockingItems, "NonBlockingItems").getStringList();
|
||||
@@ -189,6 +195,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
this.maxControllerSizeY = Math.min(Math.max(this.get("ControllerSize", "maxControllerSizeY", this.maxControllerSizeY).getInt(this.maxControllerSizeY), 1), 63);
|
||||
this.maxControllerSizeZ = Math.min(Math.max(this.get("ControllerSize", "maxControllerSizeZ", this.maxControllerSizeZ).getInt(this.maxControllerSizeZ), 1), 63);
|
||||
|
||||
|
||||
this.clientSync();
|
||||
|
||||
this.addCustomCategoryComment("features", "Warning: Disabling a feature may disable other features depending on it.");
|
||||
@@ -676,4 +683,12 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
public int getMaxControllerSizeZ() {
|
||||
return this.maxControllerSizeZ;
|
||||
}
|
||||
|
||||
public int getNormalChannelCapacity() {
|
||||
return this.normalChannelCapacity;
|
||||
}
|
||||
|
||||
public int getDenseChannelCapacity() {
|
||||
return this.denseChannelCapacity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,6 +200,9 @@ public class PacketJEIRecipe extends AppEngPacket {
|
||||
if (request.getItem().isDamageable() || Platform.isGTDamageableItem(request.getItem())) {
|
||||
Collection<IAEItemStack> outList = inv.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)).getStorageList().findFuzzy(request, FuzzyMode.IGNORE_ALL);
|
||||
for (IAEItemStack is : outList) {
|
||||
if (is.getStackSize() == 0) {
|
||||
continue;
|
||||
}
|
||||
if (Platform.isGTDamageableItem(request.getItem())) {
|
||||
if (!(is.getDefinition().getMetadata() == request.getDefinition().getMetadata())) {
|
||||
continue;
|
||||
|
||||
@@ -32,13 +32,16 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInformPlayer;
|
||||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import appeng.util.item.MeaningfulItemIterator;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class CraftingTreeNode {
|
||||
@@ -95,15 +98,6 @@ public class CraftingTreeNode {
|
||||
IAEItemStack request(final MECraftingInventory inv, long l, final IActionSource src) throws CraftBranchFailure, InterruptedException {
|
||||
addNode();
|
||||
this.job.handlePausing();
|
||||
if (this.canEmit) {
|
||||
final IAEItemStack wat = this.what.copy();
|
||||
wat.setStackSize(l);
|
||||
|
||||
this.howManyEmitted = wat.getStackSize();
|
||||
this.bytes += wat.getStackSize();
|
||||
|
||||
return wat;
|
||||
}
|
||||
|
||||
final IItemList<IAEItemStack> inventoryList = inv.getItemList();
|
||||
final List<IAEItemStack> thingsUsed = new ArrayList<>();
|
||||
@@ -111,39 +105,60 @@ public class CraftingTreeNode {
|
||||
this.what.setStackSize(l);
|
||||
|
||||
if (this.getSlot() >= 0 && this.parent != null && this.parent.details.isCraftable()) {
|
||||
Collection<IAEItemStack> itemList = new ArrayList<>();
|
||||
LinkedList<IAEItemStack> itemList = new LinkedList<>();
|
||||
|
||||
boolean damageableItem = this.what.getItem().isDamageable() || Platform.isGTDamageableItem(this.what.getItem());
|
||||
|
||||
if (this.parent.details.canSubstitute()) {
|
||||
for (IAEItemStack subs : this.parent.details.getSubstituteInputs(this.slot)) {
|
||||
if (damageableItem) {
|
||||
itemList.addAll(inventoryList.findFuzzy(subs, FuzzyMode.IGNORE_ALL));
|
||||
Iterator<IAEItemStack> it = new MeaningfulItemIterator<>(inventoryList.findFuzzy(this.what, FuzzyMode.IGNORE_ALL));
|
||||
while (it.hasNext()) {
|
||||
IAEItemStack i = it.next();
|
||||
if (i.getStackSize() > 0) {
|
||||
itemList.add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
subs = inventoryList.findPrecise(subs);
|
||||
if (subs != null) {
|
||||
if (subs != null && subs.getStackSize() > 0) {
|
||||
itemList.add(subs);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (damageableItem) {
|
||||
itemList.addAll(inventoryList.findFuzzy(this.what, FuzzyMode.IGNORE_ALL));
|
||||
Iterator<IAEItemStack> it = new MeaningfulItemIterator<>(inventoryList.findFuzzy(this.what, FuzzyMode.IGNORE_ALL));
|
||||
while (it.hasNext()) {
|
||||
IAEItemStack i = it.next();
|
||||
if (i.getStackSize() > 0) {
|
||||
itemList.add(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final IAEItemStack item = inventoryList.findPrecise(this.what);
|
||||
if (item != null) {
|
||||
if (item != null && item.getStackSize() > 0) {
|
||||
itemList.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (IAEItemStack fuzz : itemList) {
|
||||
if (this.parent.details.isValidItemForSlot(this.getSlot(), fuzz.copy().getCachedItemStack(1), this.world)) {
|
||||
if (this.parent.details.isValidItemForSlot(this.getSlot(), fuzz.getDefinition(), this.world)) {
|
||||
fuzz = fuzz.copy();
|
||||
fuzz.setStackSize(l);
|
||||
|
||||
final IAEItemStack available = inv.extractItems(fuzz, Actionable.MODULATE, src);
|
||||
|
||||
if (available != null) {
|
||||
if (available.getItem().hasContainerItem(available.getDefinition())) {
|
||||
final ItemStack is2 = Platform.getContainerItem(available.createItemStack());
|
||||
final IAEItemStack o = AEItemStack.fromItemStack(is2);
|
||||
|
||||
if (o != null) {
|
||||
this.parent.addContainers(o);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.exhausted) {
|
||||
final IAEItemStack is = this.job.checkUse(available);
|
||||
|
||||
@@ -184,6 +199,16 @@ public class CraftingTreeNode {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.canEmit) {
|
||||
final IAEItemStack wat = this.what.copy();
|
||||
wat.setStackSize(l);
|
||||
|
||||
this.howManyEmitted = wat.getStackSize();
|
||||
this.bytes += wat.getStackSize();
|
||||
|
||||
return wat;
|
||||
}
|
||||
|
||||
this.exhausted = true;
|
||||
|
||||
if (this.nodes.size() == 1) {
|
||||
@@ -197,6 +222,16 @@ public class CraftingTreeNode {
|
||||
final IAEItemStack available = inv.extractItems(madeWhat, Actionable.MODULATE, src);
|
||||
|
||||
if (available != null) {
|
||||
|
||||
if (parent != null && available.getItem().hasContainerItem(available.getDefinition())) {
|
||||
final ItemStack is2 = Platform.getContainerItem(available.createItemStack());
|
||||
final IAEItemStack o = AEItemStack.fromItemStack(is2);
|
||||
|
||||
if (o != null) {
|
||||
this.parent.addContainers(o);
|
||||
}
|
||||
}
|
||||
|
||||
this.bytes += available.getStackSize();
|
||||
l -= available.getStackSize();
|
||||
|
||||
@@ -240,6 +275,14 @@ public class CraftingTreeNode {
|
||||
|
||||
if (job.isSimulation()) {
|
||||
this.bytes += l;
|
||||
if (parent != null && this.what.getItem().hasContainerItem(this.what.getDefinition())) {
|
||||
final ItemStack is2 = Platform.getContainerItem(this.what.copy().setStackSize(1).createItemStack());
|
||||
final IAEItemStack o = AEItemStack.fromItemStack(is2);
|
||||
|
||||
if (o != null) {
|
||||
this.parent.addContainers(o);
|
||||
}
|
||||
}
|
||||
this.missing += l;
|
||||
final IAEItemStack rv = this.what.copy();
|
||||
rv.setStackSize(l);
|
||||
|
||||
@@ -27,15 +27,11 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongArrayMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
|
||||
@@ -50,6 +46,7 @@ public class CraftingTreeProcess {
|
||||
boolean possible = true;
|
||||
private long crafts = 0;
|
||||
private long bytes = 0;
|
||||
private ArrayList<IAEItemStack> containers;
|
||||
|
||||
public CraftingTreeProcess(final ICraftingGrid cc, final CraftingJob job, final ICraftingPatternDetails details, final CraftingTreeNode craftingTreeNode, final int depth) {
|
||||
this.parent = craftingTreeNode;
|
||||
@@ -198,32 +195,18 @@ public class CraftingTreeProcess {
|
||||
void request(final MECraftingInventory inv, final long amountOfTimes, final IActionSource src) throws CraftBranchFailure, InterruptedException {
|
||||
addProcess();
|
||||
this.job.handlePausing();
|
||||
List<IAEItemStack> containerItems = null;
|
||||
|
||||
// request and remove inputs...
|
||||
for (final Entry<CraftingTreeNode, Long> entry : this.nodes.object2LongEntrySet()) {
|
||||
final IAEItemStack stack = entry.getKey().request(inv, entry.getValue() * amountOfTimes, src);
|
||||
|
||||
if (this.details.isCraftable() && stack.getItem().hasContainerItem(stack.getDefinition())) {
|
||||
final ItemStack is = Platform.getContainerItem(stack.createItemStack());
|
||||
final IAEItemStack o = AEItemStack.fromItemStack(is);
|
||||
if (o != null) {
|
||||
if (containerItems == null) {
|
||||
containerItems = new ArrayList<>();
|
||||
}
|
||||
this.bytes++;
|
||||
o.setCachedItemStack(is);
|
||||
containerItems.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (containerItems != null) {
|
||||
for (IAEItemStack i : containerItems) {
|
||||
inv.injectItems(i, Actionable.MODULATE, src);
|
||||
if (this.containers != null) {
|
||||
for (IAEItemStack iae : containers) {
|
||||
inv.injectItems(iae, Actionable.MODULATE, src);
|
||||
}
|
||||
containers = null;
|
||||
}
|
||||
|
||||
// assume its possible.
|
||||
|
||||
// add crafting results..
|
||||
@@ -235,6 +218,13 @@ public class CraftingTreeProcess {
|
||||
this.crafts += amountOfTimes;
|
||||
}
|
||||
|
||||
public void addContainers(IAEItemStack container) {
|
||||
if (this.containers == null) {
|
||||
this.containers = new ArrayList<>();
|
||||
}
|
||||
this.containers.add(container);
|
||||
}
|
||||
|
||||
void dive(final CraftingJob job) {
|
||||
job.addTask(this.getAmountCrafted(this.parent.getStack(1)), this.crafts, this.details, this.depth);
|
||||
for (final Entry<CraftingTreeNode, Long> entry : this.nodes.object2LongEntrySet()) {
|
||||
|
||||
@@ -166,7 +166,7 @@ public class ContainerMEPortableFluidCell extends AEBaseContainer implements IAE
|
||||
if (wirelessTerminalGUIObject.isBaubleSlot()) {
|
||||
BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack());
|
||||
} else {
|
||||
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack());
|
||||
this.getPlayerInv().setInventorySlotContents(this.slot, this.wirelessTerminalGUIObject.getItemStack());
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
|
||||
@@ -74,13 +74,11 @@ public class MultiCraftingTracker {
|
||||
|
||||
public boolean handleCrafting(final int x, final long itemToCraft, final IAEItemStack ais, final InventoryAdaptor d, final World w, final IGrid g, final ICraftingGrid cg, final IActionSource mySrc) {
|
||||
if (ais != null) {
|
||||
ItemStack inputStack = ais.getCachedItemStack(ais.getStackSize());
|
||||
ItemStack inputStack = ais.createItemStack();
|
||||
|
||||
ItemStack remaining = d.simulateAdd(inputStack);
|
||||
|
||||
if (remaining.isEmpty()) {
|
||||
ais.setCachedItemStack(inputStack);
|
||||
|
||||
final Future<ICraftingJob> craftingJob = this.getJob(x);
|
||||
|
||||
if (this.getLink(x) != null) {
|
||||
@@ -117,8 +115,6 @@ public class MultiCraftingTracker {
|
||||
this.setJob(x, cg.beginCraftingJob(w, g, mySrc, aisC, null));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ais.setCachedItemStack(remaining);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -2,26 +2,23 @@ package appeng.integration.modules.jei;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.implementations.tiles.ISegmentedInventory;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.implementations.GuiCraftingTerm;
|
||||
import appeng.client.gui.implementations.GuiWirelessCraftingTerminal;
|
||||
import appeng.container.implementations.ContainerCraftingTerm;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.ContainerWirelessCraftingTerminal;
|
||||
import appeng.helpers.IContainerCraftingPacket;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import mezz.jei.api.gui.IGuiIngredient;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferError;
|
||||
import mezz.jei.gui.TooltipRenderer;
|
||||
import mezz.jei.gui.recipes.RecipeLayout;
|
||||
import mezz.jei.gui.recipes.RecipeTransferButton;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
|
||||
|
||||
@@ -47,7 +44,7 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
JEIMissingItem(Container container, @Nonnull IRecipeLayout recipeLayout) {
|
||||
if (container instanceof ContainerMEMonitorable) {
|
||||
IItemList<IAEItemStack> ir = ((ContainerMEMonitorable) container).items;
|
||||
|
||||
|
||||
IItemList<IAEItemStack> available = mergeInventories(ir, (ContainerMEMonitorable) container);
|
||||
|
||||
boolean found;
|
||||
@@ -57,7 +54,7 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
IItemList<IAEItemStack> used = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
|
||||
for (IGuiIngredient<?> i : recipeLayout.getItemStacks().getGuiIngredients().values()) {
|
||||
found = false;
|
||||
if (i.isInput() && i.getAllIngredients().size() > 0) {
|
||||
if (i.isInput() && !i.getAllIngredients().isEmpty()) {
|
||||
List<?> allIngredients = i.getAllIngredients();
|
||||
for (Object allIngredient : allIngredients) {
|
||||
if (allIngredient instanceof ItemStack) {
|
||||
@@ -66,7 +63,7 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
IAEItemStack search = AEItemStack.fromItemStack(stack);
|
||||
if (stack.getItem().isDamageable() || Platform.isGTDamageableItem(stack.getItem())) {
|
||||
Collection<IAEItemStack> fuzzy = available.findFuzzy(search, FuzzyMode.IGNORE_ALL);
|
||||
if (fuzzy.size() > 0) {
|
||||
if (!fuzzy.isEmpty()) {
|
||||
for (IAEItemStack itemStack : fuzzy) {
|
||||
if (itemStack.getStackSize() > 0) {
|
||||
if (Platform.isGTDamageableItem(stack.getItem())) {
|
||||
@@ -112,11 +109,12 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
@Override
|
||||
public void showError(Minecraft minecraft, int mouseX, int mouseY, @Nonnull IRecipeLayout recipeLayout, int recipeX, int recipeY) {
|
||||
Container c = minecraft.player.openContainer;
|
||||
if (c instanceof ContainerMEMonitorable) {
|
||||
ContainerMEMonitorable container = (ContainerMEMonitorable) c;
|
||||
if (c instanceof ContainerMEMonitorable container) {
|
||||
IItemList<IAEItemStack> ir = ((ContainerMEMonitorable) c).items;
|
||||
boolean found;
|
||||
boolean craftable;
|
||||
boolean found = false;
|
||||
boolean foundAny = false;
|
||||
boolean craftable = false;
|
||||
boolean foundAnyCraftable = false;
|
||||
int currentSlot = 0;
|
||||
this.errored = false;
|
||||
|
||||
@@ -145,17 +143,16 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
for (IGuiIngredient<?> i : recipeLayout.getItemStacks().getGuiIngredients().values()) {
|
||||
found = false;
|
||||
craftable = false;
|
||||
ArrayList<ItemStack> valid = new ArrayList<>();
|
||||
IItemList<IAEItemStack> valid = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
|
||||
if (i.isInput()) {
|
||||
List<?> allIngredients = i.getAllIngredients();
|
||||
for (Object allIngredient : allIngredients) {
|
||||
if (allIngredient instanceof ItemStack) {
|
||||
ItemStack stack = (ItemStack) allIngredient;
|
||||
if (allIngredient instanceof ItemStack stack) {
|
||||
if (!stack.isEmpty()) {
|
||||
IAEItemStack search = AEItemStack.fromItemStack(stack);
|
||||
if (stack.getItem().isDamageable() || Platform.isGTDamageableItem(stack.getItem())) {
|
||||
Collection<IAEItemStack> fuzzy = available.findFuzzy(search, FuzzyMode.IGNORE_ALL);
|
||||
if (fuzzy.size() > 0) {
|
||||
if (!fuzzy.isEmpty()) {
|
||||
for (IAEItemStack itemStack : fuzzy) {
|
||||
if (itemStack.getStackSize() > 0) {
|
||||
if (Platform.isGTDamageableItem(stack.getItem())) {
|
||||
@@ -165,7 +162,7 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
}
|
||||
found = true;
|
||||
used.add(itemStack.copy().setStackSize(1));
|
||||
valid.add(itemStack.copy().setStackSize(1).createItemStack());
|
||||
valid.add(itemStack.copy().setStackSize(1));
|
||||
} else {
|
||||
if (itemStack.isCraftable()) {
|
||||
craftable = true;
|
||||
@@ -180,12 +177,12 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
if (ext.getStackSize() > 0 && (usedStack == null || usedStack.getStackSize() < ext.getStackSize())) {
|
||||
used.add(ext.copy().setStackSize(1));
|
||||
if (craftable) {
|
||||
valid.clear();
|
||||
valid.resetStatus();
|
||||
}
|
||||
valid.add(ext.copy().setStackSize(1).createItemStack());
|
||||
valid.add(ext.copy().setStackSize(1));
|
||||
found = true;
|
||||
} else if (ext.isCraftable()) {
|
||||
valid.add(ext.copy().setStackSize(1).createItemStack());
|
||||
valid.add(ext.copy().setStackSize(1));
|
||||
craftable = true;
|
||||
}
|
||||
}
|
||||
@@ -195,27 +192,52 @@ public class JEIMissingItem implements IRecipeTransferError {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i.getAllIngredients().size() == 0) {
|
||||
found = true;
|
||||
if (i.getAllIngredients().isEmpty()) {
|
||||
currentSlot++;
|
||||
continue;
|
||||
}
|
||||
ArrayList<ItemStack> validStacks = new ArrayList<>();
|
||||
valid.forEach(v -> {
|
||||
if (v.getStackSize() > 0) {
|
||||
ItemStack validStack = v.createItemStack();
|
||||
validStack.setCount(1);
|
||||
validStacks.add(validStack);
|
||||
}
|
||||
});
|
||||
if (!found) {
|
||||
if (craftable) {
|
||||
i.drawHighlight(minecraft, new Color(0.0f, 0.0f, 1.0f, 0.4f), recipeX, recipeY);
|
||||
this.craftableSlots.add(currentSlot);
|
||||
recipeLayout.getItemStacks().set(currentSlot, valid);
|
||||
recipeLayout.getItemStacks().set(currentSlot, validStacks);
|
||||
foundAnyCraftable = true;
|
||||
} else {
|
||||
i.drawHighlight(minecraft, new Color(1.0f, 0.0f, 0.0f, 0.4f), recipeX, recipeY);
|
||||
}
|
||||
this.errored = true;
|
||||
} else {
|
||||
foundAny = true;
|
||||
this.foundSlots.add(currentSlot);
|
||||
recipeLayout.getItemStacks().set(currentSlot, valid);
|
||||
recipeLayout.getItemStacks().set(currentSlot, validStacks);
|
||||
}
|
||||
}
|
||||
currentSlot++;
|
||||
}
|
||||
if (!this.errored) {
|
||||
((RecipeLayout) recipeLayout).getRecipeTransferButton().init(Minecraft.getMinecraft().player.openContainer, Minecraft.getMinecraft().player);
|
||||
RecipeTransferButton b = ((RecipeLayout) recipeLayout).getRecipeTransferButton();
|
||||
if (b != null) {
|
||||
List<String> tooltipLines = new ArrayList<>();
|
||||
b.init(c, minecraft.player);
|
||||
if (errored && foundAny) {
|
||||
tooltipLines.add(I18n.translateToLocal("gui.tooltips.appliedenergistics2.PartialTransfer"));
|
||||
b.enabled = true;
|
||||
b.visible = true;
|
||||
}
|
||||
if (errored) {
|
||||
tooltipLines.add(I18n.translateToLocal("gui.tooltips.appliedenergistics2.MissingItem"));
|
||||
}
|
||||
if (foundAnyCraftable) {
|
||||
tooltipLines.add(I18n.translateToLocal("gui.tooltips.appliedenergistics2.CraftableItem"));
|
||||
}
|
||||
TooltipRenderer.drawHoveringText(minecraft, tooltipLines, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.integration.modules.jei;
|
||||
|
||||
import appeng.container.implementations.ContainerCraftingTerm;
|
||||
import appeng.container.implementations.ContainerPatternEncoder;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.implementations.ContainerWirelessCraftingTerminal;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
|
||||
@@ -43,12 +43,12 @@ public class ChannelInfoProvider implements IPartProbInfoProvider {
|
||||
}
|
||||
if (part instanceof PartDenseCableSmart || part instanceof PartCableSmart) {
|
||||
final int usedChannels;
|
||||
final int maxChannels = (part instanceof PartDenseCableSmart) ? 32 : 8;
|
||||
final int maxChannels = (part instanceof PartDenseCableSmart) ? AEConfig.instance().getDenseChannelCapacity() : AEConfig.instance().getNormalChannelCapacity();
|
||||
|
||||
if (part.getGridNode().isActive()) {
|
||||
final NBTTagCompound tmp = new NBTTagCompound();
|
||||
part.writeToNBT(tmp);
|
||||
usedChannels = tmp.getByte("usedChannels");
|
||||
usedChannels = tmp.getInteger("usedChannels");
|
||||
} else {
|
||||
usedChannels = 0;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ import appeng.core.localization.WailaText;
|
||||
import appeng.parts.networking.PartCableSmart;
|
||||
import appeng.parts.networking.PartDenseCableSmart;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ByteMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -59,7 +60,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider {
|
||||
* <p/>
|
||||
* The cache will be updated from the server.
|
||||
*/
|
||||
private final Object2ByteMap<IPart> cache = new Object2ByteOpenHashMap<>();
|
||||
private final Object2IntMap<IPart> cache = new Object2IntOpenHashMap<>();
|
||||
|
||||
/**
|
||||
* Adds the used and max channel to the tool tip
|
||||
@@ -78,10 +79,10 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider {
|
||||
if (part instanceof PartCableSmart || part instanceof PartDenseCableSmart) {
|
||||
final NBTTagCompound tag = accessor.getNBTData();
|
||||
|
||||
final byte usedChannels = this.getUsedChannels(part, tag, this.cache);
|
||||
final int usedChannels = this.getUsedChannels(part, tag, this.cache);
|
||||
|
||||
if (usedChannels >= 0) {
|
||||
final byte maxChannels = (byte) ((part instanceof PartDenseCableSmart) ? 32 : 8);
|
||||
final int maxChannels = ((part instanceof PartDenseCableSmart) ? AEConfig.instance().getDenseChannelCapacity() : AEConfig.instance().getNormalChannelCapacity());
|
||||
|
||||
final String formattedToolTip = String.format(WailaText.Channels.getLocal(), usedChannels, maxChannels);
|
||||
currentToolTip.add(formattedToolTip);
|
||||
@@ -102,11 +103,11 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider {
|
||||
* @param cache cache with previous knowledge
|
||||
* @return used channels on the cable
|
||||
*/
|
||||
private byte getUsedChannels(final IPart part, final NBTTagCompound tag, final Object2ByteMap<IPart> cache) {
|
||||
final byte usedChannels;
|
||||
private int getUsedChannels(final IPart part, final NBTTagCompound tag, final Object2IntMap<IPart> cache) {
|
||||
final int usedChannels;
|
||||
|
||||
if (tag.hasKey(ID_USED_CHANNELS)) {
|
||||
usedChannels = tag.getByte(ID_USED_CHANNELS);
|
||||
usedChannels = tag.getInteger(ID_USED_CHANNELS);
|
||||
this.cache.put(part, usedChannels);
|
||||
} else if (this.cache.containsKey(part)) {
|
||||
usedChannels = this.cache.get(part);
|
||||
@@ -139,9 +140,9 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider {
|
||||
part.writeToNBT(tempTag);
|
||||
|
||||
if (tempTag.hasKey(ID_USED_CHANNELS)) {
|
||||
final byte usedChannels = tempTag.getByte(ID_USED_CHANNELS);
|
||||
final int usedChannels = tempTag.getInteger(ID_USED_CHANNELS);
|
||||
|
||||
tag.setByte(ID_USED_CHANNELS, usedChannels);
|
||||
tag.setInteger(ID_USED_CHANNELS, usedChannels);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
private static final String EXISTING_CONNECTION_MESSAGE = "Connection between node [machine=%s, %s] and [machine=%s, %s] on [%s] already exists.";
|
||||
|
||||
private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged();
|
||||
private int channelData = 0;
|
||||
private int usedChannels = 0;
|
||||
private int lastUsedChannels = 0;
|
||||
private Object visitorIterationNumber = null;
|
||||
private GridNode sideA;
|
||||
private AEPartLocation fromAtoB;
|
||||
@@ -118,7 +119,7 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
|
||||
@Override
|
||||
public int getUsedChannels() {
|
||||
return (this.channelData >> 8) & 0xff;
|
||||
return usedChannels;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,7 +133,7 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
@Override
|
||||
public void setControllerRoute(final IPathItem fast, final boolean zeroOut) {
|
||||
if (zeroOut) {
|
||||
this.channelData &= ~0xff;
|
||||
this.lastUsedChannels = 0;
|
||||
}
|
||||
|
||||
if (this.sideB == fast) {
|
||||
@@ -145,7 +146,7 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
|
||||
@Override
|
||||
public boolean canSupportMoreChannels() {
|
||||
return this.getLastUsedChannels() < 32; // max, PERIOD.
|
||||
return this.getLastUsedChannels() < AEConfig.instance().getDenseChannelCapacity(); // max, PERIOD.
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -155,7 +156,7 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
|
||||
@Override
|
||||
public void incrementChannelCount(final int usedChannels) {
|
||||
this.channelData += usedChannels;
|
||||
this.lastUsedChannels += usedChannels;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,8 +167,7 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
@Override
|
||||
public void finalizeChannels() {
|
||||
if (this.getUsedChannels() != this.getLastUsedChannels()) {
|
||||
this.channelData &= 0xff;
|
||||
this.channelData |= this.channelData << 8;
|
||||
this.usedChannels = this.lastUsedChannels;
|
||||
|
||||
if (this.sideA.getInternalGrid() != null) {
|
||||
this.sideA.getInternalGrid().postEventTo(this.sideA, EVENT);
|
||||
@@ -180,7 +180,7 @@ public class GridConnection implements IGridConnection, IPathItem {
|
||||
}
|
||||
|
||||
private int getLastUsedChannels() {
|
||||
return this.channelData & 0xff;
|
||||
return lastUsedChannels;
|
||||
}
|
||||
|
||||
Object getVisitorIterationNumber() {
|
||||
|
||||
@@ -48,7 +48,7 @@ import java.util.*;
|
||||
|
||||
public class GridNode implements IGridNode, IPathItem {
|
||||
private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged();
|
||||
private static final int[] CHANNEL_COUNT = {0, 8, 32};
|
||||
private static final int[] CHANNEL_COUNT = {0, AEConfig.instance().getNormalChannelCapacity(), AEConfig.instance().getDenseChannelCapacity()};
|
||||
|
||||
private final List<IGridConnection> connections = new ArrayList<>();
|
||||
private final IGridBlock gridProxy;
|
||||
@@ -77,7 +77,7 @@ public class GridNode implements IGridNode, IPathItem {
|
||||
}
|
||||
|
||||
public int usedChannels() {
|
||||
return this.lastUsedChannels;
|
||||
return this.usedChannels;
|
||||
}
|
||||
|
||||
Class<? extends IGridHost> getMachineClass() {
|
||||
@@ -545,7 +545,7 @@ public class GridNode implements IGridNode, IPathItem {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getLastUsedChannels() != this.getUsedChannels()) {
|
||||
if (this.lastUsedChannels != this.usedChannels) {
|
||||
this.lastUsedChannels = this.usedChannels;
|
||||
|
||||
if (this.getInternalGrid() != null) {
|
||||
@@ -554,10 +554,6 @@ public class GridNode implements IGridNode, IPathItem {
|
||||
}
|
||||
}
|
||||
|
||||
private int getLastUsedChannels() {
|
||||
return this.lastUsedChannels;
|
||||
}
|
||||
|
||||
public long getLastSecurityKey() {
|
||||
return this.lastSecurityKey;
|
||||
}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ public class PathGridCache implements IPathingGrid {
|
||||
if (this.controllerState == ControllerState.NO_CONTROLLER) {
|
||||
final int requiredChannels = this.calculateRequiredChannels();
|
||||
int used = requiredChannels;
|
||||
if (AEConfig.instance().isFeatureEnabled(AEFeature.CHANNELS) && requiredChannels > 8) {
|
||||
if (AEConfig.instance().isFeatureEnabled(AEFeature.CHANNELS) && requiredChannels > AEConfig.instance().getNormalChannelCapacity()) {
|
||||
used = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import appeng.client.render.cablebus.CableBusRenderState;
|
||||
import appeng.client.render.cablebus.CableCoreType;
|
||||
import appeng.client.render.cablebus.FacadeRenderState;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.facade.FacadeContainer;
|
||||
import appeng.helpers.AEMultiTile;
|
||||
import appeng.me.GridConnection;
|
||||
@@ -1022,7 +1023,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
int length = (int) part.getCableConnectionLength(null);
|
||||
if (length > 0 && length <= 8) {
|
||||
if (length > 0 && length <= AEConfig.instance().getNormalChannelCapacity()) {
|
||||
renderState.getAttachmentConnections().put(facing, length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,23 +132,25 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
continue;
|
||||
}
|
||||
|
||||
if( this.craftOnly() )
|
||||
{
|
||||
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
|
||||
continue;
|
||||
}
|
||||
if (this.craftOnly()) {
|
||||
this.didSomething = this.craftingTracker.handleCrafting(slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc) || this.didSomething;
|
||||
continue;
|
||||
}
|
||||
|
||||
final long before = this.itemToSend;
|
||||
|
||||
if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0) {
|
||||
for (final IAEItemStack o : ImmutableList.copyOf(inv.getStorageList().findFuzzy(ais, fzMode))) {
|
||||
this.pushItemIntoTarget(destination, energy, inv, o);
|
||||
if (this.itemToSend <= 0) {
|
||||
break;
|
||||
if (o.getStackSize() > 0) {
|
||||
this.pushItemIntoTarget(destination, energy, inv, o);
|
||||
if (this.itemToSend <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (inv.getStorageList().findPrecise(ais) != null) {
|
||||
final IAEItemStack o = inv.getStorageList().findPrecise(ais);
|
||||
if (o != null && o.getStackSize() > 0) {
|
||||
this.pushItemIntoTarget(destination, energy, inv, ais);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,6 +305,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
int missingPatternsToEncode = 0;
|
||||
int amountPatternSlots = 8 + this.getInstalledUpgrades(Upgrades.PATTERN_EXPANSION) * 9;
|
||||
|
||||
for (int i = 0; i < inv.getSlots(); i++) {
|
||||
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
|
||||
@@ -316,7 +317,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
}
|
||||
|
||||
for (int x = 0; x < tmp.getSlots(); x++) {
|
||||
for (int x = 0; x < amountPatternSlots; x++) {
|
||||
if (!tmp.getStackInSlot(x).isEmpty()) {
|
||||
boolean found = false;
|
||||
for (int i = 0; i < playerInv.getSlots(); i++) {
|
||||
|
||||
@@ -234,7 +234,7 @@ public class PartCable extends AEBasePart implements IPartCable {
|
||||
howMany = Math.max(gc.getUsedChannels(), howMany);
|
||||
}
|
||||
|
||||
data.setByte("usedChannels", (byte) howMany);
|
||||
data.setInteger("usedChannels", howMany);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +343,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
int missingPatternsToEncode = 0;
|
||||
int amountPatternSlots = 8 + this.getInstalledUpgrades(Upgrades.PATTERN_EXPANSION) * 9;
|
||||
|
||||
for (int i = 0; i < inv.getSlots(); i++) {
|
||||
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
|
||||
@@ -354,8 +355,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int x = 0; x < tmp.getSlots(); x++) {
|
||||
for (int x = 0; x < amountPatternSlots; x++) {
|
||||
if (!tmp.getStackInSlot(x).isEmpty()) {
|
||||
boolean found = false;
|
||||
for (int i = 0; i < playerInv.getSlots(); i++) {
|
||||
@@ -371,6 +371,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Platform.isServer() && missingPatternsToEncode > 0) {
|
||||
player.sendMessage(PlayerMessages.MissingPatternsToEncode.get());
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class IMEAdaptor extends InventoryAdaptor {
|
||||
IAEItemStack out = null;
|
||||
|
||||
for (final IAEItemStack req : ImmutableList.copyOf(this.getList().findFuzzy(reqFilter, fuzzyMode))) {
|
||||
if (req != null) {
|
||||
if (req != null && req.getStackSize() > 0) {
|
||||
req.setStackSize(amount);
|
||||
out = this.target.extractItems(req, type, this.src);
|
||||
if (out != null) {
|
||||
|
||||
@@ -376,6 +376,9 @@ gui.tooltips.appliedenergistics2.ToggleShowFullInterfaces=Toggles showing interf
|
||||
gui.tooltips.appliedenergistics2.ToggleShowFullInterfacesOnDesc=Showing all interfaces
|
||||
gui.tooltips.appliedenergistics2.ToggleShowFullInterfacesOffDesc=Showing only interfaces with free slots
|
||||
gui.tooltips.appliedenergistics2.HighlightInterface=Highlight interface
|
||||
gui.tooltips.appliedenergistics2.PartialTransfer=Move stored items into the crafting grid
|
||||
gui.tooltips.appliedenergistics2.MissingItem=§cMissing item
|
||||
gui.tooltips.appliedenergistics2.CraftableItem=§9Craftable item
|
||||
|
||||
// Units
|
||||
gui.appliedenergistics2.units.appliedenergstics=AE
|
||||
|
||||
Reference in New Issue
Block a user