Compare commits

...

67 Commits

Author SHA1 Message Date
yueh a14cf2204d Fixes anchor rendering (#2698)
* Fixes #2680: Use a shorter cable anchor model when blocked by a facade.
* Fixes #2664: Prevent anchors from creating intersection.

Replaced the simple List<ResourceLocation> for the static models with a
new container also indicating a solid part, which can be used to prevent
the creation of an intersection.
2016-12-14 22:37:10 +01:00
yueh 8bed7f223e TheOneProbe integration (#2696)
Displayed information is equal to current the WAILA integration.

Added a preInit stage to IIntegrationModule.
Added a factory method to IntegrationType to avoid touching
IntegrationNode for every new integration.

Fixes #2650
2016-12-14 22:36:40 +01:00
yueh db85419702 Restructured registry packages (#2703)
Moved larger registries together with their related classes instead of putting unrelated classes into the same package.
2016-12-14 22:35:52 +01:00
yueh fb79fd284d Replaced Watcher using Collection with a more fitting interface (#2693)
Replaced the watchers for energy, storage and crafting with a more fitting interface compared to a common collection.

Fixes #229
2016-12-14 18:30:49 +01:00
yueh e3305c1963 Update Forge to latest RB
Updated JEI
2016-12-14 17:46:16 +01:00
yueh a3c85b4a59 Fixes #2699: Do not trust the stackSize in case of internal changes.
An external inventory might change the stacksize of the slot we currently
are extracting from. Thus we have to cache the initial stackSize for a later
calculation of the extracted amount per slot.
As other inventories might NOT change the stacksize after a modification,
we can not use the stack reaching 0 as conditions to break.
2016-12-14 11:25:49 +01:00
yueh a2b20f1d67 Fixes #2689: Do not pass our own blockstate to the adjacent block. 2016-12-08 21:29:46 +01:00
yueh 86908b1ae6 Fixes #2647: Prevent crafting status from crashing due to missing network. 2016-12-08 13:07:25 +01:00
dshadowwolf 6bf52b0b0f Fixes constant reequip animation on portable cells/terminals (#2690)
Fix for portable cell and wireless terminal going into re-equip animations when GUI is open.
2016-12-08 12:34:41 +01:00
yueh eb1e86cacb Refactored GrinderRegistry. (#2644)
* Refactored GrinderRegistry.

Changed IGrinderRegistry#getRecipes to return an unmodifiable collection.
Added a way to remove recipes explicitly instead the internal list.
Added a cache to lookup recipes instead of iterating a list.

Renamed IGrinderEntry to IGrinderRecipe
Made IGrindRecipe immutable for easy caching.

Improved GrinderLogging and Exception Handling
JEI Workaround as it expects a List instead Collection.

* Added blacklist of explicit oredict names for the grindstone.

This can be used should the automatic recipe generation create unintended
loopholes.
2016-12-02 23:47:50 +01:00
yueh c405e725b2 Fixes #2667: Use new IC2 item names for P2P attunement. 2016-12-02 22:16:29 +01:00
yueh d377af9a69 Fixes #2675: Set fullBlock correctly afterwards.
Reduces the visibility of some methods as these should be access through the public methods of Block or the overridden ones.
Removes now useless getCheckedSubBlocks.
2016-12-02 22:15:56 +01:00
yueh 12dbd17320 Fixes #2666: Restore inventory after powerloss and still avoid dupes. 2016-12-01 16:17:46 +01:00
yueh 5028c8025b Fixes #2669: Missing particle texture for pylons. 2016-12-01 10:56:01 +01:00
yueh d11d6e754f Fixes #2655, #2276: Two dupe bugs related to network storage handling
* Fixes #2655: Actually remove an ICellContainer before updating the list.
* Fixes #2276: Apply tracker changes in the correct order.
2016-11-26 14:09:30 +01:00
yueh 887339f7b8 Removed ASMTweaker and replaced it with AT. (#2636)
Added appeng_at.cfg and updated build.gradle to correctly include the AT when building.
Deleted the now useless ASMTweaker.
Moved the coremod from package transformer to coremod as a better matching name.
Updated the old 1.7.10 code using reflection to drop it where forge or vanilla now exposes that functionality directly.
2016-11-26 14:08:10 +01:00
yueh a665200c31 Refactored AEConfig (#2633)
Added a singleton getter instead the public field.
Reduced all fields to private.
Replaced field access with getters.
Added setters where necessary (Dimension/Biome Registration)
Added config options to disable more features.
Splitted Enum name from the config key.
Changed FacadeConfig and Networkhandler similar to AEConfig.init().
2016-11-26 14:07:34 +01:00
yueh 6554e295d5 Updated dependencies.
Updated Forge and MCP Mappings.
Updated JEI, Tesla and IC2 APIs.
2016-11-17 10:50:06 +01:00
yueh 4eeb554dcb Fixes #2623: Network Tool not removing facades with shift rightlick. 2016-11-15 22:48:16 +01:00
yueh 3eae4a7d19 Fixes #2626: Subtract the correct amount from the remaining amount. 2016-11-15 22:14:17 +01:00
yueh 6c91e852ec Fixes #2608: Handle scrollbar on mouseclicks not during rendering. 2016-11-13 13:16:08 +01:00
yueh 52f516299b Fixes #2605: Formation plane now using the correct offset position. 2016-11-13 12:41:39 +01:00
yueh c74166b02a Restrict ItemHandlerAdaptor to not exceed the stacksize of a slot. (#2595) 2016-11-13 11:33:31 +01:00
yueh 26e86a114c Added an explicit ignore section to .gitignore
Current intention is to maintain a single blacklist for common OS
dependent files without having to define each and every folder and their
allowed filetypes to avoid commiting these.
2016-11-13 11:30:27 +01:00
yueh fc834036a0 Prevent hard to reproducable stacktraces from being swallowed. 2016-11-10 12:16:39 +01:00
yueh f96f7d82c5 Fixes #2544: NetworkTool now returns PASS for shift+right click on parts. 2016-11-10 11:55:13 +01:00
yueh c592f54a77 Fixes #2599: Missing instanceof EntityPlayerMP test. 2016-11-09 15:46:10 +01:00
yueh 89609a83ea Fixes #2593: Subtract the extracted not already gathered amount. 2016-11-07 13:33:11 +01:00
Sebastian Hartte e67969f52f Fixes #2566: Update packet deserialization was broken when parts were present that were not a grid host. 2016-11-07 00:44:53 +01:00
Sebastian Hartte 32a0496bc2 Fixes facade stilts sometimes being rendered using the facade texture's tint. 2016-11-07 00:17:24 +01:00
Sebastian Hartte 6df311c11a AE now accepts power via the legacy RF API (i.e. from Immersive Engineering). 2016-11-06 23:02:22 +01:00
Sebastian Hartte 2e23b92763 Added charging items via IC2 API. 2016-11-06 22:43:30 +01:00
Sebastian Hartte 41a029ffb4 Added item charging via legacy RF API. 2016-11-06 22:22:49 +01:00
Sebastian Hartte 9c8f914f42 Added CoFH Energy API. 2016-11-06 22:22:34 +01:00
shartte d75cdc9696 Gradle Source Set Changes (#2588)
Introduced separate source sets for "api" and "apis" (in preparation for source only 3rd party APIs).
2016-11-06 21:55:58 +01:00
yueh 77bb28ded6 Fixes #2585: Hide WAILA data when it cannot be retrieved. (#2586) 2016-11-06 20:28:36 +01:00
shartte 0e7981d717 Cleaning Up Mod Integrations (#2581)
* Cleaned up unused Mod integrations other than for mods that are likely to be integrated soon.
* Introduced an easier Facade class to access mod integration abstractions (called Integrations).
* Removed the link between IntegrationType and integration abstraction. Integrations are now explicitly instantiated inside of IntegrationNode.
2016-11-06 20:23:14 +01:00
Sebastian Hartte fbb0c05c7f Fixes #2577: Use the item stacks color handler to color tinted quads of the block model. 2016-11-06 03:35:56 +01:00
Sebastian Hartte efa0ab7e4e Fixes #2582: Right-Clicking with a Storage Cell would prevent further interaction even if the storage cell wasn't being disassembled. 2016-11-06 02:17:25 +01:00
yueh 70fe5189e0 Followup #2556, #2579: Prevent negative stacksizes. 2016-11-05 23:38:57 +01:00
Sebastian Hartte 3a8d6d0bcd Simplified handling of rotations inside getCapability() for TileInscriber. 2016-11-05 23:33:24 +01:00
yueh 7ac817e9ae Fixes #2556, #2579: Restore old click behaviour. 2016-11-05 23:28:27 +01:00
Sebastian Hartte 0ceb4765a2 Fixes #2580: The inscriber's rotation is not taken into account when returning the IItemHandler capability. 2016-11-05 23:27:52 +01:00
yueh 7ce9654402 Merge pull request #2576 from AppliedEnergistics/fix-2575
Fixes #2575: Removed ITickable from AEBaseTile
2016-11-05 22:07:59 +01:00
yueh 5328627d7a Fixes #2575: Removed ITickable from AEBaseTile
Removed TileEventType.TICK, use ITickable when really needed.
The few tiles needing to tick and are not a grid tile now implement ITickable.
Charger is no longer implementing ITickable.
2016-11-05 21:43:49 +01:00
yueh fe1a67ffaa Reduced drive update rate. (#2574)
Limits drive updates to modulate.
Code cleanup of the TileDrive.
2016-11-05 19:28:09 +01:00
shartte 4253d659f1 Add Config to Remove Crashing Items from Storage Cells (#2573)
Added a configuration option to enable players to recover their world if any of their items in storage cause crashes on load.
2016-11-05 13:50:54 +01:00
Sebastian Hartte b3560aaa00 Fixes #2571: Only call getDurabilityForDisplay if the item is damageable. 2016-11-05 12:58:15 +01:00
yueh 005392911d Fixed DriverWatcher constantly calling blinkCell instead when changed. 2016-11-05 00:11:02 +01:00
Sebastian Hartte 7f02562e0c Fixes sidedness issues when starting up the server. 2016-11-04 21:02:10 +01:00
yueh 84bc00fa20 Fixes #2567: Use heightmap for very low sea levels. 2016-11-04 16:13:27 +01:00
Sebastian Hartte c1483d87c7 Fixes #2549: A block being rendered in the translucent layer will cause the item renderer to completely disable depth-writing causing silly looking models when held in hand. 2016-11-04 11:51:24 +01:00
shartte f5e4a202cb Layers and IC2 Tunnel (#2565)
* Re-Activated the IC2 layers to implement an IC2 P2P tunnel.
2016-11-04 11:20:56 +01:00
yueh 6f15c2921a Fixes #2561: Do not use unchecked casts for IContainerListener. 2016-11-04 09:40:21 +01:00
DeadSix27 d891e5da15 Made memory card messages more clearly. (#2511)
* Made Memory card messages more clearly and easier to understand for newcomers.
2016-11-04 09:31:52 +01:00
Alexey Krainev 6607c8cd2f Updated russion translation (#2552)
* Added "P2P Waila Text"
* Changed "NEI to JEI"
2016-11-04 09:29:25 +01:00
yueh 1e20086799 Extracts item comparison from Platform into their own helper. (#2555)
* Extracts item comparison from Platform into their own helper.

Renamed methods to be more more fitting for the actual comparison.
Added documentation about each methods behaviour.
2016-11-04 09:27:52 +01:00
Sebastian Hartte f85ab7ddc2 Fixes Macerator recipes when IC2 integration is enabled. 2016-11-02 23:45:22 +01:00
Sebastian Hartte c3700737c3 Re-enables this IF-branch for ore dictionary tokens in the recipe files, which was inactive due to the recipe files all using lower-case verbs. 2016-11-02 23:34:04 +01:00
Sebastian Hartte 2f8013a49b Fixes registration of recipes when one of the recipes throws an unexpected unchecked exception during registration. Before, the registration would simply cancel and not log any errors in this case. Fixes issues with outdated IC2 integration (Macerator recipes) causing certain recipes to become non-functional. 2016-11-02 23:32:20 +01:00
Sebastian Hartte af54883fd3 Fixes #2558: Make Sky Stone Chest TESR more robust against odd world state, as Vanilla also does. 2016-11-02 20:44:50 +01:00
thatsIch 223a210d49 Replaced reference to FMLCommonHandler EventBus through MinecraftForge.EVENT_BUS due to deprecation notice 2016-11-02 14:22:00 +01:00
thatsIch c133e4f0ef Removed tickhandler registration from FMLCommonHandler EventBus since they same to MinecraftForge.EVENT_BUS 2016-11-02 14:14:51 +01:00
thatsIch 424d27b71c Removed github tag badge because this only works with SemVer in release format v1.0.0 for example and without any trailing information like "-alpha" 2016-11-02 13:42:24 +01:00
Sebastian Hartte 2fe5a3cef8 Fixes #2557: Made facades much more robust when rendering. Facades now use string ids for the base item in NBT again to avoid issues when loading worlds with a different Item ID registry mapping. In addition, we don't store the Block metadata instead of the Item Damage anymore, since when reading a facade back in, we were using that block metadata as the item damage, which is technically incorrect. 2016-11-02 01:43:01 +01:00
yueh a3c33d5323 Fixed typo in prioritylist. 2016-11-01 16:15:05 +01:00
yueh e927c27b85 Fixes #2554: Extract identical item not any equal one. 2016-11-01 15:51:38 +01:00
391 changed files with 7499 additions and 6123 deletions
+4 -1
View File
@@ -25,4 +25,7 @@
!codeformat/
# Github specific files and directories
!.github/
!.github/
# Explicit ignores
Thumbs.db
+1 -2
View File
@@ -1,5 +1,4 @@
[![Travis](https://img.shields.io/travis/AppliedEnergistics/Applied-Energistics-2.svg?maxAge=2592000&style=flat-square)](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
[![Latest Tag](https://img.shields.io/github/tag/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Tag&style=flat-square)](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
[![Latest Release](https://img.shields.io/github/release/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Release&style=flat-square)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
# Applied Energistics 2
@@ -104,7 +103,7 @@ Providing as many details as possible does help us to find and resolve the issue
- Eclipse: execute `gradlew eclipse`
5. For add-on developer: Core-Mod Detection
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
- `-Dfml.coreMods.load=appeng.transformer.AppEngCore`
- `-Dfml.coreMods.load=appeng.coremod.AppEngCore`
## Contribution
+22 -20
View File
@@ -40,7 +40,6 @@ repositories {
apply from: 'gradle/scripts/dependencies.gradle'
apply from: 'gradle/scripts/artifacts.gradle'
apply from: 'gradle/scripts/integration.gradle'
apply from: 'gradle/scripts/optional.gradle'
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -54,17 +53,22 @@ archivesBaseName = aebasename
jar {
manifest {
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'appeng_at.cfg'
}
from sourceSets.api.output
dependsOn apiClasses
// specify which files are really included, can control which APIs should be in
include "appeng/**"
include "assets/**"
include "mcmod.info"
include "pack.mcmeta"
include "META-INF/appeng_at.cfg"
}
minecraft {
coreMod = "appeng.transformer.AppEngCore"
coreMod = "appeng.coremod.AppEngCore"
version = minecraft_version + "-" + forge_version
@@ -82,26 +86,21 @@ minecraft {
}
sourceSets {
main {
java {
srcDirs += 'src/api/java'
srcDirs += 'src/main/java/'
}
resources {
srcDir "src/main/resources/"
include "assets/appliedenergistics2/recipes/**/*.recipe",
"assets/appliedenergistics2/recipes/README.html",
"assets/appliedenergistics2/lang/*.lang",
"assets/appliedenergistics2/blockstates/**/*.json",
"assets/appliedenergistics2/models/**/*.json",
"assets/appliedenergistics2/textures/**/*.png",
"assets/appliedenergistics2/textures/**/*.mcmeta",
"assets/appliedenergistics2/meta/*",
"mcmod.info",
"pack.mcmeta"
}
api
// This source set will contain third party API code that we need to compile, but which is not shipped with the jar
thirdparty {
// Third Party APIs often need access to Minecraft classes (i.e. EnumFacing), so set this up here
compileClasspath += configurations.forgeGradleMc + configurations.forgeGradleMcDeps
}
main
}
dependencies {
compile sourceSets.thirdparty.output
}
processResources
@@ -120,4 +119,7 @@ processResources
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
// move access transformer to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
+6 -5
View File
@@ -8,8 +8,8 @@ aebasename=appliedenergistics2
# Versions #
#########################################################
minecraft_version=1.10.2
mcp_mappings=snapshot_20161018
forge_version=12.18.2.2104
mcp_mappings=snapshot_20161111
forge_version=12.18.3.2185
#########################################################
# Installable #
@@ -19,6 +19,7 @@ waila_version=1.7.0-B3_1.9.4
#########################################################
# Provided APIs #
#########################################################
jei_version=3.12.7.312
tesla_version=1.10.2-1.2.1.49
ic2_version=2.6.96-ex110
jei_version=3.13.6.391
tesla_version=1.10.2-1.2.1.50
ic2_version=2.6.99-ex110
top_version=1.10-1.3.3-41
+1 -1
View File
@@ -46,7 +46,7 @@ task apiJar(type: Jar) {
from sourceSets.api.java
include "appeng/api/**"
from sourceSets.main.output
from sourceSets.api.output
include "appeng/api/**"
classifier = 'api'
+7
View File
@@ -38,6 +38,11 @@ repositories {
name = "IC2 repo"
url = "http://maven.ic2.player.to"
}
maven { // TheOneProbe
name 'tterrag maven'
url "http://maven.tterrag.com/"
}
}
configurations {
@@ -48,12 +53,14 @@ dependencies {
// installable runtime dependencies
mods "mcp.mobius.waila:Waila:${waila_version}"
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
mods "mcjty.theoneprobe:TheOneProbe:${top_version}"
// compile against provided APIs
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
compileOnly "mcp.mobius.waila:Waila:${waila_version}"
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe:${top_version}:api"
// at runtime, use the full JEI jar
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
-29
View File
@@ -1,29 +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>.
*/
// Should be provided by ForgeGradle, some idea user should confirm it.
apply plugin: 'idea'
idea {
module {
inheritOutputDirs = true
// excludes integration due to not being available upon port
excludeDirs += file('src/main/java/appeng/parts/layers/')
}
}
+13 -1
View File
@@ -31,7 +31,7 @@ task deinstallWaila(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
}
// IC²
// IC2
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
from { configurations.mods }
include "**/*industrialcraft-2*.jar"
@@ -41,3 +41,15 @@ task installIC2(type: Copy, dependsOn: "deinstallIC2") {
task deinstallIC2(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
}
// TOP
task installTop(type: Copy, dependsOn: "deinstallTop") {
from { configurations.mods }
include "**/*TheOneProbe*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallTop(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*TheOneProbe*.jar")
}
@@ -78,7 +78,7 @@ public interface IParts
IItemDefinition p2PTunnelLiquids();
// IItemDefinition p2PTunnelEU();
IItemDefinition p2PTunnelEU();
// IItemDefinition p2PTunnelRF();
@@ -24,13 +24,17 @@
package appeng.api.features;
import java.util.Optional;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
/**
* Registration Records for {@link IGrinderRegistry}
*/
public interface IGrinderEntry
public interface IGrinderRecipe
{
/**
@@ -38,66 +42,40 @@ public interface IGrinderEntry
*
* @return input that the grinder will accept.
*/
@Nonnull
ItemStack getInput();
/**
* lets you change the grinder recipe by changing its input.
*
* @param input input item
*/
void setInput( ItemStack input );
/**
* gets the current output
*
* @return output that the grinder will produce
*/
@Nonnull
ItemStack getOutput();
/**
* allows you to change the output.
* gets the current output
*
* @param output output item
* @return output that the grinder will produce
*/
void setOutput( ItemStack output );
@Nonnull
Optional<ItemStack> getOptionalOutput();
/**
* gets the current output
*
* @return output that the grinder will produce
*/
ItemStack getOptionalOutput();
/**
* gets the current output
*
* @return output that the grinder will produce
*/
ItemStack getSecondOptionalOutput();
/**
* stack, and 0.0-1.0 chance that it will be generated.
*
* @param output output item
* @param chance generation chance
*/
void setOptionalOutput( ItemStack output, float chance );
Optional<ItemStack> getSecondOptionalOutput();
/**
* 0.0 - 1.0 the chance that the optional output will be generated.
*
* @return chance of optional output
*/
@Nonnull
float getOptionalChance();
/**
* stack, and 0.0-1.0 chance that it will be generated.
*
* @param output second optional output item
* @param chance second optional output chance
*/
void setSecondOptionalOutput( ItemStack output, float chance );
/**
* 0.0 - 1.0 the chance that the optional output will be generated.
*
@@ -106,16 +84,10 @@ public interface IGrinderEntry
float getSecondOptionalChance();
/**
* Energy cost, in turns.
* Amount of turns required to process the item.
*
* @return number of turns it takes to produce the output from the input.
*/
int getEnergyCost();
int getRequiredTurns();
/**
* Allows you to adjust the number of turns
*
* @param c number of turns to produce output.
*/
void setEnergyCost( int c );
}
@@ -24,7 +24,10 @@
package appeng.api.features;
import java.util.List;
import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
@@ -36,51 +39,90 @@ public interface IGrinderRegistry
{
/**
* Current list of registered recipes, you can modify this if you want too.
* An immutable list of the currently registered recipes.
*
* @return currentlyRegisteredRecipes
*/
List<IGrinderEntry> getRecipes();
@Nonnull
Collection<IGrinderRecipe> getRecipes();
/**
* add a new recipe the easy way, in &#8594; out, how many turns., duplicates will not be added.
* Add a new recipe with a single input and output and how many turns it requires.
*
* Will ignore duplicate recipes with the same input item.
*
* @param in input
* @param out output
* @param turns amount of turns to turn the input into the output
* @param in The {@link ItemStack} to grind.
* @param out The {@link ItemStack} to output.
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*/
void addRecipe( ItemStack in, ItemStack out, int turns );
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, int turns );
/**
* Add a new recipe with an input, output and a single optional output.
*
* Will ignore duplicate recipes with the same input item.
*
* @param in The {@link ItemStack} to grind.
* @param out The {@link ItemStack} to output.
* @param optional The optional {@link ItemStack} to output of a certain chance.
* @param chance Chance to get the optional output within 0.0 - 1.0
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*/
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, int turns );
/**
* add a new recipe with optional outputs, duplicates will not be added.
*
* Will ignore duplicate recipes with the same input item.
*
* @param in input
* @param out output
* @param optional optional output
* @param chance chance to get the optional output within 0.0 - 1.0
* @param turns amount of turns to turn the input into the outputs
*/
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int turns );
/**
* add a new recipe with optional outputs, duplicates will not be added.
*
* @param in input
* @param out output
* @param optional optional output
* @param chance chance to get the optional output within 0.0 - 1.0
* @param optional2 second optional output
* @param in The {@link ItemStack} to grind.
* @param out The {@link ItemStack} to output.
* @param optional The first optional {@link ItemStack} to output of a certain chance.
* @param chance Chance to get the first optional output within 0.0 - 1.0
* @param optional2 The second optional {@link ItemStack} to output of a certain chance.
* @param chance2 chance to get the second optional output within 0.0 - 1.0
* @param turns amount of turns to turn the input into the outputs
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*
*/
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns );
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
/**
* Remove the specific from the recipe list.
*
* @param recipe The recipe to be removed.
* @return true, if it was removed
*/
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
/**
* Searches for a recipe for a given input, and returns it.
*
* @param input input
* @param input The {@link ItemStack} to be grinded.
*
* @return identified recipe or null
*/
IGrinderEntry getRecipeForInput( ItemStack input );
@Nullable
IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input );
/**
* Allows do add a custom ratio from an ore to dust when being grinded.
*
* The default ratio is 1 ore to 2 dusts.
*
* These have to be added before any recipe is registered. Otherwise it will use the default value.
*
* @param oredictName The name of the ore;
* @param ratio The amount, must be > 0;
*/
void addDustRatio( @Nonnull String oredictName, int ratio );
/**
* Remove a custom ratio for a specific ore name.
*
* Will use the default of 2 value afterwards.
*
* @param oredictName The name of the ore;
*/
boolean removeDustRatio( @Nonnull String oredictName );
}
@@ -24,12 +24,36 @@
package appeng.api.networking.crafting;
import java.util.Collection;
import appeng.api.storage.data.IAEStack;
public interface ICraftingWatcher extends Collection<IAEStack>
/**
* DO NOT IMPLEMENT.
*
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
*/
public interface ICraftingWatcher
{
/**
* Add a specific {@link IAEStack} to watch.
*
* Supports multiple values, duplicate ones will not be added.
*
* @param stack
* @return true, if successfully added.
*/
boolean add( IAEStack<?> stack );
/**
* Remove a specific {@link IAEStack} from the watcher.
*
* @param stack
* @return true, if successfully removed.
*/
boolean remove( IAEStack<?> stack );
/**
* Removes all watched stacks and resets the watcher to a clean state.
*/
void reset();
}
@@ -24,10 +24,34 @@
package appeng.api.networking.energy;
import java.util.Collection;
public interface IEnergyWatcher extends Collection<Double>
/**
* DO NOT IMPLEMENT.
*
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
*/
public interface IEnergyWatcher
{
/**
* Add a specific threshold to watch.
*
* Supports multiple values, duplicate ones will not be added.
*
* @param amount
* @return true, if successfully added.
*/
boolean add( double amount );
/**
* Remove a specific threshold from the watcher.
*
* @param amount
* @return true, if successfully removed.
*/
boolean remove( double amount );
/**
* Removes all thresholds and resets the watcher to a clean state.
*/
void reset();
}
@@ -24,12 +24,36 @@
package appeng.api.networking.storage;
import java.util.Collection;
import appeng.api.storage.data.IAEStack;
public interface IStackWatcher extends Collection<IAEStack>
/**
* DO NOT IMPLEMENT.
*
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
*/
public interface IStackWatcher
{
/**
* Add a specific {@link IAEStack} to watch.
*
* Supports multiple values, duplicate ones will not be added.
*
* @param stack
* @return true, if successfully added.
*/
boolean add( IAEStack<?> stack );
/**
* Remove a specific {@link IAEStack} from the watcher.
*
* @param stack
* @return true, if successfully removed.
*/
boolean remove( IAEStack<?> stack );
/**
* Removes all watched stacks and resets the watcher to a clean state.
*/
void reset();
}
+19 -10
View File
@@ -25,10 +25,11 @@ package appeng.api.parts;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import javax.annotation.Nonnull;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
@@ -39,7 +40,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
@@ -71,7 +71,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
ItemStack getItemStack( PartItemStack type );
/**
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for {@link #requireDynamicRender()} in order for
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for
* {@link #requireDynamicRender()} in order for
* this method to be called.
*/
@SideOnly( Side.CLIENT )
@@ -267,8 +268,10 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
boolean canBePlacedOn( BusSupport what );
/**
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models should represent the
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4 can be used in the
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models
* should represent the
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4
* can be used in the
* models to access the parts color.
*
* <dl>
@@ -279,18 +282,23 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* <dt>Tint Index 3</dt>
* <dd>The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.</dd>
* <dt>Tint Index 4</dt>
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its {@link AEColor#whiteVariant bright variant}.</dd>
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its
* {@link AEColor#whiteVariant bright variant}.</dd>
* </dl>
*
* <b>Important:</b> All models must have been registered via the {@link IPartModels} API before use.
*/
default List<ResourceLocation> getStaticModels()
@Nonnull
default IPartModel getStaticModels()
{
return Collections.emptyList();
return new IPartModel()
{
};
}
/**
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
* forwarded to parts on the appropriate
* side.
*
* @see TileEntity#hasCapability(Capability, EnumFacing)
@@ -303,7 +311,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
}
/**
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
* forwarded to parts on the appropriate
* side.
*
* @see TileEntity#getCapability(Capability, EnumFacing)
@@ -0,0 +1,65 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 - 2015 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.parts;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.util.ResourceLocation;
/**
* A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties.
*/
public interface IPartModel
{
/**
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
* creating an intersection for the cable.
*
* This should be true for pretty much all parts.
*
* @return true for a solid part.
*/
default boolean requireCableConnection()
{
return true;
}
/**
* A collection of {@link ResourceLocation} used as models for a part.
*
* @return a collection of models, never null.
*/
@Nonnull
default List<ResourceLocation> getModels()
{
return Collections.emptyList();
}
}
+89 -100
View File
@@ -31,10 +31,8 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -65,12 +63,6 @@ public abstract class AEBaseBlock extends Block
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
@Override
public boolean isVisuallyOpaque()
{
return this.isOpaque() && this.isFullSize();
}
protected AEBaseBlock( final Material mat )
{
super( mat );
@@ -96,13 +88,15 @@ public abstract class AEBaseBlock extends Block
this.setLightLevel( 0 );
this.setHardness( 2.2F );
this.setHarvestLevel( "pickaxe", 0 );
// Workaround as vanilla sets it way too early.
this.fullBlock = this.isFullSize();
}
@Override
public String toString()
public final boolean isVisuallyOpaque()
{
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
return getClass().getSimpleName() + "[" + regName + "]";
return this.isOpaque() && this.isFullSize();
}
@Override
@@ -111,31 +105,12 @@ public abstract class AEBaseBlock extends Block
return new BlockStateContainer( this, this.getAEStates() );
}
protected IProperty[] getAEStates()
{
return new IProperty[0];
}
public boolean isOpaque()
{
return this.isOpaque;
}
@Override
public boolean isNormalCube( IBlockState state )
public final boolean isNormalCube( IBlockState state )
{
return this.isFullSize() && this.isOpaque();
}
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
{
if( this instanceof ICustomCollision )
{
return (ICustomCollision) this;
}
return null;
}
@Override
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
{
@@ -210,7 +185,8 @@ public abstract class AEBaseBlock extends Block
if( br != null )
{
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos.getY(), br.maxZ + pos.getZ() );
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos
.getY(), br.maxZ + pos.getZ() );
return br;
}
}
@@ -241,7 +217,8 @@ public abstract class AEBaseBlock extends Block
}
else
{
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos.getZ() );
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos
.getZ() );
}
return b;
@@ -303,19 +280,6 @@ public abstract class AEBaseBlock extends Block
return super.collisionRayTrace( state, w, pos, a, b );
}
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
return false;
}
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
{
this.getCheckedSubBlocks( item, tabs, itemStacks );
}
@Override
public boolean hasComparatorInputOverride( IBlockState state )
{
@@ -329,21 +293,11 @@ public abstract class AEBaseBlock extends Block
}
@Override
public boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
public final boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
{
return this.isFullSize();
}
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
{
if( this instanceof IOrientableBlock )
{
IOrientableBlock orientable = (IOrientableBlock) this;
return orientable.getOrientable( w, pos );
}
return null;
}
@Override
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
{
@@ -378,50 +332,24 @@ public abstract class AEBaseBlock extends Block
return super.rotateBlock( w, pos, axis );
}
protected boolean hasCustomRotation()
{
return false;
}
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
{
}
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
{
return true;
}
@Override
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
{
return new EnumFacing[0];
}
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getSubBlocks( item, tabs, itemStacks );
}
public String getUnlocalizedName( final ItemStack is )
{
return this.getUnlocalizedName();
}
@Override
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
{
}
public boolean hasSubtypes()
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
return this.hasSubtypes;
return false;
}
public EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
public final EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
{
// case DOWN: return bottomIcon;
// case UP: return blockIcon;
@@ -486,36 +414,97 @@ public abstract class AEBaseBlock extends Block
return null;
}
public boolean isFullSize()
@Override
public String toString()
{
return this.isFullSize;
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
return getClass().getSimpleName() + "[" + regName + "]";
}
public boolean setFullSize( final boolean isFullSize )
protected String getUnlocalizedName( final ItemStack is )
{
this.isFullSize = isFullSize;
return isFullSize;
return this.getUnlocalizedName();
}
public boolean setOpaque( final boolean isOpaque )
protected boolean hasCustomRotation()
{
return false;
}
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
{
}
protected IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
{
if( this instanceof IOrientableBlock )
{
IOrientableBlock orientable = (IOrientableBlock) this;
return orientable.getOrientable( w, pos );
}
return null;
}
protected boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
{
return true;
}
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
{
if( this instanceof ICustomCollision )
{
return (ICustomCollision) this;
}
return null;
}
protected IProperty[] getAEStates()
{
return new IProperty[0];
}
protected boolean isOpaque()
{
return this.isOpaque;
}
protected boolean setOpaque( final boolean isOpaque )
{
this.isOpaque = isOpaque;
return isOpaque;
}
public boolean isInventory()
protected boolean hasSubtypes()
{
return this.isInventory;
return this.hasSubtypes;
}
public void setInventory( final boolean isInventory )
{
this.isInventory = isInventory;
}
public void setHasSubtypes( final boolean hasSubtypes )
protected void setHasSubtypes( final boolean hasSubtypes )
{
this.hasSubtypes = hasSubtypes;
}
protected boolean isFullSize()
{
return this.isFullSize;
}
protected boolean setFullSize( final boolean isFullSize )
{
this.isFullSize = isFullSize;
return isFullSize;
}
protected boolean isInventory()
{
return this.isInventory;
}
protected void setInventory( final boolean isInventory )
{
this.isInventory = isInventory;
}
}
@@ -300,7 +300,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
for( final ItemStack ol : itemDropCandidates )
{
if( Platform.isSameItemType( ol, op ) )
if( Platform.itemComparisons().isEqualItemType( ol, op ) )
{
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
@@ -85,7 +85,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
}
@@ -75,10 +75,22 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
return super.getActualState( state, worldIn, pos ).withProperty( POWERED, powered );
}
@SideOnly( Side.CLIENT)
/**
* NOTE: This is only used to determine how to render an item being held in hand.
* For determining block rendering, the method below is used (canRenderInLayer).
*/
@SideOnly( Side.CLIENT )
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.TRANSLUCENT;
return BlockRenderLayer.CUTOUT;
}
@SideOnly( Side.CLIENT )
@Override
public boolean canRenderInLayer( BlockRenderLayer layer )
{
return layer == BlockRenderLayer.TRANSLUCENT;
}
public boolean isFullCube(IBlockState state)
@@ -45,6 +45,6 @@ public class ItemCraftingStorage extends AEBaseItemBlock
@Override
public boolean hasContainerItem( final ItemStack stack )
{
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
}
}
@@ -22,6 +22,7 @@ package appeng.block.misc;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -94,7 +95,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -135,7 +135,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -76,7 +76,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
@Override
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -98,7 +98,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
@Override
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -22,6 +22,7 @@ package appeng.block.networking;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
@@ -69,9 +70,6 @@ import appeng.client.render.cablebus.CableBusRenderState;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.helpers.AEGlassMaterial;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP;
import appeng.parts.ICableBusContainer;
import appeng.parts.NullCableBusContainer;
import appeng.tile.AEBaseTile;
@@ -349,10 +347,6 @@ public class BlockCableBus extends AEBaseTileBlock
{
out = ( (TileCableBus) te ).getCableBus();
}
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{
out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te );
}
return out == null ? NULL_CABLE_BUS : out;
}
@@ -383,7 +377,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@@ -63,9 +63,9 @@ public class BlockEnergyCell extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
super.getSubBlocks( item, tabs, itemStacks );
final ItemStack charged = new ItemStack( this, 1 );
final NBTTagCompound tag = Platform.openNbtData( charged );
@@ -21,6 +21,7 @@ package appeng.block.networking;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.properties.IProperty;
@@ -94,7 +94,7 @@ public class BlockPaint extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@@ -4,6 +4,7 @@ package appeng.block.paint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import com.google.common.base.Function;
@@ -4,6 +4,7 @@ package appeng.block.qnb;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nullable;
import com.google.common.base.Function;
@@ -53,7 +53,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@@ -26,6 +26,7 @@ import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
@@ -184,7 +185,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
@Override
public <T extends IBlockDefinition> T build()
{
if( !AEConfig.instance.areFeaturesEnabled( features ) )
if( !AEConfig.instance().areFeaturesEnabled( features ) )
{
return (T) new TileDefinition( registryName, null, null );
}
@@ -59,7 +59,7 @@ public class FeatureFactory
public FeatureFactory()
{
this.defaultFeatures = new AEFeature[] { AEFeature.Core };
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
this.bootstrapComponents = new ArrayList<>();
if( Platform.isClient() )
@@ -147,7 +147,7 @@ class ItemDefinitionBuilder implements IItemBuilder
@Override
public ItemDefinition build()
{
if( !AEConfig.instance.areFeaturesEnabled( features ) )
if( !AEConfig.instance().areFeaturesEnabled( features ) )
{
return new ItemDefinition( registryName, null );
}
@@ -62,6 +62,7 @@ import appeng.core.CommonHelper;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketAssemblerAnimation;
import appeng.core.sync.packets.PacketValueConfig;
import appeng.coremod.MissingCoreMod;
import appeng.entity.EntityFloatingItem;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.entity.RenderFloatingItem;
@@ -70,7 +71,6 @@ import appeng.helpers.IMouseWheelItem;
import appeng.hooks.TickHandler;
import appeng.hooks.TickHandler.PlayerColor;
import appeng.server.ServerHelper;
import appeng.transformer.MissingCoreMod;
import appeng.util.Platform;
@@ -149,7 +149,7 @@ public class ClientHelper extends ServerHelper
@Override
public void spawnEffect( final EffectType effect, final World worldObj, final double posX, final double posY, final double posZ, final Object o )
{
if( AEConfig.instance.enableEffects )
if( AEConfig.instance().isEnableEffects() )
{
switch( effect )
{
@@ -354,7 +354,7 @@ public class ClientHelper extends ServerHelper
final ItemStack is = player.getHeldItem( hand );
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Item", me.getDwheel() > 0 ? "WheelUp" : "WheelDown" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Item", me.getDwheel() > 0 ? "WheelUp" : "WheelDown" ) );
me.setCanceled( true );
}
catch( final IOException e )
+52 -58
View File
@@ -54,7 +54,6 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.widgets.GuiScrollbar;
@@ -161,12 +160,6 @@ public abstract class AEBaseGui extends GuiContainer
{
super.drawScreen( mouseX, mouseY, btn );
final boolean hasClicked = Mouse.isButtonDown( 0 );
if( hasClicked && this.getScrollBar() != null )
{
this.getScrollBar().click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
}
for( final Object c : this.buttonList )
{
if( c instanceof ITooltip )
@@ -217,7 +210,7 @@ public abstract class AEBaseGui extends GuiContainer
// All lines after the first are colored gray
for( int i = 1; i < lines.size(); i++ )
{
lines.set(i, TextFormatting.GRAY + lines.get(i));
lines.set( i, TextFormatting.GRAY + lines.get( i ) );
}
this.drawHoveringText( lines, x, y, fontRendererObj );
@@ -258,13 +251,15 @@ public abstract class AEBaseGui extends GuiContainer
{
if( fs.isEnabled() )
{
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18,
18 );
}
else
{
GlStateManager.color( 1.0F, 1.0F, 1.0F, 0.4F );
GlStateManager.enableBlend();
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18,
18 );
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
}
}
@@ -290,6 +285,11 @@ public abstract class AEBaseGui extends GuiContainer
}
}
if( this.getScrollBar() != null )
{
this.getScrollBar().click( this, xCoord - this.guiLeft, yCoord - this.guiTop );
}
super.mouseClicked( xCoord, yCoord, btn );
}
@@ -299,6 +299,11 @@ public abstract class AEBaseGui extends GuiContainer
final Slot slot = this.getSlot( x, y );
final ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack();
if( this.getScrollBar() != null )
{
this.getScrollBar().click( this, x - this.guiLeft, y - this.guiTop );
}
if( slot instanceof SlotFake && itemstack != null )
{
this.drag_click.add( slot );
@@ -307,7 +312,7 @@ public abstract class AEBaseGui extends GuiContainer
for( final Slot dr : this.drag_click )
{
final PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
}
}
}
@@ -317,7 +322,7 @@ public abstract class AEBaseGui extends GuiContainer
}
}
//TODO 1.9.4 aftermath - Whole ClickType thing, to be checked.
// TODO 1.9.4 aftermath - Whole ClickType thing, to be checked.
@Override
protected void handleMouseClick( final Slot slot, final int slotIdx, final int mouseButton, final ClickType clickType )
{
@@ -325,7 +330,7 @@ public abstract class AEBaseGui extends GuiContainer
if( slot instanceof SlotFake )
{
final InventoryAction action = isCtrlKeyDown() ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
final InventoryAction action = mouseButton == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
if( this.drag_click.size() > 1 )
{
@@ -333,7 +338,7 @@ public abstract class AEBaseGui extends GuiContainer
}
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
return;
}
@@ -347,7 +352,7 @@ public abstract class AEBaseGui extends GuiContainer
try
{
NetworkHandler.instance.sendToServer( ( (SlotPatternTerm) slot ).getRequest( isShiftKeyDown() ) );
NetworkHandler.instance().sendToServer( ( (SlotPatternTerm) slot ).getRequest( isShiftKeyDown() ) );
}
catch( final IOException e )
{
@@ -369,11 +374,11 @@ public abstract class AEBaseGui extends GuiContainer
else
{
// Craft stack on right-click, craft single on left-click
action = (mouseButton == 1) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
action = ( mouseButton == 1 ) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
}
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
return;
}
@@ -397,7 +402,7 @@ public abstract class AEBaseGui extends GuiContainer
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
return;
}
}
@@ -409,10 +414,10 @@ public abstract class AEBaseGui extends GuiContainer
switch( clickType )
{
case PICKUP: // pickup / set-down.
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
action = ( mouseButton == 1 ) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
break;
case QUICK_MOVE:
action = isCtrlKeyDown() ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
action = ( mouseButton == 1 ) ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
break;
case CLONE: // creative dupe:
@@ -431,7 +436,7 @@ public abstract class AEBaseGui extends GuiContainer
if( action != null )
{
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).getSlot().getId() );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
}
return;
@@ -445,7 +450,7 @@ public abstract class AEBaseGui extends GuiContainer
switch( clickType )
{
case PICKUP: // pickup / set-down.
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
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() == null )
@@ -455,7 +460,7 @@ public abstract class AEBaseGui extends GuiContainer
break;
case QUICK_MOVE:
action = isCtrlKeyDown() ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
action = ( mouseButton == 1 ) ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
stack = ( (SlotME) slot ).getAEStack();
break;
@@ -484,7 +489,7 @@ public abstract class AEBaseGui extends GuiContainer
{
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
}
return;
@@ -515,7 +520,9 @@ public abstract class AEBaseGui extends GuiContainer
final List<Slot> slots = this.getInventorySlots();
for( final Slot inventorySlot : slots )
{
if( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.canAddItemToSlot( inventorySlot, this.dbl_whichItem, true ) )
if( inventorySlot != null && inventorySlot.canTakeStack(
this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.canAddItemToSlot(
inventorySlot, this.dbl_whichItem, true ) )
{
this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, 1, clickType );
}
@@ -531,16 +538,7 @@ public abstract class AEBaseGui extends GuiContainer
@Override
protected boolean checkHotbarKeys( final int keyCode )
{
final Slot theSlot;
try
{
theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" );
}
catch( final Throwable t )
{
return false;
}
final Slot theSlot = this.getSlotUnderMouse();
if( this.mc.thePlayer.inventory.getItemStack() == null && theSlot != null )
{
@@ -571,7 +569,7 @@ public abstract class AEBaseGui extends GuiContainer
{
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() )
{
NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
NetworkHandler.instance().sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
return true;
}
}
@@ -640,7 +638,7 @@ public abstract class AEBaseGui extends GuiContainer
for( int h = 0; h < times; h++ )
{
final PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
}
}
}
@@ -693,7 +691,8 @@ public abstract class AEBaseGui extends GuiContainer
/**
* This overrides the base-class method through some access transformer hackery...
*/
public void drawSlot( final Slot s )
@Override
public void drawSlot( Slot s )
{
if( s instanceof SlotME )
{
@@ -712,7 +711,7 @@ public abstract class AEBaseGui extends GuiContainer
this.itemRender.zLevel = 0.0F;
// Annoying but easier than trying to splice into render item
this.safeDrawSlot( new Size1Slot( s ) );
super.drawSlot( new Size1Slot( s ) );
stackSizeRenderer.renderStackSize( fontRendererObj, ( (SlotME) s ).getAEStack(), s.getStack(), s.xDisplayPosition, s.yDisplayPosition );
@@ -759,11 +758,15 @@ public abstract class AEBaseGui extends GuiContainer
final float f1 = 0.00390625F;
final float f = 0.00390625F;
final float par6 = 16;
vb.pos( par1 + 0, par2 + par6, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + 0, par2 + par6, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ).endVertex();
final float par5 = 16;
vb.pos( par1 + par5, par2 + par6, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + par5, par2 + 0, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + 0, par2 + 0, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + par5, par2 + par6, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + par5, par2 + 0, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + 0, par2 + 0, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ).endVertex();
tessellator.draw();
}
@@ -777,7 +780,8 @@ public abstract class AEBaseGui extends GuiContainer
{
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.NotAvailable )
{
boolean isValid = s.isItemValid( is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
boolean isValid = s.isItemValid(
is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
if( isValid && s instanceof SlotRestrictedInput )
{
try
@@ -809,11 +813,11 @@ public abstract class AEBaseGui extends GuiContainer
if( s instanceof AppEngSlot )
{
( (AppEngSlot) s ).setDisplay( true );
this.safeDrawSlot( s );
super.drawSlot( s );
}
else
{
this.safeDrawSlot( s );
super.drawSlot( s );
}
return;
@@ -824,7 +828,7 @@ public abstract class AEBaseGui extends GuiContainer
}
}
// do the usual for non-ME Slots.
this.safeDrawSlot( s );
super.drawSlot( s );
}
protected boolean isPowered()
@@ -832,22 +836,12 @@ public abstract class AEBaseGui extends GuiContainer
return true;
}
private void safeDrawSlot( final Slot s )
{
try
{
GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s );
}
catch( final Exception err )
{
}
}
public void bindTexture( final String file )
{
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
this.mc.getTextureManager().bindTexture( loc );
}
protected GuiScrollbar getScrollBar()
{
return this.myScrollBar;
@@ -49,7 +49,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
final Slot s = this.getSlot( mouseX, mouseY );
if( s instanceof SlotME )
{
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
final int BigNumber = AEConfig.instance().useTerminalUseLargeFont() ? 999 : 9999;
IAEItemStack myStack = null;
@@ -103,7 +103,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
final Slot s = this.getSlot( x, y );
if( s instanceof SlotME && stack != null )
{
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
final int BigNumber = AEConfig.instance().useTerminalUseLargeFont() ? 999 : 9999;
IAEItemStack myStack = null;
@@ -37,14 +37,14 @@ public class AEConfigGui extends GuiConfig
public AEConfigGui( final GuiScreen parent )
{
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance.getFilePath() ) );
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance().getFilePath() ) );
}
private static List<IConfigElement> getConfigElements()
{
final List<IConfigElement> list = new ArrayList<IConfigElement>();
for( final String cat : AEConfig.instance.getCategoryNames() )
for( final String cat : AEConfig.instance().getCategoryNames() )
{
if( cat.equals( "versionchecker" ) )
{
@@ -56,7 +56,7 @@ public class AEConfigGui extends GuiConfig
continue;
}
final ConfigCategory cc = AEConfig.instance.getCategory( cat );
final ConfigCategory cc = AEConfig.instance().getCategory( cat );
if( cc.isChild() )
{
@@ -176,15 +176,15 @@ public class GuiCellWorkbench extends GuiUpgradeable
{
if( btn == this.copyMode )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "CopyMode" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Action", "CopyMode" ) );
}
else if( btn == this.partition )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Partition" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Partition" ) );
}
else if( btn == this.clear )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Clear" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Clear" ) );
}
else if( btn == this.fuzzyMode )
{
@@ -193,7 +193,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
FuzzyMode fz = (FuzzyMode) this.fuzzyMode.getCurrentValue();
fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
}
else
{
@@ -52,7 +52,7 @@ public class GuiChest extends AEBaseGui
if( par1GuiButton == this.priority )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
}
@@ -61,7 +61,7 @@ public class GuiCondenser extends AEBaseGui
if( this.mode == btn )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) );
}
}
@@ -76,10 +76,10 @@ public class GuiCraftAmount extends AEBaseGui
{
super.initGui();
final int a = AEConfig.instance.craftItemsByStackAmounts( 0 );
final int b = AEConfig.instance.craftItemsByStackAmounts( 1 );
final int c = AEConfig.instance.craftItemsByStackAmounts( 2 );
final int d = AEConfig.instance.craftItemsByStackAmounts( 3 );
final int a = AEConfig.instance().craftItemsByStackAmounts( 0 );
final int b = AEConfig.instance().craftItemsByStackAmounts( 1 );
final int c = AEConfig.instance().craftItemsByStackAmounts( 2 );
final int d = AEConfig.instance().craftItemsByStackAmounts( 3 );
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) );
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) );
@@ -224,12 +224,12 @@ public class GuiCraftAmount extends AEBaseGui
if( btn == this.originalGuiBtn )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.originalGui ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.originalGui ) );
}
if( btn == this.next )
{
NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
NetworkHandler.instance().sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
}
}
catch( final NumberFormatException e )
@@ -552,7 +552,7 @@ public class GuiCraftConfirm extends AEBaseGui
{
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
}
catch( final IOException e )
{
@@ -562,14 +562,14 @@ public class GuiCraftConfirm extends AEBaseGui
if( btn == this.cancel )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
}
if( btn == this.start )
{
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) );
}
catch( final Throwable e )
{
@@ -125,7 +125,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) );
}
catch( final IOException e )
{
@@ -248,7 +248,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
scheduled = true;
}
if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
if( AEConfig.instance().isUseColoredCraftingStatus() && ( active || scheduled ) )
{
final int bgColor = ( active ? AEColor.GREEN.blackVariant : AEColor.YELLOW.blackVariant ) | BACKGROUND_ALPHA;
final int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
@@ -108,7 +108,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
{
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
}
catch( final IOException e )
{
@@ -118,7 +118,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
if( btn == this.originalGuiBtn )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.originalGui ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.originalGui ) );
}
}
@@ -67,7 +67,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
if( s != null )
{
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 );
NetworkHandler.instance.sendToServer( p );
NetworkHandler.instance().sendToServer( p );
}
}
}
@@ -52,7 +52,7 @@ public class GuiDrive extends AEBaseGui
if( par1GuiButton == this.priority )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
}
@@ -96,11 +96,11 @@ public class GuiFormationPlane extends GuiUpgradeable
if( btn == this.priority )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
else if( btn == this.placeMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.placeMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.placeMode.getSetting(), backwards ) );
}
}
}
@@ -113,12 +113,12 @@ public class GuiIOPort extends GuiUpgradeable
if( btn == this.fullMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
}
if( btn == this.operationMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
}
}
}
@@ -103,17 +103,17 @@ public class GuiInterface extends GuiUpgradeable
if( btn == this.priority )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
if( btn == this.interfaceMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
}
if( btn == this.BlockMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
}
}
}
@@ -88,10 +88,10 @@ public class GuiLevelEmitter extends GuiUpgradeable
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.craftingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO );
final int a = AEConfig.instance.levelByStackAmounts( 0 );
final int b = AEConfig.instance.levelByStackAmounts( 1 );
final int c = AEConfig.instance.levelByStackAmounts( 2 );
final int d = AEConfig.instance.levelByStackAmounts( 3 );
final int a = AEConfig.instance().levelByStackAmounts( 0 );
final int b = AEConfig.instance().levelByStackAmounts( 1 );
final int c = AEConfig.instance().levelByStackAmounts( 2 );
final int d = AEConfig.instance().levelByStackAmounts( 3 );
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) );
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) );
@@ -175,12 +175,12 @@ public class GuiLevelEmitter extends GuiUpgradeable
if( btn == this.craftingMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
}
if( btn == this.levelMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
}
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
@@ -224,7 +224,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
this.level.setText( Out = Long.toString( result ) );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
}
catch( final NumberFormatException e )
{
@@ -265,7 +265,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
Out = "0";
}
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
}
catch( final IOException e )
{
@@ -168,7 +168,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{
if( btn == this.craftingStatusBtn )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_CRAFTING_STATUS ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_CRAFTING_STATUS ) );
}
if( btn instanceof GuiImgButton )
@@ -183,17 +183,17 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( btn == this.terminalStyleBox )
{
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next );
}
else if( btn == this.searchBoxSettings )
{
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next );
}
else
{
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
}
catch( final IOException e )
{
@@ -223,7 +223,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
Keyboard.enableRepeatEvents( true );
this.maxRows = this.getMaxRows();
this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
this.perRow = AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
final int magicNumber = 114 + 1;
final int extraSpace = this.height - magicNumber - this.reservedSpace;
@@ -248,7 +248,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
}
if( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
if( AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
{
this.xSize = this.standardSize + ( ( this.perRow - 9 ) * 18 );
}
@@ -284,12 +284,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.buttonList.add( this.SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc.getSetting( Settings.SORT_DIRECTION ) ) );
offset += 20;
this.buttonList.add( this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ) ) );
this.buttonList.add( this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE ) ) );
offset += 20;
if( !( this instanceof GuiMEPortableCell ) || this instanceof GuiWirelessTerm )
{
this.buttonList.add( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings.getSetting( Settings.TERMINAL_STYLE ) ) );
this.buttonList.add( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) ) );
}
this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 80, this.offsetX ), this.guiTop + 4, 90, 12 );
@@ -304,8 +304,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.craftingStatusBtn.setHideEdge( 13 );
}
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
// Enum setting = AEConfig.instance().getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
final Enum setting = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.JEI_AUTOSEARCH == setting );
if( this.isSubGui() )
@@ -354,7 +354,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
@Override
protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException
{
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
final Enum searchMode = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.JEI_AUTOSEARCH )
{
@@ -438,7 +438,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
int getMaxRows()
{
return AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
return AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
}
protected void repositionSlot( final AppEngSlot s )
@@ -77,8 +77,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
if( btn == this.units )
{
AEConfig.instance.nextPowerUnit( backwards );
this.units.set( AEConfig.instance.selectedPowerUnit() );
AEConfig.instance().nextPowerUnit( backwards );
this.units.set( AEConfig.instance().selectedPowerUnit() );
}
}
@@ -87,7 +87,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
{
super.initGui();
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
this.buttonList.add( this.units );
}
@@ -54,7 +54,7 @@ public class GuiNetworkTool extends AEBaseGui
{
if( btn == this.tFacades )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
}
}
catch( final IOException e )
@@ -78,22 +78,22 @@ public class GuiPatternTerm extends GuiMEMonitorable
if( this.tabCraftButton == btn || this.tabProcessButton == btn )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) );
}
if( this.encodeBtn == btn )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
}
if( this.clearBtn == btn )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
}
if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
}
}
catch( final IOException e )
@@ -77,10 +77,10 @@ public class GuiPriority extends AEBaseGui
{
super.initGui();
final int a = AEConfig.instance.priorityByStacksAmounts( 0 );
final int b = AEConfig.instance.priorityByStacksAmounts( 1 );
final int c = AEConfig.instance.priorityByStacksAmounts( 2 );
final int d = AEConfig.instance.priorityByStacksAmounts( 3 );
final int a = AEConfig.instance().priorityByStacksAmounts( 0 );
final int b = AEConfig.instance().priorityByStacksAmounts( 1 );
final int c = AEConfig.instance().priorityByStacksAmounts( 2 );
final int d = AEConfig.instance().priorityByStacksAmounts( 3 );
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) );
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) );
@@ -170,7 +170,7 @@ public class GuiPriority extends AEBaseGui
if( btn == this.originalGuiBtn )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
}
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
@@ -210,7 +210,7 @@ public class GuiPriority extends AEBaseGui
this.priority.setText( out = Long.toString( result ) );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
}
catch( final NumberFormatException e )
{
@@ -251,7 +251,7 @@ public class GuiPriority extends AEBaseGui
out = "0";
}
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
}
catch( final IOException e )
{
@@ -81,7 +81,7 @@ public class GuiQuartzKnife extends AEBaseGui
{
final String Out = this.name.getText();
( (ContainerQuartzKnife) this.inventorySlots ).setName( Out );
NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
}
catch( final IOException e )
{
@@ -86,7 +86,7 @@ public class GuiSecurityStation extends GuiMEMonitorable
{
try
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileSecurityStation.ToggleOption", toggleSetting.name() ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "TileSecurityStation.ToggleOption", toggleSetting.name() ) );
}
catch( final IOException e )
{
@@ -24,8 +24,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerSkyChest;
import appeng.core.localization.GuiText;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.Integrations;
import appeng.tile.storage.TileSkyChest;
@@ -55,6 +54,6 @@ public class GuiSkyChest extends AEBaseGui
@Override
protected boolean enableSpaceClicking()
{
return !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks );
return !Integrations.invTweaks().isEnabled();
}
}
@@ -58,8 +58,8 @@ public class GuiSpatialIOPort extends AEBaseGui
if( btn == this.units )
{
AEConfig.instance.nextPowerUnit( backwards );
this.units.set( AEConfig.instance.selectedPowerUnit() );
AEConfig.instance().nextPowerUnit( backwards );
this.units.set( AEConfig.instance().selectedPowerUnit() );
}
}
@@ -68,7 +68,7 @@ public class GuiSpatialIOPort extends AEBaseGui
{
super.initGui();
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
this.buttonList.add( this.units );
}
@@ -116,23 +116,23 @@ public class GuiStorageBus extends GuiUpgradeable
{
if( btn == this.partition )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
}
else if( btn == this.clear )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
}
else if( btn == this.priority )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
else if( btn == this.rwMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
}
else if( btn == this.storageFilter )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
}
}
catch( final IOException e )
@@ -182,22 +182,22 @@ public class GuiUpgradeable extends AEBaseGui
if( btn == this.redstoneMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
}
if( btn == this.craftMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
}
if( btn == this.fuzzyMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
}
if( btn == this.schedulingMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
}
}
}
@@ -56,8 +56,8 @@ public class GuiWireless extends AEBaseGui
if( btn == this.units )
{
AEConfig.instance.nextPowerUnit( backwards );
this.units.set( AEConfig.instance.selectedPowerUnit() );
AEConfig.instance().nextPowerUnit( backwards );
this.units.set( AEConfig.instance().selectedPowerUnit() );
}
}
@@ -66,7 +66,7 @@ public class GuiWireless extends AEBaseGui
{
super.initGui();
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
this.buttonList.add( this.units );
}
+6 -6
View File
@@ -22,6 +22,7 @@ package appeng.client.me;
import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Pattern;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
@@ -37,11 +38,11 @@ import appeng.api.storage.data.IItemList;
import appeng.client.gui.widgets.IScrollSource;
import appeng.client.gui.widgets.ISortSource;
import appeng.core.AEConfig;
import appeng.integration.modules.JEI;
import appeng.integration.Integrations;
import appeng.items.storage.ItemViewCell;
import appeng.util.ItemSorters;
import appeng.util.Platform;
import appeng.util.prioitylist.IPartitionList;
import appeng.util.prioritylist.IPartitionList;
public class ItemRepo
@@ -58,7 +59,6 @@ public class ItemRepo
private String searchString = "";
private IPartitionList<IAEItemStack> myPartitionList;
private String innerSearch = "";
private String jeiSearch = null;
private boolean hasPower;
public ItemRepo( final IScrollSource src, final ISortSource sortSrc )
@@ -124,14 +124,14 @@ public class ItemRepo
this.dsp.ensureCapacity( this.list.size() );
final Enum viewMode = this.sortSrc.getSortDisplay();
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
final Enum searchMode = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
if( searchMode == SearchBoxMode.JEI_AUTOSEARCH || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH )
{
this.updateJEI( this.searchString );
}
this.innerSearch = this.searchString;
final boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
final boolean terminalSearchToolTips = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
// boolean terminalSearchMods = Configuration.INSTANCE.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO;
boolean searchMod = false;
@@ -244,7 +244,7 @@ public class ItemRepo
private void updateJEI( String filter )
{
JEI.instance.getJei().setSearchText( filter );
Integrations.jei().setSearchText( filter );
}
public int size()
@@ -21,6 +21,7 @@ package appeng.client.render;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
@@ -108,8 +109,9 @@ public class FacadeDispatcherBakedModel implements IBakedModel
ItemFacade itemFacade = (ItemFacade) stack.getItem();
IBlockState state = itemFacade.getTextureBlockState( stack );
ItemStack textureItem = itemFacade.getTextureItem( stack );
return new FacadeWithBlockBakedModel( baseModel, state, format );
return new FacadeWithBlockBakedModel( baseModel, state, textureItem, format );
}
};
}
@@ -22,6 +22,7 @@ package appeng.client.render;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
@@ -32,6 +33,7 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import appeng.client.render.cablebus.CubeBuilder;
@@ -53,10 +55,13 @@ public class FacadeWithBlockBakedModel implements IBakedModel
private final VertexFormat format;
public FacadeWithBlockBakedModel( IBakedModel baseModel, IBlockState blockState, VertexFormat format )
private final ItemStack textureItem;
public FacadeWithBlockBakedModel( IBakedModel baseModel, IBlockState blockState, ItemStack textureItem, VertexFormat format )
{
this.baseModel = baseModel;
this.blockState = blockState;
this.textureItem = textureItem;
this.textureModel = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( blockState );
this.format = format;
}
@@ -69,10 +74,14 @@ public class FacadeWithBlockBakedModel implements IBakedModel
{
List<BakedQuad> quads = new ArrayList<>( 1 );
CubeBuilder builder = new CubeBuilder( format, quads );
TextureAtlasSprite sprite = FacadeBuilder.getSprite( textureModel, blockState, side, rand );
if ( sprite != null )
FacadeBuilder.TextureAtlasAndTint sprite = FacadeBuilder.getSprite( textureModel, blockState, side, rand );
if ( sprite != null && sprite.getSprite() != null )
{
builder.setTexture( sprite );
if( sprite.getTint() != -1 )
{
builder.setColor( Minecraft.getMinecraft().getItemColors().getColorFromItemstack( textureItem, sprite.getTint() ) );
}
builder.setTexture( sprite.getSprite() );
builder.setDrawFaces( EnumSet.of( EnumFacing.NORTH ) );
builder.addCube( 0, 0, 0, 16, 16, 16 );
return quads;
@@ -46,16 +46,16 @@ public class StackSizeRenderer
{
if( is != null )
{
final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f;
final float scaleFactor = AEConfig.instance().useTerminalUseLargeFont() ? 0.85f : 0.5f;
final float inverseScaleFactor = 1.0f / scaleFactor;
final int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1;
final int offset = AEConfig.instance().useTerminalUseLargeFont() ? 0 : -1;
final boolean unicodeFlag = fontRenderer.getUnicodeFlag();
fontRenderer.setUnicodeFlag( false );
if( is.stackSize == 0 )
{
final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
final String craftLabelText = AEConfig.instance().useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableBlend();
@@ -95,7 +95,7 @@ public class StackSizeRenderer
private String getToBeRenderedStackSize( final long originalSize )
{
if( AEConfig.instance.useTerminalUseLargeFont() )
if( AEConfig.instance().useTerminalUseLargeFont() )
{
return SLIM_CONVERTER.toSlimReadableForm( originalSize );
}
@@ -25,6 +25,8 @@ import java.util.EnumMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
@@ -41,6 +43,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.property.IExtendedBlockState;
import appeng.api.parts.IPartModel;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.block.networking.BlockCableBus;
@@ -81,8 +84,9 @@ public class CableBusBakedModel implements IBakedModel
List<BakedQuad> quads = new ArrayList<>();
// The core parts of the cable will only be rendered in the CUTOUT layer. TRANSLUCENT is used only for translucent facades further down below.
if ( layer == BlockRenderLayer.CUTOUT )
// The core parts of the cable will only be rendered in the CUTOUT layer. TRANSLUCENT is used only for
// translucent facades further down below.
if( layer == BlockRenderLayer.CUTOUT )
{
// First, handle the cable at the center of the cable bus
addCableQuads( renderState, quads );
@@ -90,13 +94,13 @@ public class CableBusBakedModel implements IBakedModel
// Then handle attachments
for( EnumFacing facing : EnumFacing.values() )
{
List<ResourceLocation> models = renderState.getAttachments().get( facing );
if( models == null )
final IPartModel partModel = renderState.getAttachments().get( facing );
if( partModel == null )
{
continue;
}
for( ResourceLocation model : models )
for( ResourceLocation model : partModel.getModels() )
{
IBakedModel bakedModel = partModels.get( model );
@@ -122,8 +126,7 @@ public class CableBusBakedModel implements IBakedModel
renderState.getBoundingBoxes(),
renderState.getAttachments().keySet(),
rand,
quads
);
quads );
return quads;
}
@@ -131,25 +134,30 @@ public class CableBusBakedModel implements IBakedModel
// Determines whether a cable is connected to exactly two sides that are opposite each other
private static boolean isStraightLine( AECableType cableType, EnumMap<EnumFacing, AECableType> sides )
{
Iterator<EnumFacing> it = sides.keySet().iterator();
final Iterator<Entry<EnumFacing, AECableType>> it = sides.entrySet().iterator();
if( !it.hasNext() )
{
return false; // No connections
}
EnumFacing firstSide = it.next();
AECableType firstType = sides.get( firstSide );
final Entry<EnumFacing, AECableType> nextConnection = it.next();
final EnumFacing firstSide = nextConnection.getKey();
final AECableType firstType = nextConnection.getValue();
if( !it.hasNext() )
{
return false; // Only a single connection
}
if( firstSide.getOpposite() != it.next() )
if( firstSide.getOpposite() != it.next().getKey() )
{
return false; // Connected to two sides that are not opposite each other
}
if (it.hasNext()) {
if( it.hasNext() )
{
return false; // Must not have any other connection points
}
AECableType secondType = sides.get( firstSide.getOpposite() );
final AECableType secondType = sides.get( firstSide.getOpposite() );
// Certain cable types have restrictions on when they're rendered as a straight connection
switch( cableType )
@@ -176,8 +184,8 @@ public class CableBusBakedModel implements IBakedModel
// If the connection is straight, no busses are attached, and no covered core has been forced (in case of glass
// cables), then render the cable as a simplified straight line.
boolean noAttachments = renderState.getAttachments().isEmpty();
if( isStraightLine( cableType, connectionTypes ) && noAttachments )
boolean noAttachments = !renderState.getAttachments().values().stream().anyMatch( IPartModel::requireCableConnection );
if( noAttachments && isStraightLine( cableType, connectionTypes ) )
{
EnumFacing facing = connectionTypes.keySet().iterator().next();
@@ -227,11 +235,12 @@ public class CableBusBakedModel implements IBakedModel
}
// Render all outgoing connections using the appropriate type
for( EnumFacing facing : connectionTypes.keySet() )
for( final Entry<EnumFacing, AECableType> connection : connectionTypes.entrySet() )
{
AECableType connectionType = connectionTypes.get( facing );
boolean cableBusAdjacent = renderState.getCableBusAdjacent().contains( facing );
int channels = renderState.getChannelsOnSide().get( facing );
final EnumFacing facing = connection.getKey();
final AECableType connectionType = connection.getValue();
final boolean cableBusAdjacent = renderState.getCableBusAdjacent().contains( facing );
final int channels = renderState.getChannelsOnSide().get( facing );
switch( cableType )
{
@@ -269,9 +278,9 @@ public class CableBusBakedModel implements IBakedModel
// If no core is present, just use the first part that comes into play
for( EnumFacing side : renderState.getAttachments().keySet() )
{
List<ResourceLocation> models = renderState.getAttachments().get( side );
IPartModel partModel = renderState.getAttachments().get( side );
for( ResourceLocation model : models )
for( ResourceLocation model : partModel.getModels() )
{
IBakedModel bakedModel = partModels.get( model );
@@ -282,9 +291,11 @@ public class CableBusBakedModel implements IBakedModel
TextureAtlasSprite particleTexture = bakedModel.getParticleTexture();
// If a part sub-model has no particle texture (indicated by it being the missing texture), don't add it,
// If a part sub-model has no particle texture (indicated by it being the missing texture), don't
// add
// it,
// so we don't get ugly missing texture break particles.
if ( textureMap.getMissingSprite() != particleTexture )
if( textureMap.getMissingSprite() != particleTexture )
{
result.add( particleTexture );
}
@@ -25,9 +25,9 @@ import java.util.EnumSet;
import java.util.List;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import appeng.api.parts.IPartModel;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
@@ -60,7 +60,7 @@ public class CableBusRenderState
// connections contains a corresponding entry.
private EnumMap<EnumFacing, Integer> channelsOnSide = new EnumMap<>( EnumFacing.class );
private EnumMap<EnumFacing, List<ResourceLocation>> attachments = new EnumMap<>( EnumFacing.class );
private EnumMap<EnumFacing, IPartModel> attachments = new EnumMap<>( EnumFacing.class );
// For each attachment, this contains the distance from the edge until which a cable connection should be drawn
private EnumMap<EnumFacing, Integer> attachmentConnections = new EnumMap<>( EnumFacing.class );
@@ -68,7 +68,8 @@ public class CableBusRenderState
// Contains the facade to use for each side that has a facade attached
private EnumMap<EnumFacing, FacadeRenderState> facades = new EnumMap<>( EnumFacing.class );
// Contains the bounding boxes of all parts on the cable bus to allow facades to cut out holes for the parts. This list is only populated if there are
// Contains the bounding boxes of all parts on the cable bus to allow facades to cut out holes for the parts. This
// list is only populated if there are
// facades on this cable bus
private List<AxisAlignedBB> boundingBoxes = new ArrayList<>();
@@ -132,7 +133,7 @@ public class CableBusRenderState
this.cableBusAdjacent = cableBusAdjacent;
}
public EnumMap<EnumFacing, List<ResourceLocation>> getAttachments()
public EnumMap<EnumFacing, IPartModel> getAttachments()
{
return attachments;
}
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.List;
import javax.vecmath.Vector4f;
import com.google.common.base.Preconditions;
@@ -22,9 +22,11 @@ package appeng.client.render.cablebus;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import javax.vecmath.Vector3f;
@@ -35,7 +37,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.color.BlockColors;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.BlockRenderLayer;
@@ -59,13 +60,14 @@ public class FacadeBuilder
private static final ResourceLocation TEXTURE_FACADE = new ResourceLocation( AppEng.MOD_ID, "parts/cable_anchor" );
private final BlockColors blockColors = Minecraft.getMinecraft().getBlockColors();
private final VertexFormat format;
private final TextureAtlasSprite facadeTexture;
private final BlockRendererDispatcher blockRendererDispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
private static final Set<ResourceLocation> warnedFor = new HashSet<>();
FacadeBuilder( VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
{
this.format = format;
@@ -83,7 +85,7 @@ public class FacadeBuilder
CubeBuilder builder = new CubeBuilder( format, quads );
facadesState.forEach( ( side, textureItem ) ->
facadesState.forEach( ( side, state ) ->
{
AxisAlignedBB facadeBox = getFacadeBox( side, thinFacades );
AEAxisAlignedBB cutOutBox = getCutOutBox( facadeBox, partBoxes );
@@ -100,10 +102,10 @@ public class FacadeBuilder
} );
}
public static TextureAtlasSprite getSprite( IBakedModel blockModel, IBlockState state, EnumFacing facing, long rand)
public static TextureAtlasAndTint getSprite( IBakedModel blockModel, IBlockState state, EnumFacing facing, long rand)
{
TextureAtlasSprite firstFound = null;
TextureAtlasAndTint firstFound = null;
BlockRenderLayer orgLayer = MinecraftForgeClient.getRenderLayer();
try
@@ -116,27 +118,52 @@ public class FacadeBuilder
for( BakedQuad bakedQuad : blockModel.getQuads( state, facing, rand ) )
{
return bakedQuad.getSprite();
return new TextureAtlasAndTint( bakedQuad );
}
for( BakedQuad bakedQuad : blockModel.getQuads( state, null, rand ) )
{
if( firstFound == null )
{
firstFound = bakedQuad.getSprite();
firstFound = new TextureAtlasAndTint( bakedQuad );
}
if( bakedQuad.getFace() == facing )
{
return bakedQuad.getSprite();
return new TextureAtlasAndTint( bakedQuad );
}
}
}
}
catch( Exception e )
{
if( warnedFor.add( state.getBlock().getRegistryName() ) )
{
AELog.warn( "Unable to get facade sprite for blockstate %s. Supressing further warnings for this block.", state );
AELog.debug( e );
}
}
finally
{
ForgeHooksClient.setRenderLayer( orgLayer );
}
// Fall back to the particle texture, if we havent found anything else so far.
if( firstFound == null )
{
try
{
return new TextureAtlasAndTint( blockModel.getParticleTexture(), -1 );
}
catch( Exception e )
{
if( warnedFor.add( state.getBlock().getRegistryName() ) )
{
AELog.warn( "Unable to get facade sprite particle texture fallback for blockstate %s. Supressing further warnings for this block.", state );
AELog.debug( e );
}
}
}
return firstFound;
}
@@ -148,6 +175,9 @@ public class FacadeBuilder
builder.setDrawFaces( EnumSet.allOf( EnumFacing.class ) );
// Reset to no color multiplicator
builder.setColorRGB( 0xFFFFFF );
// We only render the stilt if we don't intersect with any part directly, and if there's no part on our side
if( renderStilt && busBounds == null && layer == BlockRenderLayer.CUTOUT )
{
@@ -186,36 +216,42 @@ public class FacadeBuilder
IBakedModel blockModel = blockRendererDispatcher.getModelForState( blockState );
int color = 0xffffff;
try
{
blockColors.getColor( blockState );
}
catch( final Throwable ignored )
{
}
final int color;
if( translucent )
{
color &= 0xFFFFFF;
color |= 0x4C000000;
builder.setColor( color );
color = 0x4CFFFFFF;
}
else
{
builder.setColorRGB( color );
color = 0xFFFFFFFF;
}
// TODO: Cache this
for( EnumFacing facing : facadeState.getOpenFaces() )
{
TextureAtlasSprite sprite = getSprite( blockModel, blockState, facing, rand );
if( sprite != null )
TextureAtlasAndTint spriteAndTint = getSprite( blockModel, blockState, facing, rand );
if( spriteAndTint != null && spriteAndTint.sprite != null )
{
builder.setTexture( facing, sprite );
// Use the tint color from the item stack here, which is based upon the assumption that the
// model used for the block will use the same meaning for tint indices as the item model does
if( spriteAndTint.tint != -1 )
{
int tintColor = facadeState.resolveTintColor( spriteAndTint.tint );
// Still apply the transparency color
tintColor &= 0xFFFFFF;
tintColor |= color & 0xFF000000;
builder.setColor( tintColor );
}
else
{
builder.setColor( color );
}
builder.setTexture( facing, spriteAndTint.sprite );
}
else
{
builder.setColor( color );
builder.setTexture( facing, facadeTexture );
}
}
@@ -431,4 +467,34 @@ public class FacadeBuilder
throw new IllegalArgumentException( "Unsupported face: " + side );
}
}
public static class TextureAtlasAndTint
{
private final TextureAtlasSprite sprite;
private final int tint;
private TextureAtlasAndTint( BakedQuad quad )
{
this.sprite = quad.getSprite();
this.tint = quad.getTintIndex();
}
private TextureAtlasAndTint( TextureAtlasSprite sprite, int tint )
{
this.sprite = sprite;
this.tint = tint;
}
public TextureAtlasSprite getSprite()
{
return sprite;
}
public int getTint()
{
return tint;
}
}
}
@@ -4,6 +4,8 @@ package appeng.client.render.cablebus;
import java.util.EnumSet;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
@@ -19,10 +21,14 @@ public class FacadeRenderState
// Which faces of the cube should be rendered for this particular facade
private final EnumSet<EnumFacing> openFaces;
public FacadeRenderState( IBlockState sourceBlock, EnumSet<EnumFacing> openFaces )
// For resolving the tint indices of a facade
private final ItemStack textureItem;
public FacadeRenderState( IBlockState sourceBlock, EnumSet<EnumFacing> openFaces, ItemStack textureItem )
{
this.sourceBlock = sourceBlock;
this.openFaces = openFaces;
this.textureItem = textureItem;
}
public IBlockState getSourceBlock()
@@ -35,4 +41,9 @@ public class FacadeRenderState
return openFaces;
}
public int resolveTintColor( int tintIndex )
{
return Minecraft.getMinecraft().getItemColors().getColorFromItemstack( textureItem, tintIndex );
}
}
@@ -2,6 +2,7 @@ package appeng.client.render.crafting;
import java.util.List;
import javax.annotation.Nullable;
import javax.vecmath.Matrix4f;
@@ -21,6 +21,7 @@ package appeng.client.render.model;
import java.util.ArrayList;
import java.util.List;
import javax.vecmath.Vector3f;
import javax.vecmath.Vector4f;
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import javax.annotation.Nullable;
import javax.vecmath.Matrix4f;
@@ -4,6 +4,7 @@ package appeng.client.render.model;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import javax.annotation.Nullable;
import javax.vecmath.Matrix4f;
@@ -32,6 +32,7 @@ import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
import com.google.common.base.Charsets;
@@ -233,7 +233,7 @@ class SpatialPylonBakedModel implements IBakedModel
@Override
public TextureAtlasSprite getParticleTexture()
{
return null;
return this.textures.get( SpatialPylonTextureType.DIM );
}
@Override
@@ -19,6 +19,7 @@
package appeng.client.render.tesr;
import net.minecraft.block.Block;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -70,14 +71,8 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
}
else
{
if( te != null )
{
this.bindTexture( ( (BlockSkyChest) te.getBlockType() ).type == SkyChestType.STONE ? TEXTURE_STONE : TEXTURE_BLOCK );
}
else
{
this.bindTexture( TEXTURE_BLOCK );
}
SkyChestType chestType = getChestType( te );
this.bindTexture( chestType == SkyChestType.STONE ? TEXTURE_STONE : TEXTURE_BLOCK );
}
GlStateManager.pushMatrix();
@@ -128,4 +123,20 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
}
}
// Defensively determine the sky chest type
private static SkyChestType getChestType( TileSkyChest te )
{
if( te == null )
{
return SkyChestType.BLOCK;
}
Block blockType = te.getBlockType();
if( blockType instanceof BlockSkyChest )
{
return ( (BlockSkyChest) blockType ).type;
}
return SkyChestType.BLOCK;
}
}
@@ -227,7 +227,7 @@ public abstract class AEBaseContainer extends Container
final ItemStack a = stack == null ? null : stack.getItemStack();
final ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack();
if( Platform.isSameItemPrecise( a, b ) )
if( Platform.itemComparisons().isSameItem( a, b ) )
{
return;
}
@@ -265,7 +265,7 @@ public abstract class AEBaseContainer extends Container
{
final PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet );
page++;
NetworkHandler.instance.sendToServer( ppi );
NetworkHandler.instance().sendToServer( ppi );
}
}
catch( final IOException e )
@@ -438,13 +438,11 @@ public abstract class AEBaseContainer extends Container
if( Platform.isServer() )
{
for( final Object crafter : this.listeners )
for( final IContainerListener listener : this.listeners )
{
final IContainerListener IContainerListener = (IContainerListener) crafter;
for( final SyncData sd : this.syncData.values() )
{
sd.tick( IContainerListener );
sd.tick( listener );
}
}
}
@@ -545,7 +543,7 @@ public abstract class AEBaseContainer extends Container
if( !( cs.isPlayerSide() ) && cs instanceof SlotFake )
{
if( Platform.isSameItemPrecise( destination, tis ) )
if( Platform.itemComparisons().isSameItem( destination, tis ) )
{
break;
}
@@ -577,7 +575,7 @@ public abstract class AEBaseContainer extends Container
{
final ItemStack t = d.getStack();
if( Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis))
if( Platform.itemComparisons().isSameItem( tis, t ) ) // t.isItemEqual(tis))
{
int maxSize = t.getMaxStackSize();
if( maxSize > d.getSlotStackLimit() )
@@ -629,7 +627,7 @@ public abstract class AEBaseContainer extends Container
{
final ItemStack t = d.getStack();
if( Platform.isSameItemPrecise( t, tis ) )
if( Platform.itemComparisons().isSameItem( t, tis ) )
{
int maxSize = t.getMaxStackSize();
if( d.getSlotStackLimit() < maxSize )
@@ -795,7 +793,7 @@ public abstract class AEBaseContainer extends Container
{
if( hand == null )
{
is.stackSize--;
is.stackSize = Math.max( 1, is.stackSize - 1 );
}
else if( hand.isItemEqual( is ) )
{
@@ -929,7 +927,7 @@ public abstract class AEBaseContainer extends Container
{
liftQty = 0;
}
if( !Platform.isSameItemPrecise( slotItem.getItemStack(), item ) )
if( !Platform.itemComparisons().isSameItem( slotItem.getItemStack(), item ) )
{
liftQty = 0;
}
@@ -1105,7 +1103,7 @@ public abstract class AEBaseContainer extends Container
{
try
{
NetworkHandler.instance.sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p );
NetworkHandler.instance().sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p );
}
catch( final IOException e )
{
@@ -1174,7 +1172,7 @@ public abstract class AEBaseContainer extends Container
{
try
{
NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ), (EntityPlayerMP) this.getInventoryPlayer().player );
NetworkHandler.instance().sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ), (EntityPlayerMP) this.getInventoryPlayer().player );
}
catch( final IOException e )
{
@@ -88,7 +88,7 @@ public class SyncData
{
if( o instanceof EntityPlayerMP )
{
NetworkHandler.instance.sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (EntityPlayerMP) o );
NetworkHandler.instance().sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (EntityPlayerMP) o );
}
}
else if( this.field.getType().isEnum() )
@@ -97,7 +97,10 @@ public class SyncData
}
else if( val instanceof Long || val.getClass() == long.class )
{
NetworkHandler.instance.sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o );
if( o instanceof EntityPlayerMP )
{
NetworkHandler.instance().sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o );
}
}
else if( val instanceof Boolean || val.getClass() == boolean.class )
{
@@ -26,6 +26,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
@@ -151,22 +152,24 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
this.setValidContainer( false );
}
for( final Object crafter : this.listeners )
for( final IContainerListener listener : this.listeners )
{
final IContainerListener IContainerListener = (IContainerListener) crafter;
if( this.prevStack != is )
{
// if the bars changed an item was probably made, so just send shit!
for( final Object s : this.inventorySlots )
for( final Slot s : this.inventorySlots )
{
if( s instanceof OptionalSlotRestrictedInput )
{
final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s;
IContainerListener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
listener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
}
}
( (EntityPlayerMP) IContainerListener ).isChangingQuantityOnly = false;
if( listener instanceof EntityPlayerMP )
{
( (EntityPlayerMP) listener ).isChangingQuantityOnly = false;
}
}
}
@@ -263,11 +263,11 @@ public class ContainerCraftConfirm extends AEBaseContainer
{
if( g instanceof EntityPlayer )
{
NetworkHandler.instance.sendTo( a, (EntityPlayerMP) g );
NetworkHandler.instance.sendTo( b, (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( a, (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( b, (EntityPlayerMP) g );
if( c != null )
{
NetworkHandler.instance.sendTo( c, (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( c, (EntityPlayerMP) g );
}
}
}
@@ -352,7 +352,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
this.setAutoStart( false );
if( g != null && originalGui != null && this.getOpenContext() != null )
{
NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.getInventoryPlayer().player );
NetworkHandler.instance().sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.getInventoryPlayer().player );
final TileEntity te = this.getOpenContext().getTile();
Platform.openGUI( this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui );
@@ -117,7 +117,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
{
try
{
NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g );
}
catch( final IOException e )
{
@@ -208,17 +208,17 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
{
if( !a.isEmpty() )
{
NetworkHandler.instance.sendTo( a, (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( a, (EntityPlayerMP) g );
}
if( !b.isEmpty() )
{
NetworkHandler.instance.sendTo( b, (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( b, (EntityPlayerMP) g );
}
if( !c.isEmpty() )
{
NetworkHandler.instance.sendTo( c, (EntityPlayerMP) g );
NetworkHandler.instance().sendTo( c, (EntityPlayerMP) g );
}
}
}
@@ -31,6 +31,7 @@ import appeng.api.networking.crafting.ICraftingCPU;
import appeng.api.networking.crafting.ICraftingGrid;
import appeng.api.storage.ITerminalHost;
import appeng.container.guisync.GuiSync;
import appeng.util.Platform;
public class ContainerCraftingStatus extends ContainerCraftingCPU
@@ -52,50 +53,53 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
@Override
public void detectAndSendChanges()
{
final ICraftingGrid cc = this.getNetwork().getCache( ICraftingGrid.class );
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
int matches = 0;
boolean changed = false;
for( final ICraftingCPU c : cpuSet )
if( Platform.isServer() && this.getNetwork() != null )
{
boolean found = false;
for( final CraftingCPURecord ccr : this.cpus )
{
if( ccr.getCpu() == c )
{
found = true;
}
}
final ICraftingGrid cc = this.getNetwork().getCache( ICraftingGrid.class );
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
final boolean matched = this.cpuMatches( c );
if( matched )
{
matches++;
}
if( found == !matched )
{
changed = true;
}
}
if( changed || this.cpus.size() != matches )
{
this.cpus.clear();
int matches = 0;
boolean changed = false;
for( final ICraftingCPU c : cpuSet )
{
if( this.cpuMatches( c ) )
boolean found = false;
for( final CraftingCPURecord ccr : this.cpus )
{
this.cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) );
if( ccr.getCpu() == c )
{
found = true;
}
}
final boolean matched = this.cpuMatches( c );
if( matched )
{
matches++;
}
if( found == !matched )
{
changed = true;
}
}
this.sendCPUs();
}
if( changed || this.cpus.size() != matches )
{
this.cpus.clear();
for( final ICraftingCPU c : cpuSet )
{
if( this.cpuMatches( c ) )
{
this.cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) );
}
}
this.noCPU = this.cpus.isEmpty();
this.sendCPUs();
}
this.noCPU = this.cpus.isEmpty();
}
super.detectAndSendChanges();
}
@@ -115,7 +115,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
{
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
{
if( Platform.isSameItemPrecise( optional, is ) )
if( Platform.itemComparisons().isSameItem( optional, is ) )
{
return false;
}
@@ -126,18 +126,18 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orElse( null ) ) ) && // and...
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orElse( null ) ) );
final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons().isSameItem( top, recipe.getTopOptional().orElse( null ) ) ) && // and...
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.itemComparisons().isSameItem( bot, recipe.getBottomOptional().orElse( null ) ) );
final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orElse( null ) ) ) && // and...
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orElse( null ) ) );
final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons().isSameItem( bot, recipe.getTopOptional().orElse( null ) ) ) && // and...
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.itemComparisons().isSameItem( top, recipe.getBottomOptional().orElse( null ) ) );
if( matchA || matchB )
{
matches = true;
for( final ItemStack option : recipe.getInputs() )
{
if( Platform.isSameItemPrecise( is, option ) )
if( Platform.itemComparisons().isSameItem( is, option ) )
{
found = true;
}
@@ -174,13 +174,13 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
boolean isValid = false;
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
if( Platform.isSameItemPrecise( recipe.getTopOptional().orElse( null ), otherSlot ) )
if( Platform.itemComparisons().isSameItem( recipe.getTopOptional().orElse( null ), otherSlot ) )
{
isValid = Platform.isSameItemPrecise( is, recipe.getBottomOptional().orElse( null ) );
isValid = Platform.itemComparisons().isSameItem( is, recipe.getBottomOptional().orElse( null ) );
}
else if( Platform.isSameItemPrecise( recipe.getBottomOptional().orElse( null ), otherSlot ) )
else if( Platform.itemComparisons().isSameItem( recipe.getBottomOptional().orElse( null ), otherSlot ) )
{
isValid = Platform.isSameItemPrecise( is, recipe.getTopOptional().orElse( null ) );
isValid = Platform.itemComparisons().isSameItem( is, recipe.getTopOptional().orElse( null ) );
}
if( isValid )
@@ -186,7 +186,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
{
try
{
NetworkHandler.instance.sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player );
NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player );
}
catch( final IOException e )
{
@@ -186,15 +186,18 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
if( sideLocal != sideRemote )
{
this.clientCM.putSetting( set, sideLocal );
for( final Object crafter : this.listeners )
for( final IContainerListener crafter : this.listeners )
{
try
if( crafter instanceof EntityPlayerMP )
{
NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
}
catch( final IOException e )
{
AELog.debug( e );
try
{
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
}
catch( final IOException e )
{
AELog.debug( e );
}
}
}
}
@@ -230,7 +233,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
{
if( c instanceof EntityPlayer )
{
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
}
}
}
@@ -258,6 +261,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
super.detectAndSendChanges();
}
}
protected void updatePowerStatus()
@@ -325,14 +329,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
}
catch( final BufferOverflowException boe )
{
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
piu = new PacketMEInventoryUpdate();
piu.appendItem( send );
}
}
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
}
catch( final IOException e )
{
@@ -340,7 +344,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
}
}
}
@Override
public void removeListener( final IContainerListener c )
{
@@ -67,7 +67,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
{
if( currentItem != null )
{
if( Platform.isSameItem( this.civ.getItemStack(), currentItem ) )
if( Platform.itemComparisons().isEqualItem( this.civ.getItemStack(), currentItem ) )
{
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.civ.getItemStack() );
}
@@ -137,7 +137,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
{
if( c instanceof EntityPlayer )
{
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
}
}
}
@@ -72,7 +72,7 @@ public class ContainerNetworkTool extends AEBaseContainer
{
if( currentItem != null )
{
if( Platform.isSameItem( this.toolInv.getItemStack(), currentItem ) )
if( Platform.itemComparisons().isEqualItem( this.toolInv.getItemStack(), currentItem ) )
{
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.toolInv.getItemStack() );
}
@@ -200,7 +200,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
if( output != null && !this.isPattern( output ) )
{
return;
}// if nothing is there we should snag a new pattern.
} // if nothing is there we should snag a new pattern.
else if( output == null )
{
output = this.patternSlotIN.getStack();
@@ -414,7 +414,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
final IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj );
if( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) )
if( rr == r && Platform.itemComparisons().isSameItem( rr.getCraftingResult( real ), is ) )
{
final SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 );
sc.onPickupFromSlot( p, is );
@@ -483,19 +483,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
if( s == this.patternSlotOUT && Platform.isServer() )
{
for( final Object crafter : this.listeners )
for( final IContainerListener listener : this.listeners )
{
final IContainerListener IContainerListener = (IContainerListener) crafter;
for( final Object g : this.inventorySlots )
for( final Slot slot : this.inventorySlots )
{
if( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix )
if( slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix )
{
final Slot sri = (Slot) g;
IContainerListener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
listener.sendSlotContents( this, slot.slotNumber, slot.getStack() );
}
}
( (EntityPlayerMP) IContainerListener ).isChangingQuantityOnly = false;
if( listener instanceof EntityPlayerMP )
{
( (EntityPlayerMP) listener ).isChangingQuantityOnly = false;
}
}
this.detectAndSendChanges();
}
@@ -79,7 +79,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
{
if( currentItem != null )
{
if( Platform.isSameItem( this.toolInv.getItemStack(), currentItem ) )
if( Platform.itemComparisons().isEqualItem( this.toolInv.getItemStack(), currentItem ) )
{
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.toolInv.getItemStack() );
}
@@ -168,11 +168,10 @@ public class ContainerSecurityStation extends ContainerMEMonitorable implements
this.wirelessOut.putStack( term );
// update the two slots in question...
for( final Object crafter : this.listeners )
for( final IContainerListener listener : this.listeners )
{
final IContainerListener IContainerListener = (IContainerListener) crafter;
IContainerListener.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
IContainerListener.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
listener.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
listener.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
}
}
}
@@ -235,7 +235,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
{
if( currentItem != null )
{
if( Platform.isSameItem( this.tbInventory.getItemStack(), currentItem ) )
if( Platform.itemComparisons().isEqualItem( this.tbInventory.getItemStack(), currentItem ) )
{
this.getPlayerInv().setInventorySlotContents( this.tbSlot, this.tbInventory.getItemStack() );
}
@@ -53,8 +53,8 @@ public class ContainerWireless extends AEBaseContainer
{
final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize;
this.setRange( (long) ( 10 * AEConfig.instance.wireless_getMaxRange( boosters ) ) );
this.setDrain( (long) ( 100 * AEConfig.instance.wireless_getPowerDrain( boosters ) ) );
this.setRange( (long) ( 10 * AEConfig.instance().wireless_getMaxRange( boosters ) ) );
this.setDrain( (long) ( 100 * AEConfig.instance().wireless_getPowerDrain( boosters ) ) );
super.detectAndSendChanges();
}
@@ -54,7 +54,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell
}
else
{
this.setPowerMultiplier( AEConfig.instance.wireless_getDrainRate( this.wirelessTerminalGUIObject.getRange() ) );
this.setPowerMultiplier( AEConfig.instance().wireless_getDrainRate( this.wirelessTerminalGUIObject.getRange() ) );
}
}
}
@@ -158,7 +158,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
// update crafting matrix...
ItemStack is = this.getStack();
if( is != null && Platform.isSameItem( request, is ) )
if( is != null && Platform.itemComparisons().isEqualItem( request, is ) )
{
final ItemStack[] set = new ItemStack[this.getPattern().getSizeInventory()];
@@ -170,7 +170,7 @@ public class SlotRestrictedInput extends AppEngSlot
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
{
if( Platform.isSameItemPrecise( optional, i ) )
if( Platform.itemComparisons().isSameItem( optional, i ) )
{
return true;
}
@@ -258,7 +258,7 @@ public class SlotRestrictedInput extends AppEngSlot
public static boolean isMetalIngot( final ItemStack i )
{
if( Platform.isSameItemPrecise( i, new ItemStack( Items.IRON_INGOT ) ) )
if( Platform.itemComparisons().isSameItem( i, new ItemStack( Items.IRON_INGOT ) ) )
{
return true;
}
@@ -267,7 +267,7 @@ public class SlotRestrictedInput extends AppEngSlot
{
for( final ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
{
if( Platform.isSameItemPrecise( i, ingot ) )
if( Platform.itemComparisons().isSameItem( i, ingot ) )
{
return true;
}

Some files were not shown because too many files have changed in this diff Show More