Compare commits

...

55 Commits

Author SHA1 Message Date
yueh bcba2329b7 Merge pull request #1902 from yueh/fix-1896
Fixes 1896: Only update a monitor if the text would change
2015-09-23 23:46:43 +02:00
yueh 597e17b52b Fixes 1896: Only update a monitor if the text would change 2015-09-23 22:28:50 +02:00
yueh 4b055a7f21 Merge pull request #1894 from yueh/update-readme
Updated README.md and CONTRIBIBUTING.md
2015-09-23 15:28:23 +02:00
yueh 759b6daa59 Merge pull request #1893 from yueh/fix-1892
Fixes incorrect handling of prioritized inventories
2015-09-23 15:28:13 +02:00
yueh e1f03db7b3 Updated README.md and CONTRIBIBUTING.md 2015-09-23 14:27:11 +02:00
yueh 72518ad977 Merge pull request #1772 from yueh/feature-1569
Feature 1569 Typesafe Integration Modules
2015-09-23 00:20:00 +02:00
yueh 21fa2718f8 Merge pull request #1879 from yueh/fix-1878
Fixes #1878: Now saves the dimensionlist correctly
2015-09-23 00:15:36 +02:00
yueh 777bec184a Fixes 1878: Now saves worlddata more reliable. 2015-09-23 00:12:53 +02:00
yueh b9d615c4ba Fixes incorrect handling of prioritized inventories
Prioritized inventories are not longer used twice for storing leftover
items and thus finally reporting twice the amount of storable items when
they are the only possible option to store something.

Also fixes import buses now respecting the amount of storable items inside
the network instead of trying to place the exported items back and failing
on any restricted inventory, potentially voiding the overflow.

Fixes #1892
2015-09-23 00:09:27 +02:00
yueh 40d339e173 Merge pull request #1888 from asd0210a/patch-3
zh_tw.lang Updated
2015-09-22 19:39:56 +02:00
asd0210a 20c1c4529a zh_tw.lang Updated 2015-09-21 10:15:20 +08:00
yueh 72399e5789 Merge pull request #1866 from yueh/fix-1865
Fixes #1865: Spawn overflow items into the world
2015-09-16 20:41:57 +02:00
yueh f303c17ae0 First iteration of making integrations typesafe 2015-09-16 15:59:33 +02:00
yueh 26f13d4109 Fixes #1865: Spawn overflow items into the world 2015-09-11 20:05:17 +02:00
yueh 0df445c6a8 Merge pull request #1862 from yueh/feature-interface-9-slots
Changed the interface to 9 slots to be consistent with every other machine
2015-09-11 20:04:29 +02:00
thatsIch 8c817b2f85 Merge pull request #1851 from thatsIch/b-1850-add-second-optional-to-grindstone
Fixes #1850: Fixed support for second optional output of the AE2 Grindstone
2015-09-10 19:15:29 +02:00
yueh 7bd8cf3f59 Changed the interface to 9 slots to be consistent with every other machine 2015-09-08 00:19:05 +02:00
yueh 3ab6758e6c Merge pull request #1839 from yueh/fix-1833
Fixed the order craftinglinks are notified for the last item.
2015-09-05 18:00:41 +02:00
yueh 3dd948e4a4 Merge pull request #1854 from yueh/feature-recipes-refactoring
Added a missing whitespace and removed duplicate ones.
2015-09-05 18:00:22 +02:00
thatsIch 3bb9e4df97 Merge pull request #1634 from thatsIch/b-1588-wrong-oredict-name
Fixes #1588: Charged Certus Quartz Ore was given a wrong name
2015-09-03 23:50:53 +02:00
thatsIch d17f045339 Merge pull request #1852 from Mazdallier/patch-1
Update fr_FR.lang
2015-09-02 17:03:16 +02:00
yueh 5817cde56b Added a missing whitespace and removed duplicate ones. 2015-09-02 16:51:37 +02:00
Mazdallier 45d94d4c2c Update fr_FR.lang 2015-09-02 10:00:16 +02:00
thatsIch d893e52eb0 Fixes #1850: Fixed support for second optional output of the AE2 Grindstone 2015-09-01 23:58:40 +02:00
thatsIch 464a56ffc5 Fixes #1588: Charged Certus Quartz Ore was given a wrong name 2015-08-31 16:54:29 +02:00
yueh 40dcf711f6 Fixed the order craftinglinks are notified for the last item.
Fixes #1833
2015-08-28 13:29:24 +02:00
yueh 5dfca5eb93 Merge pull request #1776 from yueh/feature-1283
Closes #1283: Add custom Callable to prevent memory leaks
2015-08-22 23:22:17 +02:00
yueh 26daaf2232 Merge pull request #1805 from yueh/feature-recipes-refactoring
Reorganizes the recipes in a more reasonable way.
2015-08-22 23:21:14 +02:00
yueh c2022a7208 Reorganizes the recipes in a more reasonable way.
The recipes are now structured into multipe subfolder and split into more
distinct files, so the names are more appropriate and are better at
hinting which items the actually contain.

It also extends the RecipeResourceCopier to now handle the folder
recursively and extract all subdirectories and their files.

"import=" is currently requiring a relative path to the root directory
of the recipes. This would require a larger rewrite/refactoring, thus it
is kept for now until a potentially later changer.

This reverts splitting the oredict entries into their own directory and
moves them back into the recipes folder, as it currently is causing a
couple of issues like not being able to resolve the aliases or is not
working indev. But to keep it seperate it is now its own recipe file.

Fixes #1791
Reverts #1635
2015-08-21 12:23:20 +02:00
yueh 74c2e1fab9 Merge pull request #1823 from yueh/fix-1810
Fixes #1810: Removes a CompassReader once the world is unloaded.
2015-08-20 23:05:58 +02:00
yueh 0de7a2d83a Closes #1283: Add custom Callable to prevent memory leaks 2015-08-20 21:04:06 +02:00
yueh 517a832ac1 Fixes #1810: Removes a CompassReader once the world is unloaded.
This should no longer keep a reference to a World around and potentially
keep them loaded.
Also added a finalize() to CompassRegion to ensure the file is closed on a
GC.

Some cleanup regarding member order, final, etc
2015-08-20 19:04:33 +02:00
yueh 1ecc811559 Merge pull request #1813 from yueh/fix-1481
Fixes #1481: Not using the right itemcount in a few cases
2015-08-16 15:39:33 +02:00
yueh 7dd283cf9f Fixes 1481: Not using the right itemcount in a few cases 2015-08-16 15:32:58 +02:00
yueh a12ef1e534 Merge pull request #1807 from yueh/fix-1806
Wrong culling direction when rendering inscriber
2015-08-15 21:25:29 +02:00
yueh a567dcc026 Wrong culling direction when rendering inscriber
Fixes #1806
2015-08-15 19:48:12 +02:00
yueh 7f72ba97f0 Merge pull request #1769 from yueh/feature-1726
Closes #1726: Added Pressure P2P tunnel (PneumaticCraft)
2015-08-15 18:12:37 +02:00
yueh c3db5ef9e4 Merge pull request #1787 from thatsIch/b-1786-turkish-locale
Fixes #1786: Locale critical code now uses the english local. Fixes Turkish Problem.
2015-08-15 18:11:48 +02:00
yueh f955febb5d Merge pull request #1782 from yueh/fix-1781
Fixes #1781: Do not crash after the tileentity was removed
2015-08-15 18:10:44 +02:00
yueh 3115147edf Merge pull request #1774 from yueh/fix-1481
Fixes #1481: Updated cell itemcount when empty
2015-08-15 18:10:30 +02:00
yueh 1cec5922a0 Merge pull request #1773 from yueh/fix-1601
Fixes #1601: Do not allow 0 as stacksize for recipes
2015-08-15 18:10:21 +02:00
thatsIch 322b296639 Fixes #1786: Locale critical code now uses the english local for transmission. Fixes Turkish Problem.
Applied English Locale where localization is not expected as in internal recipe handling and IMC handling, basically which interacts with public API where we either require to enforce the incoming text with regex ([a-z0-9]) or just expect proper usage of the API, but with just using upper cases in recipe files it would break in Turkish Locale like

ALIAS

