mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-15 01:35:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5964f67aa | ||
|
|
1f251703aa | ||
|
|
65f1627a97 | ||
|
|
dde6c79f9e |
No files matched your search
@@ -1,17 +0,0 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.28:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.11.19:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.8.25:dev')
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.105-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.61:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.47:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
+3
-27
@@ -39,33 +39,9 @@ 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 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 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 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.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/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-9.4.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -114,6 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -171,6 +172,7 @@ 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" )
|
||||
|
||||
@@ -210,6 +212,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -70,10 +70,11 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -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 '2.0.26'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
|
||||
}
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -15,5 +16,6 @@ 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,37 +64,32 @@ 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 ItemFlower flowerItem;
|
||||
public static Item pollen;
|
||||
public static Item seed;
|
||||
public static Item pollen;
|
||||
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 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 ItemSoilMeter soilMeter;
|
||||
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;
|
||||
@@ -271,7 +266,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--;
|
||||
@@ -284,7 +279,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--;
|
||||
@@ -297,7 +292,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,11 +6,6 @@ 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,10 +24,6 @@ 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,11 +6,6 @@ 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,11 +6,6 @@ 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));
|
||||
}
|
||||
@@ -130,13 +130,13 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return TileType.get(meta >>> 16 & 0xFF).icons[MultipassBlockRenderer.getLayer()];
|
||||
return getType(meta).getIcon(MultipassBlockRenderer.getLayer());
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
@@ -167,9 +167,6 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta) {
|
||||
if (!MultipassBlockRenderer.isRendering()) {
|
||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
||||
}
|
||||
return colorMultiplier(meta);
|
||||
}
|
||||
|
||||
@@ -180,14 +177,14 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(int meta) {
|
||||
int layer = MultipassBlockRenderer.getLayer();
|
||||
if (layer == 0) {
|
||||
BlockType type = getType(meta);
|
||||
if (MultipassBlockRenderer.getLayer() == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
if (layer == 1) {
|
||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
||||
if (MultipassBlockRenderer.getLayer() == 1) {
|
||||
return type.color1.getColor(false);
|
||||
}
|
||||
return EnumFlowerColor.get(meta >>> 8 & 0xFF).getColor(false);
|
||||
return type.color2.getColor(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,10 +205,6 @@ 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;
|
||||
@@ -223,7 +216,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,7 +1,5 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -41,8 +39,6 @@ public abstract class ItemBotany extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName(name);
|
||||
hasSubtypes = true;
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -27,8 +25,6 @@ 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,7 +1,5 @@
|
||||
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;
|
||||
@@ -30,8 +28,6 @@ public class ItemSoilMeter extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("soilMeter");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
@@ -30,8 +28,6 @@ public class ItemTrowel extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("trowel" + material);
|
||||
locName = "trowel" + material;
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ 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;
|
||||
@@ -36,7 +37,6 @@ 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 = new ItemMisc(CreativeTabBotany.instance, BotanyItems.values());
|
||||
Botany.misc = Binnie.Item.registerMiscItems(BotanyItems.values(), CreativeTabBotany.instance);
|
||||
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,10 +92,7 @@ public enum EnumFlowerColor implements IFlowerColor {
|
||||
YELLOW("yellow", 0xffff00),
|
||||
YELLOW_GREEN("yellowGreen", 0x9acd32);
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final EnumFlowerColor[] VALUES = values();
|
||||
private static final EnumFlowerColor[] ALL_VALUES = values();
|
||||
private final int color;
|
||||
private final int colorDis;
|
||||
private final String name;
|
||||
@@ -2967,7 +2964,7 @@ public enum EnumFlowerColor implements IFlowerColor {
|
||||
}
|
||||
|
||||
public static EnumFlowerColor get(int i) {
|
||||
return VALUES[Math.max(0, i) % VALUES.length];
|
||||
return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,10 +57,6 @@ 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,7 +1,5 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -27,8 +25,6 @@ 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,7 +1,5 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -24,8 +22,6 @@ public class ItemClay extends Item {
|
||||
setUnlocalizedName("clay");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +45,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,7 +1,5 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -24,8 +22,6 @@ public class ItemPigment extends Item {
|
||||
setUnlocalizedName("pigment");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +45,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.get(data.readByte());
|
||||
render.secondary = EnumFlowerColor.get(data.readByte());
|
||||
render.stem = EnumFlowerColor.get(data.readByte());
|
||||
render.type = EnumFlowerType.VALUES[data.readByte()];
|
||||
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.age = data.readByte();
|
||||
render.section = data.readByte();
|
||||
render.wilted = data.readBoolean();
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
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;
|
||||
@@ -16,9 +20,11 @@ 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);
|
||||
}
|
||||
@@ -59,6 +65,22 @@ 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
|
||||
@@ -74,6 +96,14 @@ 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
|
||||
@@ -86,6 +116,14 @@ 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) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.config.BCConfig;
|
||||
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
|
||||
import binnie.core.gui.BinnieCoreGUI;
|
||||
import binnie.core.gui.BinnieGUIHandler;
|
||||
@@ -23,6 +22,8 @@ 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;
|
||||
@@ -79,9 +80,7 @@ public class BinnieCore extends AbstractMod {
|
||||
}
|
||||
|
||||
addModule(new ModuleCraftGUI());
|
||||
if (!BCConfig.disableCompartments) {
|
||||
addModule(new ModuleStorage());
|
||||
}
|
||||
addModule(new ModuleStorage());
|
||||
addModule(new ModuleItems());
|
||||
if (Loader.isModLoaded("BuildCraft|Silicon")) {
|
||||
addModule(new ModuleTrigger());
|
||||
@@ -111,6 +110,7 @@ public class BinnieCore extends AbstractMod {
|
||||
Item item = new ItemFluidContainer(container);
|
||||
GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
|
||||
}
|
||||
FieldParser.parsers.add(new ItemParser());
|
||||
super.preInit();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ public class ItemMetadata extends ItemBlock {
|
||||
|
||||
public ItemMetadata(Block block) {
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,6 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static MultipassBlockRenderer instance;
|
||||
private static int layer = 0;
|
||||
private static boolean rendering = false;
|
||||
|
||||
public MultipassBlockRenderer() {
|
||||
MultipassBlockRenderer.instance = this;
|
||||
@@ -24,49 +23,31 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
return MultipassBlockRenderer.layer;
|
||||
}
|
||||
|
||||
public static boolean isRendering() {
|
||||
return MultipassBlockRenderer.rendering;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
||||
int passes = multipassBlock.getNumberOfPasses();
|
||||
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
|
||||
MultipassBlockRenderer.rendering = true;
|
||||
try {
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
MultipassBlockRenderer.layer = pass;
|
||||
renderItem(block, multipassBlock, renderer, meta);
|
||||
}
|
||||
} finally {
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
MultipassBlockRenderer.rendering = false;
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
renderItem(block, renderer, meta);
|
||||
MultipassBlockRenderer.layer++;
|
||||
}
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
||||
int passes = multipassBlock.getNumberOfPasses();
|
||||
boolean rendered = true;
|
||||
|
||||
MultipassBlockRenderer.rendering = true;
|
||||
try {
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
MultipassBlockRenderer.layer = pass;
|
||||
rendered = renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
return rendered;
|
||||
} finally {
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
MultipassBlockRenderer.rendering = false;
|
||||
boolean r = true;
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
r = renderer.renderStandardBlock(block, x, y, z);
|
||||
MultipassBlockRenderer.layer++;
|
||||
}
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,8 +60,8 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
return BinnieCore.multipassRenderID;
|
||||
}
|
||||
|
||||
private void renderItem(Block block, IMultipassBlock multipassBlock, RenderBlocks renderer, int meta) {
|
||||
setColor(multipassBlock.colorMultiplier(meta));
|
||||
public void renderItem(Block block, RenderBlocks renderer, int meta) {
|
||||
setColor(((IMultipassBlock) block).colorMultiplier(meta));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package binnie.core.config;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
@Config(modid = BinnieCore.CORE_MODID)
|
||||
public class BCConfig {
|
||||
|
||||
@Config.Comment("If true, disables all compartment storage machines (no blocks/recipes will be registered).")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean disableCompartments;
|
||||
}
|
||||
@@ -188,9 +188,7 @@ public class WindowFieldKit extends Window {
|
||||
glassOffsetX *= 1.0f - analyseProgress;
|
||||
glassOffsetY += glassVY;
|
||||
glassOffsetY *= 1.0f - analyseProgress;
|
||||
if (GlassControl != null) {
|
||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||
}
|
||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||
}
|
||||
|
||||
private void refreshSpecies() {
|
||||
|
||||
@@ -20,10 +20,6 @@ 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;
|
||||
|
||||
@@ -240,16 +240,12 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
boolean noFocusedWidget = window.getFocusedWidget() == null;
|
||||
NEIHook.lastKeyTyped(key, c);
|
||||
|
||||
if (noFocusedWidget) {
|
||||
NEIHook.lastKeyTyped(key, c);
|
||||
}
|
||||
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && noFocusedWidget)) {
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
|
||||
mc.thePlayer.closeScreen();
|
||||
}
|
||||
IWidget origin = noFocusedWidget ? window : window.getFocusedWidget();
|
||||
IWidget origin = (window.getFocusedWidget() == null) ? window : window.getFocusedWidget();
|
||||
window.callEvent(new EventKey.Down(origin, c, key));
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
protected float titleButtonLeft;
|
||||
protected float titleButtonRight;
|
||||
private GuiCraftGUI gui;
|
||||
private Renderer renderer;
|
||||
private final ContainerCraftGUI container;
|
||||
private final WindowInventory windowInventory;
|
||||
private ControlText title;
|
||||
@@ -84,8 +83,8 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||
}
|
||||
|
||||
renderer = new Renderer(gui);
|
||||
renderer.stylesheet(StyleSheetManager.getDefault());
|
||||
CraftGUI.render = new Renderer(gui);
|
||||
CraftGUI.render.stylesheet(StyleSheetManager.getDefault());
|
||||
titleButtonLeft = -14.0f;
|
||||
|
||||
if (showHelpButton()) {
|
||||
@@ -196,9 +195,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
|
||||
CraftGUI.render = renderer;
|
||||
|
||||
if (hasBeenInitialised) {
|
||||
return;
|
||||
}
|
||||
@@ -271,9 +267,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
entityInventory = inventory;
|
||||
}
|
||||
|
||||
public void onClose() {
|
||||
CraftGUI.render = null;
|
||||
}
|
||||
public void onClose() {}
|
||||
|
||||
public boolean isServer() {
|
||||
return !isClient();
|
||||
|
||||
@@ -8,7 +8,6 @@ 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 {
|
||||
@@ -25,21 +24,19 @@ 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)
|
||||
.setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18);
|
||||
slots.add(slot);
|
||||
}
|
||||
}
|
||||
|
||||
if (wide) {
|
||||
for (int i1 = 0; i1 < 9; ++i1) {
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18)
|
||||
.setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18);
|
||||
slots.add(slot2);
|
||||
}
|
||||
} else {
|
||||
for (int i1 = 0; i1 < 9; ++i1) {
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 * 18, 58.0f).setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
ControlSlot slot2 = new ControlSlot(this, i1 * 18, 58.0f);
|
||||
slots.add(slot2);
|
||||
}
|
||||
}
|
||||
@@ -54,8 +51,7 @@ 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)
|
||||
.setSlotTexture(CraftGUITexture.SlotInventory);
|
||||
ControlSlot slot = new ControlSlot(this, column * 18, row * 18);
|
||||
slots.add(slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,10 @@ 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
|
||||
@@ -82,17 +80,11 @@ 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(slotTexture, IPoint.ZERO);
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
if (slot == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ 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,7 +1,5 @@
|
||||
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;
|
||||
@@ -27,8 +25,6 @@ public class ItemGenesis extends Item {
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("genesis");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -18,13 +16,11 @@ public class ItemMisc extends Item {
|
||||
|
||||
private final IItemMisc[] items;
|
||||
|
||||
public ItemMisc(CreativeTabs tab, IItemMisc[] items) {
|
||||
protected ItemMisc(CreativeTabs tab, IItemMisc[] items2) {
|
||||
setCreativeTab(tab);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName("misc");
|
||||
this.items = items;
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
items = items2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
||||
public class ManagerItem {
|
||||
|
||||
public ItemMisc registerMiscItems(IItemMisc[] items, CreativeTabs tab) {
|
||||
return new ItemMisc(tab, items);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
package binnie.core.liquid;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@@ -11,62 +9,32 @@ import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import binnie.core.ManagerBase;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ManagerLiquid extends ManagerBase {
|
||||
|
||||
private static final Set<String> EXTERNAL_FLUIDS = new HashSet<>();
|
||||
|
||||
static {
|
||||
EXTERNAL_FLUIDS.add("liquidnitrogen");
|
||||
}
|
||||
|
||||
private static boolean isExternalFluid(String identifier) {
|
||||
return EXTERNAL_FLUIDS.contains(identifier) && Loader.isModLoaded("gregtech");
|
||||
}
|
||||
|
||||
public Map<String, IFluidType> fluids;
|
||||
private final Set<String> ownedFluids;
|
||||
|
||||
public ManagerLiquid() {
|
||||
fluids = new LinkedHashMap<>();
|
||||
ownedFluids = new HashSet<>();
|
||||
}
|
||||
|
||||
public void createLiquids(IFluidType[] liquids, int startID) {
|
||||
for (IFluidType liquid : liquids) {
|
||||
String identifier = liquid.getIdentifier().toLowerCase();
|
||||
Fluid fluid = createOrGetLiquid(liquid, startID++);
|
||||
if (fluid == null && !isExternalFluid(identifier)) {
|
||||
BinnieFluid fluid = createLiquid(liquid, startID++);
|
||||
if (fluid == null) {
|
||||
throw new RuntimeException("Liquid registered incorrectly - " + liquid.getIdentifier());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BinnieFluid createLiquid(IFluidType fluid, int id) {
|
||||
Fluid registeredFluid = createOrGetLiquid(fluid, id);
|
||||
return (registeredFluid instanceof BinnieFluid) ? (BinnieFluid) registeredFluid : null;
|
||||
}
|
||||
|
||||
private Fluid createOrGetLiquid(IFluidType fluid, int id) {
|
||||
String identifier = fluid.getIdentifier().toLowerCase();
|
||||
fluids.put(identifier, fluid);
|
||||
Fluid registeredFluid = FluidRegistry.getFluid(identifier);
|
||||
if (registeredFluid == null && !isExternalFluid(identifier)) {
|
||||
BinnieFluid binnieFluid = new BinnieFluid(fluid);
|
||||
FluidRegistry.registerFluid(binnieFluid);
|
||||
registeredFluid = FluidRegistry.getFluid(identifier);
|
||||
ownedFluids.add(identifier);
|
||||
} else if (registeredFluid == null) {
|
||||
FMLLog.warning(
|
||||
"[Binnie] External liquid %s is not registered yet. Waiting for the owning mod to register it before postInit.",
|
||||
identifier);
|
||||
}
|
||||
fluids.put(fluid.getIdentifier().toLowerCase(), fluid);
|
||||
BinnieFluid binnieFluid = new BinnieFluid(fluid);
|
||||
FluidRegistry.registerFluid(binnieFluid);
|
||||
ItemFluidContainer.registerFluid(fluid, id);
|
||||
return registeredFluid;
|
||||
return binnieFluid;
|
||||
}
|
||||
|
||||
public FluidStack getLiquidStack(String name, int amount) {
|
||||
@@ -76,26 +44,18 @@ public class ManagerLiquid extends ManagerBase {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void reloadIcons(IIconRegister register) {
|
||||
for (IFluidType type : fluids.values()) {
|
||||
String identifier = type.getIdentifier().toLowerCase();
|
||||
FluidStack stack = getLiquidStack(identifier, 1);
|
||||
Fluid fluid = stack == null ? null : stack.getFluid();
|
||||
Fluid fluid = getLiquidStack(type.getIdentifier(), 1).getFluid();
|
||||
type.registerIcon(register);
|
||||
if (fluid == null) {
|
||||
throw new RuntimeException("[Binnie] Liquid not registered properly - " + type.getIdentifier());
|
||||
}
|
||||
if (ownedFluids.contains(identifier)) {
|
||||
fluid.setIcons(type.getIcon());
|
||||
}
|
||||
fluid.setIcons(type.getIcon());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (IFluidType fluid : fluids.values()) {
|
||||
String identifier = fluid.getIdentifier().toLowerCase();
|
||||
if (isExternalFluid(identifier) && FluidRegistry.getFluid(identifier) == null) {
|
||||
throw new RuntimeException("[Binnie] External liquid not registered - " + identifier);
|
||||
}
|
||||
for (FluidContainer container : FluidContainer.values()) {
|
||||
if (container.isActive() && fluid.canPlaceIn(container)) {
|
||||
container.registerContainerData(fluid);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.machines;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
@@ -31,11 +32,6 @@ 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;
|
||||
}
|
||||
@@ -52,7 +48,8 @@ public abstract class MachinePackage {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTick);
|
||||
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer);
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.Binnie;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
@@ -12,27 +13,30 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
// Hmm. It's used class
|
||||
public class RendererMachine extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
RenderBlocks blockRenderer;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float partialTick) {
|
||||
renderTileEntity((TileEntityMachine) entity, x, y, z, partialTick);
|
||||
renderTileEntity((TileEntityMachine) entity, x, y, z, partialTick, blockRenderer);
|
||||
}
|
||||
|
||||
private void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float partialTick) {
|
||||
public void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
if (entity != null && entity.getMachine() != null) {
|
||||
MachinePackage machinePackage = entity.getMachine().getPackage();
|
||||
machinePackage.renderMachine(entity.getMachine(), x, y, z, partialTick);
|
||||
machinePackage.renderMachine(entity.getMachine(), x, y, z, partialTick, renderer);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderInvBlock(Block block, int i, int j) {
|
||||
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
|
||||
TileEntity entity = block.createTileEntity(null, i);
|
||||
renderTileEntity((TileEntityMachine) entity, 0.0, -0.1, 0.0, 0.0625f);
|
||||
renderTileEntity((TileEntityMachine) entity, 0.0, -0.1, 0.0, 0.0625f, renderblocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == Binnie.Machine.getMachineRenderID()) {
|
||||
renderInvBlock(block, metadata, modelID);
|
||||
renderInvBlock(renderer, block, metadata, modelID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +48,7 @@ public class RendererMachine extends TileEntitySpecialRenderer implements ISimpl
|
||||
&& tile.getMachine().getPackage() != null
|
||||
&& tile.getMachine().getPackage().getGroup() != null
|
||||
&& !tile.getMachine().getPackage().getGroup().customRenderer) {
|
||||
renderTileEntity(tile, x, y, z, 1.0f);
|
||||
renderTileEntity(tile, x, y, z, 1.0f, renderer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -58,4 +62,9 @@ public class RendererMachine extends TileEntitySpecialRenderer implements ISimpl
|
||||
public int getRenderId() {
|
||||
return Binnie.Machine.getMachineRenderID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_147496_a(World par1World) {
|
||||
blockRenderer = new RenderBlocks(par1World);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
@@ -15,13 +16,10 @@ 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 Int2ObjectLinkedOpenHashMap<InventorySlot> inventory = new Int2ObjectLinkedOpenHashMap<>();
|
||||
private int cachedSize = 0;
|
||||
private int[] cachedAccessibleSlots = null;
|
||||
private final Map<Integer, InventorySlot> inventory = new LinkedHashMap<>();
|
||||
|
||||
public ComponentInventorySlots(IMachine machine) {
|
||||
super(machine);
|
||||
@@ -29,20 +27,25 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return cachedSize;
|
||||
int size = 0;
|
||||
for (Integer index : inventory.keySet()) {
|
||||
size = Math.max(size, index + 1);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int index) {
|
||||
InventorySlot slot = inventory.get(index);
|
||||
return slot != null ? slot.getContent() : null;
|
||||
if (inventory.containsKey(index)) {
|
||||
return inventory.get(index).getContent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int amount) {
|
||||
InventorySlot slot = inventory.get(index);
|
||||
if (slot != null) {
|
||||
ItemStack stack = slot.decrStackSize(amount);
|
||||
if (inventory.containsKey(index)) {
|
||||
ItemStack stack = inventory.get(index).decrStackSize(amount);
|
||||
markDirty();
|
||||
return stack;
|
||||
}
|
||||
@@ -56,9 +59,8 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int index, ItemStack itemStack) {
|
||||
InventorySlot slot = inventory.get(index);
|
||||
if (slot != null && (itemStack == null || slot.isValid(itemStack))) {
|
||||
slot.setContent(itemStack);
|
||||
if (inventory.containsKey(index) && (itemStack == null || inventory.get(index).isValid(itemStack))) {
|
||||
inventory.get(index).setContent(itemStack);
|
||||
}
|
||||
markDirty();
|
||||
}
|
||||
@@ -111,7 +113,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.int2ObjectEntrySet()) {
|
||||
for (Map.Entry<Integer, InventorySlot> entry : inventory.entrySet()) {
|
||||
NBTTagCompound slotNBT = new NBTTagCompound();
|
||||
slotNBT.setInteger("id", entry.getKey());
|
||||
entry.getValue().writeToNBT(slotNBT);
|
||||
@@ -123,8 +125,6 @@ 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,7 +138,10 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public InventorySlot getSlot(int index) {
|
||||
return inventory.get(index);
|
||||
if (inventory.containsKey(index)) {
|
||||
return inventory.get(index);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,7 +151,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public InventorySlot[] getSlots(int[] indexes) {
|
||||
List<InventorySlot> list = new ArrayList<>(indexes.length);
|
||||
List<InventorySlot> list = new ArrayList<>();
|
||||
for (int i : indexes) {
|
||||
if (getSlot(i) != null) {
|
||||
list.add(getSlot(i));
|
||||
@@ -210,20 +213,18 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int var1) {
|
||||
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);
|
||||
List<Integer> slots = new ArrayList<>();
|
||||
for (InventorySlot slot : inventory.values()) {
|
||||
if (slot.canInsert() || slot.canExtract()) {
|
||||
slots.add(slot.getIndex());
|
||||
}
|
||||
}
|
||||
return cachedAccessibleSlots;
|
||||
|
||||
int[] ids = new int[slots.size()];
|
||||
for (int i = 0; i < slots.size(); ++i) {
|
||||
ids[i] = slots.get(i);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -233,7 +234,6 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack itemstack, int direction) {
|
||||
InventorySlot iSlot = getSlot(slot);
|
||||
return iSlot != null && iSlot.canExtract(ForgeDirection.getOrientation(direction));
|
||||
return getSlot(slot).canExtract(ForgeDirection.getOrientation(direction));
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
int index = getTankIndexToDrain(from, resource);
|
||||
int index = getTankIndexToDrain(from, null);
|
||||
if (!tanks.containsKey(index)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -50,7 +51,8 @@ enum Compartment implements IMachineType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
MachineRendererCompartment.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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().getGuiDisplayName());
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
int x = 16;
|
||||
int y = 32;
|
||||
ComponentCompartmentInventory inv = Machine.getMachine(getInventory())
|
||||
@@ -256,8 +256,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
ControlSlide slide = new ControlSlide(this, 0.0f, 134.0f, 136.0f, 92.0f, Position.LEFT);
|
||||
slide.setLabel(I18N.localise("binniecore.machine.storage.tab.properties"));
|
||||
slide.setSlide(false);
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tab.properties"));
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tab.properties.desc"));
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tooltip.properties"));
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tooltip.properties.desc"));
|
||||
Panel tabPropertyPanel = new Panel(slide, 16.0f, 8.0f, 112.0f, 76.0f, MinecraftGUI.PanelType.Gray);
|
||||
int y2 = 4;
|
||||
new ControlText(tabPropertyPanel, new IPoint(4.0f, y2), I18N.localise("binniecore.machine.storage.tab.name"));
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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,6 +2,7 @@ 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;
|
||||
@@ -10,7 +11,6 @@ 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,11 +18,7 @@ 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;
|
||||
@@ -62,11 +58,11 @@ public class ExtraBees extends AbstractMod {
|
||||
public static Block hive;
|
||||
public static Material materialBeehive;
|
||||
public static Block ectoplasm;
|
||||
public static ItemHoneyComb comb;
|
||||
public static ItemPropolis propolis;
|
||||
public static ItemHoneyDrop honeyDrop;
|
||||
public static ItemDictionary dictionary;
|
||||
public static ItemMisc itemMisc;
|
||||
public static Item comb;
|
||||
public static Item propolis;
|
||||
public static Item honeyDrop;
|
||||
public static Item dictionary;
|
||||
public static Item itemMisc;
|
||||
|
||||
public ExtraBees() {
|
||||
ExtraBees.instance = this;
|
||||
|
||||
@@ -6,23 +6,14 @@ 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;
|
||||
@@ -30,7 +21,7 @@ import forestry.api.multiblock.IMultiblockController;
|
||||
import forestry.api.multiblock.IMultiblockLogicAlveary;
|
||||
import forestry.api.multiblock.MultiblockManager;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IBeeHousing, IAlvearyComponent.Active,
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active,
|
||||
IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier {
|
||||
|
||||
protected IMultiblockLogicAlveary structureLogic;
|
||||
@@ -51,51 +42,11 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IBeeHousin
|
||||
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) {
|
||||
@@ -275,26 +226,6 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IBeeHousin
|
||||
}
|
||||
}
|
||||
|
||||
@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,5 +1,6 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -65,7 +66,8 @@ public enum AlvearyMachine implements IMachineType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
MachineRendererBlock.instance.renderMachine(machineTexture, x, y, z, partialTick);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
package binnie.genetics.config;
|
||||
package binnie.extrabees.config;
|
||||
|
||||
import static binnie.genetics.Genetics.GENETICS_MODID;
|
||||
import static binnie.extrabees.ExtraBees.EB_MODID;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||
|
||||
@Config(modid = GENETICS_MODID)
|
||||
public class GeneticsConfig {
|
||||
@Config(modid = EB_MODID)
|
||||
public class EBConfigMachines {
|
||||
|
||||
@Config.Comment("Percentage chance of Isolator consuming bee. 0 never consumes, 1 always does.")
|
||||
@Config.RangeFloat(min = 0f, max = 1f)
|
||||
@@ -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 = new ItemMisc(Tabs.tabApiculture, ExtraBeeItems.values());
|
||||
ExtraBees.itemMisc = Binnie.Item.registerMiscItems(ExtraBeeItems.values(), Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
@@ -27,8 +25,6 @@ public class ItemDictionary extends Item {
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("dictionary");
|
||||
setMaxStackSize(1);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ 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;
|
||||
|
||||
@@ -34,7 +35,7 @@ public class WindowAlvearyFrame extends Window {
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.frame"));
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
playerInventory = new ControlPlayerInventory(this).create(actions);
|
||||
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, 0);
|
||||
|
||||
@@ -12,6 +12,7 @@ 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;
|
||||
@@ -36,7 +37,7 @@ public class WindowAlvearyHatchery extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.hatchery"));
|
||||
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(machine.getPackage().getGuiDisplayName());
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.mutator"));
|
||||
playerInventory = new ControlPlayerInventory(this).create(actions);
|
||||
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, AlvearyMutator.SLOT_MUTATOR);
|
||||
new ControlText(
|
||||
|
||||
@@ -14,6 +14,7 @@ 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;
|
||||
@@ -38,7 +39,7 @@ public class WindowAlvearyStimulator extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
setTitle(machine.getPackage().getGuiDisplayName());
|
||||
setTitle(I18N.localise("extrabees.machine.alveay.stimulator"));
|
||||
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,10 +101,6 @@ 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;
|
||||
@@ -121,10 +117,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,10 +44,6 @@ 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;
|
||||
|
||||
@@ -62,10 +58,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,10 +24,6 @@ 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;
|
||||
@@ -40,10 +36,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,8 +21,9 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
protected IIcon icon2;
|
||||
|
||||
public ItemHoneyComb() {
|
||||
super("honeyComb", EnumHoneyComb.VALUES);
|
||||
super(EnumHoneyComb.values());
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyComb");
|
||||
}
|
||||
|
||||
public static void addSubtypes() {
|
||||
@@ -148,9 +149,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
if (!OreDictionary.getOres("dustCoffee").isEmpty()) {
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(OreDictionary.getOres("dustCoffee").get(0), 0.75f);
|
||||
}
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(Mods.ic2.stack("itemCofeePowder"), 0.75f);
|
||||
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
EnumHoneyComb.GLACIAL.addProduct(honeyDrop, 0.75f);
|
||||
@@ -233,15 +232,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,8 +15,9 @@ public class ItemHoneyDrop extends ItemProduct {
|
||||
protected IIcon icon2;
|
||||
|
||||
public ItemHoneyDrop() {
|
||||
super("honeyDrop", EnumHoneyDrop.VALUES);
|
||||
super(EnumHoneyDrop.values());
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyDrop");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import static cpw.mods.fml.common.registry.GameRegistry.registerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -14,14 +12,11 @@ public class ItemProduct extends Item {
|
||||
|
||||
protected IItemEnum[] types;
|
||||
|
||||
public ItemProduct(String name, IItemEnum[] types) {
|
||||
public ItemProduct(IItemEnum[] types) {
|
||||
this.types = types;
|
||||
setMaxStackSize(64);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName(name);
|
||||
|
||||
registerItem(this, getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
public IItemEnum get(ItemStack stack) {
|
||||
|
||||
@@ -11,8 +11,9 @@ import forestry.api.core.Tabs;
|
||||
public class ItemPropolis extends ItemProduct {
|
||||
|
||||
public ItemPropolis() {
|
||||
super("propolis", EnumPropolis.VALUES);
|
||||
super(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,10 +12,6 @@ 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,6 +4,7 @@ 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;
|
||||
@@ -12,7 +13,6 @@ 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,10 +26,6 @@ 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;
|
||||
@@ -65,13 +61,10 @@ public class ExtraTrees extends AbstractMod {
|
||||
}
|
||||
}
|
||||
|
||||
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 Item itemDictionary;
|
||||
public static Item itemDictionaryLepi;
|
||||
public static Item itemMisc;
|
||||
public static Item itemFood;
|
||||
public static Block blockStairs;
|
||||
public static Block blockLog;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
@@ -82,12 +75,13 @@ 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,10 +11,6 @@ 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,10 +67,6 @@ 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;
|
||||
@@ -90,7 +86,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public class ItemETSlab extends ItemMetadata {
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,14 +19,12 @@ public class ItemETStairs extends ItemBlock {
|
||||
super(block);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName("stairs");
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return PlankType.ExtraTreePlanks.VALUES[par1].getIcon();
|
||||
return PlankType.ExtraTreePlanks.values()[par1].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loaded 100 of 2016 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user