Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f44cddf8d5 | |||
| e3bf52ff7b | |||
| 07913af4f8 | |||
| 1760113cd4 | |||
| 12b05275f2 | |||
| c720584e49 | |||
| ab89278274 | |||
| 7c5f777e41 | |||
| 8b0637d05d | |||
| 497f1c9ace | |||
| 2ab0528015 | |||
| 589730bfad | |||
| 8700a79ca6 | |||
| a14cf2204d | |||
| 8bed7f223e | |||
| db85419702 | |||
| fb79fd284d | |||
| e3305c1963 | |||
| a3c85b4a59 | |||
| a2b20f1d67 | |||
| 86908b1ae6 | |||
| 6bf52b0b0f | |||
| eb1e86cacb | |||
| c405e725b2 | |||
| d377af9a69 | |||
| 12dbd17320 | |||
| 5028c8025b | |||
| d11d6e754f | |||
| 887339f7b8 | |||
| a665200c31 | |||
| 6554e295d5 | |||
| 4eeb554dcb | |||
| 3eae4a7d19 |
@@ -1,5 +1,5 @@
|
||||
[](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||
|
||||
# Applied Energistics 2
|
||||
|
||||
@@ -103,7 +103,7 @@ Providing as many details as possible does help us to find and resolve the issue
|
||||
- Eclipse: execute `gradlew eclipse`
|
||||
5. For add-on developer: Core-Mod Detection
|
||||
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
|
||||
- `-Dfml.coreMods.load=appeng.transformer.AppEngCore`
|
||||
- `-Dfml.coreMods.load=appeng.coremod.AppEngCore`
|
||||
|
||||
## Contribution
|
||||
|
||||
|
||||
+6
-1
@@ -53,6 +53,7 @@ archivesBaseName = aebasename
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||
attributes 'FMLAT': 'appeng_at.cfg'
|
||||
}
|
||||
|
||||
from sourceSets.api.output
|
||||
@@ -63,10 +64,11 @@ jar {
|
||||
include "assets/**"
|
||||
include "mcmod.info"
|
||||
include "pack.mcmeta"
|
||||
include "META-INF/appeng_at.cfg"
|
||||
}
|
||||
|
||||
minecraft {
|
||||
coreMod = "appeng.transformer.AppEngCore"
|
||||
coreMod = "appeng.coremod.AppEngLoadingPlugin"
|
||||
|
||||
version = minecraft_version + "-" + forge_version
|
||||
|
||||
@@ -117,4 +119,7 @@ processResources
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
|
||||
// move access transformer to META-INF
|
||||
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||
}
|
||||
+6
-5
@@ -8,8 +8,8 @@ aebasename=appliedenergistics2
|
||||
# Versions #
|
||||
#########################################################
|
||||
minecraft_version=1.10.2
|
||||
mcp_mappings=snapshot_20161018
|
||||
forge_version=12.18.2.2104
|
||||
mcp_mappings=snapshot_20161111
|
||||
forge_version=12.18.3.2185
|
||||
|
||||
#########################################################
|
||||
# Installable #
|
||||
@@ -19,6 +19,7 @@ waila_version=1.7.0-B3_1.9.4
|
||||
#########################################################
|
||||
# Provided APIs #
|
||||
#########################################################
|
||||
jei_version=3.12.7.312
|
||||
tesla_version=1.10.2-1.2.1.49
|
||||
ic2_version=2.6.96-ex110
|
||||
jei_version=3.13.6.391
|
||||
tesla_version=1.10.2-1.2.1.50
|
||||
ic2_version=2.6.99-ex110
|
||||
top_version=1.10-1.3.3-41
|
||||
@@ -38,6 +38,11 @@ repositories {
|
||||
name = "IC2 repo"
|
||||
url = "http://maven.ic2.player.to"
|
||||
}
|
||||
|
||||
maven { // TheOneProbe
|
||||
name 'tterrag maven'
|
||||
url "http://maven.tterrag.com/"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -48,12 +53,14 @@ dependencies {
|
||||
// installable runtime dependencies
|
||||
mods "mcp.mobius.waila:Waila:${waila_version}"
|
||||
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
||||
mods "mcjty.theoneprobe:TheOneProbe:${top_version}"
|
||||
|
||||
// compile against provided APIs
|
||||
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
|
||||
compileOnly "mcp.mobius.waila:Waila:${waila_version}"
|
||||
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
|
||||
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
compileOnly "mcjty.theoneprobe:TheOneProbe:${top_version}:api"
|
||||
|
||||
// at runtime, use the full JEI jar
|
||||
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
||||
|
||||
@@ -31,7 +31,7 @@ task deinstallWaila(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
|
||||
}
|
||||
|
||||
// IC²
|
||||
// IC2
|
||||
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||
from { configurations.mods }
|
||||
include "**/*industrialcraft-2*.jar"
|
||||
@@ -41,3 +41,15 @@ task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||
task deinstallIC2(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
|
||||
}
|
||||
|
||||
// TOP
|
||||
task installTop(type: Copy, dependsOn: "deinstallTop") {
|
||||
from { configurations.mods }
|
||||
include "**/*TheOneProbe*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallTop(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*TheOneProbe*.jar")
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public interface IParts
|
||||
|
||||
IItemDefinition p2PTunnelItems();
|
||||
|
||||
IItemDefinition p2PTunnelLiquids();
|
||||
IItemDefinition p2PTunnelFluids();
|
||||
|
||||
IItemDefinition p2PTunnelEU();
|
||||
|
||||
|
||||
+15
-43
@@ -24,13 +24,17 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
/**
|
||||
* Registration Records for {@link IGrinderRegistry}
|
||||
*/
|
||||
public interface IGrinderEntry
|
||||
public interface IGrinderRecipe
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -38,66 +42,40 @@ public interface IGrinderEntry
|
||||
*
|
||||
* @return input that the grinder will accept.
|
||||
*/
|
||||
@Nonnull
|
||||
ItemStack getInput();
|
||||
|
||||
/**
|
||||
* lets you change the grinder recipe by changing its input.
|
||||
*
|
||||
* @param input input item
|
||||
*/
|
||||
void setInput( ItemStack input );
|
||||
|
||||
/**
|
||||
* gets the current output
|
||||
*
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
@Nonnull
|
||||
ItemStack getOutput();
|
||||
|
||||
/**
|
||||
* allows you to change the output.
|
||||
* gets the current output
|
||||
*
|
||||
* @param output output item
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
void setOutput( ItemStack output );
|
||||
@Nonnull
|
||||
Optional<ItemStack> getOptionalOutput();
|
||||
|
||||
/**
|
||||
* gets the current output
|
||||
*
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
ItemStack getOptionalOutput();
|
||||
|
||||
/**
|
||||
* gets the current output
|
||||
*
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
ItemStack getSecondOptionalOutput();
|
||||
|
||||
/**
|
||||
* stack, and 0.0-1.0 chance that it will be generated.
|
||||
*
|
||||
* @param output output item
|
||||
* @param chance generation chance
|
||||
*/
|
||||
void setOptionalOutput( ItemStack output, float chance );
|
||||
Optional<ItemStack> getSecondOptionalOutput();
|
||||
|
||||
/**
|
||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||
*
|
||||
* @return chance of optional output
|
||||
*/
|
||||
@Nonnull
|
||||
float getOptionalChance();
|
||||
|
||||
/**
|
||||
* stack, and 0.0-1.0 chance that it will be generated.
|
||||
*
|
||||
* @param output second optional output item
|
||||
* @param chance second optional output chance
|
||||
*/
|
||||
void setSecondOptionalOutput( ItemStack output, float chance );
|
||||
|
||||
/**
|
||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||
*
|
||||
@@ -106,16 +84,10 @@ public interface IGrinderEntry
|
||||
float getSecondOptionalChance();
|
||||
|
||||
/**
|
||||
* Energy cost, in turns.
|
||||
* Amount of turns required to process the item.
|
||||
*
|
||||
* @return number of turns it takes to produce the output from the input.
|
||||
*/
|
||||
int getEnergyCost();
|
||||
int getRequiredTurns();
|
||||
|
||||
/**
|
||||
* Allows you to adjust the number of turns
|
||||
*
|
||||
* @param c number of turns to produce output.
|
||||
*/
|
||||
void setEnergyCost( int c );
|
||||
}
|
||||
@@ -24,7 +24,10 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -36,51 +39,90 @@ public interface IGrinderRegistry
|
||||
{
|
||||
|
||||
/**
|
||||
* Current list of registered recipes, you can modify this if you want too.
|
||||
* An immutable list of the currently registered recipes.
|
||||
*
|
||||
* @return currentlyRegisteredRecipes
|
||||
*/
|
||||
List<IGrinderEntry> getRecipes();
|
||||
@Nonnull
|
||||
Collection<IGrinderRecipe> getRecipes();
|
||||
|
||||
/**
|
||||
* add a new recipe the easy way, in → out, how many turns., duplicates will not be added.
|
||||
* Add a new recipe with a single input and output and how many turns it requires.
|
||||
*
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in input
|
||||
* @param out output
|
||||
* @param turns amount of turns to turn the input into the output
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
*/
|
||||
void addRecipe( ItemStack in, ItemStack out, int turns );
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, int turns );
|
||||
|
||||
/**
|
||||
* Add a new recipe with an input, output and a single optional output.
|
||||
*
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param optional The optional {@link ItemStack} to output of a certain chance.
|
||||
* @param chance Chance to get the optional output within 0.0 - 1.0
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
*/
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, int turns );
|
||||
|
||||
/**
|
||||
* add a new recipe with optional outputs, duplicates will not be added.
|
||||
*
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in input
|
||||
* @param out output
|
||||
* @param optional optional output
|
||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
||||
* @param turns amount of turns to turn the input into the outputs
|
||||
*/
|
||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int turns );
|
||||
|
||||
/**
|
||||
* add a new recipe with optional outputs, duplicates will not be added.
|
||||
*
|
||||
* @param in input
|
||||
* @param out output
|
||||
* @param optional optional output
|
||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
||||
* @param optional2 second optional output
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param optional The first optional {@link ItemStack} to output of a certain chance.
|
||||
* @param chance Chance to get the first optional output within 0.0 - 1.0
|
||||
* @param optional2 The second optional {@link ItemStack} to output of a certain chance.
|
||||
* @param chance2 chance to get the second optional output within 0.0 - 1.0
|
||||
* @param turns amount of turns to turn the input into the outputs
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
*
|
||||
*/
|
||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns );
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
|
||||
|
||||
/**
|
||||
* Remove the specific from the recipe list.
|
||||
*
|
||||
* @param recipe The recipe to be removed.
|
||||
* @return true, if it was removed
|
||||
*/
|
||||
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
|
||||
|
||||
/**
|
||||
* Searches for a recipe for a given input, and returns it.
|
||||
*
|
||||
* @param input input
|
||||
* @param input The {@link ItemStack} to be grinded.
|
||||
*
|
||||
* @return identified recipe or null
|
||||
*/
|
||||
IGrinderEntry getRecipeForInput( ItemStack input );
|
||||
@Nullable
|
||||
IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input );
|
||||
|
||||
/**
|
||||
* Allows do add a custom ratio from an ore to dust when being grinded.
|
||||
*
|
||||
* The default ratio is 1 ore to 2 dusts.
|
||||
*
|
||||
* These have to be added before any recipe is registered. Otherwise it will use the default value.
|
||||
*
|
||||
* @param oredictName The name of the ore;
|
||||
* @param ratio The amount, must be > 0;
|
||||
*/
|
||||
void addDustRatio( @Nonnull String oredictName, int ratio );
|
||||
|
||||
/**
|
||||
* Remove a custom ratio for a specific ore name.
|
||||
*
|
||||
* Will use the default of 2 value afterwards.
|
||||
*
|
||||
* @param oredictName The name of the ore;
|
||||
*/
|
||||
boolean removeDustRatio( @Nonnull String oredictName );
|
||||
|
||||
}
|
||||
|
||||
@@ -24,12 +24,36 @@
|
||||
package appeng.api.networking.crafting;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
|
||||
public interface ICraftingWatcher extends Collection<IAEStack>
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
|
||||
*/
|
||||
public interface ICraftingWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
boolean add( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Remove a specific {@link IAEStack} from the watcher.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
boolean remove( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Removes all watched stacks and resets the watcher to a clean state.
|
||||
*/
|
||||
void reset();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,34 @@
|
||||
package appeng.api.networking.energy;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
public interface IEnergyWatcher extends Collection<Double>
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IEnergyWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific threshold to watch.
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param amount
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
boolean add( double amount );
|
||||
|
||||
/**
|
||||
* Remove a specific threshold from the watcher.
|
||||
*
|
||||
* @param amount
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
boolean remove( double amount );
|
||||
|
||||
/**
|
||||
* Removes all thresholds and resets the watcher to a clean state.
|
||||
*/
|
||||
void reset();
|
||||
|
||||
}
|
||||
|
||||
@@ -24,12 +24,36 @@
|
||||
package appeng.api.networking.storage;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
|
||||
public interface IStackWatcher extends Collection<IAEStack>
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IStackWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
boolean add( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Remove a specific {@link IAEStack} from the watcher.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
boolean remove( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Removes all watched stacks and resets the watcher to a clean state.
|
||||
*/
|
||||
void reset();
|
||||
}
|
||||
|
||||
@@ -25,10 +25,11 @@ package appeng.api.parts;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -39,7 +40,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
@@ -71,7 +71,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
ItemStack getItemStack( PartItemStack type );
|
||||
|
||||
/**
|
||||
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for {@link #requireDynamicRender()} in order for
|
||||
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for
|
||||
* {@link #requireDynamicRender()} in order for
|
||||
* this method to be called.
|
||||
*/
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -267,8 +268,10 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
boolean canBePlacedOn( BusSupport what );
|
||||
|
||||
/**
|
||||
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models should represent the
|
||||
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4 can be used in the
|
||||
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models
|
||||
* should represent the
|
||||
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4
|
||||
* can be used in the
|
||||
* models to access the parts color.
|
||||
*
|
||||
* <dl>
|
||||
@@ -279,18 +282,23 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
* <dt>Tint Index 3</dt>
|
||||
* <dd>The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.</dd>
|
||||
* <dt>Tint Index 4</dt>
|
||||
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its {@link AEColor#whiteVariant bright variant}.</dd>
|
||||
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its
|
||||
* {@link AEColor#whiteVariant bright variant}.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* <b>Important:</b> All models must have been registered via the {@link IPartModels} API before use.
|
||||
*/
|
||||
default List<ResourceLocation> getStaticModels()
|
||||
@Nonnull
|
||||
default IPartModel getStaticModels()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
return new IPartModel()
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
|
||||
* forwarded to parts on the appropriate
|
||||
* side.
|
||||
*
|
||||
* @see TileEntity#hasCapability(Capability, EnumFacing)
|
||||
@@ -303,7 +311,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
|
||||
* forwarded to parts on the appropriate
|
||||
* side.
|
||||
*
|
||||
* @see TileEntity#getCapability(Capability, EnumFacing)
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.parts;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
/**
|
||||
* A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties.
|
||||
*/
|
||||
public interface IPartModel
|
||||
{
|
||||
|
||||
/**
|
||||
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
|
||||
* creating an intersection for the cable.
|
||||
*
|
||||
* This should be true for pretty much all parts.
|
||||
*
|
||||
* @return true for a solid part.
|
||||
*/
|
||||
default boolean requireCableConnection()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of {@link ResourceLocation} used as models for a part.
|
||||
*
|
||||
* @return a collection of models, never null.
|
||||
*/
|
||||
@Nonnull
|
||||
default List<ResourceLocation> getModels()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,10 +31,8 @@ import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -65,12 +63,6 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return this.isOpaque() && this.isFullSize();
|
||||
}
|
||||
|
||||
protected AEBaseBlock( final Material mat )
|
||||
{
|
||||
super( mat );
|
||||
@@ -96,13 +88,15 @@ public abstract class AEBaseBlock extends Block
|
||||
this.setLightLevel( 0 );
|
||||
this.setHardness( 2.2F );
|
||||
this.setHarvestLevel( "pickaxe", 0 );
|
||||
|
||||
// Workaround as vanilla sets it way too early.
|
||||
this.fullBlock = this.isFullSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
public final boolean isVisuallyOpaque()
|
||||
{
|
||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
return this.isOpaque() && this.isFullSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,31 +105,12 @@ public abstract class AEBaseBlock extends Block
|
||||
return new BlockStateContainer( this, this.getAEStates() );
|
||||
}
|
||||
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return new IProperty[0];
|
||||
}
|
||||
|
||||
public boolean isOpaque()
|
||||
{
|
||||
return this.isOpaque;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube( IBlockState state )
|
||||
public final boolean isNormalCube( IBlockState state )
|
||||
{
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof ICustomCollision )
|
||||
{
|
||||
return (ICustomCollision) this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
||||
{
|
||||
@@ -210,7 +185,8 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
if( br != null )
|
||||
{
|
||||
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos.getY(), br.maxZ + pos.getZ() );
|
||||
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos
|
||||
.getY(), br.maxZ + pos.getZ() );
|
||||
return br;
|
||||
}
|
||||
}
|
||||
@@ -241,7 +217,8 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
else
|
||||
{
|
||||
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos.getZ() );
|
||||
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos
|
||||
.getZ() );
|
||||
}
|
||||
|
||||
return b;
|
||||
@@ -303,19 +280,6 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.collisionRayTrace( state, w, pos, a, b );
|
||||
}
|
||||
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
|
||||
{
|
||||
this.getCheckedSubBlocks( item, tabs, itemStacks );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride( IBlockState state )
|
||||
{
|
||||
@@ -329,21 +293,11 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
||||
public final boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
||||
{
|
||||
return this.isFullSize();
|
||||
}
|
||||
|
||||
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof IOrientableBlock )
|
||||
{
|
||||
IOrientableBlock orientable = (IOrientableBlock) this;
|
||||
return orientable.getOrientable( w, pos );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
|
||||
{
|
||||
@@ -378,50 +332,24 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.rotateBlock( w, pos, axis );
|
||||
}
|
||||
|
||||
protected boolean hasCustomRotation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
|
||||
{
|
||||
return new EnumFacing[0];
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
super.getSubBlocks( item, tabs, itemStacks );
|
||||
}
|
||||
|
||||
public String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean hasSubtypes()
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return this.hasSubtypes;
|
||||
return false;
|
||||
}
|
||||
|
||||
public EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
||||
public final EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
||||
{
|
||||
// case DOWN: return bottomIcon;
|
||||
// case UP: return blockIcon;
|
||||
@@ -486,36 +414,97 @@ public abstract class AEBaseBlock extends Block
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isFullSize()
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.isFullSize;
|
||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
public boolean setFullSize( final boolean isFullSize )
|
||||
protected String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
this.isFullSize = isFullSize;
|
||||
return isFullSize;
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public boolean setOpaque( final boolean isOpaque )
|
||||
protected boolean hasCustomRotation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof IOrientableBlock )
|
||||
{
|
||||
IOrientableBlock orientable = (IOrientableBlock) this;
|
||||
return orientable.getOrientable( w, pos );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof ICustomCollision )
|
||||
{
|
||||
return (ICustomCollision) this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return new IProperty[0];
|
||||
}
|
||||
|
||||
protected boolean isOpaque()
|
||||
{
|
||||
return this.isOpaque;
|
||||
}
|
||||
|
||||
protected boolean setOpaque( final boolean isOpaque )
|
||||
{
|
||||
this.isOpaque = isOpaque;
|
||||
return isOpaque;
|
||||
}
|
||||
|
||||
public boolean isInventory()
|
||||
protected boolean hasSubtypes()
|
||||
{
|
||||
return this.isInventory;
|
||||
return this.hasSubtypes;
|
||||
}
|
||||
|
||||
public void setInventory( final boolean isInventory )
|
||||
{
|
||||
this.isInventory = isInventory;
|
||||
}
|
||||
|
||||
public void setHasSubtypes( final boolean hasSubtypes )
|
||||
protected void setHasSubtypes( final boolean hasSubtypes )
|
||||
{
|
||||
this.hasSubtypes = hasSubtypes;
|
||||
}
|
||||
|
||||
protected boolean isFullSize()
|
||||
{
|
||||
return this.isFullSize;
|
||||
}
|
||||
|
||||
protected boolean setFullSize( final boolean isFullSize )
|
||||
{
|
||||
this.isFullSize = isFullSize;
|
||||
return isFullSize;
|
||||
}
|
||||
|
||||
protected boolean isInventory()
|
||||
{
|
||||
return this.isInventory;
|
||||
}
|
||||
|
||||
protected void setInventory( final boolean isInventory )
|
||||
{
|
||||
this.isInventory = isInventory;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
final TileCraftingTile tg = this.getTileEntity( w, pos );
|
||||
|
||||
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
@@ -160,7 +161,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return super.onBlockActivated( w, pos, state, p, hand, heldItem, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
public enum CraftingUnitType
|
||||
|
||||
@@ -107,6 +107,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return super.onBlockActivated( w, pos, state, p, hand, heldItem, side, hitX, hitY, hitZ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,6 @@ public class ItemCraftingStorage extends AEBaseItemBlock
|
||||
@Override
|
||||
public boolean hasContainerItem( final ItemStack stack )
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
|
||||
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.block.misc;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
@@ -94,7 +95,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
@Override
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
@Override
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.block.networking;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -376,7 +377,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ public class BlockEnergyCell extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
super.getCheckedSubBlocks( item, tabs, itemStacks );
|
||||
super.getSubBlocks( item, tabs, itemStacks );
|
||||
|
||||
final ItemStack charged = new ItemStack( this, 1 );
|
||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.block.networking;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
@@ -46,6 +47,7 @@ import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -62,7 +64,6 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static final PropertyEnum<State> STATE = PropertyEnum.create( "state", State.class );
|
||||
|
||||
public BlockWireless()
|
||||
@@ -112,13 +113,9 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
@Override
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final TileWireless tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
|
||||
if( tg != null && !player.isSneaking() )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -126,7 +123,8 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return super.onBlockActivated( w, pos, state, player, hand, heldItem, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -94,7 +94,7 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package appeng.block.paint;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
@@ -4,6 +4,7 @@ package appeng.block.qnb;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ import appeng.util.Platform;
|
||||
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
private static final double AABB_OFFSET_BOTTOM = .0625d;
|
||||
private static final double AABB_OFFSET_SIDES = 0;
|
||||
private static final double AABB_OFFSET_TOP = .125d;
|
||||
|
||||
public enum SkyChestType
|
||||
{
|
||||
STONE, BLOCK
|
||||
@@ -71,7 +75,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
@@ -85,6 +88,21 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
||||
{
|
||||
final AxisAlignedBB aabb = computeAABB( w, pos );
|
||||
|
||||
return Collections.singletonList( aabb );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
final AxisAlignedBB aabb = computeAABB( w, pos );
|
||||
|
||||
out.add( aabb );
|
||||
}
|
||||
|
||||
private AxisAlignedBB computeAABB( final World w, final BlockPos pos )
|
||||
{
|
||||
final TileSkyChest sk = this.getTileEntity( w, pos );
|
||||
EnumFacing o = EnumFacing.UP;
|
||||
@@ -94,17 +112,19 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
o = sk.getUp();
|
||||
}
|
||||
|
||||
final double offsetX = o.getFrontOffsetX() == 0 ? 0.06 : 0.0;
|
||||
final double offsetY = o.getFrontOffsetY() == 0 ? 0.06 : 0.0;
|
||||
final double offsetZ = o.getFrontOffsetZ() == 0 ? 0.06 : 0.0;
|
||||
final double offsetX = o.getFrontOffsetX() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||
final double offsetY = o.getFrontOffsetY() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||
final double offsetZ = o.getFrontOffsetZ() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||
|
||||
final double sc = 0.06;
|
||||
return Collections.singletonList( new AxisAlignedBB( Math.max( 0.0, offsetX - o.getFrontOffsetX() * sc ), Math.max( 0.0, offsetY - o.getFrontOffsetY() * sc ), Math.max( 0.0, offsetZ - o.getFrontOffsetZ() * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.getFrontOffsetX() * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.getFrontOffsetZ() * sc ) ) );
|
||||
}
|
||||
// x/z needs to be multiplied by -1, thus we simply add not substract.
|
||||
final double minX = Math.max( 0.0, offsetX + o.getFrontOffsetX() * AABB_OFFSET_TOP );
|
||||
final double minY = Math.max( 0.0, offsetY - o.getFrontOffsetY() * AABB_OFFSET_TOP );
|
||||
final double minZ = Math.max( 0.0, offsetZ + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
out.add( new AxisAlignedBB( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
|
||||
final double maxX = Math.min( 1.0, ( 1.0 - offsetX ) + o.getFrontOffsetX() * AABB_OFFSET_TOP );
|
||||
final double maxY = Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * AABB_OFFSET_TOP );
|
||||
final double maxZ = Math.min( 1.0, ( 1.0 - offsetZ ) + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
|
||||
|
||||
return new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -184,7 +185,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
@Override
|
||||
public <T extends IBlockDefinition> T build()
|
||||
{
|
||||
if( !AEConfig.instance.areFeaturesEnabled( features ) )
|
||||
if( !AEConfig.instance().areFeaturesEnabled( features ) )
|
||||
{
|
||||
return (T) new TileDefinition( registryName, null, null );
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class FeatureFactory
|
||||
|
||||
public FeatureFactory()
|
||||
{
|
||||
this.defaultFeatures = new AEFeature[] { AEFeature.Core };
|
||||
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
|
||||
this.bootstrapComponents = new ArrayList<>();
|
||||
|
||||
if( Platform.isClient() )
|
||||
|
||||
@@ -147,7 +147,7 @@ class ItemDefinitionBuilder implements IItemBuilder
|
||||
@Override
|
||||
public ItemDefinition build()
|
||||
{
|
||||
if( !AEConfig.instance.areFeaturesEnabled( features ) )
|
||||
if( !AEConfig.instance().areFeaturesEnabled( features ) )
|
||||
{
|
||||
return new ItemDefinition( registryName, null );
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ import appeng.core.CommonHelper;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketAssemblerAnimation;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.coremod.MissingCoreMod;
|
||||
import appeng.entity.EntityFloatingItem;
|
||||
import appeng.entity.EntityTinyTNTPrimed;
|
||||
import appeng.entity.RenderFloatingItem;
|
||||
@@ -70,7 +71,6 @@ import appeng.helpers.IMouseWheelItem;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.hooks.TickHandler.PlayerColor;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.transformer.MissingCoreMod;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ public class ClientHelper extends ServerHelper
|
||||
@Override
|
||||
public void spawnEffect( final EffectType effect, final World worldObj, final double posX, final double posY, final double posZ, final Object o )
|
||||
{
|
||||
if( AEConfig.instance.enableEffects )
|
||||
if( AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
switch( effect )
|
||||
{
|
||||
@@ -354,7 +354,7 @@ public class ClientHelper extends ServerHelper
|
||||
final ItemStack is = player.getHeldItem( hand );
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Item", me.getDwheel() > 0 ? "WheelUp" : "WheelDown" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Item", me.getDwheel() > 0 ? "WheelUp" : "WheelDown" ) );
|
||||
me.setCanceled( true );
|
||||
}
|
||||
catch( final IOException e )
|
||||
|
||||
@@ -54,7 +54,6 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -313,7 +312,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
for( final Slot dr : this.drag_click )
|
||||
{
|
||||
final PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,7 +338,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -353,7 +352,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( ( (SlotPatternTerm) slot ).getRequest( isShiftKeyDown() ) );
|
||||
NetworkHandler.instance().sendToServer( ( (SlotPatternTerm) slot ).getRequest( isShiftKeyDown() ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -379,7 +378,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -403,7 +402,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
|
||||
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -437,7 +436,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
if( action != null )
|
||||
{
|
||||
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).getSlot().getId() );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -490,7 +489,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
|
||||
final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -539,16 +538,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
@Override
|
||||
protected boolean checkHotbarKeys( final int keyCode )
|
||||
{
|
||||
final Slot theSlot;
|
||||
|
||||
try
|
||||
{
|
||||
theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" );
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final Slot theSlot = this.getSlotUnderMouse();
|
||||
|
||||
if( this.mc.thePlayer.inventory.getItemStack() == null && theSlot != null )
|
||||
{
|
||||
@@ -579,7 +569,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -648,7 +638,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
for( int h = 0; h < times; h++ )
|
||||
{
|
||||
final PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -701,7 +691,8 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
/**
|
||||
* This overrides the base-class method through some access transformer hackery...
|
||||
*/
|
||||
public void drawSlot( final Slot s )
|
||||
@Override
|
||||
public void drawSlot( Slot s )
|
||||
{
|
||||
if( s instanceof SlotME )
|
||||
{
|
||||
@@ -720,7 +711,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
this.itemRender.zLevel = 0.0F;
|
||||
|
||||
// Annoying but easier than trying to splice into render item
|
||||
this.safeDrawSlot( new Size1Slot( s ) );
|
||||
super.drawSlot( new Size1Slot( s ) );
|
||||
|
||||
stackSizeRenderer.renderStackSize( fontRendererObj, ( (SlotME) s ).getAEStack(), s.getStack(), s.xDisplayPosition, s.yDisplayPosition );
|
||||
|
||||
@@ -822,11 +813,11 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
if( s instanceof AppEngSlot )
|
||||
{
|
||||
( (AppEngSlot) s ).setDisplay( true );
|
||||
this.safeDrawSlot( s );
|
||||
super.drawSlot( s );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.safeDrawSlot( s );
|
||||
super.drawSlot( s );
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -837,7 +828,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
}
|
||||
// do the usual for non-ME Slots.
|
||||
this.safeDrawSlot( s );
|
||||
super.drawSlot( s );
|
||||
}
|
||||
|
||||
protected boolean isPowered()
|
||||
@@ -845,17 +836,6 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
return true;
|
||||
}
|
||||
|
||||
private void safeDrawSlot( final Slot s )
|
||||
{
|
||||
try
|
||||
{
|
||||
GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s );
|
||||
}
|
||||
catch( final Exception err )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void bindTexture( final String file )
|
||||
{
|
||||
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
|
||||
|
||||
@@ -49,7 +49,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
final Slot s = this.getSlot( mouseX, mouseY );
|
||||
if( s instanceof SlotME )
|
||||
{
|
||||
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||
final int BigNumber = AEConfig.instance().useTerminalUseLargeFont() ? 999 : 9999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
|
||||
@@ -103,7 +103,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
final Slot s = this.getSlot( x, y );
|
||||
if( s instanceof SlotME && stack != null )
|
||||
{
|
||||
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||
final int BigNumber = AEConfig.instance().useTerminalUseLargeFont() ? 999 : 9999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ public class AEConfigGui extends GuiConfig
|
||||
|
||||
public AEConfigGui( final GuiScreen parent )
|
||||
{
|
||||
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance.getFilePath() ) );
|
||||
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance().getFilePath() ) );
|
||||
}
|
||||
|
||||
private static List<IConfigElement> getConfigElements()
|
||||
{
|
||||
final List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
|
||||
for( final String cat : AEConfig.instance.getCategoryNames() )
|
||||
for( final String cat : AEConfig.instance().getCategoryNames() )
|
||||
{
|
||||
if( cat.equals( "versionchecker" ) )
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public class AEConfigGui extends GuiConfig
|
||||
continue;
|
||||
}
|
||||
|
||||
final ConfigCategory cc = AEConfig.instance.getCategory( cat );
|
||||
final ConfigCategory cc = AEConfig.instance().getCategory( cat );
|
||||
|
||||
if( cc.isChild() )
|
||||
{
|
||||
|
||||
@@ -176,15 +176,15 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
{
|
||||
if( btn == this.copyMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "CopyMode" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Action", "CopyMode" ) );
|
||||
}
|
||||
else if( btn == this.partition )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Partition" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Partition" ) );
|
||||
}
|
||||
else if( btn == this.clear )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Clear" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Action", "Clear" ) );
|
||||
}
|
||||
else if( btn == this.fuzzyMode )
|
||||
{
|
||||
@@ -193,7 +193,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
FuzzyMode fz = (FuzzyMode) this.fuzzyMode.getCurrentValue();
|
||||
fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() );
|
||||
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GuiChest extends AEBaseGui
|
||||
|
||||
if( par1GuiButton == this.priority )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GuiCondenser extends AEBaseGui
|
||||
|
||||
if( this.mode == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,10 +76,10 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
final int a = AEConfig.instance.craftItemsByStackAmounts( 0 );
|
||||
final int b = AEConfig.instance.craftItemsByStackAmounts( 1 );
|
||||
final int c = AEConfig.instance.craftItemsByStackAmounts( 2 );
|
||||
final int d = AEConfig.instance.craftItemsByStackAmounts( 3 );
|
||||
final int a = AEConfig.instance().craftItemsByStackAmounts( 0 );
|
||||
final int b = AEConfig.instance().craftItemsByStackAmounts( 1 );
|
||||
final int c = AEConfig.instance().craftItemsByStackAmounts( 2 );
|
||||
final int d = AEConfig.instance().craftItemsByStackAmounts( 3 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) );
|
||||
@@ -224,12 +224,12 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
|
||||
if( btn == this.originalGuiBtn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.originalGui ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.originalGui ) );
|
||||
}
|
||||
|
||||
if( btn == this.next )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
|
||||
}
|
||||
}
|
||||
catch( final NumberFormatException e )
|
||||
|
||||
@@ -552,7 +552,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -562,14 +562,14 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
|
||||
if( btn == this.cancel )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
|
||||
}
|
||||
|
||||
if( btn == this.start )
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) );
|
||||
}
|
||||
catch( final Throwable e )
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -248,7 +248,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
scheduled = true;
|
||||
}
|
||||
|
||||
if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
|
||||
if( AEConfig.instance().isUseColoredCraftingStatus() && ( active || scheduled ) )
|
||||
{
|
||||
final int bgColor = ( active ? AEColor.GREEN.blackVariant : AEColor.YELLOW.blackVariant ) | BACKGROUND_ALPHA;
|
||||
final int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
|
||||
|
||||
@@ -108,7 +108,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -118,7 +118,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
|
||||
if( btn == this.originalGuiBtn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.originalGui ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.originalGui ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
|
||||
if( s != null )
|
||||
{
|
||||
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GuiDrive extends AEBaseGui
|
||||
|
||||
if( par1GuiButton == this.priority )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,11 +96,11 @@ public class GuiFormationPlane extends GuiUpgradeable
|
||||
|
||||
if( btn == this.priority )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
else if( btn == this.placeMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.placeMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.placeMode.getSetting(), backwards ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,12 +113,12 @@ public class GuiIOPort extends GuiUpgradeable
|
||||
|
||||
if( btn == this.fullMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
if( btn == this.operationMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,17 +103,17 @@ public class GuiInterface extends GuiUpgradeable
|
||||
|
||||
if( btn == this.priority )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
|
||||
if( btn == this.interfaceMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
|
||||
}
|
||||
|
||||
if( btn == this.BlockMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,10 +88,10 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||
this.craftingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO );
|
||||
|
||||
final int a = AEConfig.instance.levelByStackAmounts( 0 );
|
||||
final int b = AEConfig.instance.levelByStackAmounts( 1 );
|
||||
final int c = AEConfig.instance.levelByStackAmounts( 2 );
|
||||
final int d = AEConfig.instance.levelByStackAmounts( 3 );
|
||||
final int a = AEConfig.instance().levelByStackAmounts( 0 );
|
||||
final int b = AEConfig.instance().levelByStackAmounts( 1 );
|
||||
final int c = AEConfig.instance().levelByStackAmounts( 2 );
|
||||
final int d = AEConfig.instance().levelByStackAmounts( 3 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) );
|
||||
@@ -175,12 +175,12 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
|
||||
if( btn == this.craftingMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
if( btn == this.levelMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
|
||||
@@ -224,7 +224,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
|
||||
this.level.setText( Out = Long.toString( result ) );
|
||||
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
|
||||
}
|
||||
catch( final NumberFormatException e )
|
||||
{
|
||||
@@ -265,7 +265,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
Out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -168,7 +168,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
{
|
||||
if( btn == this.craftingStatusBtn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_CRAFTING_STATUS ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_CRAFTING_STATUS ) );
|
||||
}
|
||||
|
||||
if( btn instanceof GuiImgButton )
|
||||
@@ -183,17 +183,17 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
if( btn == this.terminalStyleBox )
|
||||
{
|
||||
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next );
|
||||
}
|
||||
else if( btn == this.searchBoxSettings )
|
||||
{
|
||||
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next );
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -223,7 +223,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
Keyboard.enableRepeatEvents( true );
|
||||
|
||||
this.maxRows = this.getMaxRows();
|
||||
this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
|
||||
this.perRow = AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
|
||||
|
||||
final int magicNumber = 114 + 1;
|
||||
final int extraSpace = this.height - magicNumber - this.reservedSpace;
|
||||
@@ -248,7 +248,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
}
|
||||
|
||||
if( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
|
||||
if( AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
|
||||
{
|
||||
this.xSize = this.standardSize + ( ( this.perRow - 9 ) * 18 );
|
||||
}
|
||||
@@ -284,12 +284,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.buttonList.add( this.SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc.getSetting( Settings.SORT_DIRECTION ) ) );
|
||||
offset += 20;
|
||||
|
||||
this.buttonList.add( this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ) ) );
|
||||
this.buttonList.add( this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE ) ) );
|
||||
offset += 20;
|
||||
|
||||
if( !( this instanceof GuiMEPortableCell ) || this instanceof GuiWirelessTerm )
|
||||
{
|
||||
this.buttonList.add( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings.getSetting( Settings.TERMINAL_STYLE ) ) );
|
||||
this.buttonList.add( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) ) );
|
||||
}
|
||||
|
||||
this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 80, this.offsetX ), this.guiTop + 4, 90, 12 );
|
||||
@@ -304,8 +304,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.craftingStatusBtn.setHideEdge( 13 );
|
||||
}
|
||||
|
||||
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
||||
final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
// Enum setting = AEConfig.instance().getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
||||
final Enum setting = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
|
||||
this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.JEI_AUTOSEARCH == setting );
|
||||
|
||||
if( this.isSubGui() )
|
||||
@@ -354,7 +354,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
@Override
|
||||
protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException
|
||||
{
|
||||
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
final Enum searchMode = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
|
||||
|
||||
if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.JEI_AUTOSEARCH )
|
||||
{
|
||||
@@ -438,7 +438,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
int getMaxRows()
|
||||
{
|
||||
return AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
|
||||
return AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
protected void repositionSlot( final AppEngSlot s )
|
||||
|
||||
@@ -77,8 +77,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
|
||||
if( btn == this.units )
|
||||
{
|
||||
AEConfig.instance.nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance.selectedPowerUnit() );
|
||||
AEConfig.instance().nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance().selectedPowerUnit() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
|
||||
this.buttonList.add( this.units );
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GuiNetworkTool extends AEBaseGui
|
||||
{
|
||||
if( btn == this.tFacades )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
|
||||
}
|
||||
}
|
||||
catch( final IOException e )
|
||||
|
||||
@@ -78,22 +78,22 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
|
||||
if( this.tabCraftButton == btn || this.tabProcessButton == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) );
|
||||
}
|
||||
|
||||
if( this.encodeBtn == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
|
||||
}
|
||||
|
||||
if( this.clearBtn == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
|
||||
}
|
||||
|
||||
if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
|
||||
}
|
||||
}
|
||||
catch( final IOException e )
|
||||
|
||||
@@ -77,10 +77,10 @@ public class GuiPriority extends AEBaseGui
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
final int a = AEConfig.instance.priorityByStacksAmounts( 0 );
|
||||
final int b = AEConfig.instance.priorityByStacksAmounts( 1 );
|
||||
final int c = AEConfig.instance.priorityByStacksAmounts( 2 );
|
||||
final int d = AEConfig.instance.priorityByStacksAmounts( 3 );
|
||||
final int a = AEConfig.instance().priorityByStacksAmounts( 0 );
|
||||
final int b = AEConfig.instance().priorityByStacksAmounts( 1 );
|
||||
final int c = AEConfig.instance().priorityByStacksAmounts( 2 );
|
||||
final int d = AEConfig.instance().priorityByStacksAmounts( 3 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) );
|
||||
@@ -170,7 +170,7 @@ public class GuiPriority extends AEBaseGui
|
||||
|
||||
if( btn == this.originalGuiBtn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.OriginalGui ) );
|
||||
}
|
||||
|
||||
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
|
||||
@@ -210,7 +210,7 @@ public class GuiPriority extends AEBaseGui
|
||||
|
||||
this.priority.setText( out = Long.toString( result ) );
|
||||
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
|
||||
}
|
||||
catch( final NumberFormatException e )
|
||||
{
|
||||
@@ -251,7 +251,7 @@ public class GuiPriority extends AEBaseGui
|
||||
out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ public class GuiQuartzKnife extends AEBaseGui
|
||||
{
|
||||
final String Out = this.name.getText();
|
||||
( (ContainerQuartzKnife) this.inventorySlots ).setName( Out );
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ public class GuiSecurityStation extends GuiMEMonitorable
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileSecurityStation.ToggleOption", toggleSetting.name() ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "TileSecurityStation.ToggleOption", toggleSetting.name() ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -58,8 +58,8 @@ public class GuiSpatialIOPort extends AEBaseGui
|
||||
|
||||
if( btn == this.units )
|
||||
{
|
||||
AEConfig.instance.nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance.selectedPowerUnit() );
|
||||
AEConfig.instance().nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance().selectedPowerUnit() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class GuiSpatialIOPort extends AEBaseGui
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
|
||||
this.buttonList.add( this.units );
|
||||
}
|
||||
|
||||
|
||||
@@ -116,23 +116,23 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||
{
|
||||
if( btn == this.partition )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
|
||||
}
|
||||
else if( btn == this.clear )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
|
||||
}
|
||||
else if( btn == this.priority )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
else if( btn == this.rwMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
|
||||
}
|
||||
else if( btn == this.storageFilter )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
|
||||
}
|
||||
}
|
||||
catch( final IOException e )
|
||||
|
||||
@@ -182,22 +182,22 @@ public class GuiUpgradeable extends AEBaseGui
|
||||
|
||||
if( btn == this.redstoneMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
if( btn == this.craftMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
if( btn == this.fuzzyMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
if( btn == this.schedulingMode )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ public class GuiWireless extends AEBaseGui
|
||||
|
||||
if( btn == this.units )
|
||||
{
|
||||
AEConfig.instance.nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance.selectedPowerUnit() );
|
||||
AEConfig.instance().nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance().selectedPowerUnit() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class GuiWireless extends AEBaseGui
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
|
||||
this.buttonList.add( this.units );
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.me;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -123,14 +124,14 @@ public class ItemRepo
|
||||
this.dsp.ensureCapacity( this.list.size() );
|
||||
|
||||
final Enum viewMode = this.sortSrc.getSortDisplay();
|
||||
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
final Enum searchMode = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
|
||||
if( searchMode == SearchBoxMode.JEI_AUTOSEARCH || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH )
|
||||
{
|
||||
this.updateJEI( this.searchString );
|
||||
}
|
||||
|
||||
this.innerSearch = this.searchString;
|
||||
final boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
|
||||
final boolean terminalSearchToolTips = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
|
||||
// boolean terminalSearchMods = Configuration.INSTANCE.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO;
|
||||
|
||||
boolean searchMod = false;
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.render;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.render;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@@ -46,16 +46,16 @@ public class StackSizeRenderer
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f;
|
||||
final float scaleFactor = AEConfig.instance().useTerminalUseLargeFont() ? 0.85f : 0.5f;
|
||||
final float inverseScaleFactor = 1.0f / scaleFactor;
|
||||
final int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1;
|
||||
final int offset = AEConfig.instance().useTerminalUseLargeFont() ? 0 : -1;
|
||||
|
||||
final boolean unicodeFlag = fontRenderer.getUnicodeFlag();
|
||||
fontRenderer.setUnicodeFlag( false );
|
||||
|
||||
if( is.stackSize == 0 )
|
||||
{
|
||||
final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
||||
final String craftLabelText = AEConfig.instance().useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableDepth();
|
||||
GlStateManager.disableBlend();
|
||||
@@ -95,7 +95,7 @@ public class StackSizeRenderer
|
||||
|
||||
private String getToBeRenderedStackSize( final long originalSize )
|
||||
{
|
||||
if( AEConfig.instance.useTerminalUseLargeFont() )
|
||||
if( AEConfig.instance().useTerminalUseLargeFont() )
|
||||
{
|
||||
return SLIM_CONVERTER.toSlimReadableForm( originalSize );
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ import java.util.EnumMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -41,6 +43,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
@@ -81,8 +84,9 @@ public class CableBusBakedModel implements IBakedModel
|
||||
|
||||
List<BakedQuad> quads = new ArrayList<>();
|
||||
|
||||
// The core parts of the cable will only be rendered in the CUTOUT layer. TRANSLUCENT is used only for translucent facades further down below.
|
||||
if ( layer == BlockRenderLayer.CUTOUT )
|
||||
// The core parts of the cable will only be rendered in the CUTOUT layer. TRANSLUCENT is used only for
|
||||
// translucent facades further down below.
|
||||
if( layer == BlockRenderLayer.CUTOUT )
|
||||
{
|
||||
// First, handle the cable at the center of the cable bus
|
||||
addCableQuads( renderState, quads );
|
||||
@@ -90,13 +94,13 @@ public class CableBusBakedModel implements IBakedModel
|
||||
// Then handle attachments
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
{
|
||||
List<ResourceLocation> models = renderState.getAttachments().get( facing );
|
||||
if( models == null )
|
||||
final IPartModel partModel = renderState.getAttachments().get( facing );
|
||||
if( partModel == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for( ResourceLocation model : models )
|
||||
for( ResourceLocation model : partModel.getModels() )
|
||||
{
|
||||
IBakedModel bakedModel = partModels.get( model );
|
||||
|
||||
@@ -122,8 +126,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
renderState.getBoundingBoxes(),
|
||||
renderState.getAttachments().keySet(),
|
||||
rand,
|
||||
quads
|
||||
);
|
||||
quads );
|
||||
|
||||
return quads;
|
||||
}
|
||||
@@ -131,25 +134,30 @@ public class CableBusBakedModel implements IBakedModel
|
||||
// Determines whether a cable is connected to exactly two sides that are opposite each other
|
||||
private static boolean isStraightLine( AECableType cableType, EnumMap<EnumFacing, AECableType> sides )
|
||||
{
|
||||
Iterator<EnumFacing> it = sides.keySet().iterator();
|
||||
final Iterator<Entry<EnumFacing, AECableType>> it = sides.entrySet().iterator();
|
||||
if( !it.hasNext() )
|
||||
{
|
||||
return false; // No connections
|
||||
}
|
||||
EnumFacing firstSide = it.next();
|
||||
AECableType firstType = sides.get( firstSide );
|
||||
|
||||
final Entry<EnumFacing, AECableType> nextConnection = it.next();
|
||||
final EnumFacing firstSide = nextConnection.getKey();
|
||||
final AECableType firstType = nextConnection.getValue();
|
||||
|
||||
if( !it.hasNext() )
|
||||
{
|
||||
return false; // Only a single connection
|
||||
}
|
||||
if( firstSide.getOpposite() != it.next() )
|
||||
if( firstSide.getOpposite() != it.next().getKey() )
|
||||
{
|
||||
return false; // Connected to two sides that are not opposite each other
|
||||
}
|
||||
if (it.hasNext()) {
|
||||
if( it.hasNext() )
|
||||
{
|
||||
return false; // Must not have any other connection points
|
||||
}
|
||||
AECableType secondType = sides.get( firstSide.getOpposite() );
|
||||
|
||||
final AECableType secondType = sides.get( firstSide.getOpposite() );
|
||||
|
||||
// Certain cable types have restrictions on when they're rendered as a straight connection
|
||||
switch( cableType )
|
||||
@@ -176,8 +184,8 @@ public class CableBusBakedModel implements IBakedModel
|
||||
|
||||
// If the connection is straight, no busses are attached, and no covered core has been forced (in case of glass
|
||||
// cables), then render the cable as a simplified straight line.
|
||||
boolean noAttachments = renderState.getAttachments().isEmpty();
|
||||
if( isStraightLine( cableType, connectionTypes ) && noAttachments )
|
||||
boolean noAttachments = !renderState.getAttachments().values().stream().anyMatch( IPartModel::requireCableConnection );
|
||||
if( noAttachments && isStraightLine( cableType, connectionTypes ) )
|
||||
{
|
||||
EnumFacing facing = connectionTypes.keySet().iterator().next();
|
||||
|
||||
@@ -227,11 +235,12 @@ public class CableBusBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
// Render all outgoing connections using the appropriate type
|
||||
for( EnumFacing facing : connectionTypes.keySet() )
|
||||
for( final Entry<EnumFacing, AECableType> connection : connectionTypes.entrySet() )
|
||||
{
|
||||
AECableType connectionType = connectionTypes.get( facing );
|
||||
boolean cableBusAdjacent = renderState.getCableBusAdjacent().contains( facing );
|
||||
int channels = renderState.getChannelsOnSide().get( facing );
|
||||
final EnumFacing facing = connection.getKey();
|
||||
final AECableType connectionType = connection.getValue();
|
||||
final boolean cableBusAdjacent = renderState.getCableBusAdjacent().contains( facing );
|
||||
final int channels = renderState.getChannelsOnSide().get( facing );
|
||||
|
||||
switch( cableType )
|
||||
{
|
||||
@@ -269,9 +278,9 @@ public class CableBusBakedModel implements IBakedModel
|
||||
// If no core is present, just use the first part that comes into play
|
||||
for( EnumFacing side : renderState.getAttachments().keySet() )
|
||||
{
|
||||
List<ResourceLocation> models = renderState.getAttachments().get( side );
|
||||
IPartModel partModel = renderState.getAttachments().get( side );
|
||||
|
||||
for( ResourceLocation model : models )
|
||||
for( ResourceLocation model : partModel.getModels() )
|
||||
{
|
||||
IBakedModel bakedModel = partModels.get( model );
|
||||
|
||||
@@ -282,9 +291,11 @@ public class CableBusBakedModel implements IBakedModel
|
||||
|
||||
TextureAtlasSprite particleTexture = bakedModel.getParticleTexture();
|
||||
|
||||
// If a part sub-model has no particle texture (indicated by it being the missing texture), don't add it,
|
||||
// If a part sub-model has no particle texture (indicated by it being the missing texture), don't
|
||||
// add
|
||||
// it,
|
||||
// so we don't get ugly missing texture break particles.
|
||||
if ( textureMap.getMissingSprite() != particleTexture )
|
||||
if( textureMap.getMissingSprite() != particleTexture )
|
||||
{
|
||||
result.add( particleTexture );
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class CableBusRenderState
|
||||
// connections contains a corresponding entry.
|
||||
private EnumMap<EnumFacing, Integer> channelsOnSide = new EnumMap<>( EnumFacing.class );
|
||||
|
||||
private EnumMap<EnumFacing, List<ResourceLocation>> attachments = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<EnumFacing, IPartModel> attachments = new EnumMap<>( EnumFacing.class );
|
||||
|
||||
// For each attachment, this contains the distance from the edge until which a cable connection should be drawn
|
||||
private EnumMap<EnumFacing, Integer> attachmentConnections = new EnumMap<>( EnumFacing.class );
|
||||
@@ -68,7 +68,8 @@ public class CableBusRenderState
|
||||
// Contains the facade to use for each side that has a facade attached
|
||||
private EnumMap<EnumFacing, FacadeRenderState> facades = new EnumMap<>( EnumFacing.class );
|
||||
|
||||
// Contains the bounding boxes of all parts on the cable bus to allow facades to cut out holes for the parts. This list is only populated if there are
|
||||
// Contains the bounding boxes of all parts on the cable bus to allow facades to cut out holes for the parts. This
|
||||
// list is only populated if there are
|
||||
// facades on this cable bus
|
||||
private List<AxisAlignedBB> boundingBoxes = new ArrayList<>();
|
||||
|
||||
@@ -132,7 +133,7 @@ public class CableBusRenderState
|
||||
this.cableBusAdjacent = cableBusAdjacent;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, List<ResourceLocation>> getAttachments()
|
||||
public EnumMap<EnumFacing, IPartModel> getAttachments()
|
||||
{
|
||||
return attachments;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.vecmath.Vector4f;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package appeng.client.render.crafting;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.render.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Vector4f;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package appeng.client.render.model;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.lang.reflect.Type;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
@@ -233,7 +233,7 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
return null;
|
||||
return this.textures.get( SpatialPylonTextureType.DIM );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -265,7 +265,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
final PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet );
|
||||
page++;
|
||||
NetworkHandler.instance.sendToServer( ppi );
|
||||
NetworkHandler.instance().sendToServer( ppi );
|
||||
}
|
||||
}
|
||||
catch( final IOException e )
|
||||
@@ -1103,7 +1103,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p );
|
||||
NetworkHandler.instance().sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -1172,7 +1172,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ), (EntityPlayerMP) this.getInventoryPlayer().player );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ), (EntityPlayerMP) this.getInventoryPlayer().player );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -88,7 +88,7 @@ public class SyncData
|
||||
{
|
||||
if( o instanceof EntityPlayerMP )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (EntityPlayerMP) o );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (EntityPlayerMP) o );
|
||||
}
|
||||
}
|
||||
else if( this.field.getType().isEnum() )
|
||||
@@ -99,7 +99,7 @@ public class SyncData
|
||||
{
|
||||
if( o instanceof EntityPlayerMP )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o );
|
||||
NetworkHandler.instance().sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o );
|
||||
}
|
||||
}
|
||||
else if( val instanceof Boolean || val.getClass() == boolean.class )
|
||||
|
||||
@@ -263,11 +263,11 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
{
|
||||
if( g instanceof EntityPlayer )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( a, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance.sendTo( b, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( a, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( b, (EntityPlayerMP) g );
|
||||
if( c != null )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( c, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( c, (EntityPlayerMP) g );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
this.setAutoStart( false );
|
||||
if( g != null && originalGui != null && this.getOpenContext() != null )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.getInventoryPlayer().player );
|
||||
NetworkHandler.instance().sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.getInventoryPlayer().player );
|
||||
|
||||
final TileEntity te = this.getOpenContext().getTile();
|
||||
Platform.openGUI( this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui );
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -208,17 +208,17 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
{
|
||||
if( !a.isEmpty() )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( a, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( a, (EntityPlayerMP) g );
|
||||
}
|
||||
|
||||
if( !b.isEmpty() )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( b, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( b, (EntityPlayerMP) g );
|
||||
}
|
||||
|
||||
if( !c.isEmpty() )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( c, (EntityPlayerMP) g );
|
||||
NetworkHandler.instance().sendTo( c, (EntityPlayerMP) g );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import appeng.api.networking.crafting.ICraftingCPU;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
@@ -52,50 +53,53 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
final ICraftingGrid cc = this.getNetwork().getCache( ICraftingGrid.class );
|
||||
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
|
||||
int matches = 0;
|
||||
boolean changed = false;
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
if( Platform.isServer() && this.getNetwork() != null )
|
||||
{
|
||||
boolean found = false;
|
||||
for( final CraftingCPURecord ccr : this.cpus )
|
||||
{
|
||||
if( ccr.getCpu() == c )
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
final ICraftingGrid cc = this.getNetwork().getCache( ICraftingGrid.class );
|
||||
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
|
||||
final boolean matched = this.cpuMatches( c );
|
||||
|
||||
if( matched )
|
||||
{
|
||||
matches++;
|
||||
}
|
||||
|
||||
if( found == !matched )
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( changed || this.cpus.size() != matches )
|
||||
{
|
||||
this.cpus.clear();
|
||||
int matches = 0;
|
||||
boolean changed = false;
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
{
|
||||
if( this.cpuMatches( c ) )
|
||||
boolean found = false;
|
||||
for( final CraftingCPURecord ccr : this.cpus )
|
||||
{
|
||||
this.cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) );
|
||||
if( ccr.getCpu() == c )
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
final boolean matched = this.cpuMatches( c );
|
||||
|
||||
if( matched )
|
||||
{
|
||||
matches++;
|
||||
}
|
||||
|
||||
if( found == !matched )
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.sendCPUs();
|
||||
}
|
||||
if( changed || this.cpus.size() != matches )
|
||||
{
|
||||
this.cpus.clear();
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
{
|
||||
if( this.cpuMatches( c ) )
|
||||
{
|
||||
this.cpus.add( new CraftingCPURecord( c.getAvailableStorage(), c.getCoProcessors(), c ) );
|
||||
}
|
||||
}
|
||||
|
||||
this.noCPU = this.cpus.isEmpty();
|
||||
this.sendCPUs();
|
||||
}
|
||||
|
||||
this.noCPU = this.cpus.isEmpty();
|
||||
}
|
||||
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player );
|
||||
NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -192,7 +192,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -233,7 +233,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
{
|
||||
if( c instanceof EntityPlayer )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -329,14 +329,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
catch( final BufferOverflowException boe )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
|
||||
|
||||
piu = new PacketMEInventoryUpdate();
|
||||
piu.appendItem( send );
|
||||
}
|
||||
}
|
||||
|
||||
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
{
|
||||
if( c instanceof EntityPlayer )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (EntityPlayerMP) c );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ public class ContainerWireless extends AEBaseContainer
|
||||
{
|
||||
final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize;
|
||||
|
||||
this.setRange( (long) ( 10 * AEConfig.instance.wireless_getMaxRange( boosters ) ) );
|
||||
this.setDrain( (long) ( 100 * AEConfig.instance.wireless_getPowerDrain( boosters ) ) );
|
||||
this.setRange( (long) ( 10 * AEConfig.instance().wireless_getMaxRange( boosters ) ) );
|
||||
this.setDrain( (long) ( 100 * AEConfig.instance().wireless_getPowerDrain( boosters ) ) );
|
||||
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setPowerMultiplier( AEConfig.instance.wireless_getDrainRate( this.wirelessTerminalGUIObject.getRange() ) );
|
||||
this.setPowerMultiplier( AEConfig.instance().wireless_getDrainRate( this.wirelessTerminalGUIObject.getRange() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
@@ -52,73 +56,96 @@ import appeng.util.Platform;
|
||||
public final class AEConfig extends Configuration implements IConfigurableObject, IConfigManagerHost
|
||||
{
|
||||
|
||||
public static final double TUNNEL_POWER_LOSS = 0.05;
|
||||
public static final String VERSION = "@version@";
|
||||
public static final String CHANNEL = "@aechannel@";
|
||||
public static final String PACKET_CHANNEL = "AE";
|
||||
public static AEConfig instance;
|
||||
public final IConfigManager settings = new ConfigManager( this );
|
||||
public final EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
|
||||
public final int[] craftByStacks = { 1, 10, 100, 1000 };
|
||||
public final int[] priorityByStacks = { 1, 10, 100, 1000 };
|
||||
public final int[] levelByStacks = { 1, 10, 100, 1000 };
|
||||
private final double WirelessHighWirelessCount = 64;
|
||||
private final File configFile;
|
||||
public int storageBiomeID = -1;
|
||||
public int storageProviderID = -1;
|
||||
public int formationPlaneEntityLimit = 128;
|
||||
public float spawnChargedChance = 0.92f;
|
||||
public int quartzOresPerCluster = 4;
|
||||
public int quartzOresClusterAmount = 15;
|
||||
public final int chargedChange = 4;
|
||||
public int minMeteoriteDistance = 707;
|
||||
public int minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance;
|
||||
public double spatialPowerExponent = 1.35;
|
||||
public double spatialPowerMultiplier = 1250.0;
|
||||
public String[] grinderOres = {
|
||||
// Vanilla Items
|
||||
"Obsidian", "Ender", "EnderPearl", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz",
|
||||
// Common Mod Ores
|
||||
"Copper", "Tin", "Silver", "Lead", "Bronze",
|
||||
// AE
|
||||
"CertusQuartz", "Wheat", "Fluix",
|
||||
// Other Mod Ores
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium", "Zinc" };
|
||||
public double oreDoublePercentage = 90.0;
|
||||
public boolean enableEffects = true;
|
||||
public boolean useLargeFonts = false;
|
||||
public boolean useColoredCraftingStatus;
|
||||
public boolean removeCrashingItemsOnLoad = false;
|
||||
public int wirelessTerminalBattery = 1600000;
|
||||
public int entropyManipulatorBattery = 200000;
|
||||
public int matterCannonBattery = 200000;
|
||||
public int portableCellBattery = 20000;
|
||||
public int colorApplicatorBattery = 20000;
|
||||
public int chargedStaffBattery = 8000;
|
||||
public boolean disableColoredCableRecipesInJEI = true;
|
||||
public boolean updatable = false;
|
||||
public double meteoriteClusterChance = 0.1;
|
||||
public double meteoriteSpawnChance = 0.3;
|
||||
public int[] meteoriteDimensionWhitelist = { 0 };
|
||||
public int craftingCalculationTimePerTick = 5;
|
||||
PowerUnits selectedPowerUnit = PowerUnits.AE;
|
||||
private double WirelessBaseCost = 8;
|
||||
private double WirelessCostMultiplier = 1;
|
||||
private double WirelessTerminalDrainMultiplier = 1;
|
||||
private double WirelessBaseRange = 16;
|
||||
private double WirelessBoosterRangeMultiplier = 1;
|
||||
private double WirelessBoosterExp = 1.5;
|
||||
|
||||
public AEConfig( final File configFile )
|
||||
// Config instance
|
||||
private static AEConfig instance;
|
||||
|
||||
// Default Grindstone ores
|
||||
private static final String[] ORES_VANILLA = { "Obsidian", "Ender", "EnderPearl", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz" };
|
||||
private static final String[] ORES_AE = { "CertusQuartz", "Wheat", "Fluix" };
|
||||
private static final String[] ORES_COMMON = { "Copper", "Tin", "Silver", "Lead", "Bronze" };
|
||||
private static final String[] ORES_MISC = { "Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium", "Zinc" };
|
||||
|
||||
// Default Energy Conversion Rates
|
||||
private static final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
private static final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||
|
||||
private final IConfigManager settings = new ConfigManager( this );
|
||||
|
||||
private final EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
|
||||
private final File configFile;
|
||||
private boolean updatable = false;
|
||||
|
||||
// Misc
|
||||
private boolean removeCrashingItemsOnLoad = false;
|
||||
private int formationPlaneEntityLimit = 128;
|
||||
private boolean enableEffects = true;
|
||||
private boolean useLargeFonts = false;
|
||||
private boolean useColoredCraftingStatus;
|
||||
private boolean disableColoredCableRecipesInJEI = true;
|
||||
private int craftingCalculationTimePerTick = 5;
|
||||
private PowerUnits selectedPowerUnit = PowerUnits.AE;
|
||||
|
||||
// GUI Buttons
|
||||
private final int[] craftByStacks = { 1, 10, 100, 1000 };
|
||||
private final int[] priorityByStacks = { 1, 10, 100, 1000 };
|
||||
private final int[] levelByStacks = { 1, 10, 100, 1000 };
|
||||
|
||||
// Spatial IO/Dimension
|
||||
private int storageBiomeID = -1;
|
||||
private int storageProviderID = -1;
|
||||
private double spatialPowerExponent = 1.35;
|
||||
private double spatialPowerMultiplier = 1250.0;
|
||||
|
||||
// Grindstone
|
||||
private String[] grinderOres = Stream.of( ORES_VANILLA, ORES_AE, ORES_COMMON, ORES_MISC ).flatMap( Stream::of ).toArray( String[]::new );
|
||||
private Set<String> grinderBlackList;
|
||||
private double oreDoublePercentage = 90.0;
|
||||
|
||||
// Batteries
|
||||
private int wirelessTerminalBattery = 1600000;
|
||||
private int entropyManipulatorBattery = 200000;
|
||||
private int matterCannonBattery = 200000;
|
||||
private int portableCellBattery = 20000;
|
||||
private int colorApplicatorBattery = 20000;
|
||||
private int chargedStaffBattery = 8000;
|
||||
|
||||
// Certus quartz
|
||||
private float spawnChargedChance = 0.92f;
|
||||
private int quartzOresPerCluster = 4;
|
||||
private int quartzOresClusterAmount = 15;
|
||||
private int chargedChange = 4;
|
||||
|
||||
// Meteors
|
||||
private int minMeteoriteDistance = 707;
|
||||
private int minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance;
|
||||
private double meteoriteClusterChance = 0.1;
|
||||
private int meteoriteMaximumSpawnHeight = 180;
|
||||
private int[] meteoriteDimensionWhitelist = { 0 };
|
||||
|
||||
// Wireless
|
||||
private double wirelessBaseCost = 8;
|
||||
private double wirelessCostMultiplier = 1;
|
||||
private double wirelessTerminalDrainMultiplier = 1;
|
||||
private double wirelessBaseRange = 16;
|
||||
private double wirelessBoosterRangeMultiplier = 1;
|
||||
private double wirelessBoosterExp = 1.5;
|
||||
private double wirelessHighWirelessCount = 64;
|
||||
|
||||
// Tunnels
|
||||
public static final double TUNNEL_POWER_LOSS = 0.05;
|
||||
|
||||
private AEConfig( final File configFile )
|
||||
{
|
||||
super( configFile );
|
||||
this.configFile = configFile;
|
||||
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
|
||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
|
||||
final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "Forge Energy", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
|
||||
|
||||
final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
|
||||
@@ -127,19 +154,30 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
|
||||
CondenserOutput.SINGULARITY.requiredPower = this.get( "Condenser", "Singularity", 256000 ).getInt( 256000 );
|
||||
|
||||
this.removeCrashingItemsOnLoad = this.get( "general", "removeCrashingItemsOnLoad", false, "Will auto-remove items that crash when being loaded from storage. This will destroy those items instead of crashing the game!" ).getBoolean();
|
||||
this.removeCrashingItemsOnLoad = this.get( "general", "removeCrashingItemsOnLoad", false,
|
||||
"Will auto-remove items that crash when being loaded from storage. This will destroy those items instead of crashing the game!" ).getBoolean();
|
||||
|
||||
this.grinderOres = this.get( "GrindStone", "grinderOres", this.grinderOres ).getStringList();
|
||||
this.oreDoublePercentage = this.get( "GrindStone", "oreDoublePercentage", this.oreDoublePercentage ).getDouble( this.oreDoublePercentage );
|
||||
this.setCategoryComment( "GrindStone",
|
||||
"Creates recipe of the following pattern automatically: '1 oreTYPE => 2 dustTYPE' and '(1 ingotTYPE or 1 crystalTYPE or 1 gemTYPE) => 1 dustTYPE'" );
|
||||
this.grinderOres = this.get( "GrindStone", "grinderOres", this.grinderOres, "The list of types to handle. Specify without a prefix like ore or dust." )
|
||||
.getStringList();
|
||||
this.grinderBlackList = Sets.newHashSet(
|
||||
this.get( "GrindStone", "blacklist", new String[] {}, "Blacklists the exact oredict name from being handled by any recipe." )
|
||||
.getStringList() );
|
||||
this.oreDoublePercentage = this
|
||||
.get( "GrindStone", "oreDoublePercentage", this.oreDoublePercentage, "Chance to actually get an output with stacksize > 1." )
|
||||
.getDouble( this.oreDoublePercentage );
|
||||
|
||||
this.settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||
this.settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL );
|
||||
this.settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
|
||||
|
||||
this.spawnChargedChance = (float) ( 1.0 - this.get( "worldGen", "spawnChargedChance", 1.0 - this.spawnChargedChance ).getDouble( 1.0 - this.spawnChargedChance ) );
|
||||
this.spawnChargedChance = (float) ( 1.0 - this.get( "worldGen", "spawnChargedChance", 1.0 - this.spawnChargedChance ).getDouble(
|
||||
1.0 - this.spawnChargedChance ) );
|
||||
this.minMeteoriteDistance = this.get( "worldGen", "minMeteoriteDistance", this.minMeteoriteDistance ).getInt( this.minMeteoriteDistance );
|
||||
this.meteoriteClusterChance = this.get( "worldGen", "meteoriteClusterChance", this.meteoriteClusterChance ).getDouble( this.meteoriteClusterChance );
|
||||
this.meteoriteSpawnChance = this.get( "worldGen", "meteoriteSpawnChance", this.meteoriteSpawnChance ).getDouble( this.meteoriteSpawnChance );
|
||||
this.meteoriteMaximumSpawnHeight = this.get( "worldGen", "meteoriteMaximumSpawnHeight", this.meteoriteMaximumSpawnHeight ).getInt(
|
||||
this.meteoriteMaximumSpawnHeight );
|
||||
this.meteoriteDimensionWhitelist = this.get( "worldGen", "meteoriteDimensionWhitelist", this.meteoriteDimensionWhitelist ).getIntList();
|
||||
|
||||
this.quartzOresPerCluster = this.get( "worldGen", "quartzOresPerCluster", this.quartzOresPerCluster ).getInt( this.quartzOresPerCluster );
|
||||
@@ -147,16 +185,20 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
|
||||
this.minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance;
|
||||
|
||||
this.addCustomCategoryComment( "wireless", "Range= WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp )\nPowerDrain= WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount )" );
|
||||
this.addCustomCategoryComment( "wireless",
|
||||
"Range= wirelessBaseRange + wirelessBoosterRangeMultiplier * Math.pow( boosters, wirelessBoosterExp )\nPowerDrain= wirelessBaseCost + wirelessCostMultiplier * Math.pow( boosters, 1 + boosters / wirelessHighWirelessCount )" );
|
||||
|
||||
this.WirelessBaseCost = this.get( "wireless", "WirelessBaseCost", this.WirelessBaseCost ).getDouble( this.WirelessBaseCost );
|
||||
this.WirelessCostMultiplier = this.get( "wireless", "WirelessCostMultiplier", this.WirelessCostMultiplier ).getDouble( this.WirelessCostMultiplier );
|
||||
this.WirelessBaseRange = this.get( "wireless", "WirelessBaseRange", this.WirelessBaseRange ).getDouble( this.WirelessBaseRange );
|
||||
this.WirelessBoosterRangeMultiplier = this.get( "wireless", "WirelessBoosterRangeMultiplier", this.WirelessBoosterRangeMultiplier ).getDouble( this.WirelessBoosterRangeMultiplier );
|
||||
this.WirelessBoosterExp = this.get( "wireless", "WirelessBoosterExp", this.WirelessBoosterExp ).getDouble( this.WirelessBoosterExp );
|
||||
this.WirelessTerminalDrainMultiplier = this.get( "wireless", "WirelessTerminalDrainMultiplier", this.WirelessTerminalDrainMultiplier ).getDouble( this.WirelessTerminalDrainMultiplier );
|
||||
this.wirelessBaseCost = this.get( "wireless", "wirelessBaseCost", this.wirelessBaseCost ).getDouble( this.wirelessBaseCost );
|
||||
this.wirelessCostMultiplier = this.get( "wireless", "wirelessCostMultiplier", this.wirelessCostMultiplier ).getDouble( this.wirelessCostMultiplier );
|
||||
this.wirelessBaseRange = this.get( "wireless", "wirelessBaseRange", this.wirelessBaseRange ).getDouble( this.wirelessBaseRange );
|
||||
this.wirelessBoosterRangeMultiplier = this.get( "wireless", "wirelessBoosterRangeMultiplier", this.wirelessBoosterRangeMultiplier ).getDouble(
|
||||
this.wirelessBoosterRangeMultiplier );
|
||||
this.wirelessBoosterExp = this.get( "wireless", "wirelessBoosterExp", this.wirelessBoosterExp ).getDouble( this.wirelessBoosterExp );
|
||||
this.wirelessTerminalDrainMultiplier = this.get( "wireless", "wirelessTerminalDrainMultiplier", this.wirelessTerminalDrainMultiplier ).getDouble(
|
||||
this.wirelessTerminalDrainMultiplier );
|
||||
|
||||
this.formationPlaneEntityLimit = this.get( "automation", "formationPlaneEntityLimit", this.formationPlaneEntityLimit ).getInt( this.formationPlaneEntityLimit );
|
||||
this.formationPlaneEntityLimit = this.get( "automation", "formationPlaneEntityLimit", this.formationPlaneEntityLimit ).getInt(
|
||||
this.formationPlaneEntityLimit );
|
||||
|
||||
this.wirelessTerminalBattery = this.get( "battery", "wirelessTerminal", this.wirelessTerminalBattery ).getInt( this.wirelessTerminalBattery );
|
||||
this.chargedStaffBattery = this.get( "battery", "chargedStaff", this.chargedStaffBattery ).getInt( this.chargedStaffBattery );
|
||||
@@ -171,7 +213,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
{
|
||||
if( feature.isVisible() )
|
||||
{
|
||||
if( this.get( "Features." + feature.category, feature.name(), feature.defaultValue ).getBoolean( feature.defaultValue ) )
|
||||
if( this.get( "Features." + feature.category(), feature.key(), feature.isEnabled() ).getBoolean( feature.isEnabled() ) )
|
||||
{
|
||||
this.featureFlags.add( feature );
|
||||
}
|
||||
@@ -188,13 +230,14 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
final List<String> version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" );
|
||||
if( version.contains( imb.getVersion() ) )
|
||||
{
|
||||
this.featureFlags.remove( AEFeature.AlphaPass );
|
||||
this.featureFlags.remove( AEFeature.ALPHA_PASS );
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.selectedPowerUnit = PowerUnits.valueOf( this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() );
|
||||
this.selectedPowerUnit = PowerUnits.valueOf(
|
||||
this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() );
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
@@ -206,22 +249,34 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
tr.Load( this );
|
||||
}
|
||||
|
||||
if( this.isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||
if( this.isFeatureEnabled( AEFeature.SPATIAL_IO ) )
|
||||
{
|
||||
this.storageBiomeID = this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).getInt( this.storageBiomeID );
|
||||
this.storageProviderID = this.get( "spatialio", "storageProviderID", this.storageProviderID ).getInt( this.storageProviderID );
|
||||
this.spatialPowerMultiplier = this.get( "spatialio", "spatialPowerMultiplier", this.spatialPowerMultiplier ).getDouble( this.spatialPowerMultiplier );
|
||||
this.spatialPowerMultiplier = this.get( "spatialio", "spatialPowerMultiplier", this.spatialPowerMultiplier ).getDouble(
|
||||
this.spatialPowerMultiplier );
|
||||
this.spatialPowerExponent = this.get( "spatialio", "spatialPowerExponent", this.spatialPowerExponent ).getDouble( this.spatialPowerExponent );
|
||||
}
|
||||
|
||||
if( this.isFeatureEnabled( AEFeature.CraftingCPU ) )
|
||||
if( this.isFeatureEnabled( AEFeature.CRAFTING_CPU ) )
|
||||
{
|
||||
this.craftingCalculationTimePerTick = this.get( "craftingCPU", "craftingCalculationTimePerTick", this.craftingCalculationTimePerTick ).getInt( this.craftingCalculationTimePerTick );
|
||||
this.craftingCalculationTimePerTick = this.get( "craftingCPU", "craftingCalculationTimePerTick", this.craftingCalculationTimePerTick ).getInt(
|
||||
this.craftingCalculationTimePerTick );
|
||||
}
|
||||
|
||||
this.updatable = true;
|
||||
}
|
||||
|
||||
public static void init( final File configFile )
|
||||
{
|
||||
instance = new AEConfig( configFile );
|
||||
}
|
||||
|
||||
public static AEConfig instance()
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
private void clientSync()
|
||||
{
|
||||
this.disableColoredCableRecipesInJEI = this.get( "Client", "disableColoredCableRecipesInJEI", true ).getBoolean( true );
|
||||
@@ -308,17 +363,17 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
|
||||
public double wireless_getDrainRate( final double range )
|
||||
{
|
||||
return this.WirelessTerminalDrainMultiplier * range;
|
||||
return this.wirelessTerminalDrainMultiplier * range;
|
||||
}
|
||||
|
||||
public double wireless_getMaxRange( final int boosters )
|
||||
{
|
||||
return this.WirelessBaseRange + this.WirelessBoosterRangeMultiplier * Math.pow( boosters, this.WirelessBoosterExp );
|
||||
return this.wirelessBaseRange + this.wirelessBoosterRangeMultiplier * Math.pow( boosters, this.wirelessBoosterExp );
|
||||
}
|
||||
|
||||
public double wireless_getPowerDrain( final int boosters )
|
||||
{
|
||||
return this.WirelessBaseCost + this.WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.WirelessHighWirelessCount );
|
||||
return this.wirelessBaseCost + this.wirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.wirelessHighWirelessCount );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -340,7 +395,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
if( this.isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||
if( this.isFeatureEnabled( AEFeature.SPATIAL_IO ) )
|
||||
{
|
||||
this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).set( this.storageBiomeID );
|
||||
this.get( "spatialio", "storageProviderID", this.storageProviderID ).set( this.storageProviderID );
|
||||
@@ -375,12 +430,13 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
|
||||
public boolean useAEVersion( final MaterialType mt )
|
||||
{
|
||||
if( this.isFeatureEnabled( AEFeature.WebsiteRecipes ) )
|
||||
if( this.isFeatureEnabled( AEFeature.WEBSITE_RECIPES ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
this.setCategoryComment( "OreCamouflage", "AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." );
|
||||
this.setCategoryComment( "OreCamouflage",
|
||||
"AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." );
|
||||
final Property p = this.get( "OreCamouflage", mt.name(), true );
|
||||
p.setComment( "OreDictionary Names: " + mt.getOreName() );
|
||||
|
||||
@@ -506,4 +562,217 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
this.selectedPowerUnit = Platform.rotateEnum( this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() );
|
||||
this.save();
|
||||
}
|
||||
|
||||
// Getters
|
||||
public boolean isRemoveCrashingItemsOnLoad()
|
||||
{
|
||||
return removeCrashingItemsOnLoad;
|
||||
}
|
||||
|
||||
public int getFormationPlaneEntityLimit()
|
||||
{
|
||||
return formationPlaneEntityLimit;
|
||||
}
|
||||
|
||||
public boolean isEnableEffects()
|
||||
{
|
||||
return enableEffects;
|
||||
}
|
||||
|
||||
public boolean isUseLargeFonts()
|
||||
{
|
||||
return useLargeFonts;
|
||||
}
|
||||
|
||||
public boolean isUseColoredCraftingStatus()
|
||||
{
|
||||
return useColoredCraftingStatus;
|
||||
}
|
||||
|
||||
public boolean isDisableColoredCableRecipesInJEI()
|
||||
{
|
||||
return disableColoredCableRecipesInJEI;
|
||||
}
|
||||
|
||||
public int getCraftingCalculationTimePerTick()
|
||||
{
|
||||
return craftingCalculationTimePerTick;
|
||||
}
|
||||
|
||||
public PowerUnits getSelectedPowerUnit()
|
||||
{
|
||||
return selectedPowerUnit;
|
||||
}
|
||||
|
||||
public int[] getCraftByStacks()
|
||||
{
|
||||
return craftByStacks;
|
||||
}
|
||||
|
||||
public int[] getPriorityByStacks()
|
||||
{
|
||||
return priorityByStacks;
|
||||
}
|
||||
|
||||
public int[] getLevelByStacks()
|
||||
{
|
||||
return levelByStacks;
|
||||
}
|
||||
|
||||
public int getStorageBiomeID()
|
||||
{
|
||||
return storageBiomeID;
|
||||
}
|
||||
|
||||
public int getStorageProviderID()
|
||||
{
|
||||
return storageProviderID;
|
||||
}
|
||||
|
||||
public double getSpatialPowerExponent()
|
||||
{
|
||||
return spatialPowerExponent;
|
||||
}
|
||||
|
||||
public double getSpatialPowerMultiplier()
|
||||
{
|
||||
return spatialPowerMultiplier;
|
||||
}
|
||||
|
||||
public String[] getGrinderOres()
|
||||
{
|
||||
return grinderOres;
|
||||
}
|
||||
|
||||
public Set<String> getGrinderBlackList()
|
||||
{
|
||||
return this.grinderBlackList;
|
||||
}
|
||||
|
||||
public double getOreDoublePercentage()
|
||||
{
|
||||
return oreDoublePercentage;
|
||||
}
|
||||
|
||||
public int getWirelessTerminalBattery()
|
||||
{
|
||||
return wirelessTerminalBattery;
|
||||
}
|
||||
|
||||
public int getEntropyManipulatorBattery()
|
||||
{
|
||||
return entropyManipulatorBattery;
|
||||
}
|
||||
|
||||
public int getMatterCannonBattery()
|
||||
{
|
||||
return matterCannonBattery;
|
||||
}
|
||||
|
||||
public int getPortableCellBattery()
|
||||
{
|
||||
return portableCellBattery;
|
||||
}
|
||||
|
||||
public int getColorApplicatorBattery()
|
||||
{
|
||||
return colorApplicatorBattery;
|
||||
}
|
||||
|
||||
public int getChargedStaffBattery()
|
||||
{
|
||||
return chargedStaffBattery;
|
||||
}
|
||||
|
||||
public float getSpawnChargedChance()
|
||||
{
|
||||
return spawnChargedChance;
|
||||
}
|
||||
|
||||
public int getQuartzOresPerCluster()
|
||||
{
|
||||
return quartzOresPerCluster;
|
||||
}
|
||||
|
||||
public int getQuartzOresClusterAmount()
|
||||
{
|
||||
return quartzOresClusterAmount;
|
||||
}
|
||||
|
||||
public int getChargedChange()
|
||||
{
|
||||
return chargedChange;
|
||||
}
|
||||
|
||||
public int getMinMeteoriteDistance()
|
||||
{
|
||||
return minMeteoriteDistance;
|
||||
}
|
||||
|
||||
public int getMinMeteoriteDistanceSq()
|
||||
{
|
||||
return minMeteoriteDistanceSq;
|
||||
}
|
||||
|
||||
public double getMeteoriteClusterChance()
|
||||
{
|
||||
return meteoriteClusterChance;
|
||||
}
|
||||
|
||||
public int getMeteoriteMaximumSpawnHeight()
|
||||
{
|
||||
return meteoriteMaximumSpawnHeight;
|
||||
}
|
||||
|
||||
public int[] getMeteoriteDimensionWhitelist()
|
||||
{
|
||||
return meteoriteDimensionWhitelist;
|
||||
}
|
||||
|
||||
public double getWirelessBaseCost()
|
||||
{
|
||||
return wirelessBaseCost;
|
||||
}
|
||||
|
||||
public double getWirelessCostMultiplier()
|
||||
{
|
||||
return wirelessCostMultiplier;
|
||||
}
|
||||
|
||||
public double getWirelessTerminalDrainMultiplier()
|
||||
{
|
||||
return wirelessTerminalDrainMultiplier;
|
||||
}
|
||||
|
||||
public double getWirelessBaseRange()
|
||||
{
|
||||
return wirelessBaseRange;
|
||||
}
|
||||
|
||||
public double getWirelessBoosterRangeMultiplier()
|
||||
{
|
||||
return wirelessBoosterRangeMultiplier;
|
||||
}
|
||||
|
||||
public double getWirelessBoosterExp()
|
||||
{
|
||||
return wirelessBoosterExp;
|
||||
}
|
||||
|
||||
public double getWirelessHighWirelessCount()
|
||||
{
|
||||
return wirelessHighWirelessCount;
|
||||
}
|
||||
|
||||
// Setters keep visibility as low as possible.
|
||||
|
||||
void setStorageBiomeID( int id )
|
||||
{
|
||||
this.storageBiomeID = id;
|
||||
}
|
||||
|
||||
void setStorageProviderID( int id )
|
||||
{
|
||||
this.storageProviderID = id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public final class AELog
|
||||
*/
|
||||
public static boolean isLogEnabled()
|
||||
{
|
||||
return AEConfig.instance == null || AEConfig.instance.isFeatureEnabled( AEFeature.Logging );
|
||||
return AEConfig.instance() == null || AEConfig.instance().isFeatureEnabled( AEFeature.LOGGING );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,7 +278,7 @@ public final class AELog
|
||||
*/
|
||||
public static boolean isDebugLogEnabled()
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.DebugLogging );
|
||||
return AEConfig.instance().isFeatureEnabled( AEFeature.DEBUG_LOGGING );
|
||||
}
|
||||
|
||||
//
|
||||
@@ -290,11 +290,11 @@ public final class AELog
|
||||
*
|
||||
* @param message String to be logged
|
||||
*/
|
||||
public static void grinder( @Nonnull final String message )
|
||||
public static void grinder( @Nonnull final String message, final Object... params )
|
||||
{
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.GrinderLogging ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.GRINDER_LOGGING ) )
|
||||
{
|
||||
log( Level.DEBUG, "grinder: " + message );
|
||||
log( Level.DEBUG, "grinder: " + message, params );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,9 +305,9 @@ public final class AELog
|
||||
*/
|
||||
public static void integration( @Nonnull final Throwable exception )
|
||||
{
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.IntegrationLogging ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.INTEGRATION_LOGGING ) )
|
||||
{
|
||||
debug( exception );
|
||||
error( exception );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ public final class AELog
|
||||
*/
|
||||
public static void blockUpdate( @Nonnull final BlockPos pos, @Nonnull final AEBaseTile aeBaseTile )
|
||||
{
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.UpdateLogging ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.UPDATE_LOGGING ) )
|
||||
{
|
||||
info( BLOCK_UPDATE, aeBaseTile.getClass().getName(), pos );
|
||||
}
|
||||
@@ -337,7 +337,7 @@ public final class AELog
|
||||
*/
|
||||
public static boolean isCraftingLogEnabled()
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.CraftingLog );
|
||||
return AEConfig.instance().isFeatureEnabled( AEFeature.CRAFTING_LOG );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +366,7 @@ public final class AELog
|
||||
*/
|
||||
public static boolean isCraftingDebugLogEnabled()
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.CraftingLog ) && AEConfig.instance.isFeatureEnabled( AEFeature.DebugLogging );
|
||||
return AEConfig.instance().isFeatureEnabled( AEFeature.CRAFTING_LOG ) && AEConfig.instance().isFeatureEnabled( AEFeature.DEBUG_LOGGING );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.core;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
@@ -78,10 +79,10 @@ public final class AppEng
|
||||
|
||||
// depend on version of forge used for build.
|
||||
"after:appliedenergistics2-core;" + "required-after:Forge@[" // require forge.
|
||||
+ net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.buildVersion + ",)"; // buildVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.buildVersion + ",)"; // buildVersion
|
||||
|
||||
@Nonnull
|
||||
private static final AppEng INSTANCE = new AppEng();
|
||||
@@ -141,8 +142,9 @@ public final class AppEng
|
||||
final File recipeFile = new File( this.configDirectory, "CustomRecipes.cfg" );
|
||||
final Configuration recipeConfiguration = new Configuration( recipeFile );
|
||||
|
||||
AEConfig.instance = new AEConfig( configFile );
|
||||
FacadeConfig.instance = new FacadeConfig( facadeFile );
|
||||
AEConfig.init( configFile );
|
||||
FacadeConfig.init( facadeFile );
|
||||
|
||||
final VersionCheckerConfig versionCheckerConfig = new VersionCheckerConfig( versionFile );
|
||||
this.customRecipeConfig = new CustomRecipeForgeConfiguration( recipeConfiguration );
|
||||
this.exportConfig = new ForgeExportConfig( recipeConfiguration );
|
||||
@@ -150,7 +152,7 @@ public final class AppEng
|
||||
AELog.info( "Pre Initialization ( started )" );
|
||||
|
||||
CreativeTab.init();
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.FACADES ) )
|
||||
{
|
||||
CreativeTabFacade.init();
|
||||
}
|
||||
@@ -174,8 +176,7 @@ public final class AppEng
|
||||
|
||||
// Instantiate all Plugins
|
||||
List<Object> injectables = Lists.newArrayList(
|
||||
AEApi.instance()
|
||||
);
|
||||
AEApi.instance() );
|
||||
new PluginLoader().loadPlugins( injectables, event.getAsmData() );
|
||||
}
|
||||
|
||||
@@ -226,10 +227,10 @@ public final class AppEng
|
||||
FMLCommonHandler.instance().registerCrashCallable( new IntegrationCrashEnhancement() );
|
||||
|
||||
CommonHelper.proxy.postInit();
|
||||
AEConfig.instance.save();
|
||||
AEConfig.instance().save();
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler );
|
||||
NetworkHandler.instance = new NetworkHandler( "AE2" );
|
||||
NetworkHandler.init( "AE2" );
|
||||
|
||||
AELog.info( "Post Initialization ( ended after " + start.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class CreativeTab extends CreativeTabs
|
||||
final IItems items = definitions.items();
|
||||
final IMaterials materials = definitions.materials();
|
||||
|
||||
return this.findFirst( blocks.controller(), blocks.chest(), blocks.cellWorkbench(), blocks.fluixBlock(), items.cell1k(), items.networkTool(), materials.fluixCrystal(), materials.certusQuartzCrystal() );
|
||||
return this.findFirst( blocks.controller(), blocks.chest(), blocks.cellWorkbench(), blocks.fluixBlock(), items.cell1k(), items.networkTool(), materials.fluixCrystal(), materials.certusQuartzCrystal(), materials.skyDust() );
|
||||
}
|
||||
|
||||
private ItemStack findFirst( final IItemDefinition... choices )
|
||||
|
||||
@@ -33,7 +33,8 @@ import net.minecraftforge.common.config.Configuration;
|
||||
public class FacadeConfig extends Configuration
|
||||
{
|
||||
|
||||
public static FacadeConfig instance;
|
||||
private static FacadeConfig instance;
|
||||
|
||||
private final Pattern replacementPattern;
|
||||
|
||||
public FacadeConfig( final File facadeFile )
|
||||
@@ -42,6 +43,16 @@ public class FacadeConfig extends Configuration
|
||||
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
|
||||
}
|
||||
|
||||
public static void init( final File configFile )
|
||||
{
|
||||
instance = new FacadeConfig( configFile );
|
||||
}
|
||||
|
||||
public static FacadeConfig instance()
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
public boolean checkEnabled( final Block id, final int metadata, final boolean automatic )
|
||||
{
|
||||
if( id == null )
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.core;
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
@@ -57,8 +58,8 @@ import appeng.api.parts.IPartHelper;
|
||||
import appeng.capabilities.Capabilities;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.registries.P2PTunnelRegistry;
|
||||
import appeng.core.features.registries.entries.BasicCellHandler;
|
||||
import appeng.core.features.registries.entries.CreativeCellHandler;
|
||||
import appeng.core.features.registries.cell.BasicCellHandler;
|
||||
import appeng.core.features.registries.cell.CreativeCellHandler;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.stats.PlayerStatsRegistration;
|
||||
@@ -149,42 +150,42 @@ public final class Registration
|
||||
|
||||
private void registerSpatial( final boolean force )
|
||||
{
|
||||
if( !AEConfig.instance.isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||
if( !AEConfig.instance().isFeatureEnabled( AEFeature.SPATIAL_IO ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final AEConfig config = AEConfig.instance;
|
||||
final AEConfig config = AEConfig.instance();
|
||||
|
||||
if( this.storageBiome == null )
|
||||
{
|
||||
if( force && config.storageBiomeID == -1 )
|
||||
if( force && config.getStorageBiomeID() == -1 )
|
||||
{
|
||||
config.storageBiomeID = Platform.findEmpty( Biome.REGISTRY, 0, 256 );
|
||||
if( config.storageBiomeID == -1 )
|
||||
config.setStorageBiomeID( Platform.findEmpty( Biome.REGISTRY, 0, 256 ) );
|
||||
if( config.getStorageBiomeID() == -1 )
|
||||
{
|
||||
throw new IllegalStateException( "Biome Array is full, please free up some Biome ID's or disable spatial." );
|
||||
}
|
||||
|
||||
this.storageBiome = new BiomeGenStorage();
|
||||
Biome.registerBiome( config.storageBiomeID, "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
Biome.registerBiome( config.getStorageBiomeID(), "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
config.save();
|
||||
}
|
||||
|
||||
if( !force && config.storageBiomeID != -1 )
|
||||
if( !force && config.getStorageBiomeID() != -1 )
|
||||
{
|
||||
this.storageBiome = new BiomeGenStorage();
|
||||
Biome.registerBiome( config.storageBiomeID, "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
Biome.registerBiome( config.getStorageBiomeID(), "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( config.storageProviderID != -1 )
|
||||
if( config.getStorageProviderID() != -1 )
|
||||
{
|
||||
storageDimensionType = DimensionType.register( "Storage Cell", "_cell", config.storageProviderID, StorageWorldProvider.class, false );
|
||||
storageDimensionType = DimensionType.register( "Storage Cell", "_cell", config.getStorageProviderID(), StorageWorldProvider.class, false );
|
||||
}
|
||||
|
||||
if( config.storageProviderID == -1 && force )
|
||||
if( config.getStorageProviderID() == -1 && force )
|
||||
{
|
||||
final Set<Integer> ids = new HashSet<>();
|
||||
for( DimensionType type : DimensionType.values() )
|
||||
@@ -192,14 +193,14 @@ public final class Registration
|
||||
ids.add( type.getId() );
|
||||
}
|
||||
|
||||
config.storageProviderID = -11;
|
||||
config.setStorageProviderID( -11 );
|
||||
|
||||
while( ids.contains( config.storageProviderID ) )
|
||||
while( ids.contains( config.getStorageProviderID() ) )
|
||||
{
|
||||
config.storageProviderID--;
|
||||
config.setStorageProviderID( config.getStorageProviderID() - 1 );
|
||||
}
|
||||
|
||||
storageDimensionType = DimensionType.register( "Storage Cell", "_cell", config.storageProviderID, StorageWorldProvider.class, false );
|
||||
storageDimensionType = DimensionType.register( "Storage Cell", "_cell", config.getStorageProviderID(), StorageWorldProvider.class, false );
|
||||
|
||||
config.save();
|
||||
}
|
||||
@@ -264,10 +265,9 @@ public final class Registration
|
||||
|
||||
MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE );
|
||||
|
||||
|
||||
MinecraftForge.EVENT_BUS.register( new PartPlacement() );
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.CHEST_LOOT ) )
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register( new ChestLoot() );
|
||||
}
|
||||
@@ -285,8 +285,7 @@ public final class Registration
|
||||
registries.cell().addCellHandler( new BasicCellHandler() );
|
||||
registries.cell().addCellHandler( new CreativeCellHandler() );
|
||||
|
||||
api.definitions().materials().matterBall().maybeStack( 1 ).ifPresent( ammoStack ->
|
||||
{
|
||||
api.definitions().materials().matterBall().maybeStack( 1 ).ifPresent( ammoStack -> {
|
||||
final double weight = 32;
|
||||
|
||||
registries.matterCannon().registerAmmo( ammoStack, weight );
|
||||
@@ -294,17 +293,17 @@ public final class Registration
|
||||
|
||||
this.recipeHandler.injectRecipes();
|
||||
|
||||
final PlayerStatsRegistration registration = new PlayerStatsRegistration( MinecraftForge.EVENT_BUS, AEConfig.instance );
|
||||
final PlayerStatsRegistration registration = new PlayerStatsRegistration( MinecraftForge.EVENT_BUS, AEConfig.instance() );
|
||||
registration.registerAchievementHandlers();
|
||||
registration.registerAchievements();
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) )
|
||||
{
|
||||
GameRegistry.addRecipe( new DisassembleRecipe() );
|
||||
RecipeSorter.register( "appliedenergistics2:disassemble", DisassembleRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless" );
|
||||
}
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.EnableFacadeCrafting ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
|
||||
{
|
||||
definitions.items().facade().maybeItem().ifPresent( facadeItem -> {
|
||||
GameRegistry.addRecipe( new FacadeRecipe( (ItemFacade) facadeItem ) );
|
||||
@@ -398,24 +397,23 @@ public final class Registration
|
||||
// Inscriber
|
||||
Upgrades.SPEED.registerItem( blocks.inscriber(), 3 );
|
||||
|
||||
items.wirelessTerminal().maybeItem().ifPresent( terminal ->
|
||||
{
|
||||
items.wirelessTerminal().maybeItem().ifPresent( terminal -> {
|
||||
registries.wireless().registerWirelessHandler( (IWirelessTermHandler) terminal );
|
||||
} );
|
||||
|
||||
// add villager trading to black smiths for a few basic materials
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.VillagerTrading ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.VILLAGER_TRADING ) )
|
||||
{
|
||||
// TODO: VILLAGER TRADING
|
||||
// VillagerRegistry.instance().getRegisteredVillagers()..registerVillageTradeHandler( 3, new AETrading() );
|
||||
}
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.CertusQuartzWorldGen ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.CERTUS_QUARTZ_WORLD_GEN ) )
|
||||
{
|
||||
GameRegistry.registerWorldGenerator( new QuartzWorldGen(), 0 );
|
||||
}
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.MeteoriteWorldGen ) )
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.METEORITE_WORLD_GEN ) )
|
||||
{
|
||||
GameRegistry.registerWorldGenerator( new MeteoriteWorldGen(), 0 );
|
||||
}
|
||||
@@ -470,7 +468,7 @@ public final class Registration
|
||||
}
|
||||
|
||||
// whitelist from config
|
||||
for( final int dimension : AEConfig.instance.meteoriteDimensionWhitelist )
|
||||
for( final int dimension : AEConfig.instance().getMeteoriteDimensionWhitelist() )
|
||||
{
|
||||
registries.worldgen().enableWorldGenForDimension( WorldGenType.METEORITES, dimension );
|
||||
}
|
||||
|
||||
@@ -203,20 +203,22 @@ public final class ApiBlocks implements IBlocks
|
||||
{
|
||||
// this.quartzOre = new BlockDefinition( "ore.quartz", new OreQuartz() );
|
||||
this.quartzOre = registry.block( "quartz_ore", BlockQuartzOre::new )
|
||||
.features( AEFeature.CERTUS_ORE )
|
||||
.postInit( ( block, item ) ->
|
||||
{
|
||||
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( block ) );
|
||||
} )
|
||||
.build();
|
||||
this.quartzOreCharged = registry.block( "charged_quartz_ore", BlockChargedQuartzOre::new )
|
||||
.features( AEFeature.CERTUS_ORE, AEFeature.CHARGED_CERTUS_ORE )
|
||||
.postInit( ( block, item ) ->
|
||||
{
|
||||
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( block ) );
|
||||
} )
|
||||
.build();
|
||||
this.matrixFrame = registry.block( "matrix_frame", BlockMatrixFrame::new ).features( AEFeature.SpatialIO ).build();
|
||||
this.matrixFrame = registry.block( "matrix_frame", BlockMatrixFrame::new ).features( AEFeature.SPATIAL_IO ).build();
|
||||
|
||||
FeatureFactory deco = registry.features( AEFeature.DecorativeQuartzBlocks );
|
||||
FeatureFactory deco = registry.features( AEFeature.DECORATIVE_QUARTZ_BLOCKS );
|
||||
this.quartzBlock = deco.block( "quartz_block", BlockQuartz::new ).build();
|
||||
this.quartzPillar = deco.block( "quartz_pillar", BlockQuartzPillar::new ).build();
|
||||
this.chiseledQuartzBlock = deco.block( "chiseled_quartz_block", BlockChiseledQuartz::new ).build();
|
||||
@@ -233,11 +235,11 @@ public final class ApiBlocks implements IBlocks
|
||||
} )
|
||||
.build();
|
||||
this.quartzVibrantGlass = deco.block( "quartz_vibrant_glass", BlockQuartzLamp::new )
|
||||
.addFeatures( AEFeature.DecorativeLights )
|
||||
.addFeatures( AEFeature.DECORATIVE_LIGHTS )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.quartzFixture = registry.block( "quartz_fixture", BlockQuartzFixture::new )
|
||||
.features( AEFeature.DecorativeLights )
|
||||
.features( AEFeature.DECORATIVE_LIGHTS )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
|
||||
@@ -248,32 +250,33 @@ public final class ApiBlocks implements IBlocks
|
||||
this.skyStoneSmallBrick = deco.block( "sky_stone_small_brick", () -> new BlockSkyStone( SkystoneType.SMALL_BRICK ) ).build();
|
||||
|
||||
this.skyStoneChest = registry.block( "sky_stone_chest", () -> new BlockSkyChest( SkyChestType.STONE ) )
|
||||
.features( AEFeature.SkyStoneChests )
|
||||
.features( AEFeature.SKY_STONE_CHESTS )
|
||||
.rendering( new SkyChestRenderingCustomizer( SkyChestType.STONE ) )
|
||||
.build();
|
||||
this.smoothSkyStoneChest = registry.block( "smooth_sky_stone_chest", () -> new BlockSkyChest( SkyChestType.BLOCK ) )
|
||||
.features( AEFeature.SkyStoneChests )
|
||||
.features( AEFeature.SKY_STONE_CHESTS )
|
||||
.rendering( new SkyChestRenderingCustomizer( SkyChestType.BLOCK ) )
|
||||
.build();
|
||||
|
||||
this.skyCompass = registry.block( "sky_compass", BlockSkyCompass::new )
|
||||
.features( AEFeature.MeteoriteCompass )
|
||||
.features( AEFeature.METEORITE_COMPASS )
|
||||
.rendering( new SkyCompassRendering() )
|
||||
.build();
|
||||
this.grindstone = registry.block( "grindstone", BlockGrinder::new ).features( AEFeature.GrindStone ).build();
|
||||
this.grindstone = registry.block( "grindstone", BlockGrinder::new ).features( AEFeature.GRIND_STONE ).build();
|
||||
this.crank = registry.block( "crank", BlockCrank::new )
|
||||
.features( AEFeature.GrindStone )
|
||||
.features( AEFeature.GRIND_STONE )
|
||||
.rendering( new CrankRendering() )
|
||||
.build();
|
||||
this.inscriber = registry.block( "inscriber", BlockInscriber::new )
|
||||
.features( AEFeature.Inscriber )
|
||||
.features( AEFeature.INSCRIBER )
|
||||
.rendering( new InscriberRendering() )
|
||||
.build();
|
||||
this.wirelessAccessPoint = registry.block( "wireless_access_point", BlockWireless::new )
|
||||
.features( AEFeature.WirelessAccessTerminal )
|
||||
.features( AEFeature.WIRELESS_ACCESS_TERMINAL )
|
||||
.rendering( new WirelessRendering() )
|
||||
.build();
|
||||
this.charger = registry.block( "charger", BlockCharger::new )
|
||||
.features( AEFeature.CHARGER )
|
||||
.rendering( new BlockRenderingCustomizer()
|
||||
{
|
||||
@Override
|
||||
@@ -284,67 +287,71 @@ public final class ApiBlocks implements IBlocks
|
||||
}
|
||||
} )
|
||||
.build();
|
||||
this.tinyTNT = registry.block( "tiny_tnt", BlockTinyTNT::new ).features( AEFeature.TinyTNT )
|
||||
this.tinyTNT = registry.block( "tiny_tnt", BlockTinyTNT::new )
|
||||
.features( AEFeature.TINY_TNT )
|
||||
.postInit( ( block, item ) ->
|
||||
{
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, new DispenserBehaviorTinyTNT() );
|
||||
} )
|
||||
.build();
|
||||
this.securityStation = registry.block( "security_station", BlockSecurityStation::new )
|
||||
.features( AEFeature.Security )
|
||||
.features( AEFeature.SECURITY )
|
||||
.rendering( new SecurityStationRendering() )
|
||||
.build();
|
||||
this.quantumRing = registry.block( "quantum_ring", BlockQuantumRing::new )
|
||||
.features( AEFeature.QuantumNetworkBridge )
|
||||
.features( AEFeature.QUANTUM_NETWORK_BRIDGE )
|
||||
.rendering( new QuantumBridgeRendering() )
|
||||
.build();
|
||||
this.quantumLink = registry.block( "quantum_link", BlockQuantumLinkChamber::new )
|
||||
.features( AEFeature.QuantumNetworkBridge )
|
||||
.features( AEFeature.QUANTUM_NETWORK_BRIDGE )
|
||||
.rendering( new QuantumBridgeRendering() )
|
||||
.build();
|
||||
this.spatialPylon = registry.block( "spatial_pylon", BlockSpatialPylon::new )
|
||||
.features( AEFeature.SpatialIO )
|
||||
.features( AEFeature.SPATIAL_IO )
|
||||
.useCustomItemModel()
|
||||
.rendering( new SpatialPylonRendering() )
|
||||
.build();
|
||||
this.spatialIOPort = registry.block( "spatial_io_port", BlockSpatialIOPort::new ).features( AEFeature.SpatialIO ).build();
|
||||
this.spatialIOPort = registry.block( "spatial_io_port", BlockSpatialIOPort::new ).features( AEFeature.SPATIAL_IO ).build();
|
||||
this.controller = registry.block( "controller", BlockController::new )
|
||||
.features( AEFeature.Channels )
|
||||
.features( AEFeature.CHANNELS )
|
||||
.useCustomItemModel()
|
||||
.rendering( new ControllerRendering() )
|
||||
.build();
|
||||
this.drive = registry.block( "drive", BlockDrive::new )
|
||||
.features( AEFeature.StorageCells, AEFeature.MEDrive )
|
||||
.features( AEFeature.STORAGE_CELLS, AEFeature.ME_DRIVE )
|
||||
.useCustomItemModel()
|
||||
.rendering( new DriveRendering() )
|
||||
.build();
|
||||
this.chest = registry.block( "chest", BlockChest::new )
|
||||
.features( AEFeature.StorageCells, AEFeature.MEChest )
|
||||
.features( AEFeature.STORAGE_CELLS, AEFeature.ME_CHEST )
|
||||
.useCustomItemModel()
|
||||
.rendering( new ChestRendering() )
|
||||
.build();
|
||||
this.iface = registry.block( "interface", BlockInterface::new ).build();
|
||||
this.cellWorkbench = registry.block( "cell_workbench", BlockCellWorkbench::new ).features( AEFeature.StorageCells ).build();
|
||||
this.iOPort = registry.block( "io_port", BlockIOPort::new ).features( AEFeature.StorageCells, AEFeature.IOPort ).build();
|
||||
this.condenser = registry.block( "condenser", BlockCondenser::new ).build();
|
||||
this.energyAcceptor = registry.block( "energy_acceptor", BlockEnergyAcceptor::new ).build();
|
||||
this.vibrationChamber = registry.block( "vibration_chamber", BlockVibrationChamber::new ).features( AEFeature.PowerGen ).build();
|
||||
this.quartzGrowthAccelerator = registry.block( "quartz_growth_accelerator", BlockQuartzGrowthAccelerator::new ).build();
|
||||
this.iface = registry.block( "interface", BlockInterface::new ).features( AEFeature.INTERFACE ).build();
|
||||
this.cellWorkbench = registry.block( "cell_workbench", BlockCellWorkbench::new ).features( AEFeature.STORAGE_CELLS ).build();
|
||||
this.iOPort = registry.block( "io_port", BlockIOPort::new ).features( AEFeature.STORAGE_CELLS, AEFeature.IO_PORT ).build();
|
||||
this.condenser = registry.block( "condenser", BlockCondenser::new ).features( AEFeature.CONDENSER ).build();
|
||||
this.energyAcceptor = registry.block( "energy_acceptor", BlockEnergyAcceptor::new ).features( AEFeature.ENERGY_ACCEPTOR ).build();
|
||||
this.vibrationChamber = registry.block( "vibration_chamber", BlockVibrationChamber::new ).features( AEFeature.POWER_GEN ).build();
|
||||
this.quartzGrowthAccelerator = registry.block( "quartz_growth_accelerator", BlockQuartzGrowthAccelerator::new )
|
||||
.features( AEFeature.CRYSTAL_GROWTH_ACCELERATOR )
|
||||
.build();
|
||||
this.energyCell = registry.block( "energy_cell", BlockEnergyCell::new )
|
||||
.features( AEFeature.ENERGY_CELLS )
|
||||
.item( AEBaseItemBlockChargeable::new )
|
||||
.rendering( new BlockEnergyCellRendering( new ResourceLocation( AppEng.MOD_ID, "energy_cell" ) ) )
|
||||
.build();
|
||||
this.energyCellDense = registry.block( "dense_energy_cell", BlockDenseEnergyCell::new )
|
||||
.features( AEFeature.DenseEnergyCells )
|
||||
.features( AEFeature.ENERGY_CELLS, AEFeature.DENSE_ENERGY_CELLS )
|
||||
.item( AEBaseItemBlockChargeable::new )
|
||||
.rendering( new BlockEnergyCellRendering( new ResourceLocation( AppEng.MOD_ID, "dense_energy_cell" ) ) )
|
||||
.build();
|
||||
this.energyCellCreative = registry.block( "creative_energy_cell", BlockCreativeEnergyCell::new )
|
||||
.features( AEFeature.Creative )
|
||||
.features( AEFeature.CREATIVE )
|
||||
.item( AEBaseItemBlockChargeable::new )
|
||||
.build();
|
||||
|
||||
FeatureFactory crafting = registry.features( AEFeature.CraftingCPU );
|
||||
FeatureFactory crafting = registry.features( AEFeature.CRAFTING_CPU );
|
||||
this.craftingUnit = crafting.block( "crafting_unit", () -> new BlockCraftingUnit( CraftingUnitType.UNIT ) )
|
||||
.rendering( new CraftingCubeRendering( "crafting_unit", CraftingUnitType.UNIT ) )
|
||||
.useCustomItemModel()
|
||||
@@ -378,12 +385,13 @@ public final class ApiBlocks implements IBlocks
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
|
||||
this.molecularAssembler = registry.block( "molecular_assembler", BlockMolecularAssembler::new ).features( AEFeature.MolecularAssembler ).build();
|
||||
this.lightDetector = registry.block( "light_detector", BlockLightDetector::new ).features( AEFeature.LightDetector )
|
||||
this.molecularAssembler = registry.block( "molecular_assembler", BlockMolecularAssembler::new ).features( AEFeature.MOLECULAR_ASSEMBLER ).build();
|
||||
this.lightDetector = registry.block( "light_detector", BlockLightDetector::new )
|
||||
.features( AEFeature.LIGHT_DETECTOR )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.paint = registry.block( "paint", BlockPaint::new )
|
||||
.features( AEFeature.PaintBalls )
|
||||
.features( AEFeature.PAINT_BALLS )
|
||||
.rendering( new PaintRendering() )
|
||||
.build();
|
||||
|
||||
@@ -398,7 +406,8 @@ public final class ApiBlocks implements IBlocks
|
||||
|
||||
this.multiPart = registry.block( "cable_bus", BlockCableBus::new )
|
||||
.rendering( new CableBusRendering( partModels ) )
|
||||
.postInit( (block, item) -> {
|
||||
.postInit( ( block, item ) ->
|
||||
{
|
||||
( (BlockCableBus) block ).setupTile();
|
||||
} )
|
||||
.build();
|
||||
@@ -413,19 +422,19 @@ public final class ApiBlocks implements IBlocks
|
||||
this.quartzPillarSlab = makeSlab( "quartz_pillar_slab", "quartz_pillar_double_slab", registry, this.quartzPillar() );
|
||||
|
||||
this.itemGen = registry.block( "debug_item_gen", BlockItemGen::new )
|
||||
.features( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.chunkLoader = registry.block( "debug_chunk_loader", BlockChunkloader::new )
|
||||
.features( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.phantomNode = registry.block( "debug_phantom_node", BlockPhantomNode::new )
|
||||
.features( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.cubeGenerator = registry.block( "debug_cube_gen", BlockCubeGenerator::new )
|
||||
.features( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
}
|
||||
@@ -440,7 +449,7 @@ public final class ApiBlocks implements IBlocks
|
||||
Block block = blockDef.maybeBlock().get();
|
||||
|
||||
IBlockDefinition slabDef = registry.block( slabId, () -> new BlockSlabCommon.Half( block ) )
|
||||
.features( AEFeature.DecorativeQuartzBlocks )
|
||||
.features( AEFeature.DECORATIVE_QUARTZ_BLOCKS )
|
||||
.disableItem()
|
||||
.build();
|
||||
|
||||
@@ -453,7 +462,7 @@ public final class ApiBlocks implements IBlocks
|
||||
|
||||
// Reigster the double slab variant as well
|
||||
IBlockDefinition doubleSlabDef = registry.block( doubleSlabId, () -> new BlockSlabCommon.Double( slabBlock, block ) )
|
||||
.features( AEFeature.DecorativeQuartzBlocks )
|
||||
.features( AEFeature.DECORATIVE_QUARTZ_BLOCKS )
|
||||
.disableItem()
|
||||
.build();
|
||||
|
||||
@@ -463,7 +472,7 @@ public final class ApiBlocks implements IBlocks
|
||||
|
||||
// Make the slab item
|
||||
IItemDefinition itemDef = registry.item( slabId, () -> new ItemSlab( slabBlock, slabBlock, doubleSlabBlock ) )
|
||||
.features( AEFeature.DecorativeQuartzBlocks )
|
||||
.features( AEFeature.DECORATIVE_QUARTZ_BLOCKS )
|
||||
.build();
|
||||
|
||||
Verify.verify( itemDef.maybeItem().isPresent() );
|
||||
@@ -475,7 +484,7 @@ public final class ApiBlocks implements IBlocks
|
||||
private static IBlockDefinition makeStairs( String registryName, FeatureFactory registry, IBlockDefinition block )
|
||||
{
|
||||
return registry.block( registryName, () -> new BlockStairCommon( block.maybeBlock().get(), block.identifier() ) )
|
||||
.features( AEFeature.DecorativeQuartzBlocks )
|
||||
.features( AEFeature.DECORATIVE_QUARTZ_BLOCKS )
|
||||
.rendering( new BlockRenderingCustomizer()
|
||||
{
|
||||
@Override
|
||||
|
||||
@@ -125,85 +125,113 @@ public final class ApiItems implements IItems
|
||||
|
||||
public ApiItems( FeatureFactory registry )
|
||||
{
|
||||
FeatureFactory certusTools = registry.features( AEFeature.CertusQuartzTools );
|
||||
this.certusQuartzAxe = certusTools.item( "certus_quartz_axe", () -> new ToolQuartzAxe( AEFeature.CertusQuartzTools ) ).addFeatures( AEFeature.QuartzAxe ).build();
|
||||
this.certusQuartzHoe = certusTools.item( "certus_quartz_hoe", () -> new ToolQuartzHoe( AEFeature.CertusQuartzTools ) ).addFeatures( AEFeature.QuartzHoe ).build();
|
||||
this.certusQuartzShovel = certusTools.item( "certus_quartz_spade", () -> new ToolQuartzSpade( AEFeature.CertusQuartzTools ) ).addFeatures( AEFeature.QuartzSpade ).build();
|
||||
this.certusQuartzPick = certusTools.item( "certus_quartz_pickaxe", () -> new ToolQuartzPickaxe( AEFeature.CertusQuartzTools ) ).addFeatures( AEFeature.QuartzPickaxe ).build();
|
||||
this.certusQuartzSword = certusTools.item( "certus_quartz_sword", () -> new ToolQuartzSword( AEFeature.CertusQuartzTools ) ).addFeatures( AEFeature.QuartzSword ).build();
|
||||
this.certusQuartzWrench = certusTools.item( "certus_quartz_wrench", ToolQuartzWrench::new ).addFeatures( AEFeature.QuartzWrench ).build();
|
||||
this.certusQuartzKnife = certusTools.item( "certus_quartz_cutting_knife", () -> new ToolQuartzCuttingKnife( AEFeature.CertusQuartzTools ) ).addFeatures( AEFeature.QuartzKnife ).build();
|
||||
FeatureFactory certusTools = registry.features( AEFeature.CERTUS_QUARTZ_TOOLS );
|
||||
this.certusQuartzAxe = certusTools.item( "certus_quartz_axe", () -> new ToolQuartzAxe( AEFeature.CERTUS_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_AXE )
|
||||
.build();
|
||||
this.certusQuartzHoe = certusTools.item( "certus_quartz_hoe", () -> new ToolQuartzHoe( AEFeature.CERTUS_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_HOE )
|
||||
.build();
|
||||
this.certusQuartzShovel = certusTools.item( "certus_quartz_spade", () -> new ToolQuartzSpade( AEFeature.CERTUS_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_SPADE )
|
||||
.build();
|
||||
this.certusQuartzPick = certusTools.item( "certus_quartz_pickaxe", () -> new ToolQuartzPickaxe( AEFeature.CERTUS_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_PICKAXE )
|
||||
.build();
|
||||
this.certusQuartzSword = certusTools.item( "certus_quartz_sword", () -> new ToolQuartzSword( AEFeature.CERTUS_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_SWORD )
|
||||
.build();
|
||||
this.certusQuartzWrench = certusTools.item( "certus_quartz_wrench", ToolQuartzWrench::new ).addFeatures( AEFeature.QUARTZ_WRENCH ).build();
|
||||
this.certusQuartzKnife = certusTools.item( "certus_quartz_cutting_knife", () -> new ToolQuartzCuttingKnife( AEFeature.CERTUS_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_KNIFE )
|
||||
.build();
|
||||
|
||||
FeatureFactory netherTools = registry.features( AEFeature.NetherQuartzTools );
|
||||
this.netherQuartzAxe = netherTools.item( "nether_quartz_axe", () -> new ToolQuartzAxe( AEFeature.NetherQuartzTools ) ).addFeatures( AEFeature.QuartzAxe ).build();
|
||||
this.netherQuartzHoe = netherTools.item( "nether_quartz_hoe", () -> new ToolQuartzHoe( AEFeature.NetherQuartzTools ) ).addFeatures( AEFeature.QuartzHoe ).build();
|
||||
this.netherQuartzShovel = netherTools.item( "nether_quartz_spade", () -> new ToolQuartzSpade( AEFeature.NetherQuartzTools ) ).addFeatures( AEFeature.QuartzSpade ).build();
|
||||
this.netherQuartzPick = netherTools.item( "nether_quartz_pickaxe", () -> new ToolQuartzPickaxe( AEFeature.NetherQuartzTools ) ).addFeatures( AEFeature.QuartzPickaxe ).build();
|
||||
this.netherQuartzSword = netherTools.item( "nether_quartz_sword", () -> new ToolQuartzSword( AEFeature.NetherQuartzTools ) ).addFeatures( AEFeature.QuartzSword ).build();
|
||||
this.netherQuartzWrench = netherTools.item( "nether_quartz_wrench", ToolQuartzWrench::new ).addFeatures( AEFeature.QuartzWrench ).build();
|
||||
this.netherQuartzKnife = netherTools.item( "nether_quartz_cutting_knife", () -> new ToolQuartzCuttingKnife( AEFeature.NetherQuartzTools ) ).addFeatures( AEFeature.QuartzKnife ).build();
|
||||
FeatureFactory netherTools = registry.features( AEFeature.NETHER_QUARTZ_TOOLS );
|
||||
this.netherQuartzAxe = netherTools.item( "nether_quartz_axe", () -> new ToolQuartzAxe( AEFeature.NETHER_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_AXE )
|
||||
.build();
|
||||
this.netherQuartzHoe = netherTools.item( "nether_quartz_hoe", () -> new ToolQuartzHoe( AEFeature.NETHER_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_HOE )
|
||||
.build();
|
||||
this.netherQuartzShovel = netherTools.item( "nether_quartz_spade", () -> new ToolQuartzSpade( AEFeature.NETHER_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_SPADE )
|
||||
.build();
|
||||
this.netherQuartzPick = netherTools.item( "nether_quartz_pickaxe", () -> new ToolQuartzPickaxe( AEFeature.NETHER_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_PICKAXE )
|
||||
.build();
|
||||
this.netherQuartzSword = netherTools.item( "nether_quartz_sword", () -> new ToolQuartzSword( AEFeature.NETHER_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_SWORD )
|
||||
.build();
|
||||
this.netherQuartzWrench = netherTools.item( "nether_quartz_wrench", ToolQuartzWrench::new ).addFeatures( AEFeature.QUARTZ_WRENCH ).build();
|
||||
this.netherQuartzKnife = netherTools.item( "nether_quartz_cutting_knife", () -> new ToolQuartzCuttingKnife( AEFeature.NETHER_QUARTZ_TOOLS ) )
|
||||
.addFeatures( AEFeature.QUARTZ_KNIFE )
|
||||
.build();
|
||||
|
||||
FeatureFactory powerTools = registry.features( AEFeature.PoweredTools );
|
||||
FeatureFactory powerTools = registry.features( AEFeature.POWERED_TOOLS );
|
||||
this.entropyManipulator = powerTools.item( "entropy_manipulator", ToolEntropyManipulator::new )
|
||||
.addFeatures( AEFeature.EntropyManipulator )
|
||||
.addFeatures( AEFeature.ENTROPY_MANIPULATOR )
|
||||
.dispenserBehavior( DispenserBlockTool::new )
|
||||
.build();
|
||||
this.wirelessTerminal = powerTools.item( "wireless_terminal", ToolWirelessTerminal::new ).addFeatures( AEFeature.WirelessAccessTerminal ).build();
|
||||
this.chargedStaff = powerTools.item( "charged_staff", ToolChargedStaff::new ).addFeatures( AEFeature.ChargedStaff ).build();
|
||||
this.wirelessTerminal = powerTools.item( "wireless_terminal", ToolWirelessTerminal::new ).addFeatures( AEFeature.WIRELESS_ACCESS_TERMINAL ).build();
|
||||
this.chargedStaff = powerTools.item( "charged_staff", ToolChargedStaff::new ).addFeatures( AEFeature.CHARGED_STAFF ).build();
|
||||
this.massCannon = powerTools.item( "matter_cannon", ToolMatterCannon::new )
|
||||
.addFeatures( AEFeature.MatterCannon )
|
||||
.addFeatures( AEFeature.MATTER_CANNON )
|
||||
.dispenserBehavior( DispenserMatterCannon::new )
|
||||
.build();
|
||||
this.portableCell = powerTools.item( "portable_cell", ToolPortableCell::new ).addFeatures( AEFeature.PortableCell, AEFeature.StorageCells ).build();
|
||||
this.portableCell = powerTools.item( "portable_cell", ToolPortableCell::new ).addFeatures( AEFeature.PORTABLE_CELL, AEFeature.STORAGE_CELLS ).build();
|
||||
this.colorApplicator = powerTools.item( "color_applicator", ToolColorApplicator::new )
|
||||
.addFeatures( AEFeature.ColorApplicator )
|
||||
.addFeatures( AEFeature.COLOR_APPLICATOR )
|
||||
.dispenserBehavior( DispenserBlockTool::new )
|
||||
.rendering( new ToolColorApplicatorRendering() )
|
||||
.build();
|
||||
|
||||
this.biometricCard = registry.item( "biometric_card", ToolBiometricCard::new )
|
||||
.rendering( new ToolBiometricCardRendering() )
|
||||
.features( AEFeature.Security ).build();
|
||||
this.memoryCard = registry.item( "memory_card", ToolMemoryCard::new ).build();
|
||||
this.networkTool = registry.item( "network_tool", ToolNetworkTool::new ).features( AEFeature.NetworkTool ).build();
|
||||
.features( AEFeature.SECURITY )
|
||||
.build();
|
||||
this.memoryCard = registry.item( "memory_card", ToolMemoryCard::new ).features( AEFeature.MEMORY_CARD ).build();
|
||||
this.networkTool = registry.item( "network_tool", ToolNetworkTool::new ).features( AEFeature.NETWORK_TOOL ).build();
|
||||
|
||||
this.cellCreative = registry.item( "creative_storage_cell", ItemCreativeStorageCell::new ).features( AEFeature.StorageCells, AEFeature.Creative ).build();
|
||||
this.viewCell = registry.item( "view_cell", ItemViewCell::new ).build();
|
||||
this.cellCreative = registry.item( "creative_storage_cell", ItemCreativeStorageCell::new )
|
||||
.features( AEFeature.STORAGE_CELLS, AEFeature.CREATIVE )
|
||||
.build();
|
||||
this.viewCell = registry.item( "view_cell", ItemViewCell::new ).features( AEFeature.VIEW_CELL ).build();
|
||||
|
||||
FeatureFactory storageCells = registry.features( AEFeature.StorageCells );
|
||||
FeatureFactory storageCells = registry.features( AEFeature.STORAGE_CELLS );
|
||||
this.cell1k = storageCells.item( "storage_cell_1k", () -> new ItemBasicStorageCell( MaterialType.Cell1kPart, 1 ) ).build();
|
||||
this.cell4k = storageCells.item( "storage_cell_4k", () -> new ItemBasicStorageCell( MaterialType.Cell4kPart, 4 ) ).build();
|
||||
this.cell16k = storageCells.item( "storage_cell_16k", () -> new ItemBasicStorageCell( MaterialType.Cell16kPart, 16 ) ).build();
|
||||
this.cell64k = storageCells.item( "storage_cell_64k", () -> new ItemBasicStorageCell( MaterialType.Cell64kPart, 64 ) ).build();
|
||||
|
||||
FeatureFactory spatialCells = registry.features( AEFeature.SpatialIO );
|
||||
FeatureFactory spatialCells = registry.features( AEFeature.SPATIAL_IO );
|
||||
this.spatialCell2 = spatialCells.item( "spatial_storage_cell_2_cubed", () -> new ItemSpatialStorageCell( 2 ) ).build();
|
||||
this.spatialCell16 = spatialCells.item( "spatial_storage_cell_16_cubed", () -> new ItemSpatialStorageCell( 16 ) ).build();
|
||||
this.spatialCell128 = spatialCells.item( "spatial_storage_cell_128_cubed", () -> new ItemSpatialStorageCell( 128 ) ).build();
|
||||
|
||||
this.facade = registry.item( "facade", ItemFacade::new )
|
||||
.features( AEFeature.Facades )
|
||||
.features( AEFeature.FACADES )
|
||||
.creativeTab( CreativeTabFacade.instance )
|
||||
.rendering( new FacadeRendering() )
|
||||
.build();
|
||||
this.crystalSeed = registry.item( "crystal_seed", ItemCrystalSeed::new )
|
||||
.features( AEFeature.CRYSTAL_SEEDS )
|
||||
.rendering( new ItemCrystalSeedRendering() )
|
||||
.build();
|
||||
|
||||
// rv1
|
||||
this.encodedPattern = registry.item( "encoded_pattern", ItemEncodedPattern::new )
|
||||
.features( AEFeature.Patterns )
|
||||
.features( AEFeature.PATTERNS )
|
||||
.rendering( new ItemEncodedPatternRendering() )
|
||||
.build();
|
||||
|
||||
this.paintBall = registry.item( "paint_ball", ItemPaintBall::new )
|
||||
.features( AEFeature.PaintBalls )
|
||||
.features( AEFeature.PAINT_BALLS )
|
||||
.rendering( new ItemPaintBallRendering() )
|
||||
.build();
|
||||
this.coloredPaintBall = registry.colored( this.paintBall, 0 );
|
||||
this.coloredLumenPaintBall = registry.colored( this.paintBall, 20 );
|
||||
|
||||
FeatureFactory debugTools = registry.features( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative );
|
||||
FeatureFactory debugTools = registry.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE );
|
||||
this.toolEraser = debugTools.item( "debug_eraser", ToolEraser::new ).build();
|
||||
this.toolMeteoritePlacer = debugTools.item( "debug_meteorite_placer", ToolMeteoritePlacer::new ).build();
|
||||
this.toolDebugCard = debugTools.item( "debug_card", ToolDebugCard::new ).build();
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class ApiParts implements IParts
|
||||
private final IItemDefinition p2PTunnelME;
|
||||
private final IItemDefinition p2PTunnelRedstone;
|
||||
private final IItemDefinition p2PTunnelItems;
|
||||
private final IItemDefinition p2PTunnelLiquids;
|
||||
private final IItemDefinition p2PTunnelFluids;
|
||||
private final IItemDefinition p2PTunnelEU;
|
||||
// private final IItemDefinition p2PTunnelRF;
|
||||
private final IItemDefinition p2PTunnelLight;
|
||||
@@ -112,7 +112,7 @@ public final class ApiParts implements IParts
|
||||
this.p2PTunnelME = new DamagedItemDefinition( "part.tunnel.me", itemPart.createPart( PartType.P2PTunnelME ) );
|
||||
this.p2PTunnelRedstone = new DamagedItemDefinition( "part.tunnel.redstone", itemPart.createPart( PartType.P2PTunnelRedstone ) );
|
||||
this.p2PTunnelItems = new DamagedItemDefinition( "part.tunnel.item", itemPart.createPart( PartType.P2PTunnelItems ) );
|
||||
this.p2PTunnelLiquids = new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2PTunnelLiquids ) );
|
||||
this.p2PTunnelFluids = new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2PTunnelFluids ) );
|
||||
this.p2PTunnelEU = new DamagedItemDefinition( "part.tunnel.eu", itemPart.createPart( PartType.P2PTunnelEU ) );
|
||||
// this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) );
|
||||
this.p2PTunnelLight = new DamagedItemDefinition( "part.tunnel.light", itemPart.createPart( PartType.P2PTunnelLight ) );
|
||||
@@ -281,9 +281,9 @@ public final class ApiParts implements IParts
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemDefinition p2PTunnelLiquids()
|
||||
public IItemDefinition p2PTunnelFluids()
|
||||
{
|
||||
return this.p2PTunnelLiquids;
|
||||
return this.p2PTunnelFluids;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public enum AEFeature
|
||||
// stuff that has no reason for ever being turned off, or that
|
||||
// is just flat out required by tons of
|
||||
// important stuff.
|
||||
Core( null )
|
||||
CORE( "Core", null )
|
||||
{
|
||||
@Override
|
||||
public boolean isVisible()
|
||||
@@ -33,124 +33,162 @@ public enum AEFeature
|
||||
}
|
||||
},
|
||||
|
||||
CertusQuartzWorldGen( Constants.CATEGORY_WORLD ),
|
||||
MeteoriteWorldGen( Constants.CATEGORY_WORLD ),
|
||||
DecorativeLights( Constants.CATEGORY_WORLD ),
|
||||
DecorativeQuartzBlocks( Constants.CATEGORY_WORLD ),
|
||||
SkyStoneChests( Constants.CATEGORY_WORLD ),
|
||||
SpawnPressesInMeteorites( Constants.CATEGORY_WORLD ),
|
||||
GrindStone( Constants.CATEGORY_WORLD ),
|
||||
Flour( Constants.CATEGORY_WORLD ),
|
||||
Inscriber( Constants.CATEGORY_WORLD ),
|
||||
ChestLoot( Constants.CATEGORY_WORLD ),
|
||||
VillagerTrading( Constants.CATEGORY_WORLD ),
|
||||
TinyTNT( Constants.CATEGORY_WORLD ),
|
||||
CERTUS_QUARTZ_WORLD_GEN( "CertusQuartzWorldGen", Constants.CATEGORY_WORLD ),
|
||||
METEORITE_WORLD_GEN( "MeteoriteWorldGen", Constants.CATEGORY_WORLD ),
|
||||
DECORATIVE_LIGHTS( "DecorativeLights", Constants.CATEGORY_WORLD ),
|
||||
DECORATIVE_QUARTZ_BLOCKS( "DecorativeQuartzBlocks", Constants.CATEGORY_WORLD ),
|
||||
SKY_STONE_CHESTS( "SkyStoneChests", Constants.CATEGORY_WORLD ),
|
||||
SPAWN_PRESSES_IN_METEORITES( "SpawnPressesInMeteorites", Constants.CATEGORY_WORLD ),
|
||||
GRIND_STONE( "GrindStone", Constants.CATEGORY_WORLD ),
|
||||
FLOUR( "Flour", Constants.CATEGORY_WORLD ),
|
||||
INSCRIBER( "Inscriber", Constants.CATEGORY_WORLD ),
|
||||
CHARGER( "Charger", Constants.CATEGORY_WORLD ),
|
||||
CRYSTAL_GROWTH_ACCELERATOR( "CrystalGrowthAccelerator", Constants.CATEGORY_WORLD ),
|
||||
CHEST_LOOT( "ChestLoot", Constants.CATEGORY_WORLD ),
|
||||
VILLAGER_TRADING( "VillagerTrading", Constants.CATEGORY_WORLD ),
|
||||
TINY_TNT( "TinyTNT", Constants.CATEGORY_WORLD ),
|
||||
CERTUS_ORE( "CertusOre", Constants.CATEGORY_WORLD ),
|
||||
CHARGED_CERTUS_ORE( "ChargedCertusOre", Constants.CATEGORY_WORLD ),
|
||||
|
||||
PoweredTools( Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
|
||||
CertusQuartzTools( Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
|
||||
NetherQuartzTools( Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
|
||||
POWERED_TOOLS( "PoweredTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
|
||||
CERTUS_QUARTZ_TOOLS( "CertusQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
|
||||
NETHER_QUARTZ_TOOLS( "NetherQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
|
||||
|
||||
QuartzHoe( Constants.CATEGORY_TOOLS ),
|
||||
QuartzSpade( Constants.CATEGORY_TOOLS ),
|
||||
QuartzSword( Constants.CATEGORY_TOOLS ),
|
||||
QuartzPickaxe( Constants.CATEGORY_TOOLS ),
|
||||
QuartzAxe( Constants.CATEGORY_TOOLS ),
|
||||
QuartzKnife( Constants.CATEGORY_TOOLS ),
|
||||
QuartzWrench( Constants.CATEGORY_TOOLS ),
|
||||
ChargedStaff( Constants.CATEGORY_TOOLS ),
|
||||
EntropyManipulator( Constants.CATEGORY_TOOLS ),
|
||||
MatterCannon( Constants.CATEGORY_TOOLS ),
|
||||
WirelessAccessTerminal( Constants.CATEGORY_TOOLS ),
|
||||
ColorApplicator( Constants.CATEGORY_TOOLS ),
|
||||
MeteoriteCompass( Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_HOE( "QuartzHoe", Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_SPADE( "QuartzSpade", Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_SWORD( "QuartzSword", Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_PICKAXE( "QuartzPickaxe", Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_AXE( "QuartzAxe", Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_KNIFE( "QuartzKnife", Constants.CATEGORY_TOOLS ),
|
||||
QUARTZ_WRENCH( "QuartzWrench", Constants.CATEGORY_TOOLS ),
|
||||
CHARGED_STAFF( "ChargedStaff", Constants.CATEGORY_TOOLS ),
|
||||
ENTROPY_MANIPULATOR( "EntropyManipulator", Constants.CATEGORY_TOOLS ),
|
||||
MATTER_CANNON( "MatterCannon", Constants.CATEGORY_TOOLS ),
|
||||
WIRELESS_ACCESS_TERMINAL( "WirelessAccessTerminal", Constants.CATEGORY_TOOLS ),
|
||||
COLOR_APPLICATOR( "ColorApplicator", Constants.CATEGORY_TOOLS ),
|
||||
METEORITE_COMPASS( "MeteoriteCompass", Constants.CATEGORY_TOOLS ),
|
||||
|
||||
PowerGen( Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
Security( Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
SpatialIO( Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
QuantumNetworkBridge( Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
Channels( Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
POWER_GEN( "PowerGen", Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
SECURITY( "Security", Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
SPATIAL_IO( "SpatialIO", Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
QUANTUM_NETWORK_BRIDGE( "QuantumNetworkBridge", Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
CHANNELS( "Channels", Constants.CATEGORY_NETWORK_FEATURES ),
|
||||
|
||||
LevelEmitter( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
CraftingTerminal( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
StorageMonitor( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
P2PTunnel( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
FormationPlane( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
AnnihilationPlane( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
IdentityAnnihilationPlane( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
ImportBus( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
ExportBus( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
StorageBus( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
PartConversionMonitor( Constants.CATEGORY_NETWORK_BUSES ),
|
||||
INTERFACE( "Interface", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
LEVEL_EMITTER( "LevelEmitter", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
CRAFTING_TERMINAL( "CraftingTerminal", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
TERMINAL( "Terminal", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
STORAGE_MONITOR( "StorageMonitor", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
P2P_TUNNEL( "P2PTunnel", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
FORMATION_PLANE( "FormationPlane", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
ANNIHILATION_PLANE( "AnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
IDENTITY_ANNIHILATION_PLANE( "IdentityAnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
IMPORT_BUS( "ImportBus", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
EXPORT_BUS( "ExportBus", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
STORAGE_BUS( "StorageBus", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
PART_CONVERSION_MONITOR( "PartConversionMonitor", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
TOGGLE_BUS( "ToggleBus", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
PANELS( "Panels", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
QUARTZ_FIBER( "QuartzFiber", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
CABLE_ANCHOR( "CableAnchor", Constants.CATEGORY_NETWORK_BUSES ),
|
||||
|
||||
PortableCell( Constants.CATEGORY_PORTABLE_CELL ),
|
||||
PORTABLE_CELL( "PortableCell", Constants.CATEGORY_PORTABLE_CELL ),
|
||||
|
||||
StorageCells( Constants.CATEGORY_STORAGE ),
|
||||
MEChest( Constants.CATEGORY_STORAGE ),
|
||||
MEDrive( Constants.CATEGORY_STORAGE ),
|
||||
IOPort( Constants.CATEGORY_STORAGE ),
|
||||
STORAGE_CELLS( "StorageCells", Constants.CATEGORY_STORAGE ),
|
||||
ME_CHEST( "MEChest", Constants.CATEGORY_STORAGE ),
|
||||
ME_DRIVE( "MEDrive", Constants.CATEGORY_STORAGE ),
|
||||
IO_PORT( "IOPort", Constants.CATEGORY_STORAGE ),
|
||||
CONDENSER( "Condenser", Constants.CATEGORY_STORAGE ),
|
||||
|
||||
NetworkTool( Constants.CATEGORY_NETWORK_TOOL ),
|
||||
NETWORK_TOOL( "NetworkTool", Constants.CATEGORY_NETWORK_TOOL ),
|
||||
MEMORY_CARD( "MemoryCard", Constants.CATEGORY_NETWORK_TOOL ),
|
||||
|
||||
DenseEnergyCells( Constants.CATEGORY_HIGHER_CAPACITY ),
|
||||
DenseCables( Constants.CATEGORY_HIGHER_CAPACITY ),
|
||||
GLASS_CABLES( "GlassCables", Constants.CATEGORY_CABLES ),
|
||||
COVERED_CABLES( "CoveredCables", Constants.CATEGORY_CABLES ),
|
||||
SMART_CABLES( "SmartCables", Constants.CATEGORY_CABLES ),
|
||||
|
||||
P2PTunnelRF( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelME( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelItems( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelRedstone( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelEU( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelLiquids( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelLight( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelOpenComputers( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2PTunnelPressure( Constants.CATEGORY_P2P_TUNNELS ),
|
||||
ENERGY_CELLS( "EnergyCells", Constants.CATEGORY_ENERGY ),
|
||||
ENERGY_ACCEPTOR( "EnergyAcceptor", Constants.CATEGORY_ENERGY ),
|
||||
|
||||
MassCannonBlockDamage( Constants.CATEGORY_BLOCK_FEATURES ),
|
||||
TinyTNTBlockDamage( Constants.CATEGORY_BLOCK_FEATURES ),
|
||||
DENSE_ENERGY_CELLS( "DenseEnergyCells", Constants.CATEGORY_HIGHER_CAPACITY ),
|
||||
DENSE_CABLES( "DenseCables", Constants.CATEGORY_HIGHER_CAPACITY ),
|
||||
|
||||
Facades( Constants.CATEGORY_FACADES ),
|
||||
P2P_TUNNEL_RF( "P2PTunnelRF", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_ME( "P2PTunnelME", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_ITEMS( "P2PTunnelItems", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_REDSTONE( "P2PTunnelRedstone", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_EU( "P2PTunnelEU", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_FLUIDS( "P2PTunnelFluids", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_LIGHT( "P2PTunnelLight", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_OPEN_COMPUTERS( "P2PTunnelOpenComputers", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
P2P_TUNNEL_PRESSURE( "P2PTunnelPressure", Constants.CATEGORY_P2P_TUNNELS ),
|
||||
|
||||
UnsupportedDeveloperTools( Constants.CATEGORY_MISC, false ),
|
||||
Creative( Constants.CATEGORY_MISC ),
|
||||
GrinderLogging( Constants.CATEGORY_MISC, false ),
|
||||
Logging( Constants.CATEGORY_MISC ),
|
||||
IntegrationLogging( Constants.CATEGORY_MISC, false ),
|
||||
WebsiteRecipes( Constants.CATEGORY_MISC, false ),
|
||||
LogSecurityAudits( Constants.CATEGORY_MISC, false ),
|
||||
Achievements( Constants.CATEGORY_MISC ),
|
||||
UpdateLogging( Constants.CATEGORY_MISC, false ),
|
||||
PacketLogging( Constants.CATEGORY_MISC, false ),
|
||||
CraftingLog( Constants.CATEGORY_MISC, false ),
|
||||
LightDetector( Constants.CATEGORY_MISC ),
|
||||
DebugLogging( Constants.CATEGORY_MISC, false ),
|
||||
MASS_CANNON_BLOCK_DAMAGE( "MassCannonBlockDamage", Constants.CATEGORY_BLOCK_FEATURES ),
|
||||
TINY_TNT_BLOCK_DAMAGE( "TinyTNTBlockDamage", Constants.CATEGORY_BLOCK_FEATURES ),
|
||||
|
||||
EnableFacadeCrafting( Constants.CATEGORY_CRAFTING ),
|
||||
InWorldSingularity( Constants.CATEGORY_CRAFTING ),
|
||||
InWorldFluix( Constants.CATEGORY_CRAFTING ),
|
||||
InWorldPurification( Constants.CATEGORY_CRAFTING ),
|
||||
InterfaceTerminal( Constants.CATEGORY_CRAFTING ),
|
||||
EnableDisassemblyCrafting( Constants.CATEGORY_CRAFTING ),
|
||||
FACADES( "Facades", Constants.CATEGORY_FACADES ),
|
||||
|
||||
AlphaPass( Constants.CATEGORY_RENDERING ),
|
||||
PaintBalls( Constants.CATEGORY_TOOLS ),
|
||||
UNSUPPORTED_DEVELOPER_TOOLS( "UnsupportedDeveloperTools", Constants.CATEGORY_MISC, false ),
|
||||
CREATIVE( "Creative", Constants.CATEGORY_MISC ),
|
||||
GRINDER_LOGGING( "GrinderLogging", Constants.CATEGORY_MISC, false ),
|
||||
LOGGING( "Logging", Constants.CATEGORY_MISC ),
|
||||
INTEGRATION_LOGGING( "IntegrationLogging", Constants.CATEGORY_MISC, false ),
|
||||
WEBSITE_RECIPES( "WebsiteRecipes", Constants.CATEGORY_MISC, false ),
|
||||
LOG_SECURITY_AUDITS( "LogSecurityAudits", Constants.CATEGORY_MISC, false ),
|
||||
ACHIEVEMENTS( "Achievements", Constants.CATEGORY_MISC ),
|
||||
UPDATE_LOGGING( "UpdateLogging", Constants.CATEGORY_MISC, false ),
|
||||
PACKET_LOGGING( "PacketLogging", Constants.CATEGORY_MISC, false ),
|
||||
CRAFTING_LOG( "CraftingLog", Constants.CATEGORY_MISC, false ),
|
||||
LIGHT_DETECTOR( "LightDetector", Constants.CATEGORY_MISC ),
|
||||
DEBUG_LOGGING( "DebugLogging", Constants.CATEGORY_MISC, false ),
|
||||
|
||||
MolecularAssembler( Constants.CATEGORY_CRAFTING_FEATURES ),
|
||||
Patterns( Constants.CATEGORY_CRAFTING_FEATURES ),
|
||||
CraftingCPU( Constants.CATEGORY_CRAFTING_FEATURES ),
|
||||
ENABLE_FACADE_CRAFTING( "EnableFacadeCrafting", Constants.CATEGORY_CRAFTING ),
|
||||
IN_WORLD_SINGULARITY( "InWorldSingularity", Constants.CATEGORY_CRAFTING ),
|
||||
IN_WORLD_FLUIX( "InWorldFluix", Constants.CATEGORY_CRAFTING ),
|
||||
IN_WORLD_PURIFICATION( "InWorldPurification", Constants.CATEGORY_CRAFTING ),
|
||||
INTERFACE_TERMINAL( "InterfaceTerminal", Constants.CATEGORY_CRAFTING ),
|
||||
ENABLE_DISASSEMBLY_CRAFTING( "EnableDisassemblyCrafting", Constants.CATEGORY_CRAFTING ),
|
||||
|
||||
ChunkLoggerTrace( Constants.CATEGORY_COMMANDS, false );
|
||||
ALPHA_PASS( "AlphaPass", Constants.CATEGORY_RENDERING ),
|
||||
PAINT_BALLS( "PaintBalls", Constants.CATEGORY_TOOLS ),
|
||||
|
||||
public final String category;
|
||||
public final boolean defaultValue;
|
||||
MOLECULAR_ASSEMBLER( "MolecularAssembler", Constants.CATEGORY_CRAFTING_FEATURES ),
|
||||
PATTERNS( "Patterns", Constants.CATEGORY_CRAFTING_FEATURES ),
|
||||
CRAFTING_CPU( "CraftingCPU", Constants.CATEGORY_CRAFTING_FEATURES ),
|
||||
|
||||
AEFeature( final String cat )
|
||||
BASIC_CARDS( "BasicCards", Constants.CATEGORY_UPGRADES ),
|
||||
ADVANCED_CARDS( "AdvancedCards", Constants.CATEGORY_UPGRADES ),
|
||||
VIEW_CELL( "ViewCell", Constants.CATEGORY_UPGRADES ),
|
||||
|
||||
PROCESSORS( "Processors", Constants.CATEGORY_MATERIALS ),
|
||||
PRINTED_CIRCUITS( "PrintedCircuits", Constants.CATEGORY_MATERIALS ),
|
||||
PRESSES( "Presses", Constants.CATEGORY_MATERIALS ),
|
||||
CRYSTAL_SEEDS( "CrystalSeeds", Constants.CATEGORY_MATERIALS ),
|
||||
PURE_CRYSTALS( "PureCrystals", Constants.CATEGORY_MATERIALS ),
|
||||
CERTUS( "Certus", Constants.CATEGORY_MATERIALS ),
|
||||
FLUIX( "Fluix", Constants.CATEGORY_MATERIALS ),
|
||||
SILICON( "Silicon", Constants.CATEGORY_MATERIALS ),
|
||||
DUSTS( "Dusts", Constants.CATEGORY_MATERIALS ),
|
||||
NUGGETS( "Nuggets", Constants.CATEGORY_MATERIALS ),
|
||||
MATTER_BALL( "MatterBall", Constants.CATEGORY_MATERIALS ),
|
||||
CORES( "Cores", Constants.CATEGORY_MATERIALS ),
|
||||
|
||||
CHUNK_LOGGER_TRACE( "ChunkLoggerTrace", Constants.CATEGORY_COMMANDS, false );
|
||||
|
||||
private final String key;
|
||||
private final String category;
|
||||
private final boolean enabled;
|
||||
|
||||
AEFeature( final String key, final String cat )
|
||||
{
|
||||
this( cat, true );
|
||||
this( key, cat, true );
|
||||
}
|
||||
|
||||
AEFeature( final String cat, final boolean defaultValue )
|
||||
AEFeature( final String key, final String cat, final boolean enabled )
|
||||
{
|
||||
this.key = key;
|
||||
this.category = cat;
|
||||
this.defaultValue = defaultValue;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,6 +201,21 @@ public enum AEFeature
|
||||
return true;
|
||||
}
|
||||
|
||||
public String key()
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
public String category()
|
||||
{
|
||||
return category;
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
private enum Constants
|
||||
{
|
||||
;
|
||||
@@ -177,6 +230,7 @@ public enum AEFeature
|
||||
private static final String CATEGORY_BLOCK_FEATURES = "BlockFeatures";
|
||||
private static final String CATEGORY_CRAFTING_FEATURES = "CraftingFeatures";
|
||||
private static final String CATEGORY_STORAGE = "Storage";
|
||||
private static final String CATEGORY_CABLES = "Cables";
|
||||
private static final String CATEGORY_HIGHER_CAPACITY = "HigherCapacity";
|
||||
private static final String CATEGORY_NETWORK_FEATURES = "NetworkFeatures";
|
||||
private static final String CATEGORY_COMMANDS = "Commands";
|
||||
@@ -184,5 +238,8 @@ public enum AEFeature
|
||||
private static final String CATEGORY_FACADES = "Facades";
|
||||
private static final String CATEGORY_NETWORK_TOOL = "NetworkTool";
|
||||
private static final String CATEGORY_PORTABLE_CELL = "PortableCell";
|
||||
private static final String CATEGORY_ENERGY = "Energy";
|
||||
private static final String CATEGORY_UPGRADES = "Upgrades";
|
||||
private static final String CATEGORY_MATERIALS = "Materials";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,14 @@ import appeng.items.materials.MaterialType;
|
||||
public class MaterialStackSrc implements IStackSrc
|
||||
{
|
||||
private final MaterialType src;
|
||||
private final boolean enabled;
|
||||
|
||||
public MaterialStackSrc( final MaterialType src )
|
||||
public MaterialStackSrc( final MaterialType src, boolean enabled )
|
||||
{
|
||||
Preconditions.checkNotNull( src );
|
||||
|
||||
this.src = src;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,6 +61,6 @@ public class MaterialStackSrc implements IStackSrc
|
||||
@Override
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return true;
|
||||
return this.enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,299 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features.registries;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IGrinderEntry;
|
||||
import appeng.api.features.IGrinderRegistry;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.features.registries.entries.AppEngGrinderRecipe;
|
||||
import appeng.recipes.ores.IOreListener;
|
||||
import appeng.recipes.ores.OreDictionaryHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public final class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
private final List<IGrinderEntry> recipes;
|
||||
private final Map<ItemStack, String> ores;
|
||||
private final Map<ItemStack, String> ingots;
|
||||
private final Map<String, ItemStack> dusts;
|
||||
|
||||
public GrinderRecipeManager()
|
||||
{
|
||||
this.recipes = new ArrayList<IGrinderEntry>();
|
||||
this.ores = new HashMap<ItemStack, String>();
|
||||
this.ingots = new HashMap<ItemStack, String>();
|
||||
this.dusts = new HashMap<String, ItemStack>();
|
||||
|
||||
this.addOre( "Coal", new ItemStack( Items.COAL ) );
|
||||
this.addOre( "Charcoal", new ItemStack( Items.COAL, 1, 1 ) );
|
||||
|
||||
this.addOre( "NetherQuartz", new ItemStack( Blocks.QUARTZ_ORE ) );
|
||||
this.addIngot( "NetherQuartz", new ItemStack( Items.QUARTZ ) );
|
||||
|
||||
this.addOre( "Gold", new ItemStack( Blocks.GOLD_ORE ) );
|
||||
this.addIngot( "Gold", new ItemStack( Items.GOLD_INGOT ) );
|
||||
|
||||
this.addOre( "Iron", new ItemStack( Blocks.IRON_ORE ) );
|
||||
this.addIngot( "Iron", new ItemStack( Items.IRON_INGOT ) );
|
||||
|
||||
this.addOre( "Obsidian", new ItemStack( Blocks.OBSIDIAN ) );
|
||||
|
||||
this.addIngot( "Ender", new ItemStack( Items.ENDER_PEARL ) );
|
||||
this.addIngot( "EnderPearl", new ItemStack( Items.ENDER_PEARL ) );
|
||||
|
||||
this.addIngot( "Wheat", new ItemStack( Items.WHEAT ) );
|
||||
|
||||
OreDictionaryHandler.INSTANCE.observe( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IGrinderEntry> getRecipes()
|
||||
{
|
||||
this.log( "API - getRecipes" );
|
||||
return this.recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( final ItemStack in, final ItemStack out, final int cost )
|
||||
{
|
||||
if( in == null || out == null )
|
||||
{
|
||||
this.log( "Invalid Grinder Recipe Specified." );
|
||||
return;
|
||||
}
|
||||
|
||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost );
|
||||
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), cost ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final int cost )
|
||||
{
|
||||
if( in == null || ( optional == null && out == null ) )
|
||||
{
|
||||
this.log( "Invalid Grinder Recipe Specified." );
|
||||
return;
|
||||
}
|
||||
|
||||
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 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final ItemStack optional2, final float chance2, final int cost )
|
||||
{
|
||||
if( in == null || ( optional == null && out == null && optional2 == null ) )
|
||||
{
|
||||
this.log( "Invalid Grinder Recipe Specified." );
|
||||
return;
|
||||
}
|
||||
|
||||
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 ), this.copy( optional2 ), chance, chance2, cost ) );
|
||||
}
|
||||
|
||||
private void injectRecipe( final AppEngGrinderRecipe appEngGrinderRecipe )
|
||||
{
|
||||
for( final IGrinderEntry gr : this.recipes )
|
||||
{
|
||||
if( Platform.itemComparisons().isSameItem( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.recipes.add( appEngGrinderRecipe );
|
||||
}
|
||||
|
||||
private ItemStack copy( final ItemStack is )
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
return is.copy();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGrinderEntry getRecipeForInput( final ItemStack input )
|
||||
{
|
||||
this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
|
||||
if( input != null )
|
||||
{
|
||||
for( final IGrinderEntry r : this.recipes )
|
||||
{
|
||||
if( Platform.itemComparisons().isEqualItem( input, r.getInput() ) )
|
||||
{
|
||||
this.log( "Recipe for " + input.getUnlocalizedName() + " found " + Platform.getItemDisplayName( r.getOutput() ) );
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
this.log( "Could not find recipe for " + Platform.getItemDisplayName( input ) );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void log( final String o )
|
||||
{
|
||||
AELog.grinder( o );
|
||||
}
|
||||
|
||||
private int getDustToOreRatio( final String name )
|
||||
{
|
||||
if( name.equals( "Obsidian" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if( name.equals( "Charcoal" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if( name.equals( "Coal" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
private void addOre( final String name, final ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.ores.put( item, name );
|
||||
|
||||
if( this.dusts.containsKey( name ) )
|
||||
{
|
||||
final ItemStack is = this.dusts.get( name ).copy();
|
||||
final int ratio = this.getDustToOreRatio( name );
|
||||
if( ratio > 1 )
|
||||
{
|
||||
final ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addRecipe( item, is, 8 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addIngot( final String name, final ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.ingots.put( item, name );
|
||||
|
||||
if( this.dusts.containsKey( name ) )
|
||||
{
|
||||
this.addRecipe( item, this.dusts.get( name ), 4 );
|
||||
}
|
||||
}
|
||||
|
||||
private void addDust( final String name, final ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if( this.dusts.containsKey( name ) )
|
||||
{
|
||||
this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
return;
|
||||
}
|
||||
|
||||
this.log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.dusts.put( name, item );
|
||||
|
||||
for( final Entry<ItemStack, String> d : this.ores.entrySet() )
|
||||
{
|
||||
if( name.equals( d.getValue() ) )
|
||||
{
|
||||
final ItemStack is = item.copy();
|
||||
is.stackSize = 1;
|
||||
final int ratio = this.getDustToOreRatio( name );
|
||||
if( ratio > 1 )
|
||||
{
|
||||
final ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addRecipe( d.getKey(), is, 8 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( final Entry<ItemStack, String> d : this.ingots.entrySet() )
|
||||
{
|
||||
if( name.equals( d.getValue() ) )
|
||||
{
|
||||
this.addRecipe( d.getKey(), item, 4 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oreRegistered( final String name, final ItemStack item )
|
||||
{
|
||||
if( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) )
|
||||
{
|
||||
for( final String ore : AEConfig.instance.grinderOres )
|
||||
{
|
||||
if( name.equals( "ore" + ore ) )
|
||||
{
|
||||
this.addOre( ore, item );
|
||||
}
|
||||
else if( name.equals( "crystal" + ore ) || name.equals( "ingot" + ore ) || name.equals( "gem" + ore ) )
|
||||
{
|
||||
this.addIngot( ore, item );
|
||||
}
|
||||
else if( name.equals( "dust" + ore ) )
|
||||
{
|
||||
this.addDust( ore, item );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
this.considerItem( name, item, "Sodium", 22.9897 );
|
||||
this.considerItem( name, item, "Magnesium", 24.305 );
|
||||
this.considerItem( name, item, "Aluminum", 26.9815 );
|
||||
this.considerItem( name, item, "Silicon", 28.0855 );
|
||||
this.considerItem( name, item, "SILICON", 28.0855 );
|
||||
this.considerItem( name, item, "Phosphorus", 30.9738 );
|
||||
this.considerItem( name, item, "Sulfur", 32.065 );
|
||||
this.considerItem( name, item, "Potassium", 39.0983 );
|
||||
|
||||
@@ -34,6 +34,9 @@ import appeng.api.movable.IMovableRegistry;
|
||||
import appeng.api.networking.IGridCacheRegistry;
|
||||
import appeng.api.parts.IPartModels;
|
||||
import appeng.api.storage.ICellRegistry;
|
||||
import appeng.core.features.registries.cell.CellRegistry;
|
||||
import appeng.core.features.registries.grinder.GrinderRecipeManager;
|
||||
import appeng.core.features.registries.inscriber.InscriberRegistry;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features.registries.entries;
|
||||
package appeng.core.features.registries.cell;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user