another option would have been to use `equalsIgnoreCase` in some cases, but not all applicable
2015-08-10 13:34:31 +02:00
yueh d1244f59ed Fixes #1781 Do not crash after the tileentity was removed 2015-08-08 14:14:38 +02:00
yueh 6a18102ea0 Fixes #1481: Updated cell itemcount when empty 2015-08-06 23:04:57 +02:00
yueh 300a9618b6 Fixes #1601: Do not allow 0 as stacksize for recipes 2015-08-06 22:47:24 +02:00
yueh dfb435ae7d Removed unused imports 2015-08-06 19:49:56 +02:00
yueh 1728f683c3 Closes #1726: Added Pressure P2P tunnel (PneumaticCraft) 2015-08-06 19:37:19 +02:00
yueh c0b62fd519 Added missing annotations 2015-08-06 19:08:33 +02:00
yueh 67c901966e Non static access of static members 2015-08-06 19:08:32 +02:00
yueh a5287f6779 Qualified field and method access 2015-08-06 19:08:04 +02:00
yueh 8234c6dbb5 Added missing blocks for control statements 2015-08-06 19:08:03 +02:00
yueh 9c8deac9de Code format 2015-08-06 19:08:02 +02:00
yueh c21a44d8c0 Organize imports 2015-08-06 19:06:49 +02:00
yueh 3c62734c87 Merge pull request #1770 from bakaxyf/master
Update zh_CN.lang
2015-08-06 13:25:45 +02:00
bakaxyf 5b6b14cde7 Update zh_CN.lang 2015-08-06 15:32:15 +08:00
334 changed files with 3666 additions and 2823 deletions
+29 -16
View File
@@ -11,20 +11,32 @@ top of things.
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now! Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it. 1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) 2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Click new issue 3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue. * Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* To help in resolving your issues please try to include the follow if applicable: * The following details are required. Not including them can cause the issue to be closed.
* The problem that is happening? * Forge version
* What was expected? * AE2 version
* How to reproduce the problem? * Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Server or Single Player? * Do not post an excerpt of what you consider important, instead:
* Mod Pack using and version? * Post the full log
* Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file) * Other mods and their version, when reporting an issue between AE and another mod
* Screen shots or Pictures of the problem * Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
* To further help in resolving your issues please try to include the follow if applicable:
* What was expected?
* How to reproduce the problem?
* This is usually a great detail and allows us to fix it way faster
* Server or Single Player?
* Screen shots or Pictures of the problem
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
5. Click `Submit New Issue`, and wait for feedback! 5. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
### Submitting Changes ### Submitting Changes
* Submit an issue to the github project, assuming one does not already exist. * Submit an issue to the github project, assuming one does not already exist.
@@ -55,10 +67,8 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
from our issue tracker. The body describes the behavior without the patch, from our issue tracker. The body describes the behavior without the patch,
why this is a problem, and how the patch fixes the problem when applied. why this is a problem, and how the patch fixes the problem when applied.
```` ````
* Always fully test your changes. If they are large engouh in scope, then fully * Always fully test your changes. If they are large engouh in scope, then fully test AE2.
test AE2. * Describing the process you used to test your changes in detail will help speed up this process.
* Describing the process you used to test your changes in detail will help speed
up this process.
## Making Trivial Changes ## Making Trivial Changes
@@ -97,6 +107,9 @@ the styling guidelines used by AE.
PRs that do not conform to these standards will be rejected. PRs that do not conform to these standards will be rejected.
You can find presets for Eclipse and IntelliJ IDEA in the `codeformat` folder.
We try to keep them up to date, but in case you find them not formatting it correctly, then please report it
### Whitespace ### Whitespace
#### Tabs or spaces #### Tabs or spaces
+27 -13
View File
@@ -54,20 +54,32 @@ You install this mod by putting it into the `minecraft/mods/` folder. It has no
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now! Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it. 1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) 2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Click new issue 3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue. * Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* To help in resolving your issues please try to include the follow if applicable: * The following details are required. Not including them can cause the issue to be closed.
* The problem that is happening? * Forge version
* What was expected? * AE2 version
* How to reproduce the problem? * Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Server or Single Player? * Do not post an excerpt of what you consider important, instead:
* Mod Pack using and version? * Post the full log
* Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file) * Other mods and their version, when reporting an issue between AE and another mod
* Screen shots or Pictures of the problem * Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
* To further help in resolving your issues please try to include the follow if applicable:
* What was expected?
* How to reproduce the problem?
* This is usually a great detail and allows us to fix it way faster
* Server or Single Player?
* Screen shots or Pictures of the problem
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
5. Click `Submit New Issue`, and wait for feedback! 5. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
## Building ## Building
1. Clone this repository via 1. Clone this repository via
@@ -90,6 +102,8 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
Before you want to add major changes, you might want to discuss them with us first, before wasting your time. Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request). If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request).
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
Here are a few things to keep in mind that will help get your PR approved. Here are a few things to keep in mind that will help get your PR approved.
* A PR should be focused on content. Any PRs where the changes are only syntax will be rejected. * A PR should be focused on content. Any PRs where the changes are only syntax will be rejected.
@@ -127,7 +141,7 @@ Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Do
When compiling against the AE2 API you can use gradle dependencies, just add When compiling against the AE2 API you can use gradle dependencies, just add
dependencies { dependencies {
compile "appeng:appliedenergistics2:rv_-_____-__:dev" compile "appeng:appliedenergistics2:rv_-_____-__:dev"
} }
or add the compile line to your existing dependencies task to your build.gradle or add the compile line to your existing dependencies task to your build.gradle
+1 -2
View File
@@ -98,9 +98,8 @@ sourceSets {
resources { resources {
srcDir "src/main/resources/" srcDir "src/main/resources/"
include "assets/appliedenergistics2/recipes/*.recipe", include "assets/appliedenergistics2/recipes/**/*.recipe",
"assets/appliedenergistics2/recipes/README.html", "assets/appliedenergistics2/recipes/README.html",
"assets/appliedenergistics2/oredict/*.oredict",
"assets/appliedenergistics2/lang/*.lang", "assets/appliedenergistics2/lang/*.lang",
"assets/appliedenergistics2/textures/blocks/*", "assets/appliedenergistics2/textures/blocks/*",
"assets/appliedenergistics2/textures/guis/*", "assets/appliedenergistics2/textures/guis/*",
+1
View File
@@ -35,6 +35,7 @@ code_chicken_core_version=1.0.7.46
nei_version=1.0.5.111 nei_version=1.0.5.111
bc_version=7.0.9 bc_version=7.0.9
opencomputers_version=1.5.12.26 opencomputers_version=1.5.12.26
pneumaticcraft_version=1.9.15-105
######################################################### #########################################################
# Self Compiled APIs # # Self Compiled APIs #
+6
View File
@@ -56,6 +56,11 @@ repositories {
url = "http://maven.cil.li/" url = "http://maven.cil.li/"
} }
maven {
name = "MM repo"
url = "http://maven.k-4u.nl/"
}
ivy { ivy {
name "BuildCraft" name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]" artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
@@ -109,6 +114,7 @@ dependencies {
compile "codechicken:CodeChickenCore:${minecraft_version}-${code_chicken_core_version}:dev" compile "codechicken:CodeChickenCore:${minecraft_version}-${code_chicken_core_version}:dev"
compile "codechicken:NotEnoughItems:${minecraft_version}-${nei_version}:dev" compile "codechicken:NotEnoughItems:${minecraft_version}-${nei_version}:dev"
compile "com.mod-buildcraft:buildcraft:${bc_version}:dev" compile "com.mod-buildcraft:buildcraft:${bc_version}:dev"
compile "pneumaticCraft:PneumaticCraft-${minecraft_version}:${pneumaticcraft_version}:api"
// provided APIs // provided APIs
compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api" compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api"
+2 -2
View File
@@ -1,6 +1,6 @@
#Sat May 16 13:19:14 CEST 2015 #Mon Aug 31 16:41:19 CEST 2015
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
@@ -34,5 +34,6 @@ public enum TunnelType
ITEM, // Item Tunnel ITEM, // Item Tunnel
LIGHT, // Light Tunnel LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel COMPUTER_MESSAGE, // Computer Message Tunnel
PRESSURE // PneumaticCraft Tunnel
} }
@@ -86,6 +86,8 @@ public interface IParts
IItemDefinition p2PTunnelOpenComputers(); IItemDefinition p2PTunnelOpenComputers();
IItemDefinition p2PTunnelPneumaticCraft();
IItemDefinition cableAnchor(); IItemDefinition cableAnchor();
IItemDefinition monitor(); IItemDefinition monitor();
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 AlgorithmX2 * Copyright (c) 2013 - 2015 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -24,11 +24,19 @@
package appeng.api.features; package appeng.api.features;
import javax.annotation.Nullable;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IRecipeHandler; import appeng.api.recipes.IRecipeHandler;
import appeng.api.recipes.ISubItemResolver; import appeng.api.recipes.ISubItemResolver;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv0
*/
public interface IRecipeHandlerRegistry public interface IRecipeHandlerRegistry
{ {
@@ -37,7 +45,7 @@ public interface IRecipeHandlerRegistry
* *
* MUST BE CALLED IN PRE-INIT * MUST BE CALLED IN PRE-INIT
* *
* @param name name of crafthandler * @param name name of crafthandler
* @param handler class of crafthandler * @param handler class of crafthandler
*/ */
void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler ); void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler );
@@ -56,6 +64,7 @@ public interface IRecipeHandlerRegistry
* *
* @return A recipe handler by name, returns null on failure. * @return A recipe handler by name, returns null on failure.
*/ */
@Nullable
ICraftHandler getCraftHandlerFor( String name ); ICraftHandler getCraftHandlerFor( String name );
/** /**
@@ -67,9 +76,10 @@ public interface IRecipeHandlerRegistry
* resolve sub items by name. * resolve sub items by name.
* *
* @param nameSpace namespace of item * @param nameSpace namespace of item
* @param itemName full name of item * @param itemName full name of item
* *
* @return ResolverResult or ResolverResultSet * @return ResolverResult or ResolverResultSet or null if could not resolve
*/ */
@Nullable
Object resolveItem( String nameSpace, String itemName ); Object resolveItem( String nameSpace, String itemName );
} }
@@ -56,7 +56,6 @@ import appeng.client.texture.FlippableIcon;
import appeng.client.texture.MissingIcon; import appeng.client.texture.MissingIcon;
import appeng.core.features.AEBlockFeatureHandler; import appeng.core.features.AEBlockFeatureHandler;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.FeatureNameExtractor; import appeng.core.features.FeatureNameExtractor;
import appeng.core.features.IAEFeature; import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler; import appeng.core.features.IFeatureHandler;
@@ -1,11 +1,15 @@
package appeng.block; package appeng.block;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab; import net.minecraft.item.ItemSlab;
public class AEBaseItemBlockSlab extends ItemSlab {
public AEBaseItemBlockSlab(Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab) public class AEBaseItemBlockSlab extends ItemSlab
{
public AEBaseItemBlockSlab( Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab )
{ {
super( block, singleSlab, doubleSlab, isDoubleSlab ); super( block, singleSlab, doubleSlab, isDoubleSlab );
} }
+34 -24
View File
@@ -22,15 +22,14 @@ package appeng.block;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab; import net.minecraft.block.BlockSlab;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature; import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler; import appeng.core.features.IFeatureHandler;
@@ -57,24 +56,27 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F ); this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F );
this.setStepSound( block.stepSound ); this.setStepSound( block.stepSound );
this.useNeighborBrightness = true; this.useNeighborBrightness = true;
if (!field_150004_a) this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs(this); if( !this.field_150004_a )
this.features = !field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null; {
this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs( this );
}
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
} }
public AEBaseSlabBlock setSlabs(AEBaseSlabBlock slabs) public AEBaseSlabBlock setSlabs( AEBaseSlabBlock slabs )
{ {
this.slabs = slabs; this.slabs = slabs;
return this; return this;
} }
public AEBaseSlabBlock slabs() public AEBaseSlabBlock slabs()
{ {
return slabs; return this.slabs;
} }
public AEBaseSlabBlock doubleSlabs() public AEBaseSlabBlock doubleSlabs()
{ {
return doubleSlabs; return this.doubleSlabs;
} }
@Override @Override
@@ -90,40 +92,48 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
} }
@Override @Override
public IIcon getIcon(int dir, int meta) public IIcon getIcon( int dir, int meta )
{ {
return block.getIcon( dir, this.meta ); return this.block.getIcon( dir, this.meta );
} }
@Override @Override
public String func_150002_b(int p_150002_1_) public String func_150002_b( int p_150002_1_ )
{ {
return this.getUnlocalizedName(); return this.getUnlocalizedName();
} }
@Override @Override
public void registerBlockIcons(IIconRegister reg) { } public void registerBlockIcons( IIconRegister reg )
@Override
public Item getItemDropped(int meta, Random rand, int fortune)
{ {
return this.field_150004_a ? Item.getItemFromBlock(this.slabs) : Item.getItemFromBlock(this);
} }
@Override @Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) public Item getItemDropped( int meta, Random rand, int fortune )
{ {
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock(x, y, z); return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this );
}
if (block == null) return null; @Override
if (block.field_150004_a) block = this.slabs; public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z );
int meta = world.getBlockMetadata(x, y, z) & 7; if( block == null )
return new ItemStack(block, 1, meta); {
return null;
}
if( block.field_150004_a )
{
block = this.slabs;
}
int meta = world.getBlockMetadata( x, y, z ) & 7;
return new ItemStack( block, 1, meta );
} }
public String name() public String name()
{ {
return name; return this.name;
} }
} }
@@ -53,9 +53,7 @@ import appeng.api.util.IOrientable;
import appeng.block.networking.BlockCableBus; import appeng.block.networking.BlockCableBus;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.features.AETileBlockFeatureHandler; import appeng.core.features.AETileBlockFeatureHandler;
import appeng.core.features.ActivityState;
import appeng.core.features.IAEFeature; import appeng.core.features.IAEFeature;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus; import appeng.tile.networking.TileCableBus;
@@ -77,7 +77,7 @@ import appeng.transformer.annotations.Integration.Method;
import appeng.util.Platform; import appeng.util.Platform;
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" ) @Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = IntegrationType.MFR )
public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{ {
@@ -455,7 +455,8 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who ); return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
} }
catch( Throwable ignored ) catch( Throwable ignored )
{} {
}
return false; return false;
} }
@@ -505,7 +506,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
} }
@Override @Override
@Method( iname = "MFR" ) @Method( iname = IntegrationType.MFR )
public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side ) public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side )
{ {
return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None; return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
@@ -26,7 +26,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB; import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
@@ -20,7 +20,6 @@ package appeng.block.qnb;
import java.util.Collections; import java.util.Collections;
import java.util.EnumSet;
import java.util.List; import java.util.List;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -28,7 +27,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.core.features.AEFeature;
import appeng.tile.qnb.TileQuantumBridge; import appeng.tile.qnb.TileQuantumBridge;
@@ -21,6 +21,7 @@ package appeng.block.solids;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -62,7 +62,7 @@ public class OreQuartzCharged extends OreQuartz
@Override @Override
public int damageDropped( int id ) public int damageDropped( int id )
{ {
for ( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() ) for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
{ {
return crystalStack.getItemDamage(); return crystalStack.getItemDamage();
} }
@@ -74,7 +74,7 @@ public class OreQuartzCharged extends OreQuartz
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r ) public void randomDisplayTick( World w, int x, int y, int z, Random r )
{ {
if ( !AEConfig.instance.enableEffects ) if( !AEConfig.instance.enableEffects )
{ {
return; return;
} }
@@ -63,7 +63,6 @@ import appeng.helpers.WirelessTerminalGuiObject;
import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.parts.reporting.AbstractPartTerminal; import appeng.parts.reporting.AbstractPartTerminal;
import appeng.parts.reporting.PartTerminal;
import appeng.tile.misc.TileSecurity; import appeng.tile.misc.TileSecurity;
import appeng.util.IConfigManagerHost; import appeng.util.IConfigManagerHost;
import appeng.util.Platform; import appeng.util.Platform;
@@ -394,7 +394,6 @@ public class GuiImgButton extends GuiButton implements ITooltip
} }
} }
private static class ButtonAppearance private static class ButtonAppearance
{ {
public int index; public int index;
@@ -56,11 +56,11 @@ public class GuiTabButton extends GuiButton implements ITooltip
/** /**
* Using itemstack as an icon * Using itemstack as an icon
* *
* @param x x pos of button * @param x x pos of button
* @param y y pos of button * @param y y pos of button
* @param ico used icon * @param ico used icon
* @param message mouse over message * @param message mouse over message
* @param ir renderer * @param ir renderer
*/ */
public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir ) public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir )
{ {
@@ -45,10 +45,10 @@ public class MEGuiTextField extends GuiTextField
* Pays attention to the '_' caret. * Pays attention to the '_' caret.
* *
* @param fontRenderer renderer for the strings * @param fontRenderer renderer for the strings
* @param xPos absolute left position * @param xPos absolute left position
* @param yPos absolute top position * @param yPos absolute top position
* @param width absolute width * @param width absolute width
* @param height absolute height * @param height absolute height
*/ */
public MEGuiTextField( FontRenderer fontRenderer, int xPos, int yPos, int width, int height ) public MEGuiTextField( FontRenderer fontRenderer, int xPos, int yPos, int width, int height )
{ {
@@ -20,6 +20,7 @@ package appeng.client.render;
import java.util.EnumSet; import java.util.EnumSet;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.google.common.base.Function; import com.google.common.base.Function;
@@ -24,7 +24,6 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import appeng.block.AEBaseBlock;
import appeng.block.networking.BlockController; import appeng.block.networking.BlockController;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
@@ -159,6 +159,7 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL12.GL_RESCALE_NORMAL ); GL11.glDisable( GL12.GL_RESCALE_NORMAL );
GL11.glCullFace( GL11.GL_FRONT );
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture( TextureMap.locationBlocksTexture ); mc.renderEngine.bindTexture( TextureMap.locationBlocksTexture );
@@ -224,6 +225,9 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
tess.draw(); tess.draw();
GL11.glCullFace( GL11.GL_BACK );
GL11.glEnable( GL11.GL_LIGHTING );
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
GL11.glPopMatrix(); GL11.glPopMatrix();
int items = 0; int items = 0;
@@ -29,7 +29,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock;
import appeng.block.misc.BlockPaint; import appeng.block.misc.BlockPaint;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
@@ -32,7 +32,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.block.misc.BlockQuartzTorch;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
@@ -76,7 +76,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
@Override @Override
/** /**
* Overridden super.setupConfig to prevent setting up the fake slots * Overridden super.setupConfig to prevent setting up the fake slots
*/ protected void setupConfig() */protected void setupConfig()
{ {
this.setupUpgrades(); this.setupUpgrades();
} }
@@ -127,10 +127,10 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{ {
boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and... boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and...
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) ); ( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) );
boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and... boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and...
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) ); ( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) );
if( matchA || matchB ) if( matchA || matchB )
{ {
@@ -50,19 +50,19 @@ public class ContainerInterface extends ContainerUpgradeable
this.myDuality = te.getInterfaceDuality(); this.myDuality = te.getInterfaceDuality();
for( int x = 0; x < 9; x++ ) for( int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++ )
{ {
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, this.invPlayer ) ); this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, this.invPlayer ) );
} }
for( int x = 0; x < 8; x++ ) for( int x = 0; x < DualityInterface.NUMBER_OF_CONFIG_SLOTS; x++ )
{ {
this.addSlotToContainer( new SlotFake( this.myDuality.getConfig(), x, 17 + 18 * x, 35 ) ); this.addSlotToContainer( new SlotFake( this.myDuality.getConfig(), x, 8 + 18 * x, 35 ) );
} }
for( int x = 0; x < 8; x++ ) for( int x = 0; x < DualityInterface.NUMBER_OF_STORAGE_SLOTS; x++ )
{ {
this.addSlotToContainer( new SlotNormal( this.myDuality.getStorage(), x, 17 + 18 * x, 35 + 18 ) ); this.addSlotToContainer( new SlotNormal( this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18 ) );
} }
} }
@@ -21,8 +21,8 @@ package appeng.container.slot;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
public class SlotPlayerInv extends AppEngSlot public class SlotPlayerInv extends AppEngSlot
{ {
@@ -145,7 +145,8 @@ public class SlotRestrictedInput extends AppEngSlot
{ {
return true; return true;
} }
// ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) // ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ?
// ((ICraftingPatternItem)
// i.getItem()).getPatternForItem( i ) : null; // i.getItem()).getPatternForItem( i ) : null;
return false;// pattern != null; return false;// pattern != null;
} }
@@ -179,8 +180,8 @@ public class SlotRestrictedInput extends AppEngSlot
case INSCRIBER_INPUT: case INSCRIBER_INPUT:
return true;/* return true;/*
* for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return true; * for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return
* * true;
* return false; * return false;
*/ */
+1 -1
View File
@@ -118,7 +118,7 @@ public final class Api implements IAppEngApi
@Override @Override
public IGridNode createGridNode( IGridBlock blk ) public IGridNode createGridNode( IGridBlock blk )
{ {
if ( Platform.isClient() ) if( Platform.isClient() )
{ {
throw new IllegalStateException( "Grid features for " + blk + " are server side only." ); throw new IllegalStateException( "Grid features for " + blk + " are server side only." );
} }
+1
View File
@@ -21,6 +21,7 @@ package appeng.core;
import java.io.File; import java.io.File;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
+10 -7
View File
@@ -20,6 +20,7 @@ package appeng.core;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms;
@@ -35,6 +36,10 @@ import appeng.core.api.imc.IMCSpatial;
/** /**
* Handles the delegation of the corresponding IMC messages to the suitable IMC processors * Handles the delegation of the corresponding IMC messages to the suitable IMC processors
*
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv1
*/ */
public class IMCHandler public class IMCHandler
{ {
@@ -43,8 +48,7 @@ public class IMCHandler
/** /**
* Contains the processors, * Contains the processors,
* *
* is mutable, * is mutable, but write access only by the constructor
* but write access only by the constructor
*/ */
private final Map<String, IIMCProcessor> processors; private final Map<String, IIMCProcessor> processors;
@@ -62,13 +66,12 @@ public class IMCHandler
for( TunnelType type : TunnelType.values() ) for( TunnelType type : TunnelType.values() )
{ {
this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase(), new IMCP2PAttunement() ); this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase( Locale.ENGLISH ), new IMCP2PAttunement() );
} }
} }
/** /**
* Tries to find every message matching the internal IMC keys. * Tries to find every message matching the internal IMC keys. When found the corresponding handler will process the attached message.
* When found the corresponding handler will process the attached message.
* *
* @param event Event carrying the identifier and message for the handlers * @param event Event carrying the identifier and message for the handlers
*/ */
@@ -80,7 +83,7 @@ public class IMCHandler
try try
{ {
IIMCProcessor handler = this.processors.get( key ); final IIMCProcessor handler = this.processors.get( key );
if( handler != null ) if( handler != null )
{ {
handler.process( message ); handler.process( message );
@@ -90,7 +93,7 @@ public class IMCHandler
throw new IllegalStateException( "Invalid IMC Called: " + key ); throw new IllegalStateException( "Invalid IMC Called: " + key );
} }
} }
catch( Throwable t ) catch( Exception t )
{ {
AELog.warning( "Problem detected when processing IMC " + key + " from " + message.getSender() ); AELog.warning( "Problem detected when processing IMC " + key + " from " + message.getSender() );
AELog.error( t ); AELog.error( t );
+1 -5
View File
@@ -22,6 +22,7 @@ package appeng.core;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
@@ -29,7 +30,6 @@ import com.google.common.base.Preconditions;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import appeng.api.recipes.IRecipeHandler; import appeng.api.recipes.IRecipeHandler;
import appeng.api.recipes.IRecipeLoader;
import appeng.recipes.loader.ConfigLoader; import appeng.recipes.loader.ConfigLoader;
import appeng.recipes.loader.JarLoader; import appeng.recipes.loader.JarLoader;
import appeng.recipes.loader.RecipeResourceCopier; import appeng.recipes.loader.RecipeResourceCopier;
@@ -69,10 +69,6 @@ public class RecipeLoader implements Runnable
final File readmeGenDest = new File( generatedRecipesDir, "README.html" ); final File readmeGenDest = new File( generatedRecipesDir, "README.html" );
final File readmeUserDest = new File( userRecipesDir, "README.html" ); final File readmeUserDest = new File( userRecipesDir, "README.html" );
final IRecipeLoader oreDictLoader = new JarLoader("/assets/appliedenergistics2/oredict/");
this.handler.parseRecipes(oreDictLoader, "vanilla.oredict" );
this.handler.parseRecipes(oreDictLoader, "ae2.oredict" );
// generates generated and user recipes dir // generates generated and user recipes dir
// will clean the generated every time to keep it up to date // will clean the generated every time to keep it up to date
// copies over the recipes in the jar over to the generated folder // copies over the recipes in the jar over to the generated folder
+4 -20
View File
@@ -343,10 +343,10 @@ public final class Registration
target.partCableCovered = source.cableCovered(); target.partCableCovered = source.cableCovered();
target.partCableGlass = source.cableGlass(); target.partCableGlass = source.cableGlass();
target.partCableDense = source.cableDense(); target.partCableDense = source.cableDense();
// target.partLumenCableSmart = source.lumenCableSmart(); // target.partLumenCableSmart = source.lumenCableSmart();
// target.partLumenCableCovered = source.lumenCableCovered(); // target.partLumenCableCovered = source.lumenCableCovered();
// target.partLumenCableGlass = source.lumenCableGlass(); // target.partLumenCableGlass = source.lumenCableGlass();
// target.partLumenCableDense = source.lumenCableDense(); // target.partLumenCableDense = source.lumenCableDense();
target.partQuartzFiber = this.converter.of( source.quartzFiber() ); target.partQuartzFiber = this.converter.of( source.quartzFiber() );
target.partToggleBus = this.converter.of( source.toggleBus() ); target.partToggleBus = this.converter.of( source.toggleBus() );
target.partInvertedToggleBus = this.converter.of( source.invertedToggleBus() ); target.partInvertedToggleBus = this.converter.of( source.invertedToggleBus() );
@@ -521,22 +521,6 @@ public final class Registration
partHelper.registerNewLayer( "appeng.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler" );
partHelper.registerNewLayer( "appeng.parts.layers.LayerITileStorageMonitorable", "appeng.api.implementations.tiles.ITileStorageMonitorable" ); partHelper.registerNewLayer( "appeng.parts.layers.LayerITileStorageMonitorable", "appeng.api.implementations.tiles.ITileStorageMonitorable" );
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
}
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RF ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
}
if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
}
FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE ); FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE );
MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE ); MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE );
@@ -241,14 +241,15 @@ public final class ApiBlocks implements IBlocks
this.quartzPillarStair = constructor.registerBlockDefinition( new QuartzPillarStairBlock( quartzPillar ) ); this.quartzPillarStair = constructor.registerBlockDefinition( new QuartzPillarStairBlock( quartzPillar ) );
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock" ) ); this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneSlabBlock" ) );
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock" ) ); this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneBlockSlabBlock" ) );
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock" ) ); this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneBrickSlabBlock" ) );
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock" ) ); this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneSmallBrickSlabBlock" ) );
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock" ) ); this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "FluixSlabBlock" ) );
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock" ) ); this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "QuartzSlabBlock" ) );
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );; this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "ChiseledQuartzSlabBlock" ) );
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) ); ;
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "QuartzPillarSlabBlock" ) );
this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() ); this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() );
this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() ); this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() );
@@ -61,6 +61,7 @@ public final class ApiParts implements IParts
private final IItemDefinition p2PTunnelRF; private final IItemDefinition p2PTunnelRF;
private final IItemDefinition p2PTunnelLight; private final IItemDefinition p2PTunnelLight;
private final IItemDefinition p2PTunnelOpenComputers; private final IItemDefinition p2PTunnelOpenComputers;
private final IItemDefinition p2PTunnelPneumaticCraft;
private final IItemDefinition cableAnchor; private final IItemDefinition cableAnchor;
private final IItemDefinition monitor; private final IItemDefinition monitor;
private final IItemDefinition semiDarkMonitor; private final IItemDefinition semiDarkMonitor;
@@ -104,6 +105,7 @@ public final class ApiParts implements IParts
this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) ); this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) );
this.p2PTunnelLight = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelLight ) ); this.p2PTunnelLight = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelLight ) );
this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelOpenComputers ) ); this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelOpenComputers ) );
this.p2PTunnelPneumaticCraft = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelPressure ) );
this.cableAnchor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.CableAnchor ) ); this.cableAnchor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.CableAnchor ) );
this.monitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.Monitor ) ); this.monitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.Monitor ) );
this.semiDarkMonitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.SemiDarkMonitor ) ); this.semiDarkMonitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.SemiDarkMonitor ) );
@@ -282,6 +284,12 @@ public final class ApiParts implements IParts
return this.p2PTunnelOpenComputers; return this.p2PTunnelOpenComputers;
} }
@Override
public IItemDefinition p2PTunnelPneumaticCraft()
{
return this.p2PTunnelPneumaticCraft;
}
@Override @Override
public IItemDefinition cableAnchor() public IItemDefinition cableAnchor()
{ {
@@ -54,7 +54,7 @@ public class DefinitionConstructor
if( definition instanceof ITileDefinition ) if( definition instanceof ITileDefinition )
{ {
return ( (ITileDefinition) definition ); return( (ITileDefinition) definition );
} }
throw new IllegalStateException( "No tile definition for " + feature ); throw new IllegalStateException( "No tile definition for " + feature );
@@ -66,7 +66,7 @@ public class DefinitionConstructor
if( definition instanceof IBlockDefinition ) if( definition instanceof IBlockDefinition )
{ {
return ( (IBlockDefinition) definition ); return( (IBlockDefinition) definition );
} }
throw new IllegalStateException( "No block definition for " + feature ); throw new IllegalStateException( "No block definition for " + feature );
@@ -18,35 +18,35 @@
/* Example: /* Example:
NBTTagCompound msg = new NBTTagCompound(); NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound(); NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound(); NBTTagCompound out = new NBTTagCompound();
new ItemStack( Blocks.iron_ore ).writeToNBT( in ); new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out ); new ItemStack( Items.iron_ingot ).writeToNBT( out );
msg.setTag( "in", in ); msg.setTag( "in", in );
msg.setTag( "out", out ); msg.setTag( "out", out );
msg.setInteger( "turns", 8 ); msg.setInteger( "turns", 8 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
-- or -- -- or --
NBTTagCompound msg = new NBTTagCompound(); NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound(); NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound(); NBTTagCompound out = new NBTTagCompound();
NBTTagCompound optional = new NBTTagCompound(); NBTTagCompound optional = new NBTTagCompound();
new ItemStack( Blocks.iron_ore ).writeToNBT( in ); new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out ); new ItemStack( Items.iron_ingot ).writeToNBT( out );
new ItemStack( Blocks.gravel ).writeToNBT( optional ); new ItemStack( Blocks.gravel ).writeToNBT( optional );
msg.setTag( "in", in ); msg.setTag( "in", in );
msg.setTag( "out", out ); msg.setTag( "out", out );
msg.setTag( "optional", optional ); msg.setTag( "optional", optional );
msg.setFloat( "chance", 0.5 ); msg.setFloat( "chance", 0.5 );
msg.setInteger( "turns", 8 ); msg.setInteger( "turns", 8 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
*/ */
@@ -18,14 +18,14 @@
/* Example: /* Example:
NBTTagCompound msg = new NBTTagCompound(); NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound item = new NBTTagCompound(); NBTTagCompound item = new NBTTagCompound();
new ItemStack( Blocks.anvil ).writeToNBT( item ); new ItemStack( Blocks.anvil ).writeToNBT( item );
msg.setTag( "item", item ); msg.setTag( "item", item );
msg.setDouble( "weight", 32.0 ); msg.setDouble( "weight", 32.0 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg );
*/ */
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -18,12 +18,12 @@
/* Example: /* Example:
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) );
*/ */
@@ -31,6 +31,7 @@ package appeng.core.api.imc;
import java.util.Arrays; import java.util.Arrays;
import java.util.Locale;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -47,7 +48,7 @@ public class IMCP2PAttunement implements IIMCProcessor
@Override @Override
public void process( IMCMessage m ) public void process( IMCMessage m )
{ {
String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase(); String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH );
TunnelType type = TunnelType.valueOf( key ); TunnelType type = TunnelType.valueOf( key );
@@ -18,7 +18,7 @@
/* Example: /* Example:
FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" ); FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" );
*/ */
@@ -1,3 +1,4 @@
package appeng.core.crash; package appeng.core.crash;
@@ -1,3 +1,4 @@
package appeng.core.crash; package appeng.core.crash;
@@ -7,7 +8,7 @@ import appeng.core.AEConfig;
public class ModCrashEnhancement extends BaseCrashEnhancement public class ModCrashEnhancement extends BaseCrashEnhancement
{ {
private static final String MOD_VERSION = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT? private static final String MOD_VERSION = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion + net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion + net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion; + net.minecraftforge.common.ForgeVersion.buildVersion;
@@ -27,9 +27,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.CommonHelper;
import appeng.core.CreativeTab; import appeng.core.CreativeTab;
import appeng.util.Platform;
public final class AEBlockFeatureHandler implements IFeatureHandler public final class AEBlockFeatureHandler implements IFeatureHandler
@@ -57,7 +57,7 @@ public enum AEFeature
DenseEnergyCells( "HigherCapacity" ), DenseCables( "HigherCapacity" ), DenseEnergyCells( "HigherCapacity" ), DenseCables( "HigherCapacity" ),
P2PTunnelRF( "P2PTunnels" ), P2PTunnelME( "P2PTunnels" ), P2PTunnelItems( "P2PTunnels" ), P2PTunnelRedstone( "P2PTunnels" ), P2PTunnelEU( "P2PTunnels" ), P2PTunnelLiquids( "P2PTunnels" ), P2PTunnelLight( "P2PTunnels" ), P2PTunnelOpenComputers( "P2PTunnels" ), P2PTunnelRF( "P2PTunnels" ), P2PTunnelME( "P2PTunnels" ), P2PTunnelItems( "P2PTunnels" ), P2PTunnelRedstone( "P2PTunnels" ), P2PTunnelEU( "P2PTunnels" ), P2PTunnelLiquids( "P2PTunnels" ), P2PTunnelLight( "P2PTunnels" ), P2PTunnelOpenComputers( "P2PTunnels" ), P2PTunnelPressure( "P2PTunnels" ),
MassCannonBlockDamage( "BlockFeatures" ), TinyTNTBlockDamage( "BlockFeatures" ), Facades( "Facades" ), MassCannonBlockDamage( "BlockFeatures" ), TinyTNTBlockDamage( "BlockFeatures" ), Facades( "Facades" ),
@@ -79,7 +79,7 @@ public enum AEFeature
AEFeature( String cat ) AEFeature( String cat )
{ {
this(cat, true); this( cat, true );
} }
AEFeature( String cat, boolean defaultValue ) AEFeature( String cat, boolean defaultValue )
@@ -1,3 +1,4 @@
package appeng.core.features; package appeng.core.features;
@@ -92,7 +93,6 @@ public final class DefinitionConverter
} }
} }
private static class AEItem extends AEComparable private static class AEItem extends AEComparable
{ {
private final IItemDefinition definition; private final IItemDefinition definition;
@@ -119,7 +119,6 @@ public final class DefinitionConverter
} }
} }
private static class AEBlock extends AEItem private static class AEBlock extends AEItem
{ {
private final IBlockDefinition definition; private final IBlockDefinition definition;
@@ -145,7 +144,6 @@ public final class DefinitionConverter
} }
} }
private static class AETile extends AEBlock private static class AETile extends AEBlock
{ {
private final ITileDefinition definition; private final ITileDefinition definition;
@@ -21,17 +21,15 @@ package appeng.core.features;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.block.Block; import com.google.common.base.Optional;
import net.minecraft.block.BlockSlab;
import cpw.mods.fml.common.registry.GameRegistry;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
import appeng.block.AEBaseItemBlockSlab; import appeng.block.AEBaseItemBlockSlab;
import appeng.block.AEBaseSlabBlock; import appeng.block.AEBaseSlabBlock;
import appeng.core.CreativeTab; import appeng.core.CreativeTab;
import com.google.common.base.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
public class SlabBlockFeatureHandler implements IFeatureHandler public class SlabBlockFeatureHandler implements IFeatureHandler
{ {
@@ -44,7 +42,7 @@ public class SlabBlockFeatureHandler implements IFeatureHandler
{ {
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
this.slabs = slabs; this.slabs = slabs;
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent()); this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent() );
this.enabled = state == ActivityState.Enabled; this.enabled = state == ActivityState.Enabled;
this.definition = new BlockDefinition( slabs, state ); this.definition = new BlockDefinition( slabs, state );
} }
@@ -67,8 +65,8 @@ public class SlabBlockFeatureHandler implements IFeatureHandler
if( this.enabled ) if( this.enabled )
{ {
this.slabs.setCreativeTab( CreativeTab.instance ); this.slabs.setCreativeTab( CreativeTab.instance );
GameRegistry.registerBlock( slabs, AEBaseItemBlockSlab.class, "tile." + slabs.name(), slabs, slabs.doubleSlabs(), false); GameRegistry.registerBlock( this.slabs, AEBaseItemBlockSlab.class, "tile." + this.slabs.name(), this.slabs, this.slabs.doubleSlabs(), false );
GameRegistry.registerBlock( slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + slabs.name() + ".double", slabs, slabs.doubleSlabs(), true); GameRegistry.registerBlock( this.slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + this.slabs.name() + ".double", this.slabs, this.slabs.doubleSlabs(), true );
} }
} }
} }
@@ -118,7 +118,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
} }
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost ); this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost );
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) ); this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), this.copy( optional2 ), chance, chance2, cost ) );
} }
private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe ) private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe )
@@ -21,6 +21,7 @@ package appeng.core.features.registries;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -19,8 +19,12 @@
package appeng.core.features.registries; package appeng.core.features.registries;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
import javax.annotation.Nullable;
import appeng.api.features.IRecipeHandlerRegistry; import appeng.api.features.IRecipeHandlerRegistry;
import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.ICraftHandler;
@@ -30,16 +34,21 @@ import appeng.core.AELog;
import appeng.recipes.RecipeHandler; import appeng.recipes.RecipeHandler;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv0
*/
public class RecipeHandlerRegistry implements IRecipeHandlerRegistry public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
{ {
private final Map<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>( 20 );
final HashMap<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>(); private final Collection<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
final LinkedList<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
@Override @Override
public void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler ) public void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler )
{ {
this.handlers.put( name.toLowerCase(), handler ); this.handlers.put( name.toLowerCase( Locale.ENGLISH ), handler );
} }
@Override @Override
@@ -48,6 +57,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
this.resolvers.add( sir ); this.resolvers.add( sir );
} }
@Nullable
@Override @Override
public ICraftHandler getCraftHandlerFor( String name ) public ICraftHandler getCraftHandlerFor( String name )
{ {
@@ -64,7 +74,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
{ {
AELog.severe( "Error Caused when trying to construct " + clz.getName() ); AELog.severe( "Error Caused when trying to construct " + clz.getName() );
AELog.error( e ); AELog.error( e );
this.handlers.put( name, null ); // clear it.. this.handlers.put( name, null ); // clear it..
return null; return null;
} }
} }
@@ -75,6 +87,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
return new RecipeHandler(); return new RecipeHandler();
} }
@Nullable
@Override @Override
public Object resolveItem( String nameSpace, String itemName ) public Object resolveItem( String nameSpace, String itemName )
{ {
@@ -1,3 +1,4 @@
package appeng.core.features.registries.entries; package appeng.core.features.registries.entries;
@@ -1,3 +1,4 @@
package appeng.core.features.registries.entries; package appeng.core.features.registries.entries;
@@ -94,7 +95,7 @@ public class InscriberRecipe implements IInscriberRecipe
{ {
return true; return true;
} }
if( !(o instanceof IInscriberRecipe) ) if( !( o instanceof IInscriberRecipe ) )
{ {
return false; return false;
} }
@@ -113,7 +114,7 @@ public class InscriberRecipe implements IInscriberRecipe
{ {
return false; return false;
} }
if( !this.maybeBot.equals( that.getBottomOptional()) ) if( !this.maybeBot.equals( that.getBottomOptional() ) )
{ {
return false; return false;
} }
@@ -45,7 +45,7 @@ public enum GuiText
CraftingTerminal, FormationPlane, Inscriber, QuartzCuttingKnife, CraftingTerminal, FormationPlane, Inscriber, QuartzCuttingKnife,
// tunnel names // tunnel names
METunnel, ItemTunnel, RedstoneTunnel, EUTunnel, FluidTunnel, OCTunnel, LightTunnel, RFTunnel, METunnel, ItemTunnel, RedstoneTunnel, EUTunnel, FluidTunnel, OCTunnel, LightTunnel, RFTunnel, PressureTunnel,
StoredSize, CopyMode, CopyModeDesc, PatternTerminal, CraftingPattern, StoredSize, CopyMode, CopyModeDesc, PatternTerminal, CraftingPattern,
@@ -55,9 +55,13 @@ public enum GuiText
inWorldFluix, inWorldPurificationCertus, inWorldPurificationNether, inWorldFluix, inWorldPurificationCertus, inWorldPurificationNether,
inWorldPurificationFluix, inWorldSingularity, ChargedQuartz, OfSecondOutput, inWorldPurificationFluix, inWorldSingularity, ChargedQuartz,
NoSecondOutput, Stores, Next, SelectAmount, Lumen, Empty, NoSecondOutput,
OfSecondOutput,
MultipleOutputs,
Stores, Next, SelectAmount, Lumen, Empty,
ConfirmCrafting, Stored, Crafting, Scheduled, CraftingStatus, Cancel, ETA, ETAFormat, ConfirmCrafting, Stored, Crafting, Scheduled, CraftingStatus, Cancel, ETA, ETAFormat,
@@ -30,7 +30,7 @@ public enum PlayerMessages
isNowLocked, isNowUnlocked, isNowLocked, isNowUnlocked,
AmmoDepleted, AmmoDepleted,
CommunicationError, OutOfRange, DeviceNotPowered, DeviceNotWirelessTerminal, DeviceNotLinked, StationCanNotBeLocated, CommunicationError, OutOfRange, DeviceNotPowered, DeviceNotWirelessTerminal, DeviceNotLinked, StationCanNotBeLocated,
SettingCleared,; SettingCleared, ;
public IChatComponent get() public IChatComponent get()
{ {
@@ -47,7 +47,9 @@ public enum TickRates
LightTunnel( 5, 120 ), LightTunnel( 5, 120 ),
OpenComputersTunnel( 1, 5 ); OpenComputersTunnel( 1, 5 ),
PressureTunnel( 1, 120 );
public int min; public int min;
public int max; public int max;
@@ -38,20 +38,24 @@ import appeng.core.features.AEFeature;
public class PlayerStatsRegistration public class PlayerStatsRegistration
{ {
/** /**
* {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the feature is enabled * {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the
* feature is enabled
*/ */
private final EventBus bus; private final EventBus bus;
/** /**
* is true if the {@link appeng.core.features.AEFeature#Achievements} is enabled in the {@param config} * is true if the {@link appeng.core.features.AEFeature#Achievements} is enabled in the
*
* @param config}
*/ */
private final boolean isAchievementFeatureEnabled; private final boolean isAchievementFeatureEnabled;
/** /**
* Constructs this with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}. * Constructs this with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
* *
* @param bus {@see #bus} * @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled * @param config {@link appeng.core.AEConfig} which is used to determine if the
* {@link appeng.core.features.AEFeature#Achievements} is enabled
*/ */
public PlayerStatsRegistration( EventBus bus, AEConfig config ) public PlayerStatsRegistration( EventBus bus, AEConfig config )
{ {
@@ -60,7 +64,9 @@ public class PlayerStatsRegistration
} }
/** /**
* Registers the {@link appeng.core.stats.AchievementCraftingHandler} and {@link appeng.core.stats.AchievementPickupHandler} to the {@link #bus} if {@link #isAchievementFeatureEnabled} is true. * Registers the {@link appeng.core.stats.AchievementCraftingHandler} and
* {@link appeng.core.stats.AchievementPickupHandler} to the {@link #bus} if {@link #isAchievementFeatureEnabled} is
* true.
*/ */
public void registerAchievementHandlers() public void registerAchievementHandlers()
{ {
@@ -76,7 +82,8 @@ public class PlayerStatsRegistration
} }
/** /**
* Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements} to a new {@link net.minecraftforge.common.AchievementPage}. * Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements}
* to a new {@link net.minecraftforge.common.AchievementPage}.
*/ */
public void registerAchievements() public void registerAchievements()
{ {
@@ -56,7 +56,6 @@ public class AppEngPacketHandlerBase
{ {
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>(); private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>();
public enum PacketTypes public enum PacketTypes
{ {
PACKET_COMPASS_REQUEST( PacketCompassRequest.class ), PACKET_COMPASS_REQUEST( PacketCompassRequest.class ),
@@ -101,7 +101,6 @@ import appeng.parts.automation.PartLevelEmitter;
import appeng.parts.misc.PartStorageBus; import appeng.parts.misc.PartStorageBus;
import appeng.parts.reporting.PartCraftingTerminal; import appeng.parts.reporting.PartCraftingTerminal;
import appeng.parts.reporting.PartInterfaceTerminal; import appeng.parts.reporting.PartInterfaceTerminal;
import appeng.parts.reporting.PartPanel;
import appeng.parts.reporting.PartPatternTerminal; import appeng.parts.reporting.PartPatternTerminal;
import appeng.tile.crafting.TileCraftingTile; import appeng.tile.crafting.TileCraftingTile;
import appeng.tile.crafting.TileMolecularAssembler; import appeng.tile.crafting.TileMolecularAssembler;
@@ -67,7 +67,7 @@ public final class PacketConfigButton extends AppEngPacket
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
{ {
EntityPlayerMP sender = (EntityPlayerMP) player; EntityPlayerMP sender = (EntityPlayerMP) player;
if ( sender.openContainer instanceof AEBaseContainer ) if( sender.openContainer instanceof AEBaseContainer )
{ {
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
if( baseContainer.getTarget() instanceof IConfigurableObject ) if( baseContainer.getTarget() instanceof IConfigurableObject )
@@ -219,7 +219,7 @@ public class PacketNEIRecipe extends AppEngPacket
// If that doesn't work, grab from the player's inventory // If that doesn't work, grab from the player's inventory
if( whichItem == null && playerInventory != null ) if( whichItem == null && playerInventory != null )
{ {
whichItem = extractItemFromPlayerInventory( player, realForFake, patternItem ); whichItem = this.extractItemFromPlayerInventory( player, realForFake, patternItem );
} }
craftMatrix.setInventorySlotContents( x, whichItem ); craftMatrix.setInventorySlotContents( x, whichItem );
@@ -20,6 +20,7 @@ package appeng.core.worlddata;
import java.io.File; import java.io.File;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
@@ -19,8 +19,8 @@
package appeng.core.worlddata; package appeng.core.worlddata;
import java.io.File;
import java.util.List; import java.util.List;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -63,13 +63,11 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn
private final Configuration config; private final Configuration config;
private final List<Integer> storageCellDimensionIDs; private final List<Integer> storageCellDimensionIDs;
DimensionData( @Nonnull final File parentFile, @Nonnull final String configVersion ) DimensionData( @Nonnull final Configuration parentFile )
{ {
Preconditions.checkNotNull( parentFile ); Preconditions.checkNotNull( parentFile );
Preconditions.checkNotNull( configVersion );
Preconditions.checkArgument( !configVersion.isEmpty() );
this.config = new Configuration( parentFile, configVersion ); this.config = parentFile;
final int[] storageCellIDs = this.storageCellIDsProperty().getIntList(); final int[] storageCellIDs = this.storageCellIDsProperty().getIntList();
@@ -20,6 +20,7 @@ package appeng.core.worlddata;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Optional; import com.google.common.base.Optional;
@@ -47,7 +48,7 @@ public interface IWorldPlayerMapping
/** /**
* Put in new players when they join the server * Put in new players when they join the server
* *
* @param id id of new player * @param id id of new player
* @param uuid UUID of new player * @param uuid UUID of new player
*/ */
void put( int id, @Nonnull UUID uuid ); void put( int id, @Nonnull UUID uuid );
@@ -65,10 +65,11 @@ public class MeteorDataNameEncoder
/** /**
* @param dimension ID of the processed dimension. Can be any integer * @param dimension ID of the processed dimension. Can be any integer
* @param chunkX X coordinate of the chunk. Can be any integer * @param chunkX X coordinate of the chunk. Can be any integer
* @param chunkZ Z coordinate of the chunk. Can be any integer * @param chunkZ Z coordinate of the chunk. Can be any integer
* *
* @return encoded file name suggestion in form of <tt>dim_x_y.dat</tt> where <tt>x</tt> and <tt>y</tt> will be shifted to stay conform with the vanilla chunk system * @return encoded file name suggestion in form of <tt>dim_x_y.dat</tt> where <tt>x</tt> and <tt>y</tt> will be
* shifted to stay conform with the vanilla chunk system
* *
* @since rv3 05.06.2015 * @since rv3 05.06.2015
*/ */
@@ -19,8 +19,8 @@
package appeng.core.worlddata; package appeng.core.worlddata;
import java.io.File;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -57,13 +57,11 @@ final class PlayerData implements IWorldPlayerData, IOnWorldStartable, IOnWorldS
private int lastPlayerID; private int lastPlayerID;
public PlayerData( @Nonnull final File configFile, @Nonnull final String configVersion ) public PlayerData( @Nonnull final Configuration configFile )
{ {
Preconditions.checkNotNull( configFile ); Preconditions.checkNotNull( configFile );
Preconditions.checkNotNull( configVersion );
Preconditions.checkArgument( !configVersion.isEmpty() );
this.config = new Configuration( configFile, configVersion ); this.config = configFile;
final ConfigCategory playerList = this.config.getCategory( "players" ); final ConfigCategory playerList = this.config.getCategory( "players" );
this.playerMapping = new PlayerMapping( playerList, AELog.INSTANCE ); this.playerMapping = new PlayerMapping( playerList, AELog.INSTANCE );
@@ -21,6 +21,7 @@ package appeng.core.worlddata;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Optional; import com.google.common.base.Optional;
@@ -51,7 +51,7 @@ class PlayerMappingsInitializer
* where the UUIDs were introduced. * where the UUIDs were introduced.
* *
* @param playerList the category for the player list, generally extracted using the "players" tag * @param playerList the category for the player list, generally extracted using the "players" tag
* @param log the logger used to warn the server or user of faulty entries * @param log the logger used to warn the server or user of faulty entries
*/ */
PlayerMappingsInitializer( ConfigCategory playerList, FMLRelaunchLog log ) PlayerMappingsInitializer( ConfigCategory playerList, FMLRelaunchLog log )
{ {
@@ -25,6 +25,7 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;
import java.util.LinkedList; import java.util.LinkedList;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
@@ -56,7 +57,8 @@ final class SpawnData implements IWorldSpawnData
} }
@Override @Override
public void setGenerated( int dim, int chunkX, int chunkZ ) { public void setGenerated( int dim, int chunkX, int chunkZ )
{
synchronized( SpawnData.class ) synchronized( SpawnData.class )
{ {
NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ );
@@ -19,10 +19,10 @@
package appeng.core.worlddata; package appeng.core.worlddata;
import java.io.File;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.Map; import java.util.Map;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -54,13 +54,11 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
private long lastGridStorage; private long lastGridStorage;
public StorageData( @Nonnull final File settingsFile, @Nonnull final String version ) public StorageData( @Nonnull final Configuration settingsFile )
{ {
Preconditions.checkNotNull( settingsFile ); Preconditions.checkNotNull( settingsFile );
Preconditions.checkNotNull( version );
Preconditions.checkArgument( !version.isEmpty() );
this.config = new Configuration( settingsFile, version ); this.config = settingsFile;
} }
/** /**
@@ -22,6 +22,7 @@ package appeng.core.worlddata;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadFactory;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -29,6 +30,7 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.config.Configuration;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.services.CompassService; import appeng.services.CompassService;
@@ -38,7 +40,8 @@ import appeng.services.compass.CompassThreadFactory;
/** /**
* Singleton access to anything related to world-based data. * Singleton access to anything related to world-based data.
* *
* Data will change depending which world is loaded. Will probably not affect SMP at all since only one world is loaded, but SSP more, cause they play on * Data will change depending which world is loaded. Will probably not affect SMP at all since only one world is loaded,
* but SSP more, cause they play on
* different worlds. * different worlds.
* *
* @author thatsIch * @author thatsIch
@@ -68,6 +71,8 @@ public final class WorldData implements IWorldData
private final File spawnDirectory; private final File spawnDirectory;
private final File compassDirectory; private final File compassDirectory;
private final Configuration sharedConfig;
private WorldData( @Nonnull final File worldDirectory ) private WorldData( @Nonnull final File worldDirectory )
{ {
Preconditions.checkNotNull( worldDirectory ); Preconditions.checkNotNull( worldDirectory );
@@ -78,10 +83,11 @@ public final class WorldData implements IWorldData
this.compassDirectory = new File( this.ae2directory, COMPASS_DIR_NAME ); this.compassDirectory = new File( this.ae2directory, COMPASS_DIR_NAME );
final File settingsFile = new File( this.ae2directory, SETTING_FILE_NAME ); final File settingsFile = new File( this.ae2directory, SETTING_FILE_NAME );
this.sharedConfig = new Configuration( settingsFile, AEConfig.VERSION );
final PlayerData playerData = new PlayerData( settingsFile, AEConfig.VERSION ); final PlayerData playerData = new PlayerData( this.sharedConfig );
final DimensionData dimensionData = new DimensionData( settingsFile, AEConfig.VERSION ); final DimensionData dimensionData = new DimensionData( this.sharedConfig );
final StorageData storageData = new StorageData( settingsFile, AEConfig.VERSION ); final StorageData storageData = new StorageData( this.sharedConfig );
final ThreadFactory compassThreadFactory = new CompassThreadFactory(); final ThreadFactory compassThreadFactory = new CompassThreadFactory();
final CompassService compassService = new CompassService( this.compassDirectory, compassThreadFactory ); final CompassService compassService = new CompassService( this.compassDirectory, compassThreadFactory );
+1 -5
View File
@@ -20,6 +20,7 @@ package appeng.facade;
import java.util.EnumSet; import java.util.EnumSet;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -535,23 +536,18 @@ public class FacadePart implements IFacadePart, IBoxProvider
* if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade( * if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.EAST ); } * ForgeDirection.EAST ); }
*
* if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade( * if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.WEST ); } * ForgeDirection.WEST ); }
*
* if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( * if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.NORTH ); } * ForgeDirection.NORTH ); }
*
* if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( * if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.SOUTH ); } * ForgeDirection.SOUTH ); }
*
* if ( out.contains( ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( * if ( out.contains( ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.EAST ); } * ForgeDirection.EAST ); }
*
* if ( out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( * if ( out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.WEST ); } * ForgeDirection.WEST ); }
+1 -1
View File
@@ -453,7 +453,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
double r = Math.abs( a - 0.5 ); double r = Math.abs( a - 0.5 );
r = Math.max( Math.abs( b - 0.5 ), r ); r = Math.max( Math.abs( b - 0.5 ), r );
r = Math.max( Math.abs( c - 0.5 ), r ); r = Math.max( Math.abs( c - 0.5 ), r );
return ( 8 * (int) Math.max( Math.abs( d - 0.5 ), r ) ); return( 8 * (int) Math.max( Math.abs( d - 0.5 ), r ) );
} }
// @Override // @Override
@@ -100,18 +100,22 @@ import appeng.util.item.AEItemStack;
public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, IConfigManagerHost, ICraftingProvider, IUpgradeableHost, IPriorityHost public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, IConfigManagerHost, ICraftingProvider, IUpgradeableHost, IPriorityHost
{ {
public static final int NUMBER_OF_STORAGE_SLOTS = 9;
public static final int NUMBER_OF_CONFIG_SLOTS = 9;
public static final int NUMBER_OF_PATTERN_SLOTS = 9;
private static final Collection<Block> BAD_BLOCKS = new HashSet<Block>( 100 ); private static final Collection<Block> BAD_BLOCKS = new HashSet<Block>( 100 );
final int[] sides = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }; final int[] sides = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
final IAEItemStack[] requireWork = new IAEItemStack[] { null, null, null, null, null, null, null, null }; final IAEItemStack[] requireWork = new IAEItemStack[] { null, null, null, null, null, null, null, null, null };
final MultiCraftingTracker craftingTracker; final MultiCraftingTracker craftingTracker;
final AENetworkProxy gridProxy; final AENetworkProxy gridProxy;
final IInterfaceHost iHost; final IInterfaceHost iHost;
final BaseActionSource mySource; final BaseActionSource mySource;
final BaseActionSource interfaceRequestSource; final BaseActionSource interfaceRequestSource;
final ConfigManager cm = new ConfigManager( this ); final ConfigManager cm = new ConfigManager( this );
final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 8 ); final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, NUMBER_OF_CONFIG_SLOTS );
final AppEngInternalInventory storage = new AppEngInternalInventory( this, 8 ); final AppEngInternalInventory storage = new AppEngInternalInventory( this, NUMBER_OF_STORAGE_SLOTS );
final AppEngInternalInventory patterns = new AppEngInternalInventory( this, 9 ); final AppEngInternalInventory patterns = new AppEngInternalInventory( this, NUMBER_OF_PATTERN_SLOTS );
final WrapperInvSlot slotInv = new WrapperInvSlot( this.storage ); final WrapperInvSlot slotInv = new WrapperInvSlot( this.storage );
final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<IAEItemStack>( new NullInventory<IAEItemStack>(), StorageChannel.ITEMS ); final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<IAEItemStack>( new NullInventory<IAEItemStack>(), StorageChannel.ITEMS );
final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<IAEFluidStack>( new NullInventory<IAEFluidStack>(), StorageChannel.FLUIDS ); final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<IAEFluidStack>( new NullInventory<IAEFluidStack>(), StorageChannel.FLUIDS );
@@ -279,7 +283,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
boolean had = this.hasWorkToDo(); boolean had = this.hasWorkToDo();
for( int x = 0; x < 8; x++ ) for( int x = 0; x < NUMBER_OF_CONFIG_SLOTS; x++ )
{ {
this.updatePlan( x ); this.updatePlan( x );
} }
@@ -616,7 +620,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
{ {
boolean didSomething = false; boolean didSomething = false;
for( int x = 0; x < 8; x++ ) for( int x = 0; x < NUMBER_OF_STORAGE_SLOTS; x++ )
{ {
if( this.requireWork[x] != null ) if( this.requireWork[x] != null )
{ {
@@ -373,7 +373,6 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
ACCEPT, DECLINE, TEST ACCEPT, DECLINE, TEST
} }
static class TestLookup static class TestLookup
{ {
@@ -1,3 +1,4 @@
package appeng.helpers; package appeng.helpers;
+14 -12
View File
@@ -25,7 +25,6 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Queue; import java.util.Queue;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
@@ -55,6 +54,7 @@ import appeng.entity.EntityFloatingItem;
import appeng.me.Grid; import appeng.me.Grid;
import appeng.me.NetworkList; import appeng.me.NetworkList;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
import appeng.util.IWorldCallable;
import appeng.util.Platform; import appeng.util.Platform;
@@ -62,9 +62,9 @@ public class TickHandler
{ {
public static final TickHandler INSTANCE = new TickHandler(); public static final TickHandler INSTANCE = new TickHandler();
final Queue<Callable> serverQueue = new LinkedList<Callable>(); final Queue<IWorldCallable<?>> serverQueue = new LinkedList<IWorldCallable<?>>();
final Multimap<World, CraftingJob> craftingJobs = LinkedListMultimap.create(); final Multimap<World, CraftingJob> craftingJobs = LinkedListMultimap.create();
private final WeakHashMap<World, Queue<Callable>> callQueue = new WeakHashMap<World, Queue<Callable>>(); private final WeakHashMap<World, Queue<IWorldCallable<?>>> callQueue = new WeakHashMap<World, Queue<IWorldCallable<?>>>();
private final HandlerRep server = new HandlerRep(); private final HandlerRep server = new HandlerRep();
private final HandlerRep client = new HandlerRep(); private final HandlerRep client = new HandlerRep();
private final HashMap<Integer, PlayerColor> cliPlayerColors = new HashMap<Integer, PlayerColor>(); private final HashMap<Integer, PlayerColor> cliPlayerColors = new HashMap<Integer, PlayerColor>();
@@ -80,7 +80,7 @@ public class TickHandler
return this.cliPlayerColors; return this.cliPlayerColors;
} }
public void addCallable( World w, Callable c ) public void addCallable( World w, IWorldCallable<?> c )
{ {
if( w == null ) if( w == null )
{ {
@@ -88,11 +88,12 @@ public class TickHandler
} }
else else
{ {
Queue<Callable> queue = this.callQueue.get( w ); Queue<IWorldCallable<?>> queue = this.callQueue.get( w );
if( queue == null ) if( queue == null )
{ {
this.callQueue.put( w, queue = new LinkedList<Callable>() ); queue = new LinkedList<IWorldCallable<?>>();
this.callQueue.put( w, queue );
} }
queue.add( c ); queue.add( c );
@@ -239,13 +240,15 @@ public class TickHandler
} }
// cross world queue. // cross world queue.
this.processQueue( this.serverQueue ); this.processQueue( this.serverQueue, null );
} }
// world synced queue(s) // world synced queue(s)
if( ev.type == Type.WORLD && ev.phase == Phase.START ) if( ev.type == Type.WORLD && ev.phase == Phase.START )
{ {
this.processQueue( this.callQueue.get( ( (WorldTickEvent) ev ).world ) ); final World world = ( (WorldTickEvent) ev ).world;
final Queue<IWorldCallable<?>> queue = this.callQueue.get( world );
this.processQueue( queue, world );
} }
} }
@@ -263,7 +266,7 @@ public class TickHandler
} }
} }
private void processQueue( Queue<Callable> queue ) private void processQueue( Queue<IWorldCallable<?>> queue, World world )
{ {
if( queue == null ) if( queue == null )
{ {
@@ -272,12 +275,12 @@ public class TickHandler
Stopwatch sw = Stopwatch.createStarted(); Stopwatch sw = Stopwatch.createStarted();
Callable c = null; IWorldCallable<?> c = null;
while( ( c = queue.poll() ) != null ) while( ( c = queue.poll() ) != null )
{ {
try try
{ {
c.call(); c.call( world );
if( sw.elapsed( TimeUnit.MILLISECONDS ) > 50 ) if( sw.elapsed( TimeUnit.MILLISECONDS ) > 50 )
{ {
@@ -317,7 +320,6 @@ public class TickHandler
} }
} }
public static class PlayerColor public static class PlayerColor
{ {
@@ -21,12 +21,6 @@ package appeng.integration;
public abstract class BaseModule implements IIntegrationModule public abstract class BaseModule implements IIntegrationModule
{ {
protected void testClassExistence( Class<?> clz )
{
clz.isInstance( this );
}
@Override @Override
public abstract void init() throws Throwable; public abstract void init() throws Throwable;
@@ -0,0 +1,29 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration;
public class IntegrationHelper
{
public static void testClassExistence( Object o, Class<?> clz )
{
clz.isInstance( o );
}
}
@@ -39,7 +39,7 @@ public final class IntegrationNode
IntegrationStage failedStage = IntegrationStage.PRE_INIT; IntegrationStage failedStage = IntegrationStage.PRE_INIT;
Throwable exception = null; Throwable exception = null;
String name = null; String name = null;
Class classValue = null; Class<?> classValue = null;
Object instance; Object instance;
IIntegrationModule mod = null; IIntegrationModule mod = null;
@@ -21,6 +21,7 @@ package appeng.integration;
import java.util.Collection; import java.util.Collection;
import java.util.LinkedList; import java.util.LinkedList;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import cpw.mods.fml.relauncher.FMLLaunchHandler; import cpw.mods.fml.relauncher.FMLLaunchHandler;
@@ -31,6 +32,8 @@ public enum IntegrationRegistry
{ {
INSTANCE; INSTANCE;
private static final String PACKAGE_PREFIX = "appeng.integration.modules.";
private final Collection<IntegrationNode> modules = new LinkedList<IntegrationNode>(); private final Collection<IntegrationNode> modules = new LinkedList<IntegrationNode>();
public void add( IntegrationType type ) public void add( IntegrationType type )
@@ -45,7 +48,7 @@ public enum IntegrationRegistry
return; return;
} }
this.modules.add( new IntegrationNode( type.dspName, type.modID, type, "appeng.integration.modules." + type.name() ) ); this.modules.add( new IntegrationNode( type.dspName, type.modID, type, PACKAGE_PREFIX + type.name() ) );
} }
public void init() public void init()
@@ -29,9 +29,9 @@ public enum IntegrationType
BuildCraftCore( IntegrationSide.BOTH, "BuildCraft Core", "BuildCraft|Core" ), BuildCraftCore( IntegrationSide.BOTH, "BuildCraft Core", "BuildCraft|Core" ),
BuildCraftTransport( IntegrationSide.BOTH, "BuildCraft Transport", "BuildCraft|Transport"), BuildCraftTransport( IntegrationSide.BOTH, "BuildCraft Transport", "BuildCraft|Transport" ),
BuildCraftBuilder( IntegrationSide.BOTH, "BuildCraft Builders", "BuildCraft|Builders"), BuildCraftBuilder( IntegrationSide.BOTH, "BuildCraft Builders", "BuildCraft|Builders" ),
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ), RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ),
@@ -63,7 +63,9 @@ public enum IntegrationType
BetterStorage( IntegrationSide.BOTH, "BetterStorage", "betterstorage" ), BetterStorage( IntegrationSide.BOTH, "BetterStorage", "betterstorage" ),
OpenComputers( IntegrationSide.BOTH, "OpenComputers", "OpenComputers" ); OpenComputers( IntegrationSide.BOTH, "OpenComputers", "OpenComputers" ),
PneumaticCraft( IntegrationSide.BOTH, "PneumaticCraft", "PneumaticCraft" );
public final IntegrationSide side; public final IntegrationSide side;
public final String dspName; public final String dspName;
@@ -90,7 +90,7 @@ public interface IBuildCraftTransport
IIcon getCobbleStructurePipeTexture(); IIcon getCobbleStructurePipeTexture();
/** /**
* @param te the to be checked {@link TileEntity} * @param te the to be checked {@link TileEntity}
* @param dir direction of the {@link TileEntity} * @param dir direction of the {@link TileEntity}
* *
* @return {@code true} if {@code te} is a buildcraft pipe, but not plugged * @return {@code true} if {@code te} is a buildcraft pipe, but not plugged
@@ -37,7 +37,7 @@ public class BCPipeHandler implements IExternalStorageHandler
@Override @Override
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc ) public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc )
{ {
if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
{ {
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
@@ -23,8 +23,10 @@ import net.mcft.copy.betterstorage.api.crate.ICrateStorage;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IBetterStorage; import appeng.integration.abstraction.IBetterStorage;
import appeng.integration.modules.helpers.BSCrateHandler; import appeng.integration.modules.helpers.BSCrateHandler;
import appeng.integration.modules.helpers.BSCrateStorageAdaptor; import appeng.integration.modules.helpers.BSCrateStorageAdaptor;
@@ -33,12 +35,13 @@ import appeng.util.InventoryAdaptor;
public class BetterStorage extends BaseModule implements IIntegrationModule, IBetterStorage public class BetterStorage extends BaseModule implements IIntegrationModule, IBetterStorage
{ {
@Reflected
public static BetterStorage instance; public static BetterStorage instance;
@Reflected
public BetterStorage() public BetterStorage()
{ {
this.testClassExistence( net.mcft.copy.betterstorage.api.crate.ICrateStorage.class ); IntegrationHelper.testClassExistence( this, net.mcft.copy.betterstorage.api.crate.ICrateStorage.class );
} }
@Override @Override
@@ -60,7 +63,6 @@ public class BetterStorage extends BaseModule implements IIntegrationModule, IBe
@Override @Override
public void init() public void init()
{ {
} }
@Override @Override
@@ -28,10 +28,7 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import buildcraft.api.blueprints.BuilderAPI; import buildcraft.api.blueprints.BuilderAPI;
import buildcraft.api.blueprints.IBuilderContext;
import buildcraft.api.blueprints.ISchematicRegistry; import buildcraft.api.blueprints.ISchematicRegistry;
import buildcraft.api.blueprints.SchematicBlock;
import buildcraft.api.blueprints.SchematicTile;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
@@ -41,6 +38,7 @@ import appeng.api.util.IOrientableBlock;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.helpers.Reflected; import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.modules.BCHelpers.AECableSchematicTile; import appeng.integration.modules.BCHelpers.AECableSchematicTile;
import appeng.integration.modules.BCHelpers.AEGenericSchematicTile; import appeng.integration.modules.BCHelpers.AEGenericSchematicTile;
import appeng.integration.modules.BCHelpers.AERotatableBlockSchematic; import appeng.integration.modules.BCHelpers.AERotatableBlockSchematic;
@@ -62,11 +60,11 @@ public class BuildCraftBuilder extends BaseModule
@Reflected @Reflected
public BuildCraftBuilder() public BuildCraftBuilder()
{ {
this.testClassExistence( BuilderAPI.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.BuilderAPI.class );
this.testClassExistence( IBuilderContext.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.IBuilderContext.class );
this.testClassExistence( ISchematicRegistry.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.ISchematicRegistry.class );
this.testClassExistence( SchematicTile.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.SchematicTile.class );
this.testClassExistence( SchematicBlock.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.blueprints.SchematicBlock.class );
} }
@Override @Override
@@ -85,7 +83,6 @@ public class BuildCraftBuilder extends BaseModule
@Override @Override
public void postInit() public void postInit()
{ {
} }
private void initBuilderSupport() private void initBuilderSupport()
@@ -25,7 +25,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import buildcraft.BuildCraftTransport;
import buildcraft.api.tools.IToolWrench; import buildcraft.api.tools.IToolWrench;
import appeng.api.AEApi; import appeng.api.AEApi;
@@ -33,6 +32,7 @@ import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry; import appeng.api.features.IP2PTunnelRegistry;
import appeng.helpers.Reflected; import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IBuildCraftCore; import appeng.integration.abstraction.IBuildCraftCore;
@@ -45,9 +45,9 @@ public final class BuildCraftCore extends BaseModule implements IBuildCraftCore
@Reflected @Reflected
public BuildCraftCore() public BuildCraftCore()
{ {
this.testClassExistence( buildcraft.BuildCraftCore.class ); IntegrationHelper.testClassExistence( this, buildcraft.BuildCraftCore.class );
this.testClassExistence( BuildCraftTransport.class ); IntegrationHelper.testClassExistence( this, buildcraft.BuildCraftTransport.class );
this.testClassExistence( IToolWrench.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.tools.IToolWrench.class );
} }
@Override @Override
@@ -71,7 +71,6 @@ public final class BuildCraftCore extends BaseModule implements IBuildCraftCore
@Override @Override
public void init() public void init()
{ {
} }
@Override @Override
@@ -33,7 +33,6 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import buildcraft.api.facades.IFacadeItem; import buildcraft.api.facades.IFacadeItem;
import buildcraft.api.transport.IInjectable; import buildcraft.api.transport.IInjectable;
import buildcraft.api.transport.IPipeConnection;
import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.IPipeTile;
import buildcraft.transport.ItemFacade; import buildcraft.transport.ItemFacade;
import buildcraft.transport.PipeIconProvider; import buildcraft.transport.PipeIconProvider;
@@ -48,6 +47,7 @@ import appeng.api.parts.IFacadePart;
import appeng.facade.FacadePart; import appeng.facade.FacadePart;
import appeng.helpers.Reflected; import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IBuildCraftTransport; import appeng.integration.abstraction.IBuildCraftTransport;
import appeng.integration.modules.BCHelpers.BCPipeHandler; import appeng.integration.modules.BCHelpers.BCPipeHandler;
@@ -66,14 +66,14 @@ public class BuildCraftTransport extends BaseModule implements IBuildCraftTransp
@Reflected @Reflected
public BuildCraftTransport() public BuildCraftTransport()
{ {
this.testClassExistence( buildcraft.BuildCraftTransport.class ); IntegrationHelper.testClassExistence( this, buildcraft.BuildCraftTransport.class );
this.testClassExistence( IFacadeItem.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.facades.IFacadeItem.class );
this.testClassExistence( IInjectable.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IInjectable.class );
this.testClassExistence( IPipeConnection.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IPipeConnection.class );
this.testClassExistence( IPipeTile.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IPipeTile.class );
this.testClassExistence( ItemFacade.class ); IntegrationHelper.testClassExistence( this, buildcraft.api.transport.IPipeTile.PipeType.class );
this.testClassExistence( PipeIconProvider.class ); IntegrationHelper.testClassExistence( this, buildcraft.transport.ItemFacade.class );
this.testClassExistence( IPipeTile.PipeType.class ); IntegrationHelper.testClassExistence( this, buildcraft.transport.PipeIconProvider.class );
} }
@Override @Override
@@ -20,19 +20,26 @@ package appeng.integration.modules;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.ICLApi; import appeng.integration.abstraction.ICLApi;
public class CLApi extends BaseModule implements ICLApi public class CLApi extends BaseModule implements ICLApi
{ {
@Reflected
public static CLApi instance; public static CLApi instance;
@Reflected
public CLApi()
{
IntegrationHelper.testClassExistence( this, coloredlightscore.src.api.CLApi.class );
}
@Override @Override
public void init() throws Throwable public void init() throws Throwable
{ {
this.testClassExistence( coloredlightscore.src.api.CLApi.class );
} }
@Override @Override
@@ -21,6 +21,7 @@ package appeng.integration.modules;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.google.common.base.Optional; import com.google.common.base.Optional;
@@ -55,6 +56,7 @@ import appeng.api.features.IInscriberRecipe;
import appeng.api.recipes.IIngredient; import appeng.api.recipes.IIngredient;
import appeng.helpers.Reflected; import appeng.helpers.Reflected;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.IntegrationHelper;
import appeng.recipes.game.ShapedRecipe; import appeng.recipes.game.ShapedRecipe;
import appeng.recipes.game.ShapelessRecipe; import appeng.recipes.game.ShapelessRecipe;
@@ -135,6 +137,33 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
@Reflected @Reflected
public static CraftGuide instance; public static CraftGuide instance;
public CraftGuide()
{
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.CraftGuideLog.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.DefaultRecipeTemplate.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.RecipeGeneratorImplementation.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ChanceSlot.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.CraftGuideAPIObject.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ItemSlot.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeGenerator.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeProvider.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeTemplate.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.Slot.class );
IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.SlotType.class );
IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.DynamicTexture.class );
IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.TextureClip.class );
}
@Override
public void init() throws Throwable
{
}
@Override
public void postInit()
{
}
@Override @Override
public void generateRecipes( RecipeGenerator generator ) public void generateRecipes( RecipeGenerator generator )
{ {
@@ -427,15 +456,4 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
return null; return null;
} }
@Override
public void init() throws Throwable
{
}
@Override
public void postInit()
{
}
} }
@@ -25,7 +25,9 @@ import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEInventory;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IDSU; import appeng.integration.abstraction.IDSU;
import appeng.integration.modules.helpers.MFRDSUHandler; import appeng.integration.modules.helpers.MFRDSUHandler;
import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit; import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit;
@@ -33,8 +35,15 @@ import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit;
public class DSU extends BaseModule implements IDSU public class DSU extends BaseModule implements IDSU
{ {
@Reflected
public static DSU instance; public static DSU instance;
@Reflected
public DSU()
{
IntegrationHelper.testClassExistence( this, powercrystals.minefactoryreloaded.api.IDeepStorageUnit.class );
}
@Override @Override
public IMEInventory getDSU( TileEntity te ) public IMEInventory getDSU( TileEntity te )
{ {
@@ -50,7 +59,6 @@ public class DSU extends BaseModule implements IDSU
@Override @Override
public void init() public void init()
{ {
this.testClassExistence( IDeepStorageUnit.class );
} }
@Override @Override
@@ -50,6 +50,7 @@ import appeng.fmp.CableBusPart;
import appeng.fmp.FMPEvent; import appeng.fmp.FMPEvent;
import appeng.fmp.FMPPlacementHelper; import appeng.fmp.FMPPlacementHelper;
import appeng.fmp.PartRegistry; import appeng.fmp.PartRegistry;
import appeng.helpers.Reflected;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IFMP; import appeng.integration.abstraction.IFMP;
import appeng.integration.modules.helpers.FMPPacketEvent; import appeng.integration.modules.helpers.FMPPacketEvent;
@@ -58,7 +59,7 @@ import appeng.parts.CableBusContainer;
public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IFMP public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IFMP
{ {
@Reflected
public static FMP instance; public static FMP instance;
@Override @Override
@@ -28,6 +28,8 @@ import net.minecraft.tileentity.TileEntity;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEInventory;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IFZ; import appeng.integration.abstraction.IFZ;
import appeng.integration.modules.helpers.FactorizationBarrel; import appeng.integration.modules.helpers.FactorizationBarrel;
@@ -38,9 +40,9 @@ import appeng.util.Platform;
/** /**
* 100% Hacks. * 100% Hacks.
*/ */
public class FZ implements IFZ, IIntegrationModule public class FZ extends BaseModule implements IFZ, IIntegrationModule
{ {
@Reflected
public static FZ instance; public static FZ instance;
private static Class<?> day_BarrelClass; private static Class<?> day_BarrelClass;
@@ -27,25 +27,41 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.RecipeInputItemStack;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.TunnelType; import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry; import appeng.api.features.IP2PTunnelRegistry;
import appeng.api.parts.IPartHelper;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IIC2; import appeng.integration.abstraction.IIC2;
public class IC2 extends BaseModule implements IIC2 public class IC2 extends BaseModule implements IIC2
{ {
@Reflected
public static IC2 instance; public static IC2 instance;
@Reflected
public IC2() public IC2()
{ {
this.testClassExistence( IEnergyTile.class ); IntegrationHelper.testClassExistence( this, ic2.api.energy.tile.IEnergyTile.class );
IntegrationHelper.testClassExistence( this, ic2.api.recipe.RecipeInputItemStack.class );
} }
@Override @Override
public void init() public void init()
{ {
final IAppEngApi api = AEApi.instance();
final IPartHelper partHelper = api.partHelper();
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
}
} }
@Override @Override
@@ -31,7 +31,6 @@ import net.minecraft.world.World;
import mods.immibis.core.api.multipart.ICoverSystem; import mods.immibis.core.api.multipart.ICoverSystem;
import mods.immibis.core.api.multipart.IMultipartTile; import mods.immibis.core.api.multipart.IMultipartTile;
import mods.immibis.core.api.multipart.IPartContainer;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
@@ -40,6 +39,7 @@ import appeng.api.parts.IPartItem;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.helpers.Reflected; import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IImmibisMicroblocks; import appeng.integration.abstraction.IImmibisMicroblocks;
@@ -53,13 +53,17 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
private Class<?> MicroblockAPIUtils; private Class<?> MicroblockAPIUtils;
private Method mergeIntoMicroblockContainer; private Method mergeIntoMicroblockContainer;
@Reflected
public ImmibisMicroblocks()
{
IntegrationHelper.testClassExistence( this, mods.immibis.core.api.multipart.IMultipartTile.class );
IntegrationHelper.testClassExistence( this, mods.immibis.core.api.multipart.ICoverSystem.class );
IntegrationHelper.testClassExistence( this, mods.immibis.core.api.multipart.IPartContainer.class );
}
@Override @Override
public void init() throws Throwable public void init() throws Throwable
{ {
this.testClassExistence( IMultipartTile.class );
this.testClassExistence( ICoverSystem.class );
this.testClassExistence( IPartContainer.class );
try try
{ {
this.MicroblockAPIUtils = Class.forName( "mods.immibis.microblocks.api.MicroblockAPIUtils" ); this.MicroblockAPIUtils = Class.forName( "mods.immibis.microblocks.api.MicroblockAPIUtils" );
@@ -25,17 +25,25 @@ import cpw.mods.fml.common.Loader;
import invtweaks.api.InvTweaksAPI; import invtweaks.api.InvTweaksAPI;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IInvTweaks; import appeng.integration.abstraction.IInvTweaks;
public class InvTweaks extends BaseModule implements IInvTweaks public class InvTweaks extends BaseModule implements IInvTweaks
{ {
@Reflected
public static InvTweaks instance; public static InvTweaks instance;
static InvTweaksAPI api; static InvTweaksAPI api;
@Reflected
public InvTweaks()
{
IntegrationHelper.testClassExistence( this, invtweaks.api.InvTweaksAPI.class );
}
@Override @Override
public void init() public void init()
{ {
@@ -19,30 +19,29 @@
package appeng.integration.modules; package appeng.integration.modules;
import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection; import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
public class MFR extends BaseModule public class MFR extends BaseModule
{ {
@Reflected
public static MFR instance; public static MFR instance;
@Reflected
public MFR() public MFR()
{ {
this.testClassExistence( IRedNetConnection.class ); IntegrationHelper.testClassExistence( this, powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection.class );
} }
@Override @Override
public void init() throws Throwable public void init() throws Throwable
{ {
} }
@Override @Override
public void postInit() public void postInit()
{ {
} }
} }
@@ -24,25 +24,31 @@ import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.IMekanism; import appeng.integration.abstraction.IMekanism;
public final class Mekanism extends BaseModule implements IMekanism public final class Mekanism extends BaseModule implements IMekanism
{ {
@Reflected
public static Mekanism instance; public static Mekanism instance;
@Reflected
public Mekanism()
{
IntegrationHelper.testClassExistence( this, mekanism.api.energy.IStrictEnergyAcceptor.class );
}
@Override @Override
public void init() throws Throwable public void init() throws Throwable
{ {
this.testClassExistence( mekanism.api.energy.IStrictEnergyAcceptor.class );
} }
@Override @Override
public void postInit() public void postInit()
{ {
} }
@Override @Override
@@ -42,6 +42,7 @@ import appeng.core.AEConfig;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.Reflected; import appeng.helpers.Reflected;
import appeng.integration.BaseModule; import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.abstraction.INEI; import appeng.integration.abstraction.INEI;
import appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler; import appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler;
import appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler; import appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler;
@@ -61,15 +62,19 @@ public class NEI extends BaseModule implements INEI, IContainerTooltipHandler
private final Class<?> apiClass; private final Class<?> apiClass;
// recipe handler... // recipe handler...
Method registerRecipeHandler; private Method registerRecipeHandler;
Method registerUsageHandler; private Method registerUsageHandler;
@Reflected @Reflected
public NEI() throws ClassNotFoundException public NEI() throws ClassNotFoundException
{ {
this.testClassExistence( GuiContainerManager.class ); IntegrationHelper.testClassExistence( this, codechicken.nei.api.API.class );
this.testClassExistence( codechicken.nei.recipe.ICraftingHandler.class ); IntegrationHelper.testClassExistence( this, codechicken.nei.api.IStackPositioner.class );
this.testClassExistence( codechicken.nei.recipe.IUsageHandler.class ); IntegrationHelper.testClassExistence( this, codechicken.nei.guihook.GuiContainerManager.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.guihook.IContainerTooltipHandler.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.recipe.ICraftingHandler.class );
IntegrationHelper.testClassExistence( this, codechicken.nei.recipe.IUsageHandler.class );
this.apiClass = Class.forName( "codechicken.nei.api.API" ); this.apiClass = Class.forName( "codechicken.nei.api.API" );
} }
@@ -96,7 +101,7 @@ public class NEI extends BaseModule implements INEI, IContainerTooltipHandler
// crafting terminal... // crafting terminal...
Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class ); Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class );
Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" );
Class defaultHandler = NEICraftingHandler.class; Class<NEICraftingHandler> defaultHandler = NEICraftingHandler.class;
Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class ); Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class );
registerGuiOverlay.invoke( this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() ); registerGuiOverlay.invoke( this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() );

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