mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-14 17:24:53 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a48f59e0ed | ||
|
|
84d462d8d5 | ||
|
|
b32f2a210c | ||
|
|
c988aa9870 | ||
|
|
6ba66123eb | ||
|
|
1d0568388a | ||
|
|
3968cc320e | ||
|
|
ed1daa1e96 |
No files matched your search
+4
-4
@@ -1,12 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.10.17:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.7.0:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.7:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.9.13:dev')
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.0-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.63-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
+36
-4
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
@@ -96,7 +120,9 @@ usesMixinDebug = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
@@ -172,6 +198,12 @@ curseForgeRelations =
|
||||
# projects. New projects should not use this parameter.
|
||||
customArchiveBaseName = binnie-mods
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+1
-1
@@ -17,5 +17,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import binnie.core.ManagerBase;
|
||||
import binnie.core.genetics.ManagerGenetics;
|
||||
import binnie.core.item.ManagerItem;
|
||||
import binnie.core.liquid.ManagerLiquid;
|
||||
import binnie.core.machines.ManagerMachine;
|
||||
import binnie.core.resource.ManagerResource;
|
||||
@@ -16,6 +15,5 @@ public final class Binnie {
|
||||
public static ManagerGenetics Genetics = new ManagerGenetics();
|
||||
public static ManagerLiquid Liquid = new ManagerLiquid();
|
||||
public static ManagerMachine Machine = new ManagerMachine();
|
||||
public static ManagerItem Item = new ManagerItem();
|
||||
public static ManagerResource Resource = new ManagerResource();
|
||||
}
|
||||
@@ -64,32 +64,37 @@ public class Botany extends AbstractMod {
|
||||
@SidedProxy(clientSide = "binnie.botany.proxy.ProxyClient", serverSide = "binnie.botany.proxy.ProxyServer")
|
||||
public static Proxy proxy;
|
||||
|
||||
// Genetics module
|
||||
public static BlockFlower flower;
|
||||
public static Item seed;
|
||||
|
||||
public static ItemFlower flowerItem;
|
||||
public static Item pollen;
|
||||
public static Item seed;
|
||||
public static ItemDictionary database;
|
||||
|
||||
// Gardening module
|
||||
public static BlockPlant plant;
|
||||
public static ItemTrowel trowelWood;
|
||||
public static ItemTrowel trowelStone;
|
||||
public static ItemTrowel trowelIron;
|
||||
public static ItemTrowel trowelDiamond;
|
||||
public static ItemTrowel trowelGold;
|
||||
public static BlockSoil soil;
|
||||
public static BlockSoil loam;
|
||||
public static BlockSoil flowerbed;
|
||||
public static BlockSoil soilNoWeed;
|
||||
public static BlockSoil loamNoWeed;
|
||||
public static BlockSoil flowerbedNoWeed;
|
||||
public static ItemInsulatedTube insulatedTube;
|
||||
public static BlockCeramic ceramic;
|
||||
public static BlockStained stained;
|
||||
public static BlockCeramicPatterned ceramicTile;
|
||||
public static BlockCeramicBrick ceramicBrick;
|
||||
|
||||
public static ItemSoilMeter soilMeter;
|
||||
public static ItemInsulatedTube insulatedTube;
|
||||
public static ItemTrowel trowelWood;
|
||||
public static ItemTrowel trowelStone;
|
||||
public static ItemTrowel trowelIron;
|
||||
public static ItemTrowel trowelDiamond;
|
||||
public static ItemTrowel trowelGold;
|
||||
public static ItemMisc misc;
|
||||
public static ItemFlower flowerItem;
|
||||
public static ItemPigment pigment;
|
||||
public static ItemClay clay;
|
||||
public static BlockCeramic ceramic;
|
||||
public static BlockCeramicPatterned ceramicTile;
|
||||
public static BlockStained stained;
|
||||
public static BlockCeramicBrick ceramicBrick;
|
||||
|
||||
public Botany() {
|
||||
Botany.instance = this;
|
||||
@@ -266,7 +271,7 @@ public class Botany extends AbstractMod {
|
||||
EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
|
||||
int next = Math
|
||||
.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.values()[next])
|
||||
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.VALUES[next])
|
||||
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||
heldItem.stackSize--;
|
||||
@@ -279,7 +284,7 @@ public class Botany extends AbstractMod {
|
||||
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||
int next = Math
|
||||
.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next])
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.VALUES[next])
|
||||
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem2 = event.entityPlayer.getHeldItem();
|
||||
heldItem2.stackSize--;
|
||||
@@ -292,7 +297,7 @@ public class Botany extends AbstractMod {
|
||||
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||
int next = Math
|
||||
.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next])
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.VALUES[next])
|
||||
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem3 = event.entityPlayer.getHeldItem();
|
||||
heldItem3.stackSize--;
|
||||
|
||||
@@ -6,6 +6,11 @@ public enum EnumAcidity {
|
||||
NEUTRAL,
|
||||
ALKALINE;
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumAcidity[] VALUES = values();
|
||||
|
||||
public String getID() {
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ public enum EnumFlowerChromosome implements IChromosomeType {
|
||||
SAPPINESS(IAlleleFloat.class),
|
||||
STEM(IAlleleInteger.class);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumFlowerChromosome[] VALUES = values();
|
||||
private final Class<? extends IAllele> cls;
|
||||
|
||||
EnumFlowerChromosome(Class<? extends IAllele> cls) {
|
||||
|
||||
@@ -6,6 +6,11 @@ public enum EnumMoisture {
|
||||
NORMAL,
|
||||
DAMP;
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumMoisture[] VALUES = values();
|
||||
|
||||
public String getID() {
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@ public enum EnumSoilType {
|
||||
LOAM,
|
||||
FLOWERBED;
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumSoilType[] VALUES = values();
|
||||
|
||||
public String getID() {
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemList) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,12 +102,12 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> itemList) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
BlockType type = new BlockType(c, c, TileType.Tile);
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, type.ordinal()));
|
||||
}
|
||||
|
||||
for (TileType type2 : TileType.values()) {
|
||||
for (TileType type2 : TileType.VALUES) {
|
||||
if (type2.canDouble()) {
|
||||
itemList.add(new BlockType(EnumFlowerColor.BROWN, EnumFlowerColor.GOLD, type2).getStack(1));
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (TileType type : TileType.values()) {
|
||||
for (TileType type : TileType.VALUES) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
type.icons[i] = Botany.proxy.getIcon(register, "ceramic." + type.id + "." + i);
|
||||
}
|
||||
@@ -205,6 +205,10 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
VerticalStripeBrick("verticalbrickstripe", "verticalStripedCeramicBricks"),
|
||||
VerticalLargeBrick("verticalbricklarge", "largeVerticalCeramicBricks");
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final TileType[] VALUES = values();
|
||||
private final String id;
|
||||
private final String name;
|
||||
private final IIcon[] icons;
|
||||
@@ -216,7 +220,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
public static TileType get(int id) {
|
||||
return values()[id % values().length];
|
||||
return VALUES[id % VALUES.length];
|
||||
}
|
||||
|
||||
public boolean canDouble() {
|
||||
|
||||
@@ -124,7 +124,7 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> itemList) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CeramicColor implements IDesignMaterial {
|
||||
|
||||
static {
|
||||
CeramicColor.map = new LinkedHashMap<>();
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
CeramicColor.map.put(c, new CeramicColor(c));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CeramicDesignSystem implements IDesignSystem {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (EnumPattern pattern : EnumPattern.values()) {
|
||||
for (EnumPattern pattern : EnumPattern.VALUES) {
|
||||
primary.put(
|
||||
pattern.ordinal(),
|
||||
BinnieCore.proxy.getIcon(
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CeramicTileRecipe implements IRecipe {
|
||||
}
|
||||
}
|
||||
|
||||
for (BlockCeramicBrick.TileType type : BlockCeramicBrick.TileType.values()) {
|
||||
for (BlockCeramicBrick.TileType type : BlockCeramicBrick.TileType.VALUES) {
|
||||
ItemStack stack2 = type.getRecipe(stacks);
|
||||
if (stack2 != null) {
|
||||
return stack2;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
}
|
||||
};
|
||||
List<IFlowerColor> colors = new ArrayList<>();
|
||||
Collections.addAll(colors, EnumFlowerColor.values());
|
||||
Collections.addAll(colors, EnumFlowerColor.VALUES);
|
||||
listBox.setOptions(colors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class GardenLogic extends FarmLogic {
|
||||
if (pH.ordinal() < acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAlkaline();
|
||||
if (stack != null && soil
|
||||
.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
.setPH(world, position.x, position.y, position.z, EnumAcidity.VALUES[pH.ordinal() + 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
continue;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class GardenLogic extends FarmLogic {
|
||||
if (pH.ordinal() > acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAcid();
|
||||
if (stack != null && soil
|
||||
.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
.setPH(world, position.x, position.y, position.z, EnumAcidity.VALUES[pH.ordinal() - 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class BlockFlower extends BlockContainer {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (EnumFlowerType type : EnumFlowerType.values()) {
|
||||
for (EnumFlowerType type : EnumFlowerType.VALUES) {
|
||||
type.registerIcons(register);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -39,6 +41,8 @@ public abstract class ItemBotany extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName(name);
|
||||
hasSubtypes = true;
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -25,6 +27,8 @@ public class ItemInsulatedTube extends Item {
|
||||
setUnlocalizedName("insulatedTube");
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setHasSubtypes(true);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
public static ItemStack getInsulateStack(ItemStack stack) {
|
||||
|
||||
@@ -81,8 +81,8 @@ public class BlockSoil extends Block implements IBlockSoil {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (EnumMoisture moisture : EnumMoisture.values()) {
|
||||
for (EnumAcidity pH : EnumAcidity.values()) {
|
||||
for (EnumMoisture moisture : EnumMoisture.VALUES) {
|
||||
for (EnumAcidity pH : EnumAcidity.VALUES) {
|
||||
int index = moisture.ordinal() + pH.ordinal() * 3;
|
||||
String id = "soil/" + getType().getID() + "." + pH.getID() + "." + moisture.getID();
|
||||
iconsTop[index] = Botany.proxy.getIcon(register, id + ".0");
|
||||
@@ -104,8 +104,8 @@ public class BlockSoil extends Block implements IBlockSoil {
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
EnumMoisture moisture = EnumMoisture.values()[meta % 3];
|
||||
EnumAcidity acidity = EnumAcidity.values()[meta / 3];
|
||||
EnumMoisture moisture = EnumMoisture.VALUES[meta % 3];
|
||||
EnumAcidity acidity = EnumAcidity.VALUES[meta / 3];
|
||||
EnumMoisture desiredMoisture = Gardening.getNaturalMoisture(world, x, y, z);
|
||||
if (desiredMoisture.ordinal() > moisture.ordinal()) {
|
||||
moisture = ((moisture == EnumMoisture.DRY) ? EnumMoisture.NORMAL : EnumMoisture.DAMP);
|
||||
@@ -141,12 +141,12 @@ public class BlockSoil extends Block implements IBlockSoil {
|
||||
|
||||
@Override
|
||||
public EnumAcidity getPH(World world, int x, int y, int z) {
|
||||
return EnumAcidity.values()[world.getBlockMetadata(x, y, z) / 3];
|
||||
return EnumAcidity.VALUES[world.getBlockMetadata(x, y, z) / 3];
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumMoisture getMoisture(World world, int x, int y, int z) {
|
||||
return EnumMoisture.values()[world.getBlockMetadata(x, y, z) % 3];
|
||||
return EnumMoisture.VALUES[world.getBlockMetadata(x, y, z) % 3];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -233,8 +233,8 @@ public class Gardening {
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
|
||||
return canTolerate(
|
||||
flower,
|
||||
EnumAcidity.values()[soilMeta / 3 % 3],
|
||||
EnumMoisture.values()[soilMeta % 3],
|
||||
EnumAcidity.VALUES[soilMeta / 3 % 3],
|
||||
EnumMoisture.VALUES[soilMeta % 3],
|
||||
EnumTemperature.getFromValue(biome.temperature));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ public class ItemSoil extends ItemBlock {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
EnumMoisture moisture = EnumMoisture.values()[stack.getItemDamage() % 3];
|
||||
EnumAcidity acidity = EnumAcidity.values()[stack.getItemDamage() / 3];
|
||||
EnumMoisture moisture = EnumMoisture.VALUES[stack.getItemDamage() % 3];
|
||||
EnumAcidity acidity = EnumAcidity.VALUES[stack.getItemDamage() / 3];
|
||||
String info = "";
|
||||
|
||||
if (moisture == EnumMoisture.DRY) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -28,6 +30,8 @@ public class ItemSoilMeter extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("soilMeter");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -28,6 +30,8 @@ public class ItemTrowel extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("trowel" + material);
|
||||
locName = "trowel" + material;
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
@@ -37,6 +36,7 @@ import binnie.core.block.ItemMetadata;
|
||||
import binnie.core.block.ItemMetadataRenderer;
|
||||
import binnie.core.block.MultipassItemRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ModuleGardening implements IInitializable {
|
||||
@@ -75,7 +75,7 @@ public class ModuleGardening implements IInitializable {
|
||||
Botany.trowelIron = new ItemTrowel(Item.ToolMaterial.IRON, "Iron");
|
||||
Botany.trowelDiamond = new ItemTrowel(Item.ToolMaterial.EMERALD, "Diamond");
|
||||
Botany.trowelGold = new ItemTrowel(Item.ToolMaterial.GOLD, "Gold");
|
||||
Botany.misc = Binnie.Item.registerMiscItems(BotanyItems.values(), CreativeTabBotany.instance);
|
||||
Botany.misc = new ItemMisc(CreativeTabBotany.instance, BotanyItems.values());
|
||||
Botany.pigment = new ItemPigment();
|
||||
Botany.clay = new ItemClay();
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ModuleGardening implements IInitializable {
|
||||
|
||||
for (boolean manual : new boolean[] { true, false }) {
|
||||
for (boolean fertilised : new boolean[] { true, false }) {
|
||||
for (EnumMoisture moist : EnumMoisture.values()) {
|
||||
for (EnumMoisture moist : EnumMoisture.VALUES) {
|
||||
ItemStack icon = (moist == EnumMoisture.DRY) ? yellow
|
||||
: ((moist == EnumMoisture.NORMAL) ? red : blue);
|
||||
int insulate = 2 - moist.ordinal();
|
||||
@@ -258,7 +258,7 @@ public class ModuleGardening implements IInitializable {
|
||||
GameRegistry
|
||||
.addRecipe(BotanyItems.Mortar.get(6), " c ", "cgc", " c ", 'c', Items.clay_ball, 'g', Blocks.gravel);
|
||||
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
|
||||
ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
|
||||
GameRegistry.addShapelessRecipe(clay, Items.clay_ball, Items.clay_ball, Items.clay_ball, pigment);
|
||||
@@ -276,9 +276,9 @@ public class ModuleGardening implements IInitializable {
|
||||
return null;
|
||||
}
|
||||
return new ItemStack(
|
||||
Gardening.getSoilBlock(EnumSoilType.values()[type]),
|
||||
Gardening.getSoilBlock(EnumSoilType.VALUES[type]),
|
||||
1,
|
||||
BlockSoil.getMeta(EnumAcidity.values()[pH], EnumMoisture.values()[moisture]));
|
||||
BlockSoil.getMeta(EnumAcidity.VALUES[pH], EnumMoisture.VALUES[moisture]));
|
||||
}
|
||||
|
||||
private void addAcidFertiliser(ItemStack stack, int strengthMax) {
|
||||
|
||||
@@ -92,7 +92,10 @@ public enum EnumFlowerColor implements IFlowerColor {
|
||||
YELLOW("yellow", 0xffff00),
|
||||
YELLOW_GREEN("yellowGreen", 0x9acd32);
|
||||
|
||||
private static final EnumFlowerColor[] ALL_VALUES = values();
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumFlowerColor[] VALUES = values();
|
||||
private final int color;
|
||||
private final int colorDis;
|
||||
private final String name;
|
||||
@@ -2964,7 +2967,7 @@ public enum EnumFlowerColor implements IFlowerColor {
|
||||
}
|
||||
|
||||
public static EnumFlowerColor get(int i) {
|
||||
return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
|
||||
return VALUES[Math.max(0, i) % VALUES.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,6 +57,10 @@ public enum EnumFlowerType implements IFlowerType {
|
||||
DELPHINIUM(2),
|
||||
HOLLYHOCK(2);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumFlowerType[] VALUES = values();
|
||||
private final int sections;
|
||||
private final IIcon[] stem;
|
||||
private final IIcon[] petal;
|
||||
|
||||
@@ -232,7 +232,7 @@ public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
|
||||
|
||||
@Override
|
||||
public IChromosomeType[] getKaryotype() {
|
||||
return EnumFlowerChromosome.values();
|
||||
return EnumFlowerChromosome.VALUES;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -496,7 +496,7 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return EnumHumidity.values()[getMoisture().ordinal()];
|
||||
return EnumHumidity.VALUES[getMoisture().ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,7 @@ import forestry.core.genetics.alleles.EnumAllele;
|
||||
public class FlowerTemplates {
|
||||
|
||||
public static IAllele[] getDefaultTemplate() {
|
||||
IAllele[] alleles = new IAllele[EnumFlowerChromosome.values().length];
|
||||
IAllele[] alleles = new IAllele[EnumFlowerChromosome.VALUES.length];
|
||||
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
||||
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||
alleles[EnumFlowerChromosome.SECONDARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -25,6 +27,8 @@ public class ItemDictionary extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("database");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.VALUES) {
|
||||
AlleleManager.alleleRegistry.registerAllele(color.getAllele());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -22,6 +24,8 @@ public class ItemClay extends Item {
|
||||
setUnlocalizedName("clay");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +49,7 @@ public class ItemClay extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
list.add(new ItemStack(this, 1, c.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -22,6 +24,8 @@ public class ItemPigment extends Item {
|
||||
setUnlocalizedName("pigment");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +49,7 @@ public class ItemPigment extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
|
||||
list.add(new ItemStack(this, 1, c.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ public class MessageFlowerUpdate extends MessageCoordinates {
|
||||
public void readData(ByteBuf data) throws IOException {
|
||||
super.readData(data);
|
||||
render = new TileEntityFlower.RenderInfo();
|
||||
render.primary = EnumFlowerColor.values()[data.readByte()];
|
||||
render.secondary = EnumFlowerColor.values()[data.readByte()];
|
||||
render.stem = EnumFlowerColor.values()[data.readByte()];
|
||||
render.type = EnumFlowerType.values()[data.readByte()];
|
||||
render.primary = EnumFlowerColor.get(data.readByte());
|
||||
render.secondary = EnumFlowerColor.get(data.readByte());
|
||||
render.stem = EnumFlowerColor.get(data.readByte());
|
||||
render.type = EnumFlowerType.VALUES[data.readByte()];
|
||||
render.age = data.readByte();
|
||||
render.section = data.readByte();
|
||||
render.wilted = data.readBoolean();
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package binnie.core;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.mod.parser.FieldParser;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.network.IPacketID;
|
||||
import binnie.core.network.IPacketProvider;
|
||||
@@ -20,11 +16,9 @@ import cpw.mods.fml.relauncher.Side;
|
||||
public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
|
||||
private SimpleNetworkWrapper wrapper;
|
||||
private final LinkedHashSet<Field> fields;
|
||||
protected final List<IInitializable> modules;
|
||||
|
||||
public AbstractMod() {
|
||||
fields = new LinkedHashSet<>();
|
||||
modules = new ArrayList<>();
|
||||
BinnieCore.registerMod(this);
|
||||
}
|
||||
@@ -65,22 +59,6 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
for (IInitializable module : modules) {
|
||||
module.preInit();
|
||||
}
|
||||
|
||||
// TODO what does it mean?
|
||||
Collections.addAll(fields, getClass().getFields());
|
||||
for (Class<?> cls : getClass().getClasses()) {
|
||||
Collections.addAll(fields, getClass().getFields());
|
||||
}
|
||||
for (IInitializable module : modules) {
|
||||
Collections.addAll(fields, module.getClass().getFields());
|
||||
}
|
||||
for (Field field4 : fields) {
|
||||
try {
|
||||
FieldParser.preInitParse(field4, this);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,14 +74,6 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
for (IInitializable module : modules) {
|
||||
module.init();
|
||||
}
|
||||
|
||||
for (Field field : fields) {
|
||||
try {
|
||||
FieldParser.initParse(field, this);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,14 +86,6 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
for (IInitializable module : modules) {
|
||||
module.postInit();
|
||||
}
|
||||
|
||||
for (Field field : fields) {
|
||||
try {
|
||||
FieldParser.postInitParse(field, this);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void addModule(IInitializable init) {
|
||||
|
||||
@@ -22,8 +22,6 @@ import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.ItemFluidContainer;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.core.machines.storage.ModuleStorage;
|
||||
import binnie.core.mod.parser.FieldParser;
|
||||
import binnie.core.mod.parser.ItemParser;
|
||||
import binnie.core.network.BinnieCorePacketID;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.network.IPacketID;
|
||||
@@ -110,7 +108,6 @@ public class BinnieCore extends AbstractMod {
|
||||
Item item = new ItemFluidContainer(container);
|
||||
GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
|
||||
}
|
||||
FieldParser.parsers.add(new ItemParser());
|
||||
super.preInit();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ public enum EnumColor {
|
||||
Yellow("Yellow", 16777045, 'e'),
|
||||
White("White", 16777215, 'f');
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumColor[] VALUES = values();
|
||||
private final int colour;
|
||||
private final String name;
|
||||
private final char code;
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.minecraft.InventoryType;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.network.packet.MessageCraftGUI;
|
||||
|
||||
public class ControlPlayerInventory extends Control {
|
||||
@@ -24,19 +25,21 @@ public class ControlPlayerInventory extends Control {
|
||||
slots = new ArrayList<>();
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
for (int column = 0; column < 9; ++column) {
|
||||
ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18);
|
||||
ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18)
|
||||
.setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
slots.add(slot);
|
||||
}
|
||||
}
|
||||
|
||||
if (wide) {
|
||||
for (int i1 = 0; i1 < 9; ++i1) {
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18);
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18)
|
||||
.setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
slots.add(slot2);
|
||||
}
|
||||
} else {
|
||||
for (int i1 = 0; i1 < 9; ++i1) {
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 * 18, 58.0f);
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 * 18, 58.0f).setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
slots.add(slot2);
|
||||
}
|
||||
}
|
||||
@@ -51,7 +54,8 @@ public class ControlPlayerInventory extends Control {
|
||||
slots = new ArrayList<>();
|
||||
for (int row = 0; row < 6; ++row) {
|
||||
for (int column = 0; column < 6; ++column) {
|
||||
ControlSlot slot = new ControlSlot(this, column * 18, row * 18);
|
||||
ControlSlot slot = new ControlSlot(this, column * 18, row * 18)
|
||||
.setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
slots.add(slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +49,12 @@ public class ControlSlot extends ControlSlotBase {
|
||||
}
|
||||
|
||||
public Slot slot;
|
||||
private CraftGUITexture slotTexture;
|
||||
|
||||
public ControlSlot(IWidget parent, float x, float y) {
|
||||
super(parent, x, y);
|
||||
slot = null;
|
||||
slotTexture = CraftGUITexture.Slot;
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
|
||||
@Override
|
||||
@@ -80,11 +82,17 @@ public class ControlSlot extends ControlSlotBase {
|
||||
public ControlSlot(IWidget parent, int x, int y, Slot slot) {
|
||||
super(parent, x, y);
|
||||
this.slot = slot;
|
||||
slotTexture = CraftGUITexture.Slot;
|
||||
}
|
||||
|
||||
public ControlSlot setSlotTexture(CraftGUITexture texture) {
|
||||
slotTexture = texture == null ? CraftGUITexture.Slot : texture;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
CraftGUI.render.texture(slotTexture, IPoint.ZERO);
|
||||
if (slot == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public enum CraftGUITexture {
|
||||
Button("button"),
|
||||
ButtonHighlighted("button.highlighted"),
|
||||
Slot("slot"),
|
||||
SlotInventory("slot.inventory"),
|
||||
SlotBorder("slot.border"),
|
||||
SlotOverlay("slot.overlay"),
|
||||
SlotCharge("slot.charge"),
|
||||
|
||||
@@ -113,7 +113,7 @@ class FlowerBreedingSystem extends BreedingSystem {
|
||||
case PRIMARY:
|
||||
case SECONDARY:
|
||||
case STEM:
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.VALUES) {
|
||||
alleles.add(color.getAllele());
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -25,6 +27,8 @@ public class ItemGenesis extends Item {
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("genesis");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -16,11 +18,13 @@ public class ItemMisc extends Item {
|
||||
|
||||
private final IItemMisc[] items;
|
||||
|
||||
protected ItemMisc(CreativeTabs tab, IItemMisc[] items2) {
|
||||
public ItemMisc(CreativeTabs tab, IItemMisc[] items) {
|
||||
setCreativeTab(tab);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName("misc");
|
||||
items = items2;
|
||||
this.items = items;
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
||||
public class ManagerItem {
|
||||
|
||||
public ItemMisc registerMiscItems(IItemMisc[] items, CreativeTabs tab) {
|
||||
return new ItemMisc(tab, items);
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,11 @@ public abstract class MachinePackage {
|
||||
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID());
|
||||
}
|
||||
|
||||
public String getGuiDisplayName() {
|
||||
String guiKey = group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID() + ".title";
|
||||
return I18N.canLocalise(guiKey) ? I18N.localise(guiKey) : getDisplayName();
|
||||
}
|
||||
|
||||
public Integer getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.machines.inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
@@ -16,10 +15,13 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import binnie.core.machines.IMachine;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
|
||||
|
||||
public class ComponentInventorySlots extends ComponentInventory implements IInventoryMachine, IInventorySlots {
|
||||
|
||||
private final Map<Integer, InventorySlot> inventory = new LinkedHashMap<>();
|
||||
private final Int2ObjectLinkedOpenHashMap<InventorySlot> inventory = new Int2ObjectLinkedOpenHashMap<>();
|
||||
private int cachedSize = 0;
|
||||
private int[] cachedAccessibleSlots = null;
|
||||
|
||||
public ComponentInventorySlots(IMachine machine) {
|
||||
super(machine);
|
||||
@@ -27,25 +29,20 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
int size = 0;
|
||||
for (Integer index : inventory.keySet()) {
|
||||
size = Math.max(size, index + 1);
|
||||
}
|
||||
return size;
|
||||
return cachedSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int index) {
|
||||
if (inventory.containsKey(index)) {
|
||||
return inventory.get(index).getContent();
|
||||
}
|
||||
return null;
|
||||
InventorySlot slot = inventory.get(index);
|
||||
return slot != null ? slot.getContent() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int amount) {
|
||||
if (inventory.containsKey(index)) {
|
||||
ItemStack stack = inventory.get(index).decrStackSize(amount);
|
||||
InventorySlot slot = inventory.get(index);
|
||||
if (slot != null) {
|
||||
ItemStack stack = slot.decrStackSize(amount);
|
||||
markDirty();
|
||||
return stack;
|
||||
}
|
||||
@@ -59,8 +56,9 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int index, ItemStack itemStack) {
|
||||
if (inventory.containsKey(index) && (itemStack == null || inventory.get(index).isValid(itemStack))) {
|
||||
inventory.get(index).setContent(itemStack);
|
||||
InventorySlot slot = inventory.get(index);
|
||||
if (slot != null && (itemStack == null || slot.isValid(itemStack))) {
|
||||
slot.setContent(itemStack);
|
||||
}
|
||||
markDirty();
|
||||
}
|
||||
@@ -113,7 +111,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
NBTTagList inventoryNBT = new NBTTagList();
|
||||
for (Map.Entry<Integer, InventorySlot> entry : inventory.entrySet()) {
|
||||
for (Map.Entry<Integer, InventorySlot> entry : inventory.int2ObjectEntrySet()) {
|
||||
NBTTagCompound slotNBT = new NBTTagCompound();
|
||||
slotNBT.setInteger("id", entry.getKey());
|
||||
entry.getValue().writeToNBT(slotNBT);
|
||||
@@ -125,6 +123,8 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
@Override
|
||||
public InventorySlot addSlot(int index, String unlocalizedName) {
|
||||
inventory.put(index, new InventorySlot(index, unlocalizedName));
|
||||
cachedSize = Math.max(cachedSize, index + 1);
|
||||
cachedAccessibleSlots = null;
|
||||
return getSlot(index);
|
||||
}
|
||||
|
||||
@@ -138,10 +138,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public InventorySlot getSlot(int index) {
|
||||
if (inventory.containsKey(index)) {
|
||||
return inventory.get(index);
|
||||
}
|
||||
return null;
|
||||
return inventory.get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,7 +148,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public InventorySlot[] getSlots(int[] indexes) {
|
||||
List<InventorySlot> list = new ArrayList<>();
|
||||
List<InventorySlot> list = new ArrayList<>(indexes.length);
|
||||
for (int i : indexes) {
|
||||
if (getSlot(i) != null) {
|
||||
list.add(getSlot(i));
|
||||
@@ -213,18 +210,20 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int var1) {
|
||||
List<Integer> slots = new ArrayList<>();
|
||||
for (InventorySlot slot : inventory.values()) {
|
||||
if (slot.canInsert() || slot.canExtract()) {
|
||||
slots.add(slot.getIndex());
|
||||
if (cachedAccessibleSlots == null) {
|
||||
List<Integer> slots = new ArrayList<>();
|
||||
for (InventorySlot slot : inventory.values()) {
|
||||
if (slot.canInsert() || slot.canExtract()) {
|
||||
slots.add(slot.getIndex());
|
||||
}
|
||||
}
|
||||
|
||||
cachedAccessibleSlots = new int[slots.size()];
|
||||
for (int i = 0; i < slots.size(); ++i) {
|
||||
cachedAccessibleSlots[i] = slots.get(i);
|
||||
}
|
||||
}
|
||||
|
||||
int[] ids = new int[slots.size()];
|
||||
for (int i = 0; i < slots.size(); ++i) {
|
||||
ids[i] = slots.get(i);
|
||||
}
|
||||
return ids;
|
||||
return cachedAccessibleSlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -234,6 +233,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack itemstack, int direction) {
|
||||
return getSlot(slot).canExtract(ForgeDirection.getOrientation(direction));
|
||||
InventorySlot iSlot = getSlot(slot);
|
||||
return iSlot != null && iSlot.canExtract(ForgeDirection.getOrientation(direction));
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class CompartmentTab implements INBTTagable {
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
name = nbt.getString("name");
|
||||
icon = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("icon"));
|
||||
color = EnumColor.values()[nbt.getByte("color")];
|
||||
color = EnumColor.VALUES[nbt.getByte("color")];
|
||||
id = nbt.getByte("id");
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getGuiDisplayName());
|
||||
int x = 16;
|
||||
int y = 32;
|
||||
ComponentCompartmentInventory inv = Machine.getMachine(getInventory())
|
||||
@@ -320,7 +320,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
1 + cw * (cc / 8),
|
||||
cw,
|
||||
cw,
|
||||
EnumColor.values()[cc]);
|
||||
EnumColor.VALUES[cc]);
|
||||
color.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package binnie.core.mod.parser;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
|
||||
public abstract class FieldParser {
|
||||
|
||||
public static Collection<FieldParser> parsers = new ArrayList<>();
|
||||
|
||||
public abstract boolean isHandled(Field field, AbstractMod mod);
|
||||
|
||||
public void preInit(Field field, AbstractMod mod) throws IllegalArgumentException, IllegalAccessException {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void init(Field field, AbstractMod mod) throws IllegalArgumentException, IllegalAccessException {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void postInit(Field field, AbstractMod mod) throws IllegalArgumentException, IllegalAccessException {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public static void preInitParse(Field field, AbstractMod mod)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
for (FieldParser parser : FieldParser.parsers) {
|
||||
if (parser.isHandled(field, mod)) {
|
||||
parser.preInit(field, mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initParse(Field field, AbstractMod mod) throws IllegalArgumentException, IllegalAccessException {
|
||||
for (FieldParser parser : FieldParser.parsers) {
|
||||
if (parser.isHandled(field, mod)) {
|
||||
parser.init(field, mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void postInitParse(Field field, AbstractMod mod)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
for (FieldParser parser : FieldParser.parsers) {
|
||||
if (parser.isHandled(field, mod)) {
|
||||
parser.postInit(field, mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package binnie.core.mod.parser;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemParser extends FieldParser {
|
||||
|
||||
@Override
|
||||
public boolean isHandled(Field field, AbstractMod mod) {
|
||||
return Item.class.isAssignableFrom(field.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(Field field, AbstractMod mod) throws IllegalArgumentException, IllegalAccessException {
|
||||
Item item = (Item) field.get(null);
|
||||
if (item != null) {
|
||||
GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package binnie.extrabees;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
||||
@@ -11,6 +10,7 @@ import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Tags;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
@@ -18,7 +18,11 @@ import binnie.extrabees.config.EBConfig;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ModuleCore;
|
||||
import binnie.extrabees.genetics.ModuleGenetics;
|
||||
import binnie.extrabees.genetics.items.ItemDictionary;
|
||||
import binnie.extrabees.liquids.ModuleLiquids;
|
||||
import binnie.extrabees.products.ItemHoneyComb;
|
||||
import binnie.extrabees.products.ItemHoneyDrop;
|
||||
import binnie.extrabees.products.ItemPropolis;
|
||||
import binnie.extrabees.products.ModuleProducts;
|
||||
import binnie.extrabees.proxy.ExtraBeesProxy;
|
||||
import binnie.extrabees.worldgen.ModuleGeneration;
|
||||
@@ -58,11 +62,11 @@ public class ExtraBees extends AbstractMod {
|
||||
public static Block hive;
|
||||
public static Material materialBeehive;
|
||||
public static Block ectoplasm;
|
||||
public static Item comb;
|
||||
public static Item propolis;
|
||||
public static Item honeyDrop;
|
||||
public static Item dictionary;
|
||||
public static Item itemMisc;
|
||||
public static ItemHoneyComb comb;
|
||||
public static ItemPropolis propolis;
|
||||
public static ItemHoneyDrop honeyDrop;
|
||||
public static ItemDictionary dictionary;
|
||||
public static ItemMisc itemMisc;
|
||||
|
||||
public ExtraBees() {
|
||||
ExtraBees.instance = this;
|
||||
|
||||
@@ -6,14 +6,23 @@ import java.util.List;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeekeepingLogic;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.IErrorLogic;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.api.multiblock.IMultiblockComponent;
|
||||
@@ -21,7 +30,7 @@ import forestry.api.multiblock.IMultiblockController;
|
||||
import forestry.api.multiblock.IMultiblockLogicAlveary;
|
||||
import forestry.api.multiblock.MultiblockManager;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active,
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IBeeHousing, IAlvearyComponent.Active,
|
||||
IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier {
|
||||
|
||||
protected IMultiblockLogicAlveary structureLogic;
|
||||
@@ -42,11 +51,51 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
return new ChunkCoordinates(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<IBeeModifier> getBeeModifiers() {
|
||||
return getMultiblockLogic().getController().getBeeModifiers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return getMultiblockLogic().getController().getBeeListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return getMultiblockLogic().getController().getBeeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeekeepingLogic getBeekeepingLogic() {
|
||||
return getMultiblockLogic().getController().getBeekeepingLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockLightValue() {
|
||||
return getMultiblockLogic().getController().getBlockLightValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockSeeTheSky() {
|
||||
return getMultiblockLogic().getController().canBlockSeeTheSky();
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile getOwner() {
|
||||
return getMachine().getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
return getMultiblockLogic().getController().getBeeFXCoordinates();
|
||||
}
|
||||
|
||||
public List<TileEntity> getAlvearyBlocks() {
|
||||
LinkedList<TileEntity> tiles = new LinkedList<>();
|
||||
if (min == null || max == null) {
|
||||
@@ -226,6 +275,26 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
return getMultiblockLogic().getController().getBiome();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return getMultiblockLogic().getController().getTemperature();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return getMultiblockLogic().getController().getHumidity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IErrorLogic getErrorLogic() {
|
||||
return getMultiblockLogic().getController().getErrorLogic();
|
||||
}
|
||||
|
||||
// TODO why its commented?
|
||||
// boolean init;
|
||||
// //IStructureLogic structureLogic;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
@@ -9,7 +9,7 @@ public class ModuleCore implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraBees.itemMisc = Binnie.Item.registerMiscItems(ExtraBeeItems.values(), Tabs.tabApiculture);
|
||||
ExtraBees.itemMisc = new ItemMisc(Tabs.tabApiculture, ExtraBeeItems.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extrabees.genetics.items;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -25,6 +27,8 @@ public class ItemDictionary extends Item {
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("dictionary");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,6 @@ import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.network.packet.MessageCraftGUI;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -35,7 +34,7 @@ public class WindowAlvearyFrame extends Window {
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.frame"));
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
playerInventory = new ControlPlayerInventory(this).create(actions);
|
||||
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, 0);
|
||||
|
||||
@@ -12,7 +12,6 @@ import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.network.packet.MessageCraftGUI;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.hatchery.AlvearyHatchery;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -37,7 +36,7 @@ public class WindowAlvearyHatchery extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.hatchery"));
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
playerInventory = new ControlPlayerInventory(this).create(actions);
|
||||
new ControlSlotArray(this, 43, 30, 5, 1).create(actions, InventoryType.Machine, AlvearyHatchery.SLOT_LARVAE);
|
||||
MessageCraftGUI.sendToServer(actions);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class WindowAlvearyMutator extends Window {
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.mutator"));
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
playerInventory = new ControlPlayerInventory(this).create(actions);
|
||||
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, AlvearyMutator.SLOT_MUTATOR);
|
||||
new ControlText(
|
||||
|
||||
@@ -14,7 +14,6 @@ import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.network.packet.MessageCraftGUI;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.stimulator.AlvearyStimulator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -39,7 +38,7 @@ public class WindowAlvearyStimulator extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.stimulator"));
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
playerInventory = new ControlPlayerInventory(this).create(actions);
|
||||
new ControlSlot(this, 41.0f, 28.0f).assign(actions, InventoryType.Machine, AlvearyStimulator.SLOT_CIRCUIT);
|
||||
new ControlEnergyBar(this, 75, 29, 60, 16, Position.LEFT);
|
||||
|
||||
@@ -54,9 +54,9 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
if (isHumidity) {
|
||||
tooltip.add(EnumHumidity.values()[type].name);
|
||||
tooltip.add(EnumHumidity.VALUES[type].name);
|
||||
} else {
|
||||
tooltip.add(EnumTemperature.values()[type + 1].name);
|
||||
tooltip.add(EnumTemperature.VALUES[type + 1].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,10 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
CYANITE(new Color(0x27204d), new Color(0x86ed)),
|
||||
BLUTONIUM(new Color(0x27204d), new Color(0x1b00e6));
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumHoneyComb[] VALUES = values();
|
||||
public final Map<ItemStack, Float> products;
|
||||
public final int primaryColor;
|
||||
public final int secondaryColor;
|
||||
@@ -117,10 +121,10 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
|
||||
public static EnumHoneyComb get(ItemStack itemStack) {
|
||||
int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
if (i >= 0 && i < VALUES.length) {
|
||||
return VALUES[i];
|
||||
}
|
||||
return values()[0];
|
||||
return VALUES[0];
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
|
||||
@@ -44,6 +44,10 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
MAGENTA(new Color(0xe57fd8), new Color(0xff00cc), "for.honey"),
|
||||
LIGHTGRAY(new Color(0x999999), new Color(0xc9c9c9), "for.honey");
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumHoneyDrop[] VALUES = values();
|
||||
public final int primaryColor;
|
||||
public final int secondaryColor;
|
||||
|
||||
@@ -58,10 +62,10 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
|
||||
public static EnumHoneyDrop get(ItemStack itemStack) {
|
||||
int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
if (i >= 0 && i < VALUES.length) {
|
||||
return VALUES[i];
|
||||
}
|
||||
return values()[0];
|
||||
return VALUES[0];
|
||||
}
|
||||
|
||||
public void addRemenant(ItemStack stack) {
|
||||
|
||||
@@ -24,6 +24,10 @@ public enum EnumPropolis implements IItemEnum {
|
||||
// GLACIAL,
|
||||
// PEAT
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumPropolis[] VALUES = values();
|
||||
public final int secondaryColor;
|
||||
public final int primaryColor;
|
||||
public final String liquidName;
|
||||
@@ -36,10 +40,10 @@ public enum EnumPropolis implements IItemEnum {
|
||||
|
||||
public static EnumPropolis get(ItemStack itemStack) {
|
||||
int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
if (i >= 0 && i < VALUES.length) {
|
||||
return VALUES[i];
|
||||
}
|
||||
return values()[0];
|
||||
return VALUES[0];
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
|
||||
@@ -21,9 +21,8 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
protected IIcon icon2;
|
||||
|
||||
public ItemHoneyComb() {
|
||||
super(EnumHoneyComb.values());
|
||||
super("honeyComb", EnumHoneyComb.VALUES);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyComb");
|
||||
}
|
||||
|
||||
public static void addSubtypes() {
|
||||
@@ -149,7 +148,9 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(Mods.ic2.stack("itemCofeePowder"), 0.75f);
|
||||
if (!OreDictionary.getOres("dustCoffee").isEmpty()) {
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(OreDictionary.getOres("dustCoffee").get(0), 0.75f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
EnumHoneyComb.GLACIAL.addProduct(honeyDrop, 0.75f);
|
||||
@@ -232,15 +233,15 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
OreDictionary.registerOre("beeComb", new ItemStack(ExtraBees.comb, 1, 32767));
|
||||
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
EnumHoneyComb type = EnumHoneyComb.VALUES[EnumHoneyComb.RED.ordinal() + i];
|
||||
if (type != EnumHoneyComb.RED) {
|
||||
type.copyProducts(EnumHoneyComb.RED);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
EnumHoneyDrop drop = EnumHoneyDrop.values()[EnumHoneyDrop.RED.ordinal() + i];
|
||||
EnumHoneyComb type = EnumHoneyComb.VALUES[EnumHoneyComb.RED.ordinal() + i];
|
||||
EnumHoneyDrop drop = EnumHoneyDrop.VALUES[EnumHoneyDrop.RED.ordinal() + i];
|
||||
int[] dyeC = { 1, 11, 4, 2, 0, 15, 3, 14, 6, 5, 8, 12, 9, 10, 13, 7 };
|
||||
int k = dyeC[i];
|
||||
ItemStack dye = switch (k) {
|
||||
|
||||
@@ -15,9 +15,8 @@ public class ItemHoneyDrop extends ItemProduct {
|
||||
protected IIcon icon2;
|
||||
|
||||
public ItemHoneyDrop() {
|
||||
super(EnumHoneyDrop.values());
|
||||
super("honeyDrop", EnumHoneyDrop.VALUES);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyDrop");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -12,11 +14,14 @@ public class ItemProduct extends Item {
|
||||
|
||||
protected IItemEnum[] types;
|
||||
|
||||
public ItemProduct(IItemEnum[] types) {
|
||||
public ItemProduct(String name, IItemEnum[] types) {
|
||||
this.types = types;
|
||||
setMaxStackSize(64);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName(name);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
public IItemEnum get(ItemStack stack) {
|
||||
|
||||
@@ -11,9 +11,8 @@ import forestry.api.core.Tabs;
|
||||
public class ItemPropolis extends ItemProduct {
|
||||
|
||||
public ItemPropolis() {
|
||||
super(EnumPropolis.values());
|
||||
super("propolis", EnumPropolis.VALUES);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("propolis");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,13 +25,13 @@ public class ModuleProducts implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
for (EnumHoneyComb info : EnumHoneyComb.VALUES) {
|
||||
info.addRecipe();
|
||||
}
|
||||
for (EnumHoneyDrop info2 : EnumHoneyDrop.values()) {
|
||||
for (EnumHoneyDrop info2 : EnumHoneyDrop.VALUES) {
|
||||
info2.addRecipe();
|
||||
}
|
||||
for (EnumPropolis info3 : EnumPropolis.values()) {
|
||||
for (EnumPropolis info3 : EnumPropolis.VALUES) {
|
||||
info3.addRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class BlockExtraBeeHive extends Block {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if (metadata >= EnumHiveType.values().length) {
|
||||
if (metadata >= EnumHiveType.VALUES.length) {
|
||||
return null;
|
||||
}
|
||||
if (side < 2) {
|
||||
@@ -56,8 +56,8 @@ public class BlockExtraBeeHive extends Block {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[EnumHiveType.values().length][2];
|
||||
for (EnumHiveType hive : EnumHiveType.values()) {
|
||||
icons = new IIcon[EnumHiveType.VALUES.length][2];
|
||||
for (EnumHiveType hive : EnumHiveType.VALUES) {
|
||||
icons[hive.ordinal()][0] = ExtraBees.proxy
|
||||
.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".0");
|
||||
icons[hive.ordinal()][1] = ExtraBees.proxy
|
||||
@@ -68,7 +68,7 @@ public class BlockExtraBeeHive extends Block {
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
List<IHiveDrop> dropList = EnumHiveType.values()[metadata].drops;
|
||||
List<IHiveDrop> dropList = EnumHiveType.VALUES[metadata].drops;
|
||||
Collections.shuffle(dropList);
|
||||
int tries = 0;
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ public enum EnumHiveType {
|
||||
NETHER,
|
||||
MARBLE;
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumHiveType[] VALUES = values();
|
||||
public final List<IHiveDrop> drops;
|
||||
|
||||
EnumHiveType() {
|
||||
|
||||
@@ -4,7 +4,6 @@ import static binnie.extratrees.ExtraTrees.EB_MOD_NAME;
|
||||
import static binnie.extratrees.ExtraTrees.ET_MODID;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
||||
@@ -13,6 +12,7 @@ import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Tags;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
@@ -26,6 +26,10 @@ import binnie.extratrees.config.ETConfig;
|
||||
import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import binnie.extratrees.core.ModuleCore;
|
||||
import binnie.extratrees.genetics.ModuleGenetics;
|
||||
import binnie.extratrees.item.ItemDictionary;
|
||||
import binnie.extratrees.item.ItemFood;
|
||||
import binnie.extratrees.item.ItemHammer;
|
||||
import binnie.extratrees.item.ItemMothDatabase;
|
||||
import binnie.extratrees.item.ModuleItems;
|
||||
import binnie.extratrees.machines.ModuleMachine;
|
||||
import binnie.extratrees.nei.IMCForNEI;
|
||||
@@ -61,10 +65,13 @@ public class ExtraTrees extends AbstractMod {
|
||||
}
|
||||
}
|
||||
|
||||
public static Item itemDictionary;
|
||||
public static Item itemDictionaryLepi;
|
||||
public static Item itemMisc;
|
||||
public static Item itemFood;
|
||||
public static ItemDictionary itemDictionary;
|
||||
public static ItemMothDatabase itemDictionaryLepi;
|
||||
public static ItemMisc itemMisc;
|
||||
public static ItemFood itemFood;
|
||||
public static ItemHammer itemHammer;
|
||||
public static ItemHammer itemDurableHammer;
|
||||
|
||||
public static Block blockStairs;
|
||||
public static Block blockLog;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
@@ -75,13 +82,12 @@ public class ExtraTrees extends AbstractMod {
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static Block blockSlab;
|
||||
public static Block blockDoubleSlab;
|
||||
public static Item itemHammer;
|
||||
public static Item itemDurableHammer;
|
||||
public static Block blockGate;
|
||||
public static Block blockDoor;
|
||||
public static BlockMultiFence blockMultiFence;
|
||||
public static BlockHedge blockHedge;
|
||||
public static BlockStainedDesign blockStained;
|
||||
|
||||
public static int doorRenderId;
|
||||
public static int branchRenderId;
|
||||
public static int fenceID;
|
||||
|
||||
@@ -40,8 +40,8 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
|
||||
public static DoorType getDoorType(int tileMeta) {
|
||||
int type = (tileMeta & 0xF00) >> 8;
|
||||
if (type < DoorType.values().length) {
|
||||
return DoorType.values()[type];
|
||||
if (type < DoorType.VALUES.length) {
|
||||
return DoorType.VALUES[type];
|
||||
}
|
||||
return DoorType.STANDARD;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
for (DoorType type : DoorType.VALUES) {
|
||||
type.iconDoorLower = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".lower");
|
||||
type.iconDoorUpper = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".upper");
|
||||
type.iconDoorLowerFlip = new IconFlipped(type.iconDoorLower, true, false);
|
||||
@@ -237,18 +237,18 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> itemList) {
|
||||
for (IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
for (IPlankType type : PlankType.ExtraTreePlanks.VALUES) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
for (IPlankType type : PlankType.ForestryPlanks.VALUES) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.VALUES) {
|
||||
if (type.getStack() != null) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
for (IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
for (IPlankType type : PlankType.VanillaPlanks.VALUES) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
|
||||
for (int i = 0; i < ILogType.ExtraTreeLog.VALUES.length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
|
||||
public IIcon getIcon(int side, int tileMeta, int blockMeta) {
|
||||
int oriented = blockMeta & 0xC;
|
||||
ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.values()[tileMeta];
|
||||
ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.VALUES[tileMeta];
|
||||
switch (oriented) {
|
||||
case 4:
|
||||
if (side > 3) {
|
||||
@@ -125,7 +125,7 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
ILogType.ExtraTreeLog[] logs = ILogType.ExtraTreeLog.values();
|
||||
ILogType.ExtraTreeLog[] logs = ILogType.ExtraTreeLog.VALUES;
|
||||
if (meta < 0 || meta >= logs.length) {
|
||||
meta = 0;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
return I18N.localise("extratrees.block.plank.name", PlankType.ExtraTreePlanks.VALUES[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +90,7 @@ public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.VALUES.length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
@@ -107,13 +107,13 @@ public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
|
||||
return PlankType.ExtraTreePlanks.VALUES[meta].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.VALUES) {
|
||||
plank.loadIcon(register);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
return I18N.localise("extratrees.block.woodslab.name", PlankType.ExtraTreePlanks.VALUES[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,7 +106,7 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
if (field_150004_a) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.VALUES.length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
|
||||
return PlankType.ExtraTreePlanks.VALUES[meta].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class BlockETStairs extends BlockStairs implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.VALUES.length; ++i) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ public enum DoorType {
|
||||
DOUBLE("double"),
|
||||
FULL("full");
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final DoorType[] VALUES = values();
|
||||
final String id;
|
||||
IIcon iconDoorLower;
|
||||
IIcon iconDoorUpper;
|
||||
|
||||
@@ -67,6 +67,10 @@ public interface ILogType {
|
||||
Cinnamon("cinnamon", 0x86583c, PlankType.VanillaPlanks.JUNGLE),
|
||||
PinkIvory("pinkivory", 0x7f6554, PlankType.ExtraTreePlanks.PinkIvory);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final ExtraTreeLog[] VALUES = values();
|
||||
private final String name;
|
||||
private final int color;
|
||||
private final IDesignMaterial plank;
|
||||
@@ -86,7 +90,7 @@ public interface ILogType {
|
||||
}
|
||||
|
||||
public static void registerIcons(IIconRegister register) {
|
||||
for (ExtraTreeLog log : values()) {
|
||||
for (ExtraTreeLog log : VALUES) {
|
||||
log.trunk = ExtraTrees.proxy.getIcon(register, "logs/" + log.toString().toLowerCase() + "Trunk");
|
||||
log.bark = ExtraTrees.proxy.getIcon(register, "logs/" + log.toString().toLowerCase() + "Bark");
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ItemETDoor extends ItemMetadata {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
for (DoorType type : DoorType.VALUES) {
|
||||
type.iconItem = ExtraTrees.proxy.getIcon(register, "door." + type.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ItemETStairs extends ItemBlock {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return PlankType.ExtraTreePlanks.values()[par1].getIcon();
|
||||
return PlankType.ExtraTreePlanks.VALUES[par1].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,12 +67,12 @@ public class ModuleBlocks implements IInitializable {
|
||||
.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
BinnieCore.proxy
|
||||
.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (ILogType plank : ILogType.ExtraTreeLog.values()) {
|
||||
for (ILogType plank : ILogType.ExtraTreeLog.VALUES) {
|
||||
OreDictionary.registerOre("logWood", plank.getItemStack());
|
||||
}
|
||||
|
||||
GameRegistry.addSmelting(ExtraTrees.blockLog, new ItemStack(Items.coal, 1, 1), 0.15f);
|
||||
for (IPlankType plank2 : PlankType.ExtraTreePlanks.values()) {
|
||||
for (IPlankType plank2 : PlankType.ExtraTreePlanks.VALUES) {
|
||||
OreDictionary.registerOre("plankWood", plank2.getStack());
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.VALUES) {
|
||||
ItemStack planks = plank.getStack();
|
||||
ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
|
||||
ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
|
||||
|
||||
@@ -18,16 +18,16 @@ import extrabiomes.api.Stuff;
|
||||
public class PlankType {
|
||||
|
||||
public static void setup() {
|
||||
for (VanillaPlanks plank : VanillaPlanks.values()) {
|
||||
for (VanillaPlanks plank : VanillaPlanks.VALUES) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank.ordinal(), plank);
|
||||
}
|
||||
for (ExtraTreePlanks plank2 : ExtraTreePlanks.values()) {
|
||||
for (ExtraTreePlanks plank2 : ExtraTreePlanks.VALUES) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank2.ordinal() + 32, plank2);
|
||||
}
|
||||
for (ForestryPlanks plank3 : ForestryPlanks.values()) {
|
||||
for (ForestryPlanks plank3 : ForestryPlanks.VALUES) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank3.ordinal() + 128, plank3);
|
||||
}
|
||||
for (ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
for (ExtraBiomesPlank plank4 : ExtraBiomesPlank.VALUES) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank4.ordinal() + 192, plank4);
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,10 @@ public class PlankType {
|
||||
Gingko(0xf4e7ba),
|
||||
PinkIvory(0xec8ca0);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final ExtraTreePlanks[] VALUES = values();
|
||||
private final int color;
|
||||
private IIcon icon;
|
||||
|
||||
@@ -121,6 +125,10 @@ public class PlankType {
|
||||
ACACIA(0xba6337),
|
||||
DARKOAK(0x462d15);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final VanillaPlanks[] VALUES = values();
|
||||
private final int color;
|
||||
|
||||
VanillaPlanks(int color) {
|
||||
@@ -192,6 +200,10 @@ public class PlankType {
|
||||
COCOBOLO(0x731302),
|
||||
ZEBRAWOOD(0xa6824e);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final ForestryPlanks[] VALUES = values();
|
||||
private final int color;
|
||||
|
||||
ForestryPlanks(int color) {
|
||||
@@ -241,6 +253,10 @@ public class PlankType {
|
||||
Fir(0x7e774a),
|
||||
Acacia(0xbfaa7e);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final ExtraBiomesPlank[] VALUES = values();
|
||||
private final int color;
|
||||
|
||||
ExtraBiomesPlank(int color) {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class StairItemRenderer implements IItemRenderer {
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
IIcon textureIndex = PlankType.ExtraTreePlanks.values()[item.getItemDamage()].getIcon();
|
||||
IIcon textureIndex = PlankType.ExtraTreePlanks.VALUES[item.getItemDamage()].getIcon();
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
if (i == 0) {
|
||||
|
||||
@@ -105,12 +105,12 @@ public class WoodManager {
|
||||
}
|
||||
|
||||
List<IPlankType> list = new ArrayList<>();
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.values());
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.VALUES);
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.VALUES);
|
||||
if (Mods.extraBiomes.active()) {
|
||||
Collections.addAll(list, PlankType.ExtraBiomesPlank.values());
|
||||
Collections.addAll(list, PlankType.ExtraBiomesPlank.VALUES);
|
||||
}
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.values());
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.VALUES);
|
||||
allPlankTypes = list;
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.VALUES) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
|
||||
for (IFenceProvider type : PlankType.VanillaPlanks.values()) {
|
||||
for (IFenceProvider type : PlankType.VanillaPlanks.VALUES) {
|
||||
if (type != PlankType.VanillaPlanks.OAK) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
|
||||
@@ -408,6 +408,9 @@ public enum EnumPattern implements IPattern {
|
||||
|
||||
private ILayout leftRotation;
|
||||
private ILayout horizontalFlip;
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumPattern[] VALUES = values();
|
||||
|
||||
EnumPattern() {
|
||||
|
||||
@@ -20,7 +20,7 @@ public class GlassType implements IDesignMaterial {
|
||||
for (StandardColor c : StandardColor.values()) {
|
||||
GlassType.types.put(c.ordinal(), new GlassType(c.ordinal(), c.name, c.color));
|
||||
}
|
||||
for (EnumFlowerColor c2 : EnumFlowerColor.values()) {
|
||||
for (EnumFlowerColor c2 : EnumFlowerColor.VALUES) {
|
||||
GlassType.types
|
||||
.put(128 + c2.ordinal(), new GlassType(128 + c2.ordinal(), c2.getName(), c2.getColor(false)));
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ public class ModuleCore implements IInitializable {
|
||||
Collections.addAll(speciesQueue, ExtraTreeSpecies.values());
|
||||
|
||||
Queue<ILogType> logQueue = new LinkedList<>();
|
||||
Collections.addAll(logQueue, ILogType.ExtraTreeLog.values());
|
||||
Collections.addAll(logQueue, ILogType.ExtraTreeLog.VALUES);
|
||||
|
||||
Queue<IDesignMaterial> plankQueue = new LinkedList<>();
|
||||
Collections.addAll(plankQueue, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(plankQueue, PlankType.ExtraTreePlanks.VALUES);
|
||||
|
||||
Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<>();
|
||||
Collections.addAll(fruitQueue, ExtraTreeFruitGene.values());
|
||||
|
||||
@@ -43,7 +43,7 @@ public class WindowLumbermill extends Window {
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getGuiDisplayName());
|
||||
new ControlSlot(this, 42.0f, 43.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_WOOD);
|
||||
new ControlSlot(this, 148.0f, 43.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_PLANKS);
|
||||
new ControlSlot(this, 172.0f, 28.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_BARK);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class WindowWoodworker extends Window {
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getGuiDisplayName());
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(190.0f, 36.0f, 114.0f, 10.0f),
|
||||
|
||||
@@ -387,7 +387,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
if (ripeningTime >= ripeningPeriod) {
|
||||
return 1.0f;
|
||||
}
|
||||
return ripeningTime / ripeningPeriod;
|
||||
return (float) ripeningTime / ripeningPeriod;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -418,7 +418,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
if (ordinal() == 0) {
|
||||
for (FruitSprite sprite : FruitSprite.values()) {
|
||||
for (FruitSprite sprite : FruitSprite.VALUES) {
|
||||
sprite.registerIcons(register);
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
|
||||
for (ItemStack stack : products.keySet()) {
|
||||
if (stack.getItem() == ExtraTrees.itemFood) {
|
||||
return Food.values()[stack.getItemDamage()].toString();
|
||||
return Food.VALUES[stack.getItemDamage()].toString();
|
||||
}
|
||||
}
|
||||
return "NoFruit";
|
||||
|
||||
@@ -19,6 +19,10 @@ public enum FruitSprite implements IIconProvider {
|
||||
Larger,
|
||||
Pear;
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final FruitSprite[] VALUES = values();
|
||||
private BinnieIcon icon;
|
||||
|
||||
public short getIndex() {
|
||||
@@ -29,8 +33,8 @@ public enum FruitSprite implements IIconProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(short texUID) {
|
||||
int index = texUID - 4200;
|
||||
if (index >= 0 && index < values().length) {
|
||||
return values()[index].icon.getIcon();
|
||||
if (index >= 0 && index < VALUES.length) {
|
||||
return VALUES[index].icon.getIcon();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,10 @@ public enum Food implements IItemMisc {
|
||||
Starfruit(2),
|
||||
Candlenut(0);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final Food[] VALUES = values();
|
||||
private IIcon icon;
|
||||
private final int hunger;
|
||||
private final List<String> ores;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extratrees.item;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -25,6 +27,8 @@ public class ItemDictionary extends Item {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setUnlocalizedName("database");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loaded 100 of 127 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user