Compare commits
213 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2054c2afe3 | |||
| 69650e2bef | |||
| 1a576705fe | |||
| 27a3f70f0b | |||
| b252d1c891 | |||
| a31de25257 | |||
| 01f56ae633 | |||
| 669aa3188e | |||
| 219de337be | |||
| 7747899e90 | |||
| 82751e761e | |||
| c4c0585fd3 | |||
| 496e159010 | |||
| 754ee1ba83 | |||
| ffe1a52456 | |||
| 28696bd531 | |||
| 29098372af | |||
| 9dbcf21fa9 | |||
| a5a1f79102 | |||
| 8fb12119ef | |||
| 7f83c73a28 | |||
| 80a473a93b | |||
| adac94555b | |||
| 2f11054132 | |||
| 1314ee4588 | |||
| 4484863452 | |||
| ba9b790a02 | |||
| e4d862dbfd | |||
| 812e8c5990 | |||
| e3eeee7784 | |||
| 467bb91628 | |||
| 10a12a9b97 | |||
| e5f345d49c | |||
| 95ce9694aa | |||
| d1ec1a88ee | |||
| bfe82cdc0a | |||
| 4fe0d5e767 | |||
| b38148e095 | |||
| d528d9f205 | |||
| 60211cccdd | |||
| c3a331c13f | |||
| add866443d | |||
| bf83de08b2 | |||
| 6f822af262 | |||
| 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 | |||
| 793b8d6655 | |||
| cba89b0323 | |||
| 1f2cdfd843 | |||
| da39d81d5f | |||
| 1442248ec3 | |||
| 1500661e43 | |||
| a7c2824624 | |||
| 9d2549bdd8 | |||
| a37a2b4e89 | |||
| aa6bad7a72 | |||
| e2e5eed351 | |||
| b6de4ebf18 | |||
| 4545d78a51 | |||
| 6dc75fe26e | |||
| 0552282d9d | |||
| 8be01dfb87 | |||
| 4c5803b986 | |||
| 3b4b9a1bd5 | |||
| 2c7959e399 | |||
| 4649841341 | |||
| 3d4cfb2ee8 | |||
| 8092d0d354 | |||
| ceee1f181f | |||
| eefb11544e | |||
| af5921f9e8 | |||
| 75be2ff039 | |||
| b6f4bdb64d | |||
| b76c9f1371 | |||
| 50bf591418 | |||
| b077aff1f8 | |||
| 8debd6c499 | |||
| 53ad6c776b | |||
| e37f8ef65d | |||
| d8b20f53a9 | |||
| bf1a3b7751 | |||
| c8a6d50ce3 | |||
| 13af30f657 | |||
| 5d7f552643 | |||
| 82be548fc7 | |||
| 38249608e4 | |||
| 8f66765696 | |||
| fd5f9263d8 | |||
| 36d94a17aa | |||
| ede2b4ce25 | |||
| e09ec8c420 | |||
| 3d4c03e184 | |||
| 17119fd990 | |||
| 9a00185b6d | |||
| 2c7b239914 | |||
| 4039188712 | |||
| ecb697ab11 | |||
| ab1f519401 | |||
| d06a70ee22 | |||
| 422f9faf76 | |||
| 96ab73001b | |||
| 854676a33c | |||
| 7f76723da5 | |||
| 3fc7cf0247 | |||
| b377dfdd69 | |||
| 51522019ca | |||
| ff1091d252 | |||
| 15dff5d53d | |||
| 7ab89a0657 | |||
| dcd36b3b2f | |||
| 7b985c72bd | |||
| 269d3766db | |||
| d7e7ef0cb4 | |||
| 472f1e65a2 | |||
| 56268aba79 | |||
| 9d7dacdc29 | |||
| fb2aa21337 | |||
| 8bad14f982 | |||
| 0e797b2120 | |||
| 17c38a6418 | |||
| 58a6dabb20 | |||
| 329e613c99 | |||
| 11a4783881 | |||
| e230440cba | |||
| 149e7d251a | |||
| 405f14bd13 | |||
| acd77ff3f2 | |||
| a0ec9ceb51 | |||
| d6f2ed30e5 | |||
| 9785e38e3f | |||
| 1759bd898e | |||
| ae0d02e7d5 | |||
| d76eec2145 | |||
| d7e1554e41 | |||
| 9dee7f6c0e | |||
| 13c3067068 | |||
| 7c4e5679a3 | |||
| 03ed421331 | |||
| 36197a5dc6 | |||
| f407a26a8f | |||
| cb1011295c | |||
| 55a56ad79d | |||
| dd2f1c6dc7 | |||
| f14407b87a | |||
| 04f006695e | |||
| 4f36ccf64d | |||
| d9b4410c94 | |||
| 9bbd0ad61b | |||
| 662a7805dd | |||
| c46eadec08 | |||
| 148207f5c3 | |||
| 3ae251f098 | |||
| 82a906886f | |||
| 5b2c6658c0 | |||
| 653557bc65 | |||
| dde87448a9 | |||
| 8c29eeecdc | |||
| d852d0c216 | |||
| f9bb00a7e7 | |||
| 9f7e42ca7d | |||
| b76c18fedf | |||
| 98ce8235bb | |||
| e1ea4ae22f | |||
| 20ba83c529 | |||
| 225a4d5ab6 | |||
| bd4f03652e | |||
| d6650f9617 | |||
| c5607bda4e | |||
| 11af1f2111 | |||
| 7748f7c92d | |||
| 801fec3eaa | |||
| de324aad91 | |||
| 16ccb2ee46 | |||
| bd0d2a1f28 | |||
| 9abd53a8e8 | |||
| 1f12fc5e91 | |||
| 87fcc6c267 | |||
| e301459dfa | |||
| bf802f1c6f | |||
| 7ba4ca6923 | |||
| 53ed861e23 | |||
| 833f8aca2a | |||
| 9bcf45b7e2 | |||
| b2847677ed | |||
| 95845d5a6c | |||
| 286a3631be | |||
| 6506301049 | |||
| 422543f205 |
@@ -0,0 +1,25 @@
|
||||
name: Build mod
|
||||
|
||||
on: [ push, pull_request, workflow_dispatch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build mod
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '8'
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew -Pnet.minecraftforge.gradle.disableUpdateChecker=true build
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appliedenergistics2
|
||||
path: build/libs
|
||||
@@ -1,15 +0,0 @@
|
||||
name: 'Lock threads'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-lock-inactive-days: '180'
|
||||
pr-lock-inactive-days: '180'
|
||||
@@ -8,6 +8,7 @@
|
||||
!gradlew.bat
|
||||
!build.gradle
|
||||
!gradle.properties
|
||||
!settings.gradle
|
||||
!.travis.yml
|
||||
|
||||
# include markdowns
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
This is a fork of AE2 i made for trying to solve issues for the [Omnifactory](https://www.curseforge.com/minecraft/modpacks/omnifactory) modpack.
|
||||
# Applied Energistics 2 Unofficial Extended Life
|
||||
|
||||
See https://github.com/PrototypeTrousers/Applied-Energistics-2/tree/AE2-Omnifactory branch for commits
|
||||
and
|
||||
https://github.com/PrototypeTrousers/Applied-Energistics-2/releases for the compiled jars.
|
||||
[](https://www.curseforge.com/minecraft/mc-mods/ae2-extended-life) [](https://www.curseforge.com/minecraft/mc-mods/ae2-extended-life) [](https://github.com/AE2-UEL/Applied-Energistics-2/issues) [](https://github.com/AE2-UEL/Applied-Energistics-2/pulls)
|
||||
|
||||
# Applied Energistics 2 (PrototypeTrousers fork for Omnifactory)
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
A Mod about Matter, Energy and using them to conquer the world..
|
||||
A maintained fork of a Mod about Matter, Energy and using them to conquer the world.
|
||||
|
||||
This project started as a fork of [Applied Energistics 2](https://github.com/AppliedEnergistics/Applied-Energistics-2) by [PrototypeTrousers](https://github.com/PrototypeTrousers), initially addressing issues related to the [Nomifactory](https://www.curseforge.com/minecraft/modpacks/nomifactory) modpack. It is now being maintained by the [AE2 Unofficial Extended Life Team](https://github.com/AE2-UEL).
|
||||
|
||||
See [Releases](https://github.com/PrototypeTrousers/Applied-Energistics-2/releases) for the compiled jars.
|
||||
|
||||
## RecipeStages
|
||||
|
||||
You need to add the following into a CraftTweaker script:
|
||||
```
|
||||
mods.recipestages.Recipes.setPackageStage("appeng", allStages);
|
||||
```
|
||||
|
||||
The second argument allows you to customize which stages exactly you want to be craftable with AE2. Not sure why you would do that, but we support that nonetheless!
|
||||
|
||||
## License
|
||||
|
||||
* Applied Energistics 2 API
|
||||
- (c) 2013 - 2018 AlgorithmX2 et al
|
||||
- [](http://opensource.org/licenses/MIT)
|
||||
@@ -26,8 +36,9 @@ A Mod about Matter, Energy and using them to conquer the world..
|
||||
|
||||
## Credits
|
||||
|
||||
Thanks to
|
||||
|
||||
Special thanks to:
|
||||
|
||||
* PrototypeTrousers for the initial fork
|
||||
* Notch et al for Minecraft
|
||||
* Lex et al for MinecraftForge
|
||||
* AlgorithmX2 for AppliedEnergistics2
|
||||
|
||||
+993
-87
File diff suppressed because it is too large
Load Diff
+119
-6
@@ -3,8 +3,6 @@ aechannel=stable
|
||||
aebuild=7
|
||||
aegroup=appeng
|
||||
aebasename=appliedenergistics2
|
||||
extended=extended_life
|
||||
extendedversion=v0.54.2
|
||||
#########################################################
|
||||
# Versions #
|
||||
#########################################################
|
||||
@@ -22,10 +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
|
||||
inventorytweaks_version=1.63
|
||||
bogosorter_version=1.1.0
|
||||
crafttweaker_version=4.1.20.684
|
||||
ctm_version=MC1.12.2-0.3.1.16
|
||||
forestry_version=5.8.2.387
|
||||
#########################################################
|
||||
@@ -33,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=AE2 Unofficial Extended Life
|
||||
# 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.29
|
||||
# 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
|
||||
}
|
||||
@@ -43,11 +43,6 @@ repositories {
|
||||
url "https://maven.ellpeck.de"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "IC2 repo"
|
||||
url = "http://maven.ic2.player.to"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "CoFH Maven"
|
||||
url = "http://maven.covers1624.net"
|
||||
@@ -81,35 +76,41 @@ configurations {
|
||||
dependencies {
|
||||
// deobfCompile "gregtechce:gregtech:1.12.2:1.15.1.735"
|
||||
// installable runtime dependencies
|
||||
deobfCompile "curse.maven:gregtechceu-557242:3949406"
|
||||
implementation rfg.deobf("curse.maven:gregtechceu-557242:4429261")
|
||||
|
||||
compileOnly "curse.maven:chisel-235279:2915375"
|
||||
|
||||
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"
|
||||
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}"
|
||||
|
||||
|
||||
// compile against provided APIs
|
||||
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
|
||||
//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"
|
||||
compileOnly "curse.maven:game-stages-268655:2951844"
|
||||
compileOnly "net.darkhax.tesla:Tesla-1.12.2:${tesla_version}"
|
||||
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
//compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
implementation rfg.deobf("curse.maven:industrial-craft-242638:2547175")
|
||||
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 "inventory-tweaks:InventoryTweaks:${inventorytweaks_version}:api"
|
||||
compileOnly "inventory-bogo-sorter:bogosorter:${bogosorter_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("curse.maven:forestry-59751:2684780")
|
||||
|
||||
// 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()
|
||||
@@ -32,66 +32,61 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
|
||||
|
||||
public enum Upgrades
|
||||
{
|
||||
/**
|
||||
* Gold Tier Upgrades.
|
||||
*/
|
||||
CAPACITY( 0 ),
|
||||
REDSTONE( 0 ),
|
||||
CRAFTING( 0 ),
|
||||
public enum Upgrades {
|
||||
/**
|
||||
* Gold Tier Upgrades.
|
||||
*/
|
||||
CAPACITY(0),
|
||||
REDSTONE(0),
|
||||
CRAFTING(0),
|
||||
MAGNET(0),
|
||||
|
||||
/**
|
||||
* Diamond Tier Upgrades.
|
||||
*/
|
||||
FUZZY( 1 ),
|
||||
SPEED( 1 ),
|
||||
INVERTER( 1 ),
|
||||
PATTERN_EXPANSION(1);
|
||||
/**
|
||||
* Diamond Tier Upgrades.
|
||||
*/
|
||||
FUZZY(1),
|
||||
SPEED(1),
|
||||
INVERTER(1),
|
||||
PATTERN_EXPANSION(1),
|
||||
QUANTUM_LINK(1);
|
||||
|
||||
private final int tier;
|
||||
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
|
||||
private final int tier;
|
||||
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
|
||||
|
||||
Upgrades( final int tier )
|
||||
{
|
||||
this.tier = tier;
|
||||
}
|
||||
Upgrades(final int tier) {
|
||||
this.tier = tier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list of Items/Blocks that support this upgrade, and how many it supports.
|
||||
*/
|
||||
public Map<ItemStack, Integer> getSupported()
|
||||
{
|
||||
return this.supportedMax;
|
||||
}
|
||||
/**
|
||||
* @return list of Items/Blocks that support this upgrade, and how many it supports.
|
||||
*/
|
||||
public Map<ItemStack, Integer> getSupported() {
|
||||
return this.supportedMax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a specific amount of this upgrade into a specific machine
|
||||
*
|
||||
* @param item machine in which this upgrade can be installed
|
||||
* @param maxSupported amount how many upgrades can be installed
|
||||
*/
|
||||
public void registerItem( final IItemDefinition item, final int maxSupported )
|
||||
{
|
||||
item.maybeStack( 1 ).ifPresent( is -> this.registerItem( is, maxSupported ) );
|
||||
}
|
||||
/**
|
||||
* Registers a specific amount of this upgrade into a specific machine
|
||||
*
|
||||
* @param item machine in which this upgrade can be installed
|
||||
* @param maxSupported amount how many upgrades can be installed
|
||||
*/
|
||||
public void registerItem(final IItemDefinition item, final int maxSupported) {
|
||||
item.maybeStack(1).ifPresent(is -> this.registerItem(is, maxSupported));
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a specific amount of this upgrade into a specific machine
|
||||
*
|
||||
* @param stack machine in which this upgrade can be installed
|
||||
* @param maxSupported amount how many upgrades can be installed
|
||||
*/
|
||||
public void registerItem( final ItemStack stack, final int maxSupported )
|
||||
{
|
||||
if( stack != null )
|
||||
{
|
||||
this.supportedMax.put( stack, maxSupported );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Registers a specific amount of this upgrade into a specific machine
|
||||
*
|
||||
* @param stack machine in which this upgrade can be installed
|
||||
* @param maxSupported amount how many upgrades can be installed
|
||||
*/
|
||||
public void registerItem(final ItemStack stack, final int maxSupported) {
|
||||
if (stack != null) {
|
||||
this.supportedMax.put(stack, maxSupported);
|
||||
}
|
||||
}
|
||||
|
||||
public int getTier()
|
||||
{
|
||||
return this.tier;
|
||||
}
|
||||
public int getTier() {
|
||||
return this.tier;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@ import appeng.api.util.AEColoredItemDefinition;
|
||||
/**
|
||||
* A list of all items in AE
|
||||
*/
|
||||
public interface IItems
|
||||
{
|
||||
public interface IItems {
|
||||
IItemDefinition certusQuartzAxe();
|
||||
|
||||
IItemDefinition certusQuartzHoe();
|
||||
@@ -64,6 +63,12 @@ public interface IItems
|
||||
|
||||
IItemDefinition wirelessTerminal();
|
||||
|
||||
IItemDefinition wirelessCraftingTerminal();
|
||||
|
||||
IItemDefinition wirelessPatternTerminal();
|
||||
|
||||
IItemDefinition wirelessFluidTerminal();
|
||||
|
||||
IItemDefinition biometricCard();
|
||||
|
||||
IItemDefinition chargedStaff();
|
||||
|
||||
@@ -27,121 +27,124 @@ package appeng.api.definitions;
|
||||
/**
|
||||
* A list of all materials in AE
|
||||
*/
|
||||
public interface IMaterials
|
||||
{
|
||||
IItemDefinition cell2SpatialPart();
|
||||
public interface IMaterials {
|
||||
IItemDefinition cell2SpatialPart();
|
||||
|
||||
IItemDefinition cell16SpatialPart();
|
||||
IItemDefinition cell16SpatialPart();
|
||||
|
||||
IItemDefinition cell128SpatialPart();
|
||||
IItemDefinition cell128SpatialPart();
|
||||
|
||||
IItemDefinition silicon();
|
||||
IItemDefinition silicon();
|
||||
|
||||
IItemDefinition skyDust();
|
||||
IItemDefinition skyDust();
|
||||
|
||||
IItemDefinition calcProcessorPress();
|
||||
IItemDefinition calcProcessorPress();
|
||||
|
||||
IItemDefinition engProcessorPress();
|
||||
IItemDefinition engProcessorPress();
|
||||
|
||||
IItemDefinition logicProcessorPress();
|
||||
IItemDefinition logicProcessorPress();
|
||||
|
||||
IItemDefinition calcProcessorPrint();
|
||||
IItemDefinition calcProcessorPrint();
|
||||
|
||||
IItemDefinition engProcessorPrint();
|
||||
IItemDefinition engProcessorPrint();
|
||||
|
||||
IItemDefinition logicProcessorPrint();
|
||||
IItemDefinition logicProcessorPrint();
|
||||
|
||||
IItemDefinition siliconPress();
|
||||
IItemDefinition siliconPress();
|
||||
|
||||
IItemDefinition siliconPrint();
|
||||
IItemDefinition siliconPrint();
|
||||
|
||||
IItemDefinition namePress();
|
||||
IItemDefinition namePress();
|
||||
|
||||
IItemDefinition logicProcessor();
|
||||
IItemDefinition logicProcessor();
|
||||
|
||||
IItemDefinition calcProcessor();
|
||||
IItemDefinition calcProcessor();
|
||||
|
||||
IItemDefinition engProcessor();
|
||||
IItemDefinition engProcessor();
|
||||
|
||||
IItemDefinition basicCard();
|
||||
IItemDefinition basicCard();
|
||||
|
||||
IItemDefinition advCard();
|
||||
IItemDefinition advCard();
|
||||
|
||||
IItemDefinition purifiedCertusQuartzCrystal();
|
||||
IItemDefinition purifiedCertusQuartzCrystal();
|
||||
|
||||
IItemDefinition purifiedNetherQuartzCrystal();
|
||||
IItemDefinition purifiedNetherQuartzCrystal();
|
||||
|
||||
IItemDefinition purifiedFluixCrystal();
|
||||
IItemDefinition purifiedFluixCrystal();
|
||||
|
||||
IItemDefinition cell1kPart();
|
||||
IItemDefinition cell1kPart();
|
||||
|
||||
IItemDefinition cell4kPart();
|
||||
IItemDefinition cell4kPart();
|
||||
|
||||
IItemDefinition cell16kPart();
|
||||
IItemDefinition cell16kPart();
|
||||
|
||||
IItemDefinition cell64kPart();
|
||||
IItemDefinition cell64kPart();
|
||||
|
||||
IItemDefinition emptyStorageCell();
|
||||
IItemDefinition emptyStorageCell();
|
||||
|
||||
IItemDefinition cardRedstone();
|
||||
IItemDefinition cardRedstone();
|
||||
|
||||
IItemDefinition cardSpeed();
|
||||
IItemDefinition cardSpeed();
|
||||
|
||||
IItemDefinition cardCapacity();
|
||||
IItemDefinition cardCapacity();
|
||||
|
||||
IItemDefinition cardPatternExpansion();
|
||||
IItemDefinition cardPatternExpansion();
|
||||
|
||||
IItemDefinition cardFuzzy();
|
||||
IItemDefinition cardQuantumLink();
|
||||
|
||||
IItemDefinition cardInverter();
|
||||
IItemDefinition cardMagnet();
|
||||
|
||||
IItemDefinition cardCrafting();
|
||||
IItemDefinition cardFuzzy();
|
||||
|
||||
IItemDefinition enderDust();
|
||||
IItemDefinition cardInverter();
|
||||
|
||||
IItemDefinition flour();
|
||||
IItemDefinition cardCrafting();
|
||||
|
||||
IItemDefinition goldDust();
|
||||
IItemDefinition enderDust();
|
||||
|
||||
IItemDefinition ironDust();
|
||||
IItemDefinition flour();
|
||||
|
||||
IItemDefinition fluixDust();
|
||||
IItemDefinition goldDust();
|
||||
|
||||
IItemDefinition certusQuartzDust();
|
||||
IItemDefinition ironDust();
|
||||
|
||||
IItemDefinition netherQuartzDust();
|
||||
IItemDefinition fluixDust();
|
||||
|
||||
IItemDefinition matterBall();
|
||||
IItemDefinition certusQuartzDust();
|
||||
|
||||
IItemDefinition certusQuartzCrystal();
|
||||
IItemDefinition netherQuartzDust();
|
||||
|
||||
IItemDefinition certusQuartzCrystalCharged();
|
||||
IItemDefinition matterBall();
|
||||
|
||||
IItemDefinition fluixCrystal();
|
||||
IItemDefinition certusQuartzCrystal();
|
||||
|
||||
IItemDefinition fluixPearl();
|
||||
IItemDefinition certusQuartzCrystalCharged();
|
||||
|
||||
IItemDefinition woodenGear();
|
||||
IItemDefinition fluixCrystal();
|
||||
|
||||
IItemDefinition wirelessReceiver();
|
||||
IItemDefinition fluixPearl();
|
||||
|
||||
IItemDefinition wirelessBooster();
|
||||
IItemDefinition woodenGear();
|
||||
|
||||
IItemDefinition annihilationCore();
|
||||
IItemDefinition wirelessReceiver();
|
||||
|
||||
IItemDefinition formationCore();
|
||||
IItemDefinition wirelessBooster();
|
||||
|
||||
IItemDefinition singularity();
|
||||
IItemDefinition annihilationCore();
|
||||
|
||||
IItemDefinition qESingularity();
|
||||
IItemDefinition formationCore();
|
||||
|
||||
IItemDefinition blankPattern();
|
||||
IItemDefinition singularity();
|
||||
|
||||
IItemDefinition fluidCell1kPart();
|
||||
IItemDefinition qESingularity();
|
||||
|
||||
IItemDefinition fluidCell4kPart();
|
||||
IItemDefinition blankPattern();
|
||||
|
||||
IItemDefinition fluidCell16kPart();
|
||||
IItemDefinition fluidCell1kPart();
|
||||
|
||||
IItemDefinition fluidCell64kPart();
|
||||
IItemDefinition fluidCell4kPart();
|
||||
|
||||
IItemDefinition fluidCell16kPart();
|
||||
|
||||
IItemDefinition fluidCell64kPart();
|
||||
}
|
||||
|
||||
@@ -28,47 +28,45 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.util.IConfigManager;
|
||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||
|
||||
|
||||
/**
|
||||
* A handler for a wireless terminal.
|
||||
*/
|
||||
public interface IWirelessTermHandler extends INetworkEncodable
|
||||
{
|
||||
public interface IWirelessTermHandler extends INetworkEncodable {
|
||||
|
||||
/**
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return true, if usePower, hasPower, etc... can be called for the provided item
|
||||
*/
|
||||
boolean canHandle( ItemStack is );
|
||||
/**
|
||||
* @param is wireless terminal
|
||||
* @return true, if usePower, hasPower, etc... can be called for the provided item
|
||||
*/
|
||||
boolean canHandle(ItemStack is);
|
||||
|
||||
/**
|
||||
* use an amount of power, in AE units
|
||||
*
|
||||
* @param amount is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for
|
||||
* hasPower
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return true if wireless terminal uses power
|
||||
*/
|
||||
boolean usePower( EntityPlayer player, double amount, ItemStack is );
|
||||
/**
|
||||
* use an amount of power, in AE units
|
||||
*
|
||||
* @param amount is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for
|
||||
* hasPower
|
||||
* @param is wireless terminal
|
||||
* @return true if wireless terminal uses power
|
||||
*/
|
||||
boolean usePower(EntityPlayer player, double amount, ItemStack is);
|
||||
|
||||
/**
|
||||
* gets the power status of the item.
|
||||
*
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return returns true if there is any power left.
|
||||
*/
|
||||
boolean hasPower( EntityPlayer player, double amount, ItemStack is );
|
||||
/**
|
||||
* gets the power status of the item.
|
||||
*
|
||||
* @param is wireless terminal
|
||||
* @return returns true if there is any power left.
|
||||
*/
|
||||
boolean hasPower(EntityPlayer player, double amount, ItemStack is);
|
||||
|
||||
/**
|
||||
* Return the config manager for the wireless terminal.
|
||||
*
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return config manager of wireless terminal
|
||||
*/
|
||||
IConfigManager getConfigManager( ItemStack is );
|
||||
/**
|
||||
* Return the config manager for the wireless terminal.
|
||||
*
|
||||
* @param is wireless terminal
|
||||
* @return config manager of wireless terminal
|
||||
*/
|
||||
IConfigManager getConfigManager(ItemStack is);
|
||||
|
||||
IGuiHandler getGuiHandler(ItemStack is);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package appeng.api.implementations;
|
||||
|
||||
public interface IUpgradeableCellContainer {
|
||||
int availableUpgrades();
|
||||
|
||||
void setupUpgrades();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.implementations;
|
||||
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.tiles.ISegmentedInventory;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
|
||||
|
||||
public interface IUpgradeableCellHost extends IConfigurableObject, ISegmentedInventory {
|
||||
|
||||
/**
|
||||
* determine how many of an upgrade are installed.
|
||||
*/
|
||||
default int getInstalledUpgrades(Upgrades u) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,11 +40,13 @@ public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
|
||||
/**
|
||||
* 0 - cell is missing.
|
||||
*
|
||||
* 1 - green,
|
||||
* 1 - green, the cell is present and partially empty
|
||||
*
|
||||
* 2 - orange,
|
||||
* 2 - orange, the cell is present and full on types
|
||||
*
|
||||
* 3 - red
|
||||
* 3 - red, the cell is present and full on bytes
|
||||
*
|
||||
* 4 - blue, the cell is present but totally empty
|
||||
*
|
||||
* @param slot slot index
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ public interface ICellInventory<T extends IAEStack<T>> extends IMEInventory<T>
|
||||
*
|
||||
* 3 - red, ( usually means the cell is 100% full )
|
||||
*
|
||||
* 4 - blue, ( usually means the cell is available and completely empty. )
|
||||
*
|
||||
* @return get the status of the cell based on its contents.
|
||||
*/
|
||||
int getStatusForCell();
|
||||
|
||||
@@ -39,7 +39,7 @@ import appeng.api.storage.IStorageChannel;
|
||||
* - For fluids: AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class).createList()
|
||||
* - Replace with the corresponding {@link IStorageChannel} type for non native channels
|
||||
*/
|
||||
public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Iterable<T>, Cloneable
|
||||
public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Iterable<T>
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -85,9 +85,4 @@ public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Ite
|
||||
* resets stack sizes to 0.
|
||||
*/
|
||||
void resetStatus();
|
||||
|
||||
/**
|
||||
* create a copy of this list.
|
||||
*/
|
||||
IItemList<T> clone();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.enderio.core.common.interfaces;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IOverlayRenderAware {
|
||||
|
||||
public void renderItemOverlayIntoGUI(@Nonnull ItemStack stack, int xPosition, int yPosition);
|
||||
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package yalter.mousetweaks.api;
|
||||
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
/**
|
||||
* This is the interface you want to implement in your GuiScreen to make it compatible with Mouse Tweaks.
|
||||
* If this interface is not enough (for example, you need a custom slot click function, or if you use a custom Container
|
||||
* which happens to be incompatible), check IMTModGuiContainer2Ex instead.
|
||||
* If you just need to disable Mouse Tweaks or the wheel tweak, see the MouseTweaksIgnore
|
||||
* or the MouseTweaksDisableWheelTweak annotations.
|
||||
*/
|
||||
public interface IMTModGuiContainer2 {
|
||||
/**
|
||||
* If you want to disable Mouse Tweaks in your GuiScreen, return true from this method.
|
||||
*
|
||||
* @return True if Mouse Tweaks should be disabled, false otherwise.
|
||||
*/
|
||||
boolean MT_isMouseTweaksDisabled();
|
||||
|
||||
/**
|
||||
* If you want to disable the Wheel Tweak in your GuiScreen, return true from this method.
|
||||
*
|
||||
* @return True if the Wheel Tweak should be disabled, false otherwise.
|
||||
*/
|
||||
boolean MT_isWheelTweakDisabled();
|
||||
|
||||
/**
|
||||
* Returns the Container.
|
||||
*
|
||||
* @return Container that is currently in use.
|
||||
*/
|
||||
Container MT_getContainer();
|
||||
|
||||
/**
|
||||
* Returns the Slot that is currently selected by the player, or null if no Slot is selected.
|
||||
*
|
||||
* @return Slot that is located under the mouse, or null if no Slot it currently under the mouse.
|
||||
*/
|
||||
Slot MT_getSlotUnderMouse();
|
||||
|
||||
/**
|
||||
* Return true if the given Slot behaves like the vanilla crafting output slots (inside the crafting table,
|
||||
* or the furnace output slot, or the anvil output slot, etc.). These slots are handled differently by Mouse Tweaks.
|
||||
*
|
||||
* @param slot the slot to check
|
||||
* @return True if slot is a crafting output slot.
|
||||
*/
|
||||
boolean MT_isCraftingOutput(Slot slot);
|
||||
|
||||
/**
|
||||
* Return true if the given Slot should be ignored by Mouse Tweaks. Examples of ignored slots are the item select
|
||||
* slots and the Destroy Item slot in the vanilla creative inventory.
|
||||
*
|
||||
* @param slot the slot to check
|
||||
* @return Tru if slot should be ignored by Mouse Tweaks.
|
||||
*/
|
||||
boolean MT_isIgnored(Slot slot);
|
||||
|
||||
/**
|
||||
* If your container has an RMB dragging functionality (like vanilla containers), disable it inside this method.
|
||||
* This method is called every frame (render tick), which is after all mouseClicked / mouseClickMove / mouseReleased
|
||||
* events are handled (although note these events are handled every game tick, which is far less frequent than every
|
||||
* render tick).<br><br>
|
||||
*
|
||||
* If true is returned from this method, Mouse Tweaks (after checking other conditions like isIgnored) will click
|
||||
* the slot on which the right mouse button was initially pressed (in most cases this is the slot currently under
|
||||
* mouse). This is needed because the vanilla RMB dragging functionality prevents the initial slot click.<br><br>
|
||||
*
|
||||
* For vanilla containers this method looks like this:
|
||||
* <pre>
|
||||
* this.ignoreMouseUp = true;
|
||||
*
|
||||
* if (this.dragSplitting) {
|
||||
* if (this.dragSplittingButton == 1) {
|
||||
* this.dragSplitting = false;
|
||||
* return true;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* return false;
|
||||
* </pre>
|
||||
*
|
||||
* @return True if Mouse Tweaks should click the slot on which the RMB was pressed.
|
||||
*/
|
||||
boolean MT_disableRMBDraggingFunctionality();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package yalter.mousetweaks.api;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Put this on your GuiScreen to disable Mouse Tweaks.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface MouseTweaksIgnore {
|
||||
}
|
||||
@@ -307,13 +307,13 @@ public abstract class AEBaseBlock extends Block {
|
||||
return dir;
|
||||
}
|
||||
|
||||
final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
|
||||
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
|
||||
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
|
||||
final int west_x = forward.getYOffset() * up.getZOffset() - forward.getZOffset() * up.getYOffset();
|
||||
final int west_y = forward.getZOffset() * up.getYOffset() - forward.getXOffset() * up.getZOffset();
|
||||
final int west_z = forward.getXOffset() * up.getYOffset() - forward.getYOffset() * up.getXOffset();
|
||||
|
||||
EnumFacing west = null;
|
||||
for (final EnumFacing dx : EnumFacing.VALUES) {
|
||||
if (dx.getFrontOffsetX() == west_x && dx.getFrontOffsetY() == west_y && dx.getFrontOffsetZ() == west_z) {
|
||||
if (dx.getXOffset() == west_x && dx.getYOffset() == west_y && dx.getZOffset() == west_z) {
|
||||
west = dx;
|
||||
}
|
||||
}
|
||||
@@ -348,12 +348,12 @@ public abstract class AEBaseBlock extends Block {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
|
||||
String regName = this.getRegistryName() != null ? this.getRegistryName().getPath() : "unregistered";
|
||||
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
protected String getUnlocalizedName(final ItemStack is) {
|
||||
return this.getUnlocalizedName();
|
||||
protected String getTranslationKey(final ItemStack is) {
|
||||
return this.getTranslationKey();
|
||||
}
|
||||
|
||||
protected boolean hasCustomRotation() {
|
||||
|
||||
@@ -38,6 +38,7 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -77,8 +78,9 @@ public class AEBaseItemBlock extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack is) {
|
||||
return this.blockType.getUnlocalizedName(is);
|
||||
@NotNull
|
||||
public String getTranslationKey(final ItemStack is) {
|
||||
return this.blockType.getTranslationKey(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,7 +139,7 @@ public class AEBaseItemBlock extends ItemBlock {
|
||||
ori = ((IOrientableBlock) this.blockType).getOrientable(w, pos);
|
||||
up = side;
|
||||
forward = EnumFacing.SOUTH;
|
||||
if (up.getFrontOffsetY() == 0) {
|
||||
if (up.getYOffset() == 0) {
|
||||
forward = EnumFacing.UP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,12 @@ package appeng.block;
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public abstract class AEBaseStairBlock extends BlockStairs {
|
||||
@@ -30,17 +36,22 @@ public abstract class AEBaseStairBlock extends BlockStairs {
|
||||
super(block.getDefaultState());
|
||||
|
||||
Preconditions.checkNotNull(block);
|
||||
Preconditions.checkNotNull(block.getUnlocalizedName());
|
||||
Preconditions.checkArgument(block.getUnlocalizedName().length() > 0);
|
||||
Preconditions.checkNotNull(block.getTranslationKey());
|
||||
Preconditions.checkArgument(block.getTranslationKey().length() > 0);
|
||||
|
||||
this.setUnlocalizedName("stair." + type);
|
||||
this.setTranslationKey("stair." + type);
|
||||
this.setLightOpacity(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
|
||||
String regName = this.getRegistryName() != null ? this.getRegistryName().getPath() : "unregistered";
|
||||
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSideBlockChestOpening(@Nonnull IBlockState blockState, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
return false;
|
||||
}
|
||||
|
||||
final String name = this.getUnlocalizedName();
|
||||
final String name = this.getTranslationKey();
|
||||
|
||||
if (player.isSneaking()) {
|
||||
final NBTTagCompound data = tileEntity.downloadSettings(SettingsFrom.MEMORY_CARD);
|
||||
@@ -300,7 +300,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
final String savedName = memoryCard.getSettingsName(heldItem);
|
||||
final NBTTagCompound data = memoryCard.getData(heldItem);
|
||||
|
||||
if (this.getUnlocalizedName().equals(savedName)) {
|
||||
if (this.getTranslationKey().equals(savedName)) {
|
||||
tileEntity.uploadSettings(SettingsFrom.MEMORY_CARD, data, player);
|
||||
memoryCard.notifyUser(player, MemoryCardMessages.SETTINGS_LOADED);
|
||||
} else {
|
||||
|
||||
@@ -43,6 +43,7 @@ import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.EnumSet;
|
||||
|
||||
|
||||
@@ -111,7 +112,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class BlockMolecularAssembler extends AEBaseTileBlock {
|
||||
|
||||
@@ -72,7 +74,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock {
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,15 +121,15 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision {
|
||||
final EnumFacing forward = tile.getForward();
|
||||
final AEAxisAlignedBB bb = new AEAxisAlignedBB(twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels);
|
||||
|
||||
if (up.getFrontOffsetX() != 0) {
|
||||
if (up.getXOffset() != 0) {
|
||||
bb.minX = 0;
|
||||
bb.maxX = 1;
|
||||
}
|
||||
if (up.getFrontOffsetY() != 0) {
|
||||
if (up.getYOffset() != 0) {
|
||||
bb.minY = 0;
|
||||
bb.maxY = 1;
|
||||
}
|
||||
if (up.getFrontOffsetZ() != 0) {
|
||||
if (up.getZOffset() != 0) {
|
||||
bb.minZ = 0;
|
||||
bb.maxZ = 1;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class BlockInscriber extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack is) {
|
||||
return super.getUnlocalizedName(is);
|
||||
public String getTranslationKey(final ItemStack is) {
|
||||
return super.getTranslationKey(is);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -115,9 +116,9 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(final World w, final BlockPos pos, final Entity thePlayer, final boolean b) {
|
||||
final EnumFacing up = this.getOrientable(w, pos).getUp();
|
||||
final double xOff = -0.3 * up.getFrontOffsetX();
|
||||
final double yOff = -0.3 * up.getFrontOffsetY();
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
final double xOff = -0.3 * up.getXOffset();
|
||||
final double yOff = -0.3 * up.getYOffset();
|
||||
final double zOff = -0.3 * up.getZOffset();
|
||||
return Collections.singletonList(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
}
|
||||
|
||||
@@ -167,7 +168,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -107,9 +108,9 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(final World w, final BlockPos pos, final Entity e, final boolean isVisual) {
|
||||
final EnumFacing up = this.getOrientable(w, pos).getUp();
|
||||
final double xOff = -0.3 * up.getFrontOffsetX();
|
||||
final double yOff = -0.3 * up.getFrontOffsetY();
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
final double xOff = -0.3 * up.getXOffset();
|
||||
final double yOff = -0.3 * up.getYOffset();
|
||||
final double zOff = -0.3 * up.getZOffset();
|
||||
return Collections.singletonList(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
}
|
||||
|
||||
@@ -134,9 +135,9 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
}
|
||||
|
||||
final EnumFacing up = this.getOrientable(w, pos).getUp();
|
||||
final double xOff = -0.3 * up.getFrontOffsetX();
|
||||
final double yOff = -0.3 * up.getFrontOffsetY();
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
final double xOff = -0.3 * up.getXOffset();
|
||||
final double yOff = -0.3 * up.getYOffset();
|
||||
final double zOff = -0.3 * up.getZOffset();
|
||||
for (int bolts = 0; bolts < 3; bolts++) {
|
||||
if (AppEng.proxy.shouldAddParticles(r)) {
|
||||
final LightningFX fx = new LightningFX(w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D);
|
||||
@@ -192,7 +193,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,9 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
double ry = 0.5 + pos.getY();
|
||||
double rz = 0.5 + pos.getZ();
|
||||
|
||||
rx += up.getFrontOffsetX() * d0;
|
||||
ry += up.getFrontOffsetY() * d0;
|
||||
rz += up.getFrontOffsetZ() * d0;
|
||||
rx += up.getXOffset() * d0;
|
||||
ry += up.getYOffset() * d0;
|
||||
rz += up.getZOffset() * d0;
|
||||
|
||||
final int x = pos.getX();
|
||||
final int y = pos.getY();
|
||||
@@ -103,25 +103,25 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
case 0:
|
||||
dx = 0.6;
|
||||
dz = d1;
|
||||
pt = new BlockPos(x + west.getFrontOffsetX(), y + west.getFrontOffsetY(), z + west.getFrontOffsetZ());
|
||||
pt = new BlockPos(x + west.getXOffset(), y + west.getYOffset(), z + west.getZOffset());
|
||||
|
||||
break;
|
||||
case 1:
|
||||
dx = d1;
|
||||
dz += 0.6;
|
||||
pt = new BlockPos(x + forward.getFrontOffsetX(), y + forward.getFrontOffsetY(), z + forward.getFrontOffsetZ());
|
||||
pt = new BlockPos(x + forward.getXOffset(), y + forward.getYOffset(), z + forward.getZOffset());
|
||||
|
||||
break;
|
||||
case 2:
|
||||
dx = d1;
|
||||
dz = -0.6;
|
||||
pt = new BlockPos(x - forward.getFrontOffsetX(), y - forward.getFrontOffsetY(), z - forward.getFrontOffsetZ());
|
||||
pt = new BlockPos(x - forward.getXOffset(), y - forward.getYOffset(), z - forward.getZOffset());
|
||||
|
||||
break;
|
||||
case 3:
|
||||
dx = -0.6;
|
||||
dz = d1;
|
||||
pt = new BlockPos(x - west.getFrontOffsetX(), y - west.getFrontOffsetY(), z - west.getFrontOffsetZ());
|
||||
pt = new BlockPos(x - west.getXOffset(), y - west.getYOffset(), z - west.getZOffset());
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -130,13 +130,13 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
return;
|
||||
}
|
||||
|
||||
rx += dx * west.getFrontOffsetX();
|
||||
ry += dx * west.getFrontOffsetY();
|
||||
rz += dx * west.getFrontOffsetZ();
|
||||
rx += dx * west.getXOffset();
|
||||
ry += dx * west.getYOffset();
|
||||
rz += dx * west.getZOffset();
|
||||
|
||||
rx += dz * forward.getFrontOffsetX();
|
||||
ry += dz * forward.getFrontOffsetY();
|
||||
rz += dz * forward.getFrontOffsetZ();
|
||||
rx += dz * forward.getXOffset();
|
||||
ry += dz * forward.getYOffset();
|
||||
rz += dz * forward.getZOffset();
|
||||
|
||||
final LightningFX fx = new LightningFX(w, rx, ry, rz, 0.0D, 0.0D, 0.0D);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
|
||||
@@ -37,6 +37,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
@@ -56,7 +57,7 @@ public class BlockSecurityStation extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision {
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
|
||||
if (world.isBlockIndirectlyGettingPowered(pos) > 0) {
|
||||
if (world.getRedstonePowerFromNeighbors(pos) > 0) {
|
||||
this.startFuse(world, pos, null);
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision {
|
||||
public void onBlockAdded(final World w, final BlockPos pos, final IBlockState state) {
|
||||
super.onBlockAdded(w, pos, state);
|
||||
|
||||
if (w.isBlockIndirectlyGettingPowered(pos) > 0) {
|
||||
if (w.getRedstonePowerFromNeighbors(pos) > 0) {
|
||||
this.startFuse(w, pos, null);
|
||||
w.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
@@ -102,20 +102,20 @@ public final class BlockVibrationChamber extends AEBaseTileBlock {
|
||||
final EnumFacing forward = tc.getForward();
|
||||
final EnumFacing up = tc.getUp();
|
||||
|
||||
final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
|
||||
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
|
||||
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
|
||||
final int west_x = forward.getYOffset() * up.getZOffset() - forward.getZOffset() * up.getYOffset();
|
||||
final int west_y = forward.getZOffset() * up.getXOffset() - forward.getXOffset() * up.getZOffset();
|
||||
final int west_z = forward.getXOffset() * up.getYOffset() - forward.getYOffset() * up.getXOffset();
|
||||
|
||||
f1 += forward.getFrontOffsetX() * 0.6;
|
||||
f2 += forward.getFrontOffsetY() * 0.6;
|
||||
f3 += forward.getFrontOffsetZ() * 0.6;
|
||||
f1 += forward.getXOffset() * 0.6;
|
||||
f2 += forward.getYOffset() * 0.6;
|
||||
f3 += forward.getZOffset() * 0.6;
|
||||
|
||||
final float ox = r.nextFloat();
|
||||
final float oy = r.nextFloat() * 0.2f;
|
||||
|
||||
f1 += up.getFrontOffsetX() * (-0.3 + oy);
|
||||
f2 += up.getFrontOffsetY() * (-0.3 + oy);
|
||||
f3 += up.getFrontOffsetZ() * (-0.3 + oy);
|
||||
f1 += up.getXOffset() * (-0.3 + oy);
|
||||
f2 += up.getYOffset() * (-0.3 + oy);
|
||||
f3 += up.getZOffset() * (-0.3 + oy);
|
||||
|
||||
f1 += west_x * (0.3 * ox - 0.15);
|
||||
f2 += west_y * (0.3 * ox - 0.15);
|
||||
|
||||
@@ -44,6 +44,7 @@ import appeng.tile.networking.TileCableBusTESR;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -151,7 +152,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IAEFacade {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(final World w, final BlockPos pos, final IBlockState state, final Entity entityIn) {
|
||||
public void onEntityCollision(final World w, final BlockPos pos, final IBlockState state, final Entity entityIn) {
|
||||
this.cb(w, pos).onEntityCollision(entityIn);
|
||||
}
|
||||
|
||||
@@ -413,6 +414,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IAEFacade {
|
||||
return world.getBlockState(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side) {
|
||||
IFacadeContainer container = this.fc(world, pos);
|
||||
if (container != null) {
|
||||
IFacadePart facade = container.getFacade(AEPartLocation.fromFacing(side));
|
||||
if (facade != null) {
|
||||
return BlockFaceShape.SOLID;
|
||||
}
|
||||
}
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalk(World world, BlockPos pos, Entity entityIn) {
|
||||
IFacadeContainer container = this.fc(world, pos);
|
||||
if (container != null) {
|
||||
IFacadePart facade = container.getFacade(AEPartLocation.fromFacing(EnumFacing.UP));
|
||||
if (facade != null) {
|
||||
facade.getBlockState().getBlock().onEntityWalk(world, pos, entityIn);
|
||||
}
|
||||
}
|
||||
super.onEntityWalk(world, pos, entityIn);
|
||||
}
|
||||
|
||||
public static Class<? extends AEBaseTile> getNoTesrTile() {
|
||||
return noTesrTile;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class BlockController extends AEBaseTileBlock {
|
||||
|
||||
@@ -144,7 +146,7 @@ public class BlockController extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -68,7 +69,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Random;
|
||||
@@ -81,7 +82,7 @@ public class BlockPaint extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision {
|
||||
|
||||
@@ -86,7 +88,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,9 +105,9 @@ class QnbFormedBakedModel implements IBakedModel {
|
||||
for (EnumFacing facing : EnumFacing.values()) {
|
||||
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
|
||||
// (avoids z-fighting)
|
||||
float xOffset = Math.abs(facing.getFrontOffsetX() * 0.01f);
|
||||
float yOffset = Math.abs(facing.getFrontOffsetY() * 0.01f);
|
||||
float zOffset = Math.abs(facing.getFrontOffsetZ() * 0.01f);
|
||||
float xOffset = Math.abs(facing.getXOffset() * 0.01f);
|
||||
float yOffset = Math.abs(facing.getYOffset() * 0.01f);
|
||||
float zOffset = Math.abs(facing.getZOffset() * 0.01f);
|
||||
|
||||
builder.setDrawFaces(EnumSet.of(facing));
|
||||
builder.addCube(
|
||||
@@ -130,9 +130,9 @@ class QnbFormedBakedModel implements IBakedModel {
|
||||
for (EnumFacing facing : EnumFacing.values()) {
|
||||
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
|
||||
// (avoids z-fighting)
|
||||
float xOffset = Math.abs(facing.getFrontOffsetX() * 0.01f);
|
||||
float yOffset = Math.abs(facing.getFrontOffsetY() * 0.01f);
|
||||
float zOffset = Math.abs(facing.getFrontOffsetZ() * 0.01f);
|
||||
float xOffset = Math.abs(facing.getXOffset() * 0.01f);
|
||||
float yOffset = Math.abs(facing.getYOffset() * 0.01f);
|
||||
float zOffset = Math.abs(facing.getZOffset() * 0.01f);
|
||||
|
||||
builder.setDrawFaces(EnumSet.of(facing));
|
||||
builder.addCube(
|
||||
|
||||
@@ -26,12 +26,15 @@ import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -39,8 +42,11 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class BlockSpatialIOPort extends AEBaseTileBlock {
|
||||
|
||||
public static final PropertyBool POWERED = PropertyBool.create("powered");
|
||||
|
||||
public BlockSpatialIOPort() {
|
||||
super(Material.IRON);
|
||||
setDefaultState(getDefaultState().withProperty(POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +57,19 @@ public class BlockSpatialIOPort extends AEBaseTileBlock {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
|
||||
TileSpatialIOPort te = this.getTileEntity(worldIn, pos);
|
||||
boolean powered = te != null && te.isActive();
|
||||
return super.getActualState(state, worldIn, pos)
|
||||
.withProperty(POWERED, powered);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProperty[] getAEStates() {
|
||||
return new IProperty[]{POWERED};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(final World w, final BlockPos pos, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
|
||||
if (p.isSneaking()) {
|
||||
|
||||
@@ -34,6 +34,8 @@ import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class BlockSpatialPylon extends AEBaseTileBlock {
|
||||
|
||||
@@ -83,7 +85,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
@@ -56,7 +57,7 @@ public class BlockChest extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
@@ -52,7 +53,7 @@ public class BlockDrive extends AEBaseTileBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.block.storage;
|
||||
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
@@ -26,12 +27,15 @@ import appeng.tile.storage.TileIOPort;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -39,15 +43,34 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class BlockIOPort extends AEBaseTileBlock {
|
||||
|
||||
public static final PropertyBool POWERED = PropertyBool.create("powered");
|
||||
|
||||
public BlockIOPort() {
|
||||
super(Material.IRON);
|
||||
setDefaultState(getDefaultState().withProperty(POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
|
||||
TileIOPort te = this.getTileEntity(worldIn, pos);
|
||||
boolean powred = te != null && te.isActive();
|
||||
|
||||
return super.getActualState(state, worldIn, pos)
|
||||
.withProperty(POWERED, powred);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProperty[] getAEStates() {
|
||||
return new IProperty[]{POWERED};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
|
||||
final TileIOPort te = this.getTileEntity(world, pos);
|
||||
if (te != null) {
|
||||
te.updateRedstoneState();
|
||||
if (te.getInstalledUpgrades(Upgrades.REDSTONE) != 0) {
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -48,6 +50,8 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision {
|
||||
private static final double AABB_OFFSET_SIDES = 0.06;
|
||||
private static final double AABB_OFFSET_TOP = 0.125;
|
||||
|
||||
public static final PropertyBool NATURAL = PropertyBool.create("natural");
|
||||
|
||||
public enum SkyChestType {
|
||||
STONE, BLOCK
|
||||
}
|
||||
@@ -61,6 +65,22 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision {
|
||||
this.setHardness(50);
|
||||
this.blockResistance = 150.0f;
|
||||
this.type = type;
|
||||
setDefaultState(getDefaultState().withProperty(NATURAL, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProperty[] getAEStates() {
|
||||
return new IProperty[]{NATURAL};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(NATURAL) ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(NATURAL, meta == 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,18 +119,18 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision {
|
||||
o = sk.getUp();
|
||||
}
|
||||
|
||||
final double offsetX = o.getFrontOffsetX() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetY = o.getFrontOffsetY() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetZ = o.getFrontOffsetZ() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetX = o.getXOffset() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetY = o.getYOffset() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
final double offsetZ = o.getZOffset() == 0 ? AABB_OFFSET_SIDES : 0.0;
|
||||
|
||||
// for x/z top and bottom is swapped
|
||||
final double minX = Math.max(0.0, offsetX + (o.getFrontOffsetX() < 0 ? AABB_OFFSET_BOTTOM : (o.getFrontOffsetX() * AABB_OFFSET_TOP)));
|
||||
final double minY = Math.max(0.0, offsetY + (o.getFrontOffsetY() < 0 ? AABB_OFFSET_TOP : (o.getFrontOffsetY() * AABB_OFFSET_BOTTOM)));
|
||||
final double minZ = Math.max(0.0, offsetZ + (o.getFrontOffsetZ() < 0 ? AABB_OFFSET_BOTTOM : (o.getFrontOffsetZ() * AABB_OFFSET_TOP)));
|
||||
final double minX = Math.max(0.0, offsetX + (o.getXOffset() < 0 ? AABB_OFFSET_BOTTOM : (o.getXOffset() * AABB_OFFSET_TOP)));
|
||||
final double minY = Math.max(0.0, offsetY + (o.getYOffset() < 0 ? AABB_OFFSET_TOP : (o.getYOffset() * AABB_OFFSET_BOTTOM)));
|
||||
final double minZ = Math.max(0.0, offsetZ + (o.getZOffset() < 0 ? AABB_OFFSET_BOTTOM : (o.getZOffset() * AABB_OFFSET_TOP)));
|
||||
|
||||
final double maxX = Math.min(1.0, 1.0 - offsetX - (o.getFrontOffsetX() < 0 ? AABB_OFFSET_TOP : (o.getFrontOffsetX() * AABB_OFFSET_BOTTOM)));
|
||||
final double maxY = Math.min(1.0, 1.0 - offsetY - (o.getFrontOffsetY() < 0 ? AABB_OFFSET_BOTTOM : (o.getFrontOffsetY() * AABB_OFFSET_TOP)));
|
||||
final double maxZ = Math.min(1.0, 1.0 - offsetZ - (o.getFrontOffsetZ() < 0 ? AABB_OFFSET_TOP : (o.getFrontOffsetZ() * AABB_OFFSET_BOTTOM)));
|
||||
final double maxX = Math.min(1.0, 1.0 - offsetX - (o.getXOffset() < 0 ? AABB_OFFSET_TOP : (o.getXOffset() * AABB_OFFSET_BOTTOM)));
|
||||
final double maxY = Math.min(1.0, 1.0 - offsetY - (o.getYOffset() < 0 ? AABB_OFFSET_BOTTOM : (o.getYOffset() * AABB_OFFSET_TOP)));
|
||||
final double maxZ = Math.min(1.0, 1.0 - offsetZ - (o.getZOffset() < 0 ? AABB_OFFSET_TOP : (o.getZOffset() * AABB_OFFSET_BOTTOM)));
|
||||
|
||||
return new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,10 @@ public enum DriveSlotState implements IStringSerializable {
|
||||
TYPES_FULL("types_full"),
|
||||
|
||||
// Completely full
|
||||
FULL("full");
|
||||
FULL("full"),
|
||||
|
||||
// Online and completely empty
|
||||
NO_CONTENTS("no_contents");
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -64,6 +67,8 @@ public enum DriveSlotState implements IStringSerializable {
|
||||
return DriveSlotState.TYPES_FULL;
|
||||
case 3:
|
||||
return DriveSlotState.FULL;
|
||||
case 4:
|
||||
return DriveSlotState.NO_CONTENTS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ class BlockDefinitionBuilder implements IBlockBuilder {
|
||||
// Create block and matching item, and set factory name of both
|
||||
Block block = this.blockSupplier.get();
|
||||
block.setRegistryName(AppEng.MOD_ID, this.registryName);
|
||||
block.setUnlocalizedName("appliedenergistics2." + this.registryName);
|
||||
block.setTranslationKey("appliedenergistics2." + this.registryName);
|
||||
|
||||
ItemBlock item = this.constructItemFromBlock(block);
|
||||
if (item != null) {
|
||||
|
||||
@@ -25,21 +25,31 @@ import appeng.bootstrap.components.StateMapperComponent;
|
||||
import appeng.bootstrap.components.TesrComponent;
|
||||
import appeng.client.render.model.AutoRotatingModel;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.resource.IResourceType;
|
||||
import net.minecraftforge.client.resource.ISelectiveResourceReloadListener;
|
||||
import net.minecraftforge.client.resource.VanillaResourceType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
class BlockRendering implements IBlockRendering {
|
||||
class BlockRendering implements IBlockRendering, ISelectiveResourceReloadListener {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> modelCustomizer;
|
||||
@@ -56,6 +66,13 @@ class BlockRendering implements IBlockRendering {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private final Map<String, IModel> builtInModels = new HashMap<>();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private final List<IResourceManagerReloadListener> reloads = new ArrayList<>();
|
||||
|
||||
BlockRendering() {
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IBlockRendering modelCustomizer(BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer) {
|
||||
@@ -99,11 +116,15 @@ class BlockRendering implements IBlockRendering {
|
||||
}
|
||||
|
||||
if (this.modelCustomizer != null) {
|
||||
factory.addModelOverride(block.getRegistryName().getResourcePath(), this.modelCustomizer);
|
||||
factory.addModelOverride(block.getRegistryName().getPath(), this.modelCustomizer);
|
||||
} else if (block instanceof AEBaseTileBlock) {
|
||||
// This is a default rotating model if the base-block uses an AE tile entity which exposes UP/FRONT as
|
||||
// extended props
|
||||
factory.addModelOverride(block.getRegistryName().getResourcePath(), (l, m) -> new AutoRotatingModel(m));
|
||||
factory.addModelOverride(block.getRegistryName().getPath(), (l, m) -> {
|
||||
AutoRotatingModel model = new AutoRotatingModel(m);
|
||||
BlockRendering.this.reloads.add(model);
|
||||
return model;
|
||||
});
|
||||
}
|
||||
|
||||
// TODO : 1.12
|
||||
@@ -117,4 +138,13 @@ class BlockRendering implements IBlockRendering {
|
||||
factory.addBootstrapComponent(new StateMapperComponent(block, this.stateMapper));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onResourceManagerReload(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate) {
|
||||
if (resourcePredicate.test(VanillaResourceType.MODELS)) {
|
||||
this.reloads.forEach(listener -> listener.onResourceManagerReload(resourceManager));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ class ItemDefinitionBuilder implements IItemBuilder {
|
||||
|
||||
ItemDefinition definition = new ItemDefinition(this.registryName, item);
|
||||
|
||||
item.setUnlocalizedName("appliedenergistics2." + this.registryName);
|
||||
item.setTranslationKey("appliedenergistics2." + this.registryName);
|
||||
item.setCreativeTab(this.creativeTab);
|
||||
|
||||
// Register all extra handlers
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ModelOverrideComponent implements IPreInitComponent {
|
||||
IModel missingModel = ModelLoaderRegistry.getMissingModel();
|
||||
|
||||
for (ModelResourceLocation location : keys) {
|
||||
if (!location.getResourceDomain().equals(AppEng.MOD_ID)) {
|
||||
if (!location.getNamespace().equals(AppEng.MOD_ID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ModelOverrideComponent implements IPreInitComponent {
|
||||
continue;
|
||||
}
|
||||
|
||||
BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getResourcePath());
|
||||
BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getPath());
|
||||
if (customizer != null) {
|
||||
IBakedModel newModel = customizer.apply(location, orgModel);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import appeng.api.parts.CableRenderMode;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.render.crafting.ItemEncodedPatternBakedModel;
|
||||
import appeng.client.render.effects.*;
|
||||
import appeng.client.render.model.UVLModelLoader;
|
||||
import appeng.client.render.tesr.InscriberTESR;
|
||||
@@ -30,9 +31,11 @@ import appeng.client.render.textures.ParticleTextures;
|
||||
import appeng.container.interfaces.IJEIGhostIngredients;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketAssemblerAnimation;
|
||||
import appeng.core.sync.packets.PacketTerminalUse;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.entity.EntityFloatingItem;
|
||||
import appeng.entity.EntityTinyTNTPrimed;
|
||||
@@ -42,6 +45,8 @@ import appeng.helpers.HighlighterHandler;
|
||||
import appeng.helpers.IMouseWheelItem;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.hooks.TickHandler.PlayerColor;
|
||||
import appeng.items.tools.powered.Terminal;
|
||||
import appeng.items.tools.powered.ToolWirelessTerminal;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -57,12 +62,19 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.settings.KeyConflictContext;
|
||||
import net.minecraftforge.client.settings.KeyModifier;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -71,11 +83,17 @@ import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import static appeng.client.KeyBindings.WCT;
|
||||
import static appeng.client.KeyBindings.WFT;
|
||||
import static appeng.client.KeyBindings.WPT;
|
||||
import static appeng.client.KeyBindings.WT;
|
||||
|
||||
|
||||
public class ClientHelper extends ServerHelper {
|
||||
private final static String KEY_CATEGORY = "key.appliedenergistics2.category";
|
||||
public final static String KEY_CATEGORY = "key.appliedenergistics2.category";
|
||||
|
||||
private final EnumMap<ActionKey, KeyBinding> bindings = new EnumMap<>(ActionKey.class);
|
||||
private final List<KeyBinding> keyBindings = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void preinit() {
|
||||
@@ -96,6 +114,14 @@ public class ClientHelper extends ServerHelper {
|
||||
ClientRegistry.registerKeyBinding(binding);
|
||||
this.bindings.put(key, binding);
|
||||
}
|
||||
|
||||
for (KeyBindings k : KeyBindings.values()) {
|
||||
ClientRegistry.registerKeyBinding(k.getKeyBinding());
|
||||
this.keyBindings.add(k.getKeyBinding());
|
||||
}
|
||||
|
||||
Api.INSTANCE.definitions().items().encodedPattern().maybeItem().ifPresent(pattern ->
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(ItemEncodedPatternBakedModel.PATTERN_ITEM_COLOR_HANDLER, pattern));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -314,6 +340,23 @@ public class ClientHelper extends ServerHelper {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onInputEvent(final InputEvent.KeyInputEvent event) {
|
||||
for (KeyBinding k : keyBindings) {
|
||||
if (k.isPressed()) {
|
||||
if (k == WT.getKeyBinding()) {
|
||||
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_TERMINAL));
|
||||
} else if (k == WCT.getKeyBinding()) {
|
||||
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_CRAFTING_TERMINAL));
|
||||
} else if (k == WPT.getKeyBinding()) {
|
||||
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_PATTERN_TERMINAL));
|
||||
} else if (k == WFT.getKeyBinding()) {
|
||||
NetworkHandler.instance().sendToServer(new PacketTerminalUse(Terminal.WIRELESS_FLUID_TERMINAL));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTextureStitch(final TextureStitchEvent.Pre event) {
|
||||
ParticleTextures.registerSprite(event);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package appeng.client;
|
||||
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraftforge.client.settings.KeyConflictContext;
|
||||
import net.minecraftforge.client.settings.KeyModifier;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import static appeng.client.ClientHelper.KEY_CATEGORY;
|
||||
|
||||
|
||||
public enum KeyBindings {
|
||||
WT(new KeyBinding("key.open_wireless_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_T, KEY_CATEGORY)),
|
||||
WCT(new KeyBinding("key.open_wireless_crafting_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_E, KEY_CATEGORY)),
|
||||
WPT(new KeyBinding("key.open_wireless_pattern_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_R, KEY_CATEGORY)),
|
||||
WFT(new KeyBinding("key.open_wireless_fluid_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY));
|
||||
|
||||
private KeyBinding keyBinding;
|
||||
|
||||
KeyBindings(KeyBinding keyBinding) {
|
||||
this.keyBinding = keyBinding;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public KeyBinding getKeyBinding() {
|
||||
return keyBinding;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.fluids.client.render.FluidStackSizeRenderer;
|
||||
import appeng.fluids.container.slots.IMEFluidSlot;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.google.common.base.Joiner;
|
||||
@@ -48,6 +49,7 @@ import mezz.jei.api.gui.IGhostIngredientHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -67,13 +69,11 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import yalter.mousetweaks.api.IMTModGuiContainer2;
|
||||
import yalter.mousetweaks.api.MouseTweaksIgnore;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
@@ -86,8 +86,8 @@ import static appeng.integration.modules.jei.JEIPlugin.aeGuiHandler;
|
||||
import static appeng.integration.modules.jei.JEIPlugin.runtime;
|
||||
|
||||
|
||||
@Optional.Interface(iface = "yalter.mousetweaks.api.IMTModGuiContainer2", modid = "mousetweaks")
|
||||
public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContainer2 {
|
||||
@MouseTweaksIgnore
|
||||
public abstract class AEBaseGui extends GuiContainer {
|
||||
private final List<InternalSlotME> meSlots = new ArrayList<>();
|
||||
// drag y
|
||||
private final Set<Slot> drag_click = new HashSet<>();
|
||||
@@ -567,7 +567,10 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
||||
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
stack = ((SlotME) slot).getAEStack();
|
||||
|
||||
if (stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack().isEmpty()) {
|
||||
if (stack != null
|
||||
&& action == InventoryAction.PICKUP_OR_SET_DOWN
|
||||
&& (stack.getStackSize() == 0 || GuiScreen.isAltKeyDown())
|
||||
&& player.inventory.getItemStack().isEmpty()) {
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
}
|
||||
|
||||
@@ -897,9 +900,43 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
||||
}
|
||||
}
|
||||
if (s instanceof SlotPlayerInv || s instanceof SlotPlayerHotBar) {
|
||||
super.drawSlot(s);
|
||||
if (!is.isEmpty() && is.getItem() instanceof ItemEncodedPattern) {
|
||||
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
final ItemStack out = iep.getOutput(is);
|
||||
if (!out.isEmpty()) {
|
||||
AppEngSlot appEngSlot = ((AppEngSlot) s);
|
||||
appEngSlot.setDisplay(true);
|
||||
appEngSlot.setReturnAsSingleStack(true);
|
||||
|
||||
this.zLevel = 100.0F;
|
||||
this.itemRender.zLevel = 100.0F;
|
||||
|
||||
if (!this.isPowered()) {
|
||||
drawRect(s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
|
||||
}
|
||||
|
||||
this.zLevel = 0.0F;
|
||||
this.itemRender.zLevel = 0.0F;
|
||||
|
||||
// Annoying but easier than trying to splice into render item
|
||||
super.drawSlot(s);
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
this.stackSizeRenderer.renderStackSize(this.fontRenderer, AEItemStack.fromItemStack(out), s.xPos, s.yPos);
|
||||
} else {
|
||||
super.drawSlot(s);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
super.drawSlot(s);
|
||||
}
|
||||
} else if (s instanceof AppEngSlot) {
|
||||
AppEngSlot appEngSlot = ((AppEngSlot) s);
|
||||
if (s.getStack().isEmpty()) {
|
||||
super.drawSlot(s);
|
||||
return;
|
||||
}
|
||||
appEngSlot.setDisplay(true);
|
||||
appEngSlot.setReturnAsSingleStack(true);
|
||||
|
||||
@@ -951,47 +988,4 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
||||
protected List<InternalSlotME> getMeSlots() {
|
||||
return this.meSlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public boolean MT_isMouseTweaksDisabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public boolean MT_isWheelTweakDisabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public Container MT_getContainer() {
|
||||
return this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public Slot MT_getSlotUnderMouse() {
|
||||
return getSlotUnderMouse();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public boolean MT_isCraftingOutput(Slot slot) {
|
||||
return slot instanceof SlotOutput || slot instanceof AppEngCraftingSlot;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public boolean MT_isIgnored(Slot slot) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "mousetweaks")
|
||||
public boolean MT_disableRMBDraggingFunctionality() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ public abstract class AEBaseMEGui extends AEBaseGui {
|
||||
currentToolTip.add(format);
|
||||
}
|
||||
|
||||
if (myStack.isCraftable() && AEConfig.instance().isShowCraftableTooltip()) {
|
||||
final String local = ButtonToolTips.ItemsCraftable.getLocal();
|
||||
currentToolTip.add(TextFormatting.GRAY + local);
|
||||
}
|
||||
|
||||
this.drawHoveringText(currentToolTip, x, y, this.fontRenderer);
|
||||
|
||||
return;
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.gui.implementations;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
@@ -97,9 +98,8 @@ public class GuiCraftAmount extends AEBaseGui {
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (target instanceof WirelessTerminalGuiObject) {
|
||||
myIcon = definitions.items().wirelessTerminal().maybeStack(1).orElse(myIcon);
|
||||
|
||||
this.originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
myIcon = ((WirelessTerminalGuiObject) target).getItemStack();
|
||||
this.originalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(myIcon).getGuiHandler(myIcon);
|
||||
}
|
||||
|
||||
if (target instanceof PartTerminal) {
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -84,7 +85,8 @@ public class GuiCraftConfirm extends AEBaseGui {
|
||||
this.ccc.setGui(this);
|
||||
|
||||
if (te instanceof WirelessTerminalGuiObject) {
|
||||
this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
ItemStack itemStack = ((WirelessTerminalGuiObject) te).getItemStack();
|
||||
this.OriginalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(itemStack).getGuiHandler(itemStack);
|
||||
}
|
||||
|
||||
if (te instanceof PartTerminal) {
|
||||
|
||||
@@ -26,6 +26,7 @@ package appeng.client.gui.implementations;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -33,6 +34,7 @@ import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.CraftingCPUStatus;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.features.registries.WirelessRegistry;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
@@ -84,9 +86,8 @@ public class GuiCraftingStatus extends GuiCraftingCPU {
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (target instanceof WirelessTerminalGuiObject) {
|
||||
this.myIcon = definitions.items().wirelessTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
|
||||
this.originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
myIcon = ((WirelessTerminalGuiObject) target).getItemStack();
|
||||
this.originalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(myIcon).getGuiHandler(myIcon);
|
||||
}
|
||||
|
||||
if (target instanceof PartTerminal) {
|
||||
|
||||
@@ -82,8 +82,4 @@ public class GuiCraftingTerm extends GuiMEMonitorable {
|
||||
protected String getBackground() {
|
||||
return "guis/crafting.png";
|
||||
}
|
||||
|
||||
public ItemRepo getRepo() {
|
||||
return this.repo;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-6
@@ -35,6 +35,7 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.fluids.client.gui.widgets.GuiFluidTank;
|
||||
import appeng.fluids.helper.DualityFluidInterface;
|
||||
import appeng.fluids.util.AEFluidStack;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.parts.reporting.PartFluidInterfaceConfigurationTerminal;
|
||||
@@ -155,7 +156,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
|
||||
int extraLines = numUpgradesMap.get(inv);
|
||||
|
||||
for (int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row) {
|
||||
for (int z = 0; z < 5; z++) {
|
||||
for (int z = 0; z < DualityFluidInterface.NUMBER_OF_TANKS; z++) {
|
||||
GuiFluidTank tankSlot;
|
||||
if (!matchedInterfaces.contains(inv) && !this.matchedStacks.contains(inv.getInventory().getFluidInSlot(z + (row * 5)))) {
|
||||
tankSlot = new GuiFluidTank(inv.getInventory(), z + (row * 5), z + (row * 5), (z * 18 + 22), offset, 16, 16, true);
|
||||
@@ -243,7 +244,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalFluidInv) {
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
final int width = 5 * 18;
|
||||
final int width = DualityFluidInterface.NUMBER_OF_TANKS * 18;
|
||||
|
||||
int extraLines = numUpgradesMap.get(lineObj);
|
||||
|
||||
@@ -393,7 +394,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean foundMatchingItemStack = false;
|
||||
boolean foundMatchingFluidStack = false;
|
||||
|
||||
final String displayName = Platform.getFluidDisplayName(iaeFluidStack).toLowerCase();
|
||||
|
||||
@@ -404,10 +405,12 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
|
||||
return false;
|
||||
}
|
||||
} else if (displayName.contains(term)) {
|
||||
foundMatchingItemStack = true;
|
||||
foundMatchingFluidStack = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return foundMatchingItemStack;
|
||||
return foundMatchingFluidStack;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -447,7 +450,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
|
||||
ClientDCInternalFluidInv o = this.byId.get(id);
|
||||
|
||||
if (o == null) {
|
||||
this.byId.put(id, o = new ClientDCInternalFluidInv(5, id, sortBy, string, 1000));
|
||||
this.byId.put(id, o = new ClientDCInternalFluidInv(DualityFluidInterface.NUMBER_OF_TANKS, id, sortBy, string, 1000));
|
||||
this.refreshList = true;
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -61,6 +61,7 @@ import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static appeng.client.render.BlockPosHighlighter.hilightBlock;
|
||||
import static appeng.helpers.ItemStackHelper.stackFromNBT;
|
||||
|
||||
|
||||
public class GuiInterfaceConfigurationTerminal extends AEBaseGui implements IJEIGhostIngredients {
|
||||
@@ -299,11 +300,7 @@ public class GuiInterfaceConfigurationTerminal extends AEBaseGui implements IJEI
|
||||
for (int x = 0; x < current.getInventory().getSlots(); x++) {
|
||||
final String which = Integer.toString(x);
|
||||
if (invData.hasKey(which)) {
|
||||
NBTTagCompound tag = invData.getCompoundTag(which);
|
||||
current.getInventory().setStackInSlot(x, new ItemStack(tag));
|
||||
if (tag.hasKey("stackSize")) {
|
||||
current.getInventory().getStackInSlot(x).setCount(tag.getInteger("stackSize"));
|
||||
}
|
||||
current.getInventory().setStackInSlot(x, stackFromNBT(invData.getCompoundTag(which)));
|
||||
}
|
||||
}
|
||||
} catch (final NumberFormatException ignored) {
|
||||
@@ -412,6 +409,8 @@ public class GuiInterfaceConfigurationTerminal extends AEBaseGui implements IJEI
|
||||
}
|
||||
} else if (displayName.contains(term)) {
|
||||
foundMatchingItemStack = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return foundMatchingItemStack;
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.gui.implementations;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
@@ -30,6 +31,8 @@ import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.client.me.ClientDCInternalInv;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
import appeng.container.implementations.ContainerInterfaceTerminal;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.helpers.DualityInterface;
|
||||
import appeng.parts.reporting.PartInterfaceTerminal;
|
||||
@@ -39,6 +42,7 @@ import com.google.common.collect.HashMultimap;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -46,20 +50,35 @@ import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import static appeng.client.render.BlockPosHighlighter.hilightBlock;
|
||||
import static appeng.helpers.ItemStackHelper.stackFromNBT;
|
||||
|
||||
|
||||
public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
|
||||
private static final int LINES_ON_PAGE = 6;
|
||||
private int rows = 6;
|
||||
|
||||
// TODO: copied from GuiMEMonitorable. It looks not changed, maybe unneeded?
|
||||
private final int offsetX = 21;
|
||||
private int maxRows = Integer.MAX_VALUE;
|
||||
|
||||
protected int jeiOffset = Loader.isModLoaded("jei") ? 24 : 0;
|
||||
|
||||
private int reservedSpace = 0;
|
||||
|
||||
private final HashMap<Long, ClientDCInternalInv> byId = new HashMap<>();
|
||||
private final HashMultimap<String, ClientDCInternalInv> byName = HashMultimap.create();
|
||||
@@ -78,7 +97,10 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
private final PartInterfaceTerminal partInterfaceTerminal;
|
||||
private GuiButton guiButtonHide;
|
||||
private GuiButton guiButtonNextAssembler;
|
||||
private GuiImgButton terminalStyleBox;
|
||||
|
||||
private final HashMap<ClientDCInternalInv, Integer> dimHashMap = new HashMap<>();
|
||||
private int drawnRows = 0;
|
||||
|
||||
public GuiInterfaceTerminal(final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te) {
|
||||
super(new ContainerInterfaceTerminal(inventoryPlayer, te));
|
||||
@@ -88,10 +110,33 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
this.setScrollBar(scrollbar);
|
||||
this.xSize = 208;
|
||||
this.ySize = 255;
|
||||
this.setReservedSpace(82);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
this.maxRows = AEConfig.instance()
|
||||
.getConfigManager()
|
||||
.getSetting(
|
||||
Settings.TERMINAL_STYLE) != TerminalStyle.TALL ? 6 : Integer.MAX_VALUE;
|
||||
|
||||
final int magicNumber = 82 + 14;
|
||||
final int extraSpace = this.height - magicNumber - this.reservedSpace;
|
||||
|
||||
this.rows = (int) Math.floor(extraSpace / 18);
|
||||
if (this.rows > this.maxRows) {
|
||||
this.rows = this.maxRows;
|
||||
}
|
||||
|
||||
if (this.rows < 6) {
|
||||
this.rows = 6;
|
||||
}
|
||||
|
||||
this.ySize = magicNumber + this.rows * 18 + this.reservedSpace;
|
||||
// this.guiTop = top;
|
||||
final int unusedSpace = this.height - this.ySize;
|
||||
this.guiTop = (int) Math.floor(unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f));
|
||||
|
||||
super.initGui();
|
||||
|
||||
this.getScrollBar().setLeft(189);
|
||||
@@ -114,6 +159,17 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
|
||||
this.searchFieldInputs.setText(partInterfaceTerminal.in);
|
||||
this.searchFieldOutputs.setText(partInterfaceTerminal.out);
|
||||
|
||||
this.fontRenderer.drawString(this.getGuiDisplayName(GuiText.InterfaceTerminal.getLocal()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(GuiText.inventory.getLocal(), this.offsetX + 2, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
}
|
||||
|
||||
protected void repositionSlot(final AppEngSlot s) {
|
||||
this.ySize = 82 + 14 + this.drawnRows * 18 + this.reservedSpace;
|
||||
|
||||
s.yPos = s.getY() + this.ySize - 112;
|
||||
s.xPos = s.getX() + 14;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,13 +178,18 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
super.onGuiClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Rectangle> getJEIExclusionArea() {
|
||||
Rectangle tallButton = new Rectangle(this.guiLeft - 18, this.guiTop + 24 + jeiOffset, 18, 18);
|
||||
List<Rectangle> area = new ArrayList<>();
|
||||
area.add(tallButton);
|
||||
return area;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.buttonList.clear();
|
||||
|
||||
this.fontRenderer.drawString(this.getGuiDisplayName(GuiText.InterfaceTerminal.getLocal()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(GuiText.inventory.getLocal(), this.offsetX + 2, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
final int currentScroll = this.getScrollBar().getCurrentScroll();
|
||||
|
||||
this.guiButtonNextAssembler = new GuiImgButton(guiLeft + 123, guiTop + 25, Settings.ACTIONS, ActionItems.FREE_MOLECULAR_SLOT_SHORTCUT);
|
||||
@@ -137,11 +198,23 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
guiButtonHide = new GuiImgButton(guiLeft + 141, guiTop + 25, Settings.ACTIONS, this.partInterfaceTerminal.onlyInterfacesWithFreeSlots ? ActionItems.TOGGLE_SHOW_FULL_INTERFACES_OFF : ActionItems.TOGGLE_SHOW_FULL_INTERFACES_ON);
|
||||
this.buttonList.add(guiButtonHide);
|
||||
|
||||
this.buttonList.add(this.terminalStyleBox = new GuiImgButton(this.guiLeft - 18, guiTop + 24 + jeiOffset, Settings.TERMINAL_STYLE, AEConfig.instance()
|
||||
.getConfigManager()
|
||||
.getSetting(Settings.TERMINAL_STYLE)));
|
||||
|
||||
this.inventorySlots.inventorySlots.removeIf(slot -> slot instanceof SlotDisconnected);
|
||||
|
||||
for (final Slot s : this.inventorySlots.inventorySlots) {
|
||||
if (s instanceof AppEngSlot) {
|
||||
if (s.xPos < 197) {
|
||||
this.repositionSlot((AppEngSlot) s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int offset = 52;
|
||||
int linesDraw = 0;
|
||||
for (int x = 0; x < LINES_ON_PAGE && linesDraw < LINES_ON_PAGE && currentScroll + x < this.lines.size(); x++) {
|
||||
for (int x = 0; x < rows && linesDraw < rows && currentScroll + x < this.lines.size(); x++) {
|
||||
final Object lineObj = this.lines.get(currentScroll + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
@@ -151,7 +224,7 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
this.buttonList.add(guiButton);
|
||||
int extraLines = numUpgradesMap.get(inv);
|
||||
|
||||
for (int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row) {
|
||||
for (int row = 0; row < 1 + extraLines && linesDraw < rows; ++row) {
|
||||
for (int z = 0; z < 9; z++) {
|
||||
this.inventorySlots.inventorySlots.add(new SlotDisconnected(inv, z + (row * 9), (z * 18 + 22), offset));
|
||||
if (this.matchedStacks.contains(inv.getInventory().getStackInSlot(z + (row * 9)))) {
|
||||
@@ -226,6 +299,25 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
mc.player.closeScreen();
|
||||
}
|
||||
|
||||
if (btn instanceof GuiImgButton) {
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if (iBtn.getSetting() != Settings.ACTIONS) {
|
||||
final Enum cv = iBtn.getCurrentValue();
|
||||
final Enum next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
|
||||
if (btn == this.terminalStyleBox) {
|
||||
AEConfig.instance().getConfigManager().putSetting(iBtn.getSetting(), next);
|
||||
}
|
||||
|
||||
iBtn.set(next);
|
||||
|
||||
if (next.getClass() == TerminalStyle.class) {
|
||||
this.reinitalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (btn == guiButtonHide) {
|
||||
partInterfaceTerminal.onlyInterfacesWithFreeSlots = !partInterfaceTerminal.onlyInterfacesWithFreeSlots;
|
||||
this.refreshList();
|
||||
@@ -246,15 +338,21 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
}
|
||||
}
|
||||
|
||||
private void reinitalize() {
|
||||
this.buttonList.clear();
|
||||
this.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.bindTexture("guis/newinterfaceterminal.png");
|
||||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize);
|
||||
//split the texture for the top
|
||||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, 166);
|
||||
|
||||
int offset = 51;
|
||||
final int ex = this.getScrollBar().getCurrentScroll();
|
||||
int linesDraw = 0;
|
||||
for (int x = 0; x < LINES_ON_PAGE && linesDraw < LINES_ON_PAGE && ex + x < this.lines.size(); x++) {
|
||||
for (int x = 0; x < rows && linesDraw < rows && ex + x < this.lines.size(); x++) {
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
@@ -262,16 +360,38 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
|
||||
int extraLines = numUpgradesMap.get(lineObj);
|
||||
|
||||
for (int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row) {
|
||||
for (int row = 0; row < 1 + extraLines && linesDraw < rows; ++row) {
|
||||
if (linesDraw == 6) {
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset + 7, 0, 166, 190, 7);
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset + 14, 0, 166, 190, 4);
|
||||
} else if (linesDraw >= 7) {
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset, 0, 173, 190, 18);
|
||||
}
|
||||
this.drawTexturedModalRect(offsetX + 20, offsetY + offset, 20, 173, width, 18);
|
||||
|
||||
offset += 18;
|
||||
linesDraw++;
|
||||
}
|
||||
} else {
|
||||
if (linesDraw == 6) {
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset + 7, 0, 166, 190, 7);
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset + 14, 0, 166, 190, 4);
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset, 0, 53, 183, 18);
|
||||
} else if (linesDraw >= 7) {
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset, 0, 53, 183, 18);
|
||||
this.drawTexturedModalRect(offsetX + 183, offsetY + offset, 183, 166, 7, 18);
|
||||
}
|
||||
offset += 18;
|
||||
linesDraw++;
|
||||
}
|
||||
}
|
||||
offset = 51 + Math.max(6 * 18, linesDraw * 18);
|
||||
if (linesDraw > 6) {
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset, 0, 166, 190, 7);
|
||||
}
|
||||
this.drawTexturedModalRect(offsetX, offsetY + offset + 7, 0, 166, this.xSize, 90);
|
||||
|
||||
this.drawnRows = Math.max(6, linesDraw);
|
||||
|
||||
if (this.searchFieldInputs != null) {
|
||||
this.searchFieldInputs.drawTextBox();
|
||||
@@ -321,7 +441,7 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
for (int x = 0; x < current.getInventory().getSlots(); x++) {
|
||||
final String which = Integer.toString(x);
|
||||
if (invData.hasKey(which)) {
|
||||
current.getInventory().setStackInSlot(x, new ItemStack(invData.getCompoundTag(which)));
|
||||
current.getInventory().setStackInSlot(x, stackFromNBT(invData.getCompoundTag(which)));
|
||||
}
|
||||
}
|
||||
} catch (final NumberFormatException ignored) {
|
||||
@@ -444,7 +564,7 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
final NBTTagCompound encodedValue = itemStack.getTagCompound();
|
||||
|
||||
if (encodedValue == null) {
|
||||
return false;
|
||||
return searchTerm.matches(GuiText.InvalidPattern.getLocal());
|
||||
}
|
||||
|
||||
NBTTagList tag = new NBTTagList();
|
||||
@@ -472,6 +592,8 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
}
|
||||
} else if (displayName.contains(term)) {
|
||||
foundMatchingItemStack = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -522,4 +644,12 @@ public class GuiInterfaceTerminal extends AEBaseGui {
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
int getReservedSpace() {
|
||||
return this.reservedSpace;
|
||||
}
|
||||
|
||||
void setReservedSpace(final int reservedSpace) {
|
||||
this.reservedSpace = reservedSpace;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,6 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
private int currentMouseY = 0;
|
||||
private boolean delayedUpdate;
|
||||
|
||||
private boolean updateView = true;
|
||||
protected int jeiOffset = Loader.isModLoaded("jei") ? 24 : 0;
|
||||
|
||||
public GuiMEMonitorable(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
|
||||
@@ -162,7 +161,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
if (!this.delayedUpdate) {
|
||||
this.updateView = true;
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.searchField.setText(memoryText);
|
||||
this.searchField.selectAll();
|
||||
this.repo.setSearchString(memoryText);
|
||||
this.updateView = true;
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
craftingGridOffsetX = Integer.MAX_VALUE;
|
||||
@@ -380,7 +380,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
if (btn == 1 && this.searchField.isMouseIn(xCoord, yCoord)) {
|
||||
this.searchField.setText("");
|
||||
this.repo.setSearchString("");
|
||||
this.updateView = true;
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
@@ -440,7 +440,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return this.repo.hasPower();
|
||||
}
|
||||
|
||||
int getMaxRows() {
|
||||
protected int getMaxRows() {
|
||||
return AEConfig.instance().getConfigManager().getSetting(Settings.TERMINAL_STYLE) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
if (this.searchField.textboxKeyTyped(character, key)) {
|
||||
this.repo.setSearchString(this.searchField.getText());
|
||||
this.updateView = true;
|
||||
this.setScrollBar();
|
||||
// tell forge the key event is handled and should not be sent out
|
||||
this.keyHandled = mouseInGui;
|
||||
} else {
|
||||
@@ -501,7 +501,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.delayedUpdate = false;
|
||||
}
|
||||
}
|
||||
if (!this.delayedUpdate && updateView) {
|
||||
if (!this.delayedUpdate) {
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
@@ -537,7 +537,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.ViewBox.set(this.configSrc.getSetting(Settings.VIEW_MODE));
|
||||
}
|
||||
|
||||
this.updateView = true;
|
||||
this.repo.updateView();
|
||||
}
|
||||
|
||||
int getReservedSpace() {
|
||||
|
||||
@@ -20,22 +20,17 @@ package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
|
||||
public class GuiMEPortableCell extends GuiMEMonitorable {
|
||||
|
||||
public GuiMEPortableCell(final InventoryPlayer inventoryPlayer, final IPortableCell te) {
|
||||
super(inventoryPlayer, te, new ContainerMEPortableCell(inventoryPlayer, te));
|
||||
super(inventoryPlayer, te);
|
||||
}
|
||||
|
||||
int defaultGetMaxRows() {
|
||||
return super.getMaxRows();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
int getMaxRows() {
|
||||
protected int getMaxRows() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource {
|
||||
private GuiImgButton units;
|
||||
private int tooltip = -1;
|
||||
|
||||
private boolean updateView = true;
|
||||
|
||||
public GuiNetworkStatus(final InventoryPlayer inventoryPlayer, final INetworkTool te) {
|
||||
super(new ContainerNetworkStatus(inventoryPlayer, te));
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
@@ -208,17 +206,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource {
|
||||
for (final IAEItemStack is : list) {
|
||||
this.repo.postUpdate(is);
|
||||
}
|
||||
this.updateView = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
if (updateView) {
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
updateView = false;
|
||||
}
|
||||
super.updateScreen();
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
private void setScrollBar() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,7 +25,9 @@ import appeng.api.config.Settings;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPatternEncoder;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.implementations.ContainerWirelessPatternTerminal;
|
||||
import appeng.container.interfaces.IJEIGhostIngredients;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotFake;
|
||||
@@ -35,6 +37,7 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import mezz.jei.api.gui.IGhostIngredientHandler.Target;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -60,7 +63,7 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
|
||||
private static final String CRAFTMODE_CRFTING = "1";
|
||||
private static final String CRAFTMODE_PROCESSING = "0";
|
||||
|
||||
private final ContainerPatternTerm container;
|
||||
private final ContainerPatternEncoder container;
|
||||
|
||||
private GuiTabButton tabCraftButton;
|
||||
private GuiTabButton tabProcessButton;
|
||||
@@ -83,6 +86,12 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
|
||||
this.setReservedSpace(81);
|
||||
}
|
||||
|
||||
public GuiPatternTerm(final InventoryPlayer inventoryPlayer, WirelessTerminalGuiObject te, final ContainerWirelessPatternTerminal wpt) {
|
||||
super(inventoryPlayer, te, wpt);
|
||||
this.container = (ContainerWirelessPatternTerminal) this.inventorySlots;
|
||||
this.setReservedSpace(81);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class GuiQNB extends AEBaseGui {
|
||||
|
||||
@Override
|
||||
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.bindTexture("guis/chest.png");
|
||||
this.bindTexture("guis/qbgui.png");
|
||||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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>.
|
||||
*/
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.container.implementations.ContainerWirelessCraftingTerminal;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
|
||||
public class GuiWirelessCraftingTerminal extends GuiMEMonitorable {
|
||||
|
||||
private GuiImgButton clearBtn;
|
||||
|
||||
public GuiWirelessCraftingTerminal(final InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject te) {
|
||||
super(inventoryPlayer, te, new ContainerWirelessCraftingTerminal(inventoryPlayer, te));
|
||||
this.setReservedSpace(73);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
|
||||
if (this.clearBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.add(this.clearBtn = new GuiImgButton(this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH));
|
||||
this.clearBtn.setHalfSize(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
this.fontRenderer.drawString(GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.bindTexture("guis/wirelessupgrades.png");
|
||||
Gui.drawModalRectWithCustomSizedTexture(offsetX + 198, offsetY + 127, 0, 0, 32, 32, 32, 32);
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackground() {
|
||||
return "guis/crafting.png";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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>.
|
||||
*/
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.container.implementations.ContainerWirelessPatternTerminal;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
|
||||
public class GuiWirelessPatternTerminal extends GuiPatternTerm {
|
||||
|
||||
public GuiWirelessPatternTerminal(final InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject te) {
|
||||
super(inventoryPlayer, te, new ContainerWirelessPatternTerminal(inventoryPlayer, te));
|
||||
this.setReservedSpace(81);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.bindTexture("guis/wirelessupgrades.png");
|
||||
Gui.drawModalRectWithCustomSizedTexture(offsetX + 198, offsetY + 127, 0, 0, 32, 32, 32, 32);
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
@@ -20,17 +20,22 @@ package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.container.implementations.ContainerWirelessTerm;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
|
||||
public class GuiWirelessTerm extends GuiMEPortableCell {
|
||||
public class GuiWirelessTerm extends GuiMEMonitorable {
|
||||
|
||||
public GuiWirelessTerm(final InventoryPlayer inventoryPlayer, final IPortableCell te) {
|
||||
super(inventoryPlayer, te);
|
||||
public GuiWirelessTerm(final InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject te) {
|
||||
super(inventoryPlayer, te, new ContainerWirelessTerm(inventoryPlayer, te));
|
||||
}
|
||||
|
||||
@Override
|
||||
int getMaxRows() {
|
||||
return this.defaultGetMaxRows();
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.bindTexture("guis/wirelessupgrades.png");
|
||||
Gui.drawModalRectWithCustomSizedTexture(offsetX + 198, offsetY + 127, 0, 0, 32, 32, 32, 32);
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package appeng.client.gui.toasts;
|
||||
|
||||
import appeng.core.localization.GuiText;
|
||||
import net.minecraft.client.gui.toasts.GuiToast;
|
||||
import net.minecraft.client.gui.toasts.IToast;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class CraftingStatusToast implements IToast {
|
||||
private final ItemStack itemStack;
|
||||
private final boolean cancelled;
|
||||
private long firstDrawTime;
|
||||
private boolean newDisplay;
|
||||
|
||||
public CraftingStatusToast(@NotNull ItemStack itemStack, boolean cancelled) {
|
||||
this.itemStack = itemStack;
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Visibility draw(@NotNull GuiToast toastGui, long delta)
|
||||
{
|
||||
if (this.newDisplay)
|
||||
{
|
||||
this.firstDrawTime = delta;
|
||||
this.newDisplay = false;
|
||||
}
|
||||
var minecraft = toastGui.getMinecraft();
|
||||
var fontRenderer = minecraft.fontRenderer;
|
||||
|
||||
// Texture
|
||||
minecraft.getTextureManager().bindTexture(TEXTURE_TOASTS);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F);
|
||||
toastGui.drawTexturedModalRect(0, 0, 0, 32, 160, 32);
|
||||
|
||||
// Text
|
||||
var statusText = cancelled ? GuiText.CraftingToastCancelled : GuiText.CraftingToastDone;
|
||||
fontRenderer.drawString(statusText.getLocal(), 30, 7, -11534256);
|
||||
fontRenderer.drawString(itemStack.getDisplayName(), 30, 18, -16777216);
|
||||
|
||||
// Item
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
minecraft.getRenderItem().renderItemAndEffectIntoGUI(null, itemStack, 8, 8);
|
||||
|
||||
return delta - this.firstDrawTime < 5000L ? Visibility.SHOW : Visibility.HIDE;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@ public class GuiNumberBox extends GuiTextField {
|
||||
final String original = this.getText();
|
||||
super.writeText(selectedText);
|
||||
|
||||
if (this.getText().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (this.type == int.class || this.type == Integer.class) {
|
||||
Integer.parseInt(this.getText());
|
||||
|
||||
@@ -37,32 +37,38 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class ItemRepo {
|
||||
|
||||
private final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
|
||||
private final List<IAEItemStack> view;
|
||||
private List<IAEItemStack> view = new ArrayList<>();
|
||||
private final IScrollSource src;
|
||||
private final ISortSource sortSrc;
|
||||
|
||||
private int rowSize = 9;
|
||||
|
||||
private volatile String searchString = "";
|
||||
private String searchString = "";
|
||||
private IPartitionList<IAEItemStack> myPartitionList;
|
||||
private String innerSearch = "";
|
||||
private boolean hasPower;
|
||||
|
||||
private Enum lastView;
|
||||
private Enum lastSearchMode;
|
||||
private Enum lastSortBy;
|
||||
private Enum lastSortDir;
|
||||
private String lastSearch = "";
|
||||
|
||||
private boolean resort = true;
|
||||
private boolean changed = false;
|
||||
|
||||
|
||||
public ItemRepo(final IScrollSource src, final ISortSource sortSrc) {
|
||||
this.src = src;
|
||||
this.sortSrc = sortSrc;
|
||||
|
||||
this.view = Collections.synchronizedList(new ArrayList<>());
|
||||
list.forEach(this.view::add);
|
||||
}
|
||||
|
||||
public IAEItemStack getReferenceItem(int idx) {
|
||||
@@ -87,6 +93,8 @@ public class ItemRepo {
|
||||
} else {
|
||||
this.list.add(is);
|
||||
}
|
||||
|
||||
changed = true;
|
||||
}
|
||||
|
||||
public long getItemCount(final IAEItemStack is) {
|
||||
@@ -96,126 +104,156 @@ public class ItemRepo {
|
||||
|
||||
public void setViewCell(final ItemStack[] list) {
|
||||
this.myPartitionList = ItemViewCell.createFilter(list);
|
||||
this.updateView();
|
||||
this.changed = true;
|
||||
}
|
||||
|
||||
private CompletableFuture<Void> searchTask = null;
|
||||
|
||||
public void updateView() {
|
||||
if (searchTask != null) {
|
||||
|
||||
final Enum viewMode = this.sortSrc.getSortDisplay();
|
||||
|
||||
if (lastView != viewMode) {
|
||||
resort = true;
|
||||
lastView = viewMode;
|
||||
}
|
||||
|
||||
final Enum searchMode = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_MODE);
|
||||
if (lastSearchMode != searchMode) {
|
||||
resort = true;
|
||||
lastSearchMode = searchMode;
|
||||
}
|
||||
|
||||
if (searchMode == SearchBoxMode.JEI_AUTOSEARCH || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH || searchMode == SearchBoxMode.JEI_AUTOSEARCH_KEEP || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH_KEEP) {
|
||||
this.updateJEI(this.searchString);
|
||||
}
|
||||
|
||||
if (!lastSearch.equals(searchString)) {
|
||||
resort = true;
|
||||
lastSearch = searchString;
|
||||
}
|
||||
|
||||
final Enum sortBy = this.sortSrc.getSortBy();
|
||||
final Enum sortDir = this.sortSrc.getSortDir();
|
||||
|
||||
if (lastSortBy != sortBy) {
|
||||
resort = true;
|
||||
lastSortBy = sortBy;
|
||||
}
|
||||
|
||||
if (lastSortDir != sortDir) {
|
||||
resort = true;
|
||||
lastSortDir = sortDir;
|
||||
}
|
||||
|
||||
if (changed || resort) {
|
||||
changed = false;
|
||||
resort = false;
|
||||
|
||||
view = new ArrayList<>();
|
||||
|
||||
ItemSorters.setDirection((appeng.api.config.SortDir) sortDir);
|
||||
ItemSorters.init();
|
||||
|
||||
Comparator<IAEItemStack> c = getComparator(sortBy);
|
||||
|
||||
for (IAEItemStack is : this.list) {
|
||||
addIAE(is, viewMode);
|
||||
}
|
||||
|
||||
view.sort(c);
|
||||
}
|
||||
}
|
||||
|
||||
private static Comparator<IAEItemStack> getComparator(Enum sortBy) {
|
||||
Comparator<IAEItemStack> c;
|
||||
|
||||
if (sortBy == SortOrder.MOD) {
|
||||
c = ItemSorters.CONFIG_BASED_SORT_BY_MOD;
|
||||
} else if (sortBy == SortOrder.AMOUNT) {
|
||||
c = ItemSorters.CONFIG_BASED_SORT_BY_SIZE;
|
||||
} else if (sortBy == SortOrder.INVTWEAKS) {
|
||||
if (InventoryBogoSortModule.isLoaded()) {
|
||||
c = InventoryBogoSortModule.COMPARATOR;
|
||||
} else {
|
||||
c = ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS;
|
||||
}
|
||||
} else {
|
||||
c = ItemSorters.CONFIG_BASED_SORT_BY_NAME;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
private void addIAE(IAEItemStack is, Enum viewMode) {
|
||||
|
||||
final boolean needsZeroCopy = viewMode == ViewItems.CRAFTABLE;
|
||||
|
||||
final boolean terminalSearchToolTips = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_TOOLTIPS) != YesNo.NO;
|
||||
|
||||
boolean searchMod = false;
|
||||
|
||||
this.innerSearch = searchString.toLowerCase();
|
||||
if (this.innerSearch.startsWith("@")) {
|
||||
searchMod = true;
|
||||
this.innerSearch = this.innerSearch.substring(1);
|
||||
}
|
||||
|
||||
Pattern m = null;
|
||||
try {
|
||||
m = Pattern.compile(this.innerSearch, Pattern.CASE_INSENSITIVE);
|
||||
} catch (final Throwable ignore) {
|
||||
try {
|
||||
m = Pattern.compile(Pattern.quote(this.innerSearch), Pattern.CASE_INSENSITIVE);
|
||||
} catch (final Throwable __) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.myPartitionList != null) {
|
||||
if (!this.myPartitionList.isListed(is)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Since sortSrc is final, so we can safely call it inside lambda
|
||||
searchTask = CompletableFuture.supplyAsync(() -> {
|
||||
IItemList<IAEItemStack> list = this.list.clone();
|
||||
List<IAEItemStack> view = new ArrayList<>(list.size());
|
||||
Enum viewMode = this.sortSrc.getSortDisplay();
|
||||
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean needsZeroCopy = viewMode == ViewItems.CRAFTABLE;
|
||||
final String dspName = (searchMod ? Platform.getModId(is) : Platform.getItemDisplayName(is)).toLowerCase();
|
||||
boolean foundMatchingItemStack = true;
|
||||
|
||||
boolean terminalSearchToolTips = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_TOOLTIPS) != YesNo.NO;
|
||||
|
||||
boolean searchMod = false;
|
||||
|
||||
String innerSearch = searchString.toLowerCase();
|
||||
if (innerSearch.startsWith("@")) {
|
||||
searchMod = true;
|
||||
innerSearch = innerSearch.substring(1);
|
||||
for (String term : innerSearch.split(" ")) {
|
||||
if (term.length() > 1 && (term.startsWith("-") || term.startsWith("!"))) {
|
||||
term = term.substring(1);
|
||||
if (dspName.contains(term)) {
|
||||
foundMatchingItemStack = false;
|
||||
break;
|
||||
}
|
||||
} else if (!dspName.contains(term)) {
|
||||
foundMatchingItemStack = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Pattern m = null;
|
||||
try {
|
||||
m = Pattern.compile(innerSearch, Pattern.CASE_INSENSITIVE);
|
||||
} catch (final Throwable ignore) {
|
||||
try {
|
||||
m = Pattern.compile(Pattern.quote(innerSearch), Pattern.CASE_INSENSITIVE);
|
||||
} catch (final Throwable __) {
|
||||
return Collections.<IAEItemStack>emptyList();
|
||||
if (terminalSearchToolTips && !foundMatchingItemStack) {
|
||||
final List<String> tooltip = Platform.getTooltip(is);
|
||||
for (final String line : tooltip) {
|
||||
if (m.matcher(line).find()) {
|
||||
foundMatchingItemStack = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (IAEItemStack is : list) {
|
||||
if (this.myPartitionList != null) {
|
||||
if (!this.myPartitionList.isListed(is)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final String dspName = (searchMod ? Platform.getModId(is) : Platform.getItemDisplayName(is)).toLowerCase();
|
||||
boolean foundMatchingItemStack = true;
|
||||
|
||||
for (String term : innerSearch.split(" ")) {
|
||||
if (term.length() > 1 && (term.startsWith("-") || term.startsWith("!"))) {
|
||||
term = term.substring(1);
|
||||
if (dspName.contains(term)) {
|
||||
foundMatchingItemStack = false;
|
||||
break;
|
||||
}
|
||||
} else if (!dspName.contains(term)) {
|
||||
foundMatchingItemStack = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (terminalSearchToolTips && !foundMatchingItemStack) {
|
||||
final List<String> tooltip = Platform.getTooltip(is);
|
||||
for (final String line : tooltip) {
|
||||
if (m.matcher(line).find()) {
|
||||
foundMatchingItemStack = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundMatchingItemStack) {
|
||||
if (needsZeroCopy) {
|
||||
is = is.copy();
|
||||
is.setStackSize(0);
|
||||
}
|
||||
|
||||
view.add(is);
|
||||
}
|
||||
if (foundMatchingItemStack) {
|
||||
if (needsZeroCopy) {
|
||||
is = is.copy();
|
||||
is.setStackSize(0);
|
||||
}
|
||||
|
||||
final Enum SortBy = this.sortSrc.getSortBy();
|
||||
final Enum SortDir = this.sortSrc.getSortDir();
|
||||
|
||||
ItemSorters.setDirection((appeng.api.config.SortDir) SortDir);
|
||||
ItemSorters.init();
|
||||
|
||||
if (SortBy == SortOrder.MOD) {
|
||||
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_MOD);
|
||||
} else if (SortBy == SortOrder.AMOUNT) {
|
||||
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_SIZE);
|
||||
} else if (SortBy == SortOrder.INVTWEAKS) {
|
||||
if (InventoryBogoSortModule.isLoaded()) {
|
||||
Collections.sort(this.view, InventoryBogoSortModule.COMPARATOR);
|
||||
} else {
|
||||
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
|
||||
}
|
||||
} else {
|
||||
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_NAME);
|
||||
}
|
||||
|
||||
return view;
|
||||
}).thenAcceptAsync(view -> {
|
||||
this.view.clear();
|
||||
this.view.addAll(view);
|
||||
}).thenRunAsync(() -> {
|
||||
this.searchTask = null; // Prevent redundant cancellation
|
||||
});
|
||||
|
||||
|
||||
this.view.add(is);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateJEI(String filter) {
|
||||
@@ -227,10 +265,6 @@ public class ItemRepo {
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
if (searchTask != null) {
|
||||
searchTask.cancel(true);
|
||||
searchTask = null;
|
||||
}
|
||||
this.list.resetStatus();
|
||||
}
|
||||
|
||||
@@ -256,17 +290,6 @@ public class ItemRepo {
|
||||
|
||||
public void setSearchString(@Nonnull final String searchString) {
|
||||
this.searchString = searchString;
|
||||
|
||||
if (searchTask != null) {
|
||||
searchTask.cancel(true);
|
||||
searchTask = null;
|
||||
}
|
||||
|
||||
// Passive JEI auto search
|
||||
final Enum<?> searchMode = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_MODE);
|
||||
if (searchMode == SearchBoxMode.JEI_AUTOSEARCH || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH || searchMode == SearchBoxMode.JEI_AUTOSEARCH_KEEP || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH_KEEP) {
|
||||
this.updateJEI(this.searchString);
|
||||
}
|
||||
}
|
||||
|
||||
public IItemList<IAEItemStack> getList() {
|
||||
|
||||
@@ -26,6 +26,7 @@ import appeng.util.ISlimReadableNumberConverter;
|
||||
import appeng.util.IWideReadableNumberConverter;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
||||
|
||||
@@ -48,7 +49,7 @@ public class StackSizeRenderer {
|
||||
final boolean unicodeFlag = fontRenderer.getUnicodeFlag();
|
||||
fontRenderer.setUnicodeFlag(false);
|
||||
|
||||
if (aeStack.getStackSize() == 0 && aeStack.isCraftable()) {
|
||||
if ((aeStack.getStackSize() == 0 || GuiScreen.isAltKeyDown()) && aeStack.isCraftable()) {
|
||||
final String craftLabelText = AEConfig.instance().useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft
|
||||
.getLocal();
|
||||
GlStateManager.disableLighting();
|
||||
@@ -64,8 +65,7 @@ public class StackSizeRenderer {
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.enableBlend();
|
||||
}
|
||||
|
||||
if (aeStack.getStackSize() > 0) {
|
||||
else if (aeStack.getStackSize() > 0) {
|
||||
final String stackSize = this.getToBeRenderedStackSize(aeStack.getStackSize());
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
|
||||
@@ -47,7 +47,7 @@ public class TesrRenderHelper {
|
||||
* at the center of a block.
|
||||
*/
|
||||
public static void moveToFace(EnumFacing face) {
|
||||
GlStateManager.translate(face.getFrontOffsetX() * 0.50, face.getFrontOffsetY() * 0.50, face.getFrontOffsetZ() * 0.50);
|
||||
GlStateManager.translate(face.getXOffset() * 0.50, face.getYOffset() * 0.50, face.getZOffset() * 0.50);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,12 @@ 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)));
|
||||
|
||||
// Thin part of connector, here to prevent the color of the channels
|
||||
// from leaking into it
|
||||
addCoveredCableSizedCube(facing, cubeBuilder);
|
||||
|
||||
// For to-machine connections, use a thicker end-cap for the connection
|
||||
if (connectionType != AECableType.GLASS && !cableBusAdjacent) {
|
||||
@@ -350,7 +355,6 @@ class CableBuilder {
|
||||
cubeBuilder.setTexture(texture);
|
||||
}
|
||||
|
||||
addCoveredCableSizedCube(facing, cubeBuilder);
|
||||
|
||||
// Render the channel indicators brightly lit at night
|
||||
cubeBuilder.setRenderFullBright(true);
|
||||
@@ -374,8 +378,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 +407,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,10 +468,10 @@ 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);
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForDenseChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForDenseChannels(channels);
|
||||
|
||||
// Render the channel indicators brightly lit at night
|
||||
cubeBuilder.setRenderFullBright(true);
|
||||
@@ -492,7 +496,7 @@ class CableBuilder {
|
||||
TextureAtlasSprite texture = this.connectionTextures.get(AECableType.DENSE_COVERED).get(cableColor);
|
||||
cubeBuilder.setTexture(texture);
|
||||
|
||||
setStraightCableUVs(cubeBuilder, facing, 5, 11);
|
||||
setStraightCableUVs(cubeBuilder, facing, 3, 13);
|
||||
|
||||
addStraightDenseCableSizedCube(facing, cubeBuilder);
|
||||
}
|
||||
@@ -503,15 +507,15 @@ class CableBuilder {
|
||||
TextureAtlasSprite texture = this.connectionTextures.get(AECableType.DENSE_SMART).get(cableColor);
|
||||
cubeBuilder.setTexture(texture);
|
||||
|
||||
setStraightCableUVs(cubeBuilder, facing, 5, 11);
|
||||
setStraightCableUVs(cubeBuilder, facing, 3, 13);
|
||||
|
||||
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);
|
||||
TextureAtlasSprite oddChannel = this.smartCableTextures.getOddTextureForDenseChannels(channels);
|
||||
TextureAtlasSprite evenChannel = this.smartCableTextures.getEvenTextureForDenseChannels(channels);
|
||||
|
||||
// Render the channel indicators brightly lit at night
|
||||
cubeBuilder.setRenderFullBright(true);
|
||||
@@ -555,14 +559,14 @@ class CableBuilder {
|
||||
case DOWN:
|
||||
case UP:
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 3);
|
||||
cubeBuilder.addCube(3, 0, 3, 13, 16, 13);
|
||||
cubeBuilder.addCube(3, -0.01f, 3, 13, 16.01f, 13);
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 0);
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
cubeBuilder.setUvRotation(EnumFacing.SOUTH, 3);
|
||||
cubeBuilder.setUvRotation(EnumFacing.NORTH, 3);
|
||||
cubeBuilder.addCube(0, 3, 3, 16, 13, 13);
|
||||
cubeBuilder.addCube(-0.01f, 3, 3, 16.01f, 13, 13);
|
||||
cubeBuilder.setUvRotation(EnumFacing.SOUTH, 0);
|
||||
cubeBuilder.setUvRotation(EnumFacing.NORTH, 0);
|
||||
break;
|
||||
@@ -570,7 +574,7 @@ class CableBuilder {
|
||||
case SOUTH:
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 3);
|
||||
cubeBuilder.setUvRotation(EnumFacing.WEST, 3);
|
||||
cubeBuilder.addCube(3, 3, 0, 13, 13, 16);
|
||||
cubeBuilder.addCube(3, 3, -0.01f, 13, 13, 16.01f);
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 0);
|
||||
cubeBuilder.setUvRotation(EnumFacing.WEST, 0);
|
||||
break;
|
||||
@@ -610,14 +614,14 @@ class CableBuilder {
|
||||
case DOWN:
|
||||
case UP:
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 3);
|
||||
cubeBuilder.addCube(5, 0, 5, 11, 16, 11);
|
||||
cubeBuilder.addCube(5, -0.01f, 5, 11, 16.01f, 11);
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 0);
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
cubeBuilder.setUvRotation(EnumFacing.SOUTH, 3);
|
||||
cubeBuilder.setUvRotation(EnumFacing.NORTH, 3);
|
||||
cubeBuilder.addCube(0, 5, 5, 16, 11, 11);
|
||||
cubeBuilder.addCube(-0.01f, 5, 5, 16.01f, 11, 11);
|
||||
cubeBuilder.setUvRotation(EnumFacing.SOUTH, 0);
|
||||
cubeBuilder.setUvRotation(EnumFacing.NORTH, 0);
|
||||
break;
|
||||
@@ -625,7 +629,7 @@ class CableBuilder {
|
||||
case SOUTH:
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 3);
|
||||
cubeBuilder.setUvRotation(EnumFacing.WEST, 3);
|
||||
cubeBuilder.addCube(5, 5, 0, 11, 11, 16);
|
||||
cubeBuilder.addCube(5, 5, -0.01f, 11, 11, 16.01f);
|
||||
cubeBuilder.setUvRotation(EnumFacing.EAST, 0);
|
||||
cubeBuilder.setUvRotation(EnumFacing.WEST, 0);
|
||||
break;
|
||||
@@ -701,6 +705,7 @@ class CableBuilder {
|
||||
}
|
||||
|
||||
Collections.addAll(locations, SmartCableTextures.SMART_CHANNELS_TEXTURES);
|
||||
Collections.addAll(locations, SmartCableTextures.DENSE_SMART_CHANNELS_TEXTURES);
|
||||
|
||||
return locations;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ import java.util.Map.Entry;
|
||||
|
||||
public class CableBusBakedModel implements IBakedModel {
|
||||
|
||||
private static final Map<CableBusRenderState, List<BakedQuad>> CABLE_MODEL_CACHE = new HashMap<>();
|
||||
static final Map<CableBusRenderState, List<BakedQuad>> CABLE_MODEL_CACHE = new HashMap<>();
|
||||
|
||||
private final CableBuilder cableBuilder;
|
||||
|
||||
|
||||
@@ -27,21 +27,26 @@ import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.resource.IResourceType;
|
||||
import net.minecraftforge.client.resource.ISelectiveResourceReloadListener;
|
||||
import net.minecraftforge.client.resource.VanillaResourceType;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
/**
|
||||
* The built-in model for the cable bus block.
|
||||
*/
|
||||
public class CableBusModel implements IModel {
|
||||
public class CableBusModel implements IModel, ISelectiveResourceReloadListener {
|
||||
|
||||
private final PartModels partModels;
|
||||
|
||||
@@ -101,4 +106,12 @@ public class CableBusModel implements IModel {
|
||||
public IModelState getDefaultState() {
|
||||
return TRSRTransformation.identity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate) {
|
||||
if (resourcePredicate.test(VanillaResourceType.MODELS)) {
|
||||
CableBusBakedModel.CABLE_MODEL_CACHE.clear();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ public class CubeBuilder {
|
||||
builder.put(i, x, y, z);
|
||||
break;
|
||||
case NORMAL:
|
||||
builder.put(i, face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ());
|
||||
builder.put(i, face.getXOffset(), face.getYOffset(), face.getZOffset());
|
||||
break;
|
||||
case COLOR:
|
||||
// Color format is RGBA
|
||||
|
||||
@@ -72,7 +72,7 @@ public class QuadRotator {
|
||||
// Figure out where the position is in the array
|
||||
VertexFormat format = quad.getFormat();
|
||||
int posIdx = this.findPositionOffset(format) / 4;
|
||||
int stride = format.getNextOffset() / 4;
|
||||
int stride = format.getSize() / 4;
|
||||
int normalIdx = format.getNormalOffset();
|
||||
VertexFormatElement.EnumType normalType = null;
|
||||
// Figure out the type of the normals
|
||||
|
||||
@@ -32,20 +32,43 @@ import java.util.function.Function;
|
||||
*/
|
||||
public class SmartCableTextures {
|
||||
|
||||
public static final ResourceLocation[] SMART_CHANNELS_TEXTURES = {new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_00"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_01"), new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_02"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_03"), new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_04"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_10"), new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_11"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_12"), new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_13"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_14")
|
||||
public static final ResourceLocation[] SMART_CHANNELS_TEXTURES = {
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_00"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_01"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_02"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_03"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_04"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_10"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_11"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_12"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_13"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/smart/channels_14"),
|
||||
};
|
||||
|
||||
// Textures used to display channels on smart cables. There's two sets of 5 textures each, and
|
||||
// one of each set are composed together to get even/odd colored channels
|
||||
private final TextureAtlasSprite[] textures;
|
||||
|
||||
public static final ResourceLocation[] DENSE_SMART_CHANNELS_TEXTURES = {
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_00"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_01"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_02"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_03"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_04"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_10"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_11"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_12"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_13"),
|
||||
new ResourceLocation(AppEng.MOD_ID, "parts/cable/dense_smart/channels_14"),
|
||||
};
|
||||
|
||||
// Textures used to display channels on dense smart cables. There's two sets of 5 textures each, and
|
||||
// one of each set are composed together to get even/odd colored channels
|
||||
private final TextureAtlasSprite[] denseTextures;
|
||||
|
||||
public SmartCableTextures(Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
|
||||
this.textures = Arrays.stream(SMART_CHANNELS_TEXTURES).map(bakedTextureGetter::apply).toArray(TextureAtlasSprite[]::new);
|
||||
this.denseTextures = Arrays.stream(DENSE_SMART_CHANNELS_TEXTURES).map(bakedTextureGetter::apply).toArray(TextureAtlasSprite[]::new);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,8 +84,18 @@ public class SmartCableTextures {
|
||||
}
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getOddTextureForDenseChannels(int channels) {
|
||||
if (channels < 0) {
|
||||
return this.denseTextures[0];
|
||||
} else if (channels <= 4) {
|
||||
return this.denseTextures[channels];
|
||||
} else {
|
||||
return this.denseTextures[4];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The odd variant is used for displaying channels 5-8 as in use.
|
||||
* The even variant is used for displaying channels 5-8 as in use.
|
||||
*/
|
||||
public TextureAtlasSprite getEvenTextureForChannels(int channels) {
|
||||
if (channels < 5) {
|
||||
@@ -73,4 +106,14 @@ public class SmartCableTextures {
|
||||
return this.textures[9];
|
||||
}
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getEvenTextureForDenseChannels(int channels) {
|
||||
if (channels < 5) {
|
||||
return this.denseTextures[5];
|
||||
} else if (channels <= 8) {
|
||||
return this.denseTextures[1 + channels];
|
||||
} else {
|
||||
return this.denseTextures[9];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import appeng.items.misc.ItemEncodedPattern;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
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.color.IItemColor;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -32,13 +32,22 @@ import java.util.List;
|
||||
* the pattern is being
|
||||
* rendered in the GUI, and not anywhere else.
|
||||
*/
|
||||
class ItemEncodedPatternBakedModel implements IBakedModel {
|
||||
public class ItemEncodedPatternBakedModel implements IBakedModel {
|
||||
private final IBakedModel baseModel;
|
||||
|
||||
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms;
|
||||
|
||||
private final CustomOverrideList overrides;
|
||||
|
||||
public static final IItemColor PATTERN_ITEM_COLOR_HANDLER = (stack, tintIndex) -> {
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
ItemStack output = iep.getOutput(stack);
|
||||
if (!output.isEmpty() && isShiftKeyDown()) {
|
||||
return Minecraft.getMinecraft().getItemColors().colorMultiplier(output, tintIndex);
|
||||
}
|
||||
return 0xFFFFFF;
|
||||
};
|
||||
|
||||
ItemEncodedPatternBakedModel(IBakedModel baseModel, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms) {
|
||||
this.baseModel = baseModel;
|
||||
this.transforms = transforms;
|
||||
@@ -90,88 +99,8 @@ class ItemEncodedPatternBakedModel implements IBakedModel {
|
||||
return PerspectiveMapWrapper.handlePerspective(this, this.transforms, cameraTransformType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Since the ItemOverrideList handling comes before handling the perspective awareness (which is the first place
|
||||
* where we
|
||||
* know how we are being rendered) we need to remember the model of the crafting output, and make the decision on
|
||||
* which to render later on.
|
||||
* Sadly, Forge is pretty inconsistent when it will call the handlePerspective method, so some methods are called
|
||||
* even on this interim-model.
|
||||
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the
|
||||
* crafting output model anyway,
|
||||
* so in those cases we delegate to the model of the encoded pattern.
|
||||
*/
|
||||
private class ShiftHoldingModelWrapper implements IBakedModel {
|
||||
|
||||
private final IBakedModel outputModel;
|
||||
|
||||
private ShiftHoldingModelWrapper(IBakedModel outputModel) {
|
||||
this.outputModel = outputModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
||||
final IBakedModel selectedModel;
|
||||
|
||||
// No need to re-check for shift being held since this model is only handed out in that case
|
||||
if (cameraTransformType == ItemCameraTransforms.TransformType.GUI) {
|
||||
selectedModel = this.outputModel;
|
||||
} else {
|
||||
selectedModel = ItemEncodedPatternBakedModel.this.baseModel;
|
||||
}
|
||||
|
||||
// Now retroactively handle the isGui3d call, for which we always return false below
|
||||
if (selectedModel.isGui3d() != ItemEncodedPatternBakedModel.this.baseModel.isGui3d()) {
|
||||
GlStateManager.enableLighting();
|
||||
}
|
||||
|
||||
if (selectedModel instanceof IBakedModel) {
|
||||
return selectedModel.handlePerspective(cameraTransformType);
|
||||
}
|
||||
|
||||
return PerspectiveMapWrapper.handlePerspective(this, ItemEncodedPatternBakedModel.this.transforms, cameraTransformType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
|
||||
// This may be called for items on the ground, in which case we will always fall back to the pattern
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.getQuads(state, side, rand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.isAmbientOcclusion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGui3d() {
|
||||
// NOTE: Sadly, Forge will let Minecraft call this method before handling the perspective awareness
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.isGui3d();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
// This may be called for items on the ground, in which case we will always fall back to the pattern
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.isBuiltInRenderer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
// This may be called for items on the ground, in which case we will always fall back to the pattern
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.getParticleTexture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms() {
|
||||
// This may be called for items on the ground, in which case we will always fall back to the pattern
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.getItemCameraTransforms();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
// This may be called for items on the ground, in which case we will always fall back to the pattern
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.getOverrides();
|
||||
}
|
||||
private static boolean isShiftKeyDown() {
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,15 +117,11 @@ class ItemEncodedPatternBakedModel implements IBakedModel {
|
||||
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) {
|
||||
boolean shiftHeld = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||
if (shiftHeld) {
|
||||
if (isShiftKeyDown()) {
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
ItemStack output = iep.getOutput(stack);
|
||||
if (!output.isEmpty()) {
|
||||
IBakedModel realModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(output);
|
||||
// Give the item model a chance to handle the overrides as well
|
||||
realModel = realModel.getOverrides().handleItemState(realModel, output, world, entity);
|
||||
return new ShiftHoldingModelWrapper(realModel);
|
||||
return Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(output, world, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ 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;
|
||||
@@ -46,7 +48,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AutoRotatingModel implements IBakedModel {
|
||||
public class AutoRotatingModel implements IBakedModel, IResourceManagerReloadListener {
|
||||
|
||||
private final IBakedModel parent;
|
||||
private final LoadingCache<AutoRotatingCacheKey, List<BakedQuad>> quadCache;
|
||||
@@ -152,6 +154,11 @@ public class AutoRotatingModel implements IBakedModel {
|
||||
return this.quadCache.getUnchecked(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
this.quadCache.invalidateAll();
|
||||
}
|
||||
|
||||
public static class VertexRotator extends QuadGatheringTransformer {
|
||||
private final FacingToRotation f2r;
|
||||
private final EnumFacing face;
|
||||
|
||||
@@ -43,16 +43,16 @@ public class BuiltInModelLoader implements ICustomModelLoader {
|
||||
|
||||
@Override
|
||||
public boolean accepts(ResourceLocation modelLocation) {
|
||||
if (!modelLocation.getResourceDomain().equals(AppEng.MOD_ID)) {
|
||||
if (!modelLocation.getNamespace().equals(AppEng.MOD_ID)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.builtInModels.containsKey(modelLocation.getResourcePath());
|
||||
return this.builtInModels.containsKey(modelLocation.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel loadModel(ResourceLocation modelLocation) throws Exception {
|
||||
return this.builtInModels.get(modelLocation.getResourcePath());
|
||||
return this.builtInModels.get(modelLocation.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
import appeng.block.storage.BlockDrive;
|
||||
import appeng.block.storage.DriveSlotState;
|
||||
import appeng.block.storage.DriveSlotsState;
|
||||
@@ -39,7 +38,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class DriveBakedModel implements IBakedModel {
|
||||
private final IBakedModel bakedBase;
|
||||
private final Map<DriveSlotState, IBakedModel> bakedCells;
|
||||
@@ -72,9 +70,10 @@ public class DriveBakedModel implements IBakedModel {
|
||||
Matrix4f transform = new Matrix4f();
|
||||
transform.setIdentity();
|
||||
|
||||
// Position this drive model copy at the correct slot. The transform is based on the
|
||||
// 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 * 7 / 16.0f;
|
||||
float xOffset = -col * 8 / 16.0f;
|
||||
float yOffset = -row * 3 / 16.0f;
|
||||
|
||||
transform.setTranslation(new Vector3f(xOffset, yOffset, 0));
|
||||
|
||||
@@ -42,12 +42,14 @@ public class DriveModel implements IModel {
|
||||
|
||||
private static final ResourceLocation MODEL_BASE = new ResourceLocation("appliedenergistics2:block/drive_base");
|
||||
|
||||
private static final Map<DriveSlotState, ResourceLocation> MODELS_CELLS = ImmutableMap.of(
|
||||
DriveSlotState.EMPTY, new ResourceLocation("appliedenergistics2:block/drive_cell_empty"),
|
||||
DriveSlotState.OFFLINE, new ResourceLocation("appliedenergistics2:block/drive_cell_off"),
|
||||
DriveSlotState.ONLINE, new ResourceLocation("appliedenergistics2:block/drive_cell_on"),
|
||||
DriveSlotState.TYPES_FULL, new ResourceLocation("appliedenergistics2:block/drive_cell_types_full"),
|
||||
DriveSlotState.FULL, new ResourceLocation("appliedenergistics2:block/drive_cell_full"));
|
||||
private static final Map<DriveSlotState, ResourceLocation> MODELS_CELLS = ImmutableMap.<DriveSlotState, ResourceLocation>builder()
|
||||
.put(DriveSlotState.EMPTY, new ResourceLocation("appliedenergistics2:block/drive_cell_empty"))
|
||||
.put(DriveSlotState.OFFLINE, new ResourceLocation("appliedenergistics2:block/drive_cell_off"))
|
||||
.put(DriveSlotState.ONLINE, new ResourceLocation("appliedenergistics2:block/drive_cell_on"))
|
||||
.put(DriveSlotState.TYPES_FULL, new ResourceLocation("appliedenergistics2:block/drive_cell_types_full"))
|
||||
.put(DriveSlotState.FULL, new ResourceLocation("appliedenergistics2:block/drive_cell_full"))
|
||||
.put(DriveSlotState.NO_CONTENTS, new ResourceLocation("appliedenergistics2:block/drive_cell_no_contents"))
|
||||
.build();
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> getDependencies() {
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.JsonUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.EnumHelperClient;
|
||||
import net.minecraftforge.client.model.ICustomModelLoader;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
@@ -54,7 +55,6 @@ import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -74,11 +74,7 @@ public enum UVLModelLoader implements ICustomModelLoader {
|
||||
|
||||
static {
|
||||
try {
|
||||
Field modifiers = Field.class.getDeclaredField("modifiers");
|
||||
modifiers.setAccessible(true);
|
||||
|
||||
faceBakery = ReflectionHelper.findField(ModelBakery.class, "faceBakery", "field_177607_l");
|
||||
modifiers.set(faceBakery, faceBakery.getModifiers() & (~Modifier.FINAL));
|
||||
|
||||
Class clas = Class.forName(ModelLoader.class.getName() + "$VanillaModelWrapper");
|
||||
vanillaModelWrapper = clas.getDeclaredConstructor(ModelLoader.class, ResourceLocation.class, ModelBlock.class, boolean.class,
|
||||
@@ -118,7 +114,7 @@ public enum UVLModelLoader implements ICustomModelLoader {
|
||||
|
||||
private static void setFaceBakery(ModelBakery modelBakery, FaceBakery faceBakery) {
|
||||
try {
|
||||
UVLModelLoader.faceBakery.set(modelBakery, faceBakery);
|
||||
EnumHelperClient.setFailsafeFieldValue(UVLModelLoader.faceBakery, modelBakery, faceBakery);
|
||||
} catch (Exception e) {
|
||||
throw Throwables.propagate(e);
|
||||
}
|
||||
@@ -141,14 +137,14 @@ public enum UVLModelLoader implements ICustomModelLoader {
|
||||
|
||||
@Override
|
||||
public boolean accepts(ResourceLocation modelLocation) {
|
||||
String modelPath = modelLocation.getResourcePath();
|
||||
if (modelLocation.getResourcePath().startsWith("models/")) {
|
||||
String modelPath = modelLocation.getPath();
|
||||
if (modelLocation.getPath().startsWith("models/")) {
|
||||
modelPath = modelPath.substring("models/".length());
|
||||
}
|
||||
|
||||
try (InputStreamReader io = new InputStreamReader(Minecraft.getMinecraft()
|
||||
.getResourceManager()
|
||||
.getResource(new ResourceLocation(modelLocation.getResourceDomain(), "models/" + modelPath + ".json"))
|
||||
.getResource(new ResourceLocation(modelLocation.getNamespace(), "models/" + modelPath + ".json"))
|
||||
.getInputStream())) {
|
||||
return gson.fromJson(io, UVLMarker.class).ae2_uvl_marker;
|
||||
} catch (Exception e) {
|
||||
@@ -178,11 +174,11 @@ public enum UVLModelLoader implements ICustomModelLoader {
|
||||
private final IModel parent;
|
||||
|
||||
public UVLModelWrapper(ResourceLocation modelLocation) {
|
||||
String modelPath = modelLocation.getResourcePath();
|
||||
if (modelLocation.getResourcePath().startsWith("models/")) {
|
||||
String modelPath = modelLocation.getPath();
|
||||
if (modelLocation.getPath().startsWith("models/")) {
|
||||
modelPath = modelPath.substring("models/".length());
|
||||
}
|
||||
ResourceLocation armatureLocation = new ResourceLocation(modelLocation.getResourceDomain(), "armatures/" + modelPath + ".json");
|
||||
ResourceLocation armatureLocation = new ResourceLocation(modelLocation.getNamespace(), "armatures/" + modelPath + ".json");
|
||||
ModelBlockAnimation animation = ModelBlockAnimation.loadVanillaAnimation(UVLModelLoader.this.resourceManager, armatureLocation);
|
||||
ModelBlock model;
|
||||
{
|
||||
@@ -191,12 +187,12 @@ public enum UVLModelLoader implements ICustomModelLoader {
|
||||
ModelBlock lvt_5_1_ = null;
|
||||
|
||||
try {
|
||||
String s = modelLocation.getResourcePath();
|
||||
String s = modelLocation.getPath();
|
||||
|
||||
iresource = Minecraft.getMinecraft()
|
||||
.getResourceManager()
|
||||
.getResource(
|
||||
new ResourceLocation(modelLocation.getResourceDomain(), "models/" + modelPath + ".json"));
|
||||
new ResourceLocation(modelLocation.getNamespace(), "models/" + modelPath + ".json"));
|
||||
reader = new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8);
|
||||
|
||||
lvt_5_1_ = JsonUtils.gsonDeserialize(this.UVLSERIALIZER, reader, ModelBlock.class, false);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SpatialPylonRendering extends BlockRenderingCustomizer {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.builtInModel(MODEL_ID.getResourcePath(), new SpatialPylonModel());
|
||||
rendering.builtInModel(MODEL_ID.getPath(), new SpatialPylonModel());
|
||||
rendering.stateMapper(this::mapState);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.container;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -37,7 +38,9 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.guisync.SyncData;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.container.slot.*;
|
||||
import appeng.container.slot.SlotRestrictedInput.PlacableItemType;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
@@ -48,21 +51,18 @@ import appeng.helpers.InventoryAction;
|
||||
import appeng.me.helpers.PlayerSource;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.helpers.ItemHandlerUtil;
|
||||
import appeng.util.inv.AdaptorItemHandler;
|
||||
import appeng.util.inv.WrapperCursorItemHandler;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -78,7 +78,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
private final HashSet<Integer> locked = new HashSet<>();
|
||||
private final TileEntity tileEntity;
|
||||
private final IPart part;
|
||||
private final IGuiItemObject obj;
|
||||
protected final IGuiItemObject obj;
|
||||
private final HashMap<Integer, SyncData> syncData = new HashMap<>();
|
||||
private boolean isContainerValid = true;
|
||||
private String customName;
|
||||
@@ -312,10 +312,13 @@ public abstract class AEBaseContainer extends Container {
|
||||
}
|
||||
if (clickSlot != null && clickSlot.getHasStack()) {
|
||||
ItemStack tis = clickSlot.getStack();
|
||||
|
||||
|
||||
if (tis.isEmpty()) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
IItemDefinition expansionCard = AEApi.instance().definitions().materials().cardPatternExpansion();
|
||||
ContainerInterface casted;
|
||||
|
||||
final List<Slot> selectedSlots = new ArrayList<>();
|
||||
|
||||
@@ -326,6 +329,10 @@ public abstract class AEBaseContainer extends Container {
|
||||
tis = this.transferStackToContainer(tis);
|
||||
|
||||
if (!tis.isEmpty()) {
|
||||
if (this instanceof ContainerInterface && expansionCard.isSameAs(tis) && (casted = (ContainerInterface) this).getPatternUpgrades() == casted.availableUpgrades() - 1) {
|
||||
return ItemStack.EMPTY; // Don't insert more pattern expansions than maximum useful
|
||||
}
|
||||
|
||||
// target slots in the container...
|
||||
for (final Object inventorySlot : this.inventorySlots) {
|
||||
final AppEngSlot cs = (AppEngSlot) inventorySlot;
|
||||
@@ -388,7 +395,11 @@ public abstract class AEBaseContainer extends Container {
|
||||
|
||||
if (Platform.itemComparisons().isSameItem(tis, t)) // t.isItemEqual(tis))
|
||||
{
|
||||
int maxSize = d.getSlotStackLimit();
|
||||
if (d instanceof SlotRestrictedInput && ((SlotRestrictedInput) d).getPlaceableItemType() == PlacableItemType.ENCODED_PATTERN) {
|
||||
return ItemStack.EMPTY; // don't insert duplicate encoded patterns to interfaces
|
||||
}
|
||||
|
||||
int maxSize = Math.max(tis.getMaxStackSize(), d.getSlotStackLimit());
|
||||
|
||||
int placeAble = maxSize - t.getCount();
|
||||
|
||||
@@ -404,7 +415,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
if (tis.getCount() <= 0) {
|
||||
clickSlot.putStack(ItemStack.EMPTY);
|
||||
d.onSlotChanged();
|
||||
|
||||
|
||||
this.updateSlot(clickSlot);
|
||||
this.updateSlot(d);
|
||||
return ItemStack.EMPTY;
|
||||
@@ -423,46 +434,8 @@ public abstract class AEBaseContainer extends Container {
|
||||
}
|
||||
|
||||
if (d.isItemValid(tis)) {
|
||||
if (d.getHasStack()) {
|
||||
final ItemStack t = d.getStack().copy();
|
||||
|
||||
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
||||
int maxSize = t.getMaxStackSize();
|
||||
if (d.getSlotStackLimit() < maxSize) {
|
||||
maxSize = d.getSlotStackLimit();
|
||||
}
|
||||
|
||||
int placeAble = maxSize - t.getCount();
|
||||
|
||||
if (tis.getCount() < placeAble) {
|
||||
placeAble = tis.getCount();
|
||||
}
|
||||
|
||||
t.setCount(t.getCount() + placeAble);
|
||||
tis.setCount(tis.getCount() - placeAble);
|
||||
|
||||
d.putStack(t);
|
||||
|
||||
if (tis.getCount() <= 0) {
|
||||
clickSlot.putStack(ItemStack.EMPTY);
|
||||
d.onSlotChanged();
|
||||
|
||||
// if ( worldEntity != null )
|
||||
// worldEntity.markDirty();
|
||||
// if ( hasMETiles ) updateClient();
|
||||
|
||||
this.updateSlot(clickSlot);
|
||||
this.updateSlot(d);
|
||||
return ItemStack.EMPTY;
|
||||
} else {
|
||||
this.updateSlot(d);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int maxSize = tis.getMaxStackSize();
|
||||
if (maxSize > d.getSlotStackLimit()) {
|
||||
maxSize = d.getSlotStackLimit();
|
||||
}
|
||||
if (!d.getHasStack()) {
|
||||
int maxSize = Math.max(tis.getMaxStackSize(), d.getSlotStackLimit());
|
||||
|
||||
final ItemStack tmp = tis.copy();
|
||||
if (tmp.getCount() > maxSize) {
|
||||
@@ -476,15 +449,18 @@ public abstract class AEBaseContainer extends Container {
|
||||
clickSlot.putStack(ItemStack.EMPTY);
|
||||
d.onSlotChanged();
|
||||
|
||||
// if ( worldEntity != null )
|
||||
// worldEntity.markDirty();
|
||||
// if ( hasMETiles ) updateClient();
|
||||
|
||||
this.updateSlot(clickSlot);
|
||||
this.updateSlot(d);
|
||||
return ItemStack.EMPTY;
|
||||
} else {
|
||||
this.updateSlot(d);
|
||||
|
||||
if (
|
||||
(d instanceof SlotRestrictedInput && ((SlotRestrictedInput) d).getPlaceableItemType() == PlacableItemType.ENCODED_PATTERN) ||
|
||||
(this instanceof ContainerInterface && expansionCard.isSameAs(tis) && (casted = (ContainerInterface) this).getPatternUpgrades() == casted.availableUpgrades() - 1)
|
||||
) {
|
||||
break; // Only insert one pattern when shift-clicking into interfaces, and don't insert more pattern expansions than maximum useful
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -975,6 +951,47 @@ public abstract class AEBaseContainer extends Container {
|
||||
b.putStack(testB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, @NotNull EntityPlayer player) {
|
||||
if (slotId >= 0 && clickTypeIn == ClickType.PICKUP) {
|
||||
final var slot = this.getSlot(slotId);
|
||||
if (slot instanceof AppEngSlot appEngSlot) {
|
||||
var slotStack = slot.getStack();
|
||||
var draggedStack = this.invPlayer.getItemStack();
|
||||
|
||||
// The default vanilla behavior assumes that slots can't hold more items than the default stack size.
|
||||
// Thus, it's possible to underflow the vanilla code when clicking non-empty slots with an item stack.
|
||||
if (!draggedStack.isEmpty()) {
|
||||
if (appEngSlot.isItemValid(draggedStack)) {
|
||||
if (slotStack.getItem() == draggedStack.getItem() && slotStack.getMetadata() == draggedStack.getMetadata() && ItemStack.areItemStackTagsEqual(slotStack, draggedStack)) {
|
||||
var maxSize = Math.max(appEngSlot.getSlotStackLimit(), draggedStack.getMaxStackSize());
|
||||
var maxInsertable = Math.min(draggedStack.getCount(), maxSize - appEngSlot.getStack().getCount());
|
||||
var toInsert = Math.min(maxInsertable, dragType == 0 ? maxInsertable : 1);
|
||||
|
||||
draggedStack.shrink(toInsert);
|
||||
slotStack.grow(toInsert);
|
||||
|
||||
slot.onSlotChanged();
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fixes taking and halving issues from oversized slots.
|
||||
else if (dragType == 0 || dragType == 1) {
|
||||
if (slot.canTakeStack(player) && !slotStack.isEmpty()) {
|
||||
var toTake = Math.min(slotStack.getCount(), slotStack.getMaxStackSize());
|
||||
this.invPlayer.setItemStack(slot.decrStackSize(dragType == 0 ? toTake : (toTake + 1) / 2));
|
||||
|
||||
slot.onTake(player, invPlayer.getItemStack());
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return super.slotClick(slotId, dragType, clickTypeIn, player);
|
||||
}
|
||||
|
||||
public void onUpdate(final String field, final Object oldValue, final Object newValue) {
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -38,6 +39,7 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.implementations.GuiCraftConfirm;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.interfaces.IInventorySlotAware;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
@@ -54,6 +56,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.world.World;
|
||||
@@ -123,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;
|
||||
@@ -197,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;
|
||||
@@ -250,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();
|
||||
}
|
||||
@@ -279,7 +289,8 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
||||
|
||||
final IActionHost ah = this.getActionHost();
|
||||
if (ah instanceof WirelessTerminalGuiObject) {
|
||||
originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
ItemStack myIcon = ((WirelessTerminalGuiObject) ah).getItemStack();
|
||||
originalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(myIcon).getGuiHandler(myIcon);
|
||||
}
|
||||
|
||||
if (ah instanceof PartTerminal) {
|
||||
@@ -298,13 +309,32 @@ 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 && originalGui != null && this.getOpenContext() != null) {
|
||||
if (g == 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();
|
||||
Platform.openGUI(this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui);
|
||||
if (te != null) {
|
||||
Platform.openGUI(this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui);
|
||||
} else {
|
||||
if (ah instanceof IInventorySlotAware) {
|
||||
IInventorySlotAware i = ((IInventorySlotAware) ah);
|
||||
Platform.openGUI(this.getInventoryPlayer().player, i.getInventorySlot(), originalGui, i.isBaubleSlot());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -163,7 +163,7 @@ public final class ContainerFluidInterfaceConfigurationTerminal extends AEBaseCo
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.data.hasNoTags()) {
|
||||
if (!this.data.isEmpty()) {
|
||||
try {
|
||||
NetworkHandler.instance().sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player);
|
||||
} catch (final IOException e) {
|
||||
@@ -251,7 +251,7 @@ public final class ContainerFluidInterfaceConfigurationTerminal extends AEBaseCo
|
||||
final String name = '=' + Long.toString(inv.which, Character.MAX_RADIX);
|
||||
final NBTTagCompound tag = data.getCompoundTag(name);
|
||||
|
||||
if (tag.hasNoTags()) {
|
||||
if (tag.isEmpty()) {
|
||||
tag.setLong("sortBy", inv.sortBy);
|
||||
tag.setString("un", inv.unlocalizedName);
|
||||
tag.setTag("pos", NBTUtil.createPosTag(inv.pos));
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ContainerInterface extends ContainerUpgradeable implements IOptiona
|
||||
}
|
||||
|
||||
for (int x = 0; x < DualityInterface.NUMBER_OF_STORAGE_SLOTS; x++) {
|
||||
this.addSlotToContainer(new SlotNormal(this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18));
|
||||
this.addSlotToContainer(new SlotOversized(this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -50,6 +50,8 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static appeng.helpers.ItemStackHelper.stackWriteToNBT;
|
||||
|
||||
|
||||
public final class ContainerInterfaceConfigurationTerminal extends AEBaseContainer {
|
||||
|
||||
@@ -151,7 +153,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.data.hasNoTags()) {
|
||||
if (!this.data.isEmpty()) {
|
||||
try {
|
||||
NetworkHandler.instance().sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player);
|
||||
} catch (final IOException e) {
|
||||
@@ -294,7 +296,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
|
||||
final String name = '=' + Long.toString(inv.which, Character.MAX_RADIX);
|
||||
final NBTTagCompound tag = data.getCompoundTag(name);
|
||||
|
||||
if (tag.hasNoTags()) {
|
||||
if (tag.isEmpty()) {
|
||||
tag.setLong("sortBy", inv.sortBy);
|
||||
tag.setString("un", inv.unlocalizedName);
|
||||
tag.setTag("pos", NBTUtil.createPosTag(inv.pos));
|
||||
@@ -310,10 +312,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
|
||||
ItemHandlerUtil.setStackInSlot(inv.client, x + offset, is.isEmpty() ? ItemStack.EMPTY : is.copy());
|
||||
|
||||
if (!is.isEmpty()) {
|
||||
is.writeToNBT(itemNBT);
|
||||
if (is.getCount() > is.getMaxStackSize()) {
|
||||
itemNBT.setInteger("stackSize", is.getCount());
|
||||
}
|
||||
stackWriteToNBT(is, itemNBT);
|
||||
}
|
||||
|
||||
tag.setTag(Integer.toString(x + offset), itemNBT);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user