mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 01:24:59 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a8ac56266 | ||
|
|
208de8ad3a | ||
|
|
d988fb849d | ||
|
|
ab83d90dd3 | ||
|
|
79c5cff926 | ||
|
|
5522c33924 | ||
|
|
93aa429cf2 | ||
|
|
fa5c4c0218 | ||
|
|
32691c6af4 | ||
|
|
5615ffc518 | ||
|
|
2af41cf68d | ||
|
|
0cdaf8cff8 | ||
|
|
7b5eafc42a | ||
|
|
59ca1d2082 | ||
|
|
0df88973c0 | ||
|
|
e54bb5d4ea | ||
|
|
824f155804 | ||
|
|
24e2cf668e | ||
|
|
f260099bfa | ||
|
|
855d359b02 | ||
|
|
abcb180689 | ||
|
|
507adb1b3f | ||
|
|
23c4e4ed91 | ||
|
|
e5057788a8 | ||
|
|
a5045bfc0f | ||
|
|
bfd678c63e | ||
|
|
320ea99090 | ||
|
|
08f16ba26d | ||
|
|
9419dc82de | ||
|
|
2d1f64c5f6 | ||
|
|
cd9f82001c | ||
|
|
f7b8435d28 | ||
|
|
013806f158 | ||
|
|
062b5ee75f | ||
|
|
56adc25fdf | ||
|
|
df375b1b30 | ||
|
|
789da29af0 | ||
|
|
e0df2f84a0 | ||
|
|
01656f13a6 | ||
|
|
b466e9ce4a | ||
|
|
60c9dad874 | ||
|
|
d734ca55e6 | ||
|
|
f16f349f10 | ||
|
|
66561ac66d | ||
|
|
ad96e21b37 | ||
|
|
3967d21b06 | ||
|
|
2a025254a0 | ||
|
|
97bfbe2213 | ||
|
|
98c56973db | ||
|
|
b83da5c628 | ||
|
|
4a2af4743f | ||
|
|
e90771e38a | ||
|
|
9c98a6a00b | ||
|
|
75a3a7b935 | ||
|
|
99020cde7f | ||
|
|
98e13299d6 | ||
|
|
010fe4662a | ||
|
|
92ee6dbc0d | ||
|
|
98c7b3b5ed | ||
|
|
507b03043e | ||
|
|
c1e00ff395 | ||
|
|
897123c883 | ||
|
|
0ed33cf9a3 | ||
|
|
8ba8c0fb17 | ||
|
|
9c40b03751 | ||
|
|
194c0a0e77 | ||
|
|
77157aa9cb | ||
|
|
f4681d251c | ||
|
|
96cc1b869c | ||
|
|
20ca044be0 | ||
|
|
6cd9f33c3f | ||
|
|
7585c6a265 | ||
|
|
91a5084bde | ||
|
|
0876a50be2 | ||
|
|
1941690330 | ||
|
|
bbd39ea5c7 | ||
|
|
53f4107ee3 | ||
|
|
6265c01f60 | ||
|
|
b9478e16b7 | ||
|
|
2cdee67624 | ||
|
|
58fe331fe3 | ||
|
|
a4d5117a97 | ||
|
|
32a9a6ff5c | ||
|
|
9f2f2ed85b | ||
|
|
22258c2dac | ||
|
|
e0c1c538aa | ||
|
|
825768e522 | ||
|
|
dd21d83ea3 | ||
|
|
d0ead16eaa | ||
|
|
1d924d5ed5 | ||
|
|
ff7adac9e1 | ||
|
|
45993f8213 | ||
|
|
33573fea20 | ||
|
|
178142bf7a | ||
|
|
5d2aaea757 | ||
|
|
fbb02e43f5 | ||
|
|
896767ae1b | ||
|
|
d11034e4aa | ||
|
|
cc64b09ad4 | ||
|
|
d5ebc02999 | ||
|
|
8415b657f2 | ||
|
|
f0099b728f | ||
|
|
1ceccddbd0 | ||
|
|
c875e8ed5d | ||
|
|
f3ee4f8694 | ||
|
|
c2437a8a13 | ||
|
|
e2f32ab767 | ||
|
|
d0c8c92863 | ||
|
|
a8c84cfcf9 | ||
|
|
8f8f6a05f7 | ||
|
|
721c8fd0ad | ||
|
|
962a17494c | ||
|
|
01e43d8a18 | ||
|
|
4228ef73d7 | ||
|
|
6b9614bccd | ||
|
|
179311a390 | ||
|
|
d8bcab07ba | ||
|
|
2368f05778 | ||
|
|
347e0a61e1 | ||
|
|
23792a84c1 | ||
|
|
b4c0777f1c | ||
|
|
db5daf9e3d | ||
|
|
a574eac903 | ||
|
|
b3799c22e6 | ||
|
|
97d10fdba3 | ||
|
|
e03400fc6a | ||
|
|
2a35c1072b | ||
|
|
a4dd450ff8 | ||
|
|
8df8404a84 | ||
|
|
54e73da1d5 | ||
|
|
7d83e28a03 | ||
|
|
db7736f7d2 | ||
|
|
eff9dfcca7 | ||
|
|
2b874fb42f | ||
|
|
27daa8e1ac | ||
|
|
a49eb1c5f9 | ||
|
|
7e3b7acdef | ||
|
|
9c532dd076 | ||
|
|
3c7856f264 | ||
|
|
408a66bb40 | ||
|
|
31231db459 | ||
|
|
67a7185261 | ||
|
|
aeaf113b11 | ||
|
|
084a84903f | ||
|
|
167e493160 | ||
|
|
ce2a2ec8ed | ||
|
|
10e5391f48 | ||
|
|
ffe19807db | ||
|
|
6cfae1462f | ||
|
|
18a0ae3643 | ||
|
|
358522b2af | ||
|
|
ade9bb6940 | ||
|
|
23fd664e34 | ||
|
|
60d5728ccb | ||
|
|
55118e399f | ||
|
|
7e50c57ba9 | ||
|
|
317dd0dbf9 | ||
|
|
e9af62e772 | ||
|
|
daa5e3bc75 | ||
|
|
e248f40f58 | ||
|
|
0e53fccfdb | ||
|
|
fc289c16d4 | ||
|
|
fe69452464 | ||
|
|
4c41d0bb6e | ||
|
|
0fe87253d1 | ||
|
|
4f19f95b71 |
No files matched your search
+1
-1
@@ -3,7 +3,7 @@
|
||||
url = https://github.com/ForestryMC/Forestry-Localization.git
|
||||
[submodule "api/redstoneflux"]
|
||||
path = api/redstoneflux
|
||||
url = https://github.com/CoFH/RedstoneFlux-API.git
|
||||
url = https://github.com/Texasjake95/RedstoneFlux-API.git
|
||||
[submodule "api/forestry"]
|
||||
path = api/forestry
|
||||
url = https://github.com/ForestryMC/ForestryAPI.git
|
||||
+1
-1
Submodule api/forestry updated: 2af681c0f2...5e44fe9c6a.
+1
-1
Submodule api/redstoneflux updated: 10e10af214...b5771e4ef8.
+20
-11
@@ -35,8 +35,10 @@ ext.apiForestry = "./api/forestry"
|
||||
ext.apiRedstoneFlux = "./api/redstoneflux"
|
||||
|
||||
// java version
|
||||
sourceCompatibility = 1.7
|
||||
targetCompatibility = 1.7
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
minecraft {
|
||||
version = mcversion + "-" + forgeversion
|
||||
@@ -82,8 +84,8 @@ repositories {
|
||||
configurations {
|
||||
api
|
||||
compile.extendsFrom api
|
||||
shade
|
||||
compile.extendsFrom shade
|
||||
//shade
|
||||
//compile.extendsFrom shade
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -99,7 +101,7 @@ dependencies {
|
||||
compile "codechicken:NotEnoughItems:1.7.10-1.0.5.111:src"
|
||||
|
||||
// http://maven.tterrag.com/
|
||||
shade "chylex.javacheck:JavaChecker:v1.2-b1"
|
||||
//shade "chylex.javacheck:JavaChecker:v1.2-b1"
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
@@ -154,12 +156,15 @@ jar {
|
||||
into ('cofh/api') {
|
||||
from project.apiRedstoneFlux + "/LICENSE - LGPLv3.txt"
|
||||
}
|
||||
|
||||
configurations.shade.each{ dep ->
|
||||
from(project.zipTree(dep)){
|
||||
exclude 'META-INF', 'META-INF/**', 'mcmod.info'
|
||||
}
|
||||
into ('invtweaks/api') {
|
||||
from "./src/main/java/invtweaks/LICENSE.txt"
|
||||
}
|
||||
|
||||
//configurations.shade.each{ dep ->
|
||||
// from(project.zipTree(dep)){
|
||||
// exclude 'META-INF', 'META-INF/**', 'mcmod.info'
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
task mainJar(type: Jar, dependsOn: 'reobf') {
|
||||
@@ -174,7 +179,7 @@ task mainJar(type: Jar, dependsOn: 'reobf') {
|
||||
includeEmptyDirs = false
|
||||
|
||||
manifest{
|
||||
attributes 'TweakClass': 'forestry.shade.javacheck.Java7Checker'
|
||||
//attributes 'TweakClass': 'forestry.shade.javacheck.Java7Checker'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,3 +257,7 @@ def getBuildNumber() {
|
||||
return "$System.env.BUILD_NUMBER" != "null" ? "$System.env.BUILD_NUMBER" : "0"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main { output.resourcesDir = output.classesDir }
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
mcversion=1.7.10
|
||||
forgeversion=10.13.4.1541-1.7.10
|
||||
forgeversion=10.13.4.1614-1.7.10
|
||||
version_major=4
|
||||
version_minor=2
|
||||
version_patch=0
|
||||
version_patch=23
|
||||
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
|
||||
+1
-1
Submodule lang updated: f7b40946a9...4cfdcf1595.
@@ -11,14 +11,13 @@
|
||||
package forestry;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -35,14 +34,13 @@ import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.EventHandlerCore;
|
||||
import forestry.core.GuiHandler;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.config.GameMode;
|
||||
import forestry.core.config.Version;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.errors.ErrorStateRegistry;
|
||||
import forestry.core.gui.GuiHandler;
|
||||
import forestry.core.multiblock.MultiblockEventHandler;
|
||||
import forestry.core.network.PacketHandler;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -61,7 +59,7 @@ import forestry.plugins.PluginManager;
|
||||
name = "Forestry",
|
||||
version = Version.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
dependencies = "required-after:Forge@[10.13.4.1448,);"
|
||||
dependencies = "required-after:Forge@[10.13.4.1566,);"
|
||||
+ "after:Buildcraft|Core@[6.1.7,);"
|
||||
+ "after:ExtrabiomesXL;"
|
||||
+ "after:BiomesOPlenty;"
|
||||
@@ -74,22 +72,6 @@ public class Forestry {
|
||||
public static Forestry instance;
|
||||
private File configFolder;
|
||||
|
||||
private static final Map<String, ForestryItem> mappedItems = new HashMap<>();
|
||||
|
||||
static {
|
||||
mappedItems.put("Forestry:builderBackpack", ForestryItem.builderBackpack);
|
||||
mappedItems.put("Forestry:builderBackpackT2", ForestryItem.builderBackpackT2);
|
||||
mappedItems.put("Forestry:adventurerBackpack", ForestryItem.adventurerBackpack);
|
||||
mappedItems.put("Forestry:adventurerBackpackT2", ForestryItem.adventurerBackpackT2);
|
||||
mappedItems.put("Forestry:shortMead", ForestryItem.beverage);
|
||||
mappedItems.put("Forestry:waterCan", ForestryItem.canWater);
|
||||
mappedItems.put("Forestry:biofuelCan", ForestryItem.canEthanol);
|
||||
mappedItems.put("Forestry:biomassCan", ForestryItem.canBiomass);
|
||||
mappedItems.put("Forestry:bucketBiofuel", ForestryItem.bucketEthanol);
|
||||
mappedItems.put("Forestry:refractoryBiofuel", ForestryItem.refractoryEthanol);
|
||||
mappedItems.put("Forestry:waxCapsuleBiofuel", ForestryItem.waxCapsuleEthanol);
|
||||
}
|
||||
|
||||
public Forestry() {
|
||||
ForestryAPI.instance = this;
|
||||
ForestryAPI.forestryConstants = new Constants();
|
||||
@@ -104,7 +86,9 @@ public class Forestry {
|
||||
packetHandler = new PacketHandler();
|
||||
|
||||
// Register event handler
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerCore());
|
||||
EventHandlerCore eventHandlerCore = new EventHandlerCore();
|
||||
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
|
||||
FMLCommonHandler.instance().bus().register(eventHandlerCore);
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
|
||||
configFolder = new File(event.getModConfigurationDirectory(), "forestry");
|
||||
@@ -164,16 +148,10 @@ public class Forestry {
|
||||
Log.warning("Remapping block " + mapping.name + " to " + StringUtil.cleanBlockName(block));
|
||||
}
|
||||
} else {
|
||||
Block block = GameRegistry.findBlock(Constants.MOD, StringUtil.cleanTags(mapping.name));
|
||||
if (block != null) {
|
||||
mapping.remap(Item.getItemFromBlock(block));
|
||||
Log.warning("Remapping item " + mapping.name + " to " + StringUtil.cleanBlockName(block));
|
||||
} else {
|
||||
ForestryItem mappedItem = mappedItems.get(mapping.name);
|
||||
if (mappedItem != null) {
|
||||
mapping.remap(mappedItem.item());
|
||||
Log.warning("Remapping item " + mapping.name + " to " + mappedItem.name());
|
||||
}
|
||||
Item item = GameRegistry.findItem(Constants.MOD, StringUtil.cleanTags(mapping.name));
|
||||
if (item != null) {
|
||||
mapping.remap(item);
|
||||
Log.warning("Remapping item " + mapping.name + " to " + StringUtil.cleanItemName(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,10 +38,9 @@ import forestry.api.core.IErrorLogic;
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.apiculture.network.PacketBeeLogicActive;
|
||||
import forestry.apiculture.network.PacketBeeLogicActiveEntity;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicActive;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicActiveEntity;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
@@ -117,9 +116,13 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
hasFlowersCache.writeToNBT(nbttagcompound);
|
||||
|
||||
Stack<ItemStack> spawnCopy = new Stack<>();
|
||||
spawnCopy.addAll(spawn);
|
||||
if (spawn.size()<128)
|
||||
spawnCopy.addAll(spawn);
|
||||
else
|
||||
for (byte b=0;b<128;++b)
|
||||
spawnCopy.add(spawn.get(b));
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
while (!spawnCopy.isEmpty()) {
|
||||
while (!spawnCopy.isEmpty() && spawnCopy.size()<=128) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
spawnCopy.pop().writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
@@ -169,9 +172,9 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
errorLogic.setCondition(!hasSpace, EnumErrorCode.NO_SPACE_INVENTORY);
|
||||
|
||||
ItemStack queenStack = beeInventory.getQueen();
|
||||
|
||||
EnumBeeType beeType = BeeManager.beeRoot.getType(queenStack);
|
||||
// check if we're breeding
|
||||
if (ForestryItem.beePrincessGE.isItemEqual(queenStack)) {
|
||||
if (beeType == EnumBeeType.PRINCESS) {
|
||||
boolean hasDrone = BeeManager.beeRoot.isDrone(beeInventory.getDrone());
|
||||
errorLogic.setCondition(!hasDrone, EnumErrorCode.NO_DRONE);
|
||||
|
||||
@@ -179,7 +182,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
return !errorLogic.hasErrors();
|
||||
}
|
||||
|
||||
if (ForestryItem.beeQueenGE.isItemEqual(queenStack)) {
|
||||
if (beeType == EnumBeeType.QUEEN) {
|
||||
if (!isQueenAlive(queenStack)) {
|
||||
IBee dyingQueen = BeeManager.beeRoot.getMember(queenStack);
|
||||
Collection<ItemStack> spawned = killQueen(dyingQueen, housing, beeListener);
|
||||
@@ -218,7 +221,8 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
public void doWork() {
|
||||
IBeeHousingInventory beeInventory = housing.getBeeInventory();
|
||||
ItemStack queenStack = beeInventory.getQueen();
|
||||
if (ForestryItem.beePrincessGE.isItemEqual(queenStack)) {
|
||||
EnumBeeType beeType = BeeManager.beeRoot.getType(queenStack);
|
||||
if (beeType == EnumBeeType.PRINCESS) {
|
||||
tickBreed();
|
||||
} else {
|
||||
queenWorkTick(queen);
|
||||
@@ -289,7 +293,13 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
|
||||
/** Checks if a queen is alive. Much faster than reading the whole bee nbt */
|
||||
private static boolean isQueenAlive(ItemStack queenStack) {
|
||||
if (queenStack == null) {
|
||||
return false;
|
||||
}
|
||||
NBTTagCompound nbtTagCompound = queenStack.getTagCompound();
|
||||
if (nbtTagCompound == null) {
|
||||
return false;
|
||||
}
|
||||
int health = nbtTagCompound.getInteger("Health");
|
||||
return health > 0;
|
||||
}
|
||||
@@ -303,7 +313,9 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
ItemStack droneStack = beeInventory.getDrone();
|
||||
ItemStack princessStack = beeInventory.getQueen();
|
||||
|
||||
if (!ForestryItem.beeDroneGE.isItemEqual(droneStack) || !ForestryItem.beePrincessGE.isItemEqual(princessStack)) {
|
||||
EnumBeeType droneType = BeeManager.beeRoot.getType(droneStack);
|
||||
EnumBeeType princessType = BeeManager.beeRoot.getType(princessStack);
|
||||
if (droneType != EnumBeeType.DRONE || princessType != EnumBeeType.PRINCESS) {
|
||||
beeProgress = 0;
|
||||
return;
|
||||
}
|
||||
@@ -322,7 +334,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
princess.writeToNBT(nbttagcompound);
|
||||
queenStack = ForestryItem.beeQueenGE.getItemStack();
|
||||
queenStack = new ItemStack(PluginApiculture.items.beeQueenGE);
|
||||
queenStack.setTagCompound(nbttagcompound);
|
||||
|
||||
beeInventory.setQueen(queenStack);
|
||||
@@ -359,7 +371,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
} else {
|
||||
Log.warning("Tried to spawn offspring off an unmated queen. Devolving her to a princess.");
|
||||
|
||||
ItemStack convert = ForestryItem.beePrincessGE.getItemStack();
|
||||
ItemStack convert = new ItemStack(PluginApiculture.items.beePrincessGE);
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
queen.writeToNBT(nbttagcompound);
|
||||
convert.setTagCompound(nbttagcompound);
|
||||
|
||||
@@ -1,239 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.apiculture.entities.EntityMinecartApiary;
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.apiculture.gui.ContainerAlveary;
|
||||
import forestry.apiculture.gui.ContainerAlvearyHygroregulator;
|
||||
import forestry.apiculture.gui.ContainerAlvearySieve;
|
||||
import forestry.apiculture.gui.ContainerAlvearySwarmer;
|
||||
import forestry.apiculture.gui.ContainerBeeHousing;
|
||||
import forestry.apiculture.gui.ContainerHabitatLocator;
|
||||
import forestry.apiculture.gui.ContainerImprinter;
|
||||
import forestry.apiculture.gui.ContainerMinecartBeehouse;
|
||||
import forestry.apiculture.gui.GuiAlveary;
|
||||
import forestry.apiculture.gui.GuiAlvearyHygroregulator;
|
||||
import forestry.apiculture.gui.GuiAlvearySieve;
|
||||
import forestry.apiculture.gui.GuiAlvearySwarmer;
|
||||
import forestry.apiculture.gui.GuiBeeHousing;
|
||||
import forestry.apiculture.gui.GuiBeealyzer;
|
||||
import forestry.apiculture.gui.GuiHabitatLocator;
|
||||
import forestry.apiculture.gui.GuiImprinter;
|
||||
import forestry.apiculture.inventory.ItemInventoryBeealyzer;
|
||||
import forestry.apiculture.inventory.ItemInventoryHabitatLocator;
|
||||
import forestry.apiculture.inventory.ItemInventoryImprinter;
|
||||
import forestry.apiculture.multiblock.TileAlvearyHygroregulator;
|
||||
import forestry.apiculture.multiblock.TileAlvearyPlain;
|
||||
import forestry.apiculture.multiblock.TileAlvearySieve;
|
||||
import forestry.apiculture.multiblock.TileAlvearySwarmer;
|
||||
import forestry.apiculture.tiles.TileApiary;
|
||||
import forestry.apiculture.tiles.TileBeehouse;
|
||||
import forestry.core.GuiHandlerBase;
|
||||
import forestry.core.gui.ContainerAlyzer;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
|
||||
public class GuiHandlerApiculture extends GuiHandlerBase {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public Gui getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
int cleanId = decodeGuiID(id);
|
||||
int guiData = decodeGuiData(id);
|
||||
|
||||
if (cleanId >= GuiId.values().length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack equipped;
|
||||
switch (GuiId.values()[cleanId]) {
|
||||
|
||||
case AlvearyGUI:
|
||||
return new GuiAlveary(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearyPlain.class));
|
||||
|
||||
case AlvearySieveGUI:
|
||||
return new GuiAlvearySieve(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearySieve.class));
|
||||
|
||||
case AlvearySwarmerGUI:
|
||||
return new GuiAlvearySwarmer(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearySwarmer.class));
|
||||
|
||||
case ApiaristChestGUI:
|
||||
return getNaturalistChestGui(BeeManager.beeRoot, player, world, x, y, z, guiData);
|
||||
|
||||
case ApiaryGUI: {
|
||||
TileApiary tileApiary = TileUtil.getTile(world, x, y, z, TileApiary.class);
|
||||
ContainerBeeHousing container = new ContainerBeeHousing(player.inventory, tileApiary, true);
|
||||
return new GuiBeeHousing<>(tileApiary, container, GuiBeeHousing.Icon.APIARY);
|
||||
}
|
||||
|
||||
case BeealyzerGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new GuiBeealyzer(player, new ItemInventoryBeealyzer(player, equipped));
|
||||
|
||||
case BeehouseGUI: {
|
||||
TileBeehouse tileBeehouse = TileUtil.getTile(world, x, y, z, TileBeehouse.class);
|
||||
ContainerBeeHousing container = new ContainerBeeHousing(player.inventory, tileBeehouse, false);
|
||||
return new GuiBeeHousing<>(tileBeehouse, container, GuiBeeHousing.Icon.BEE_HOUSE);
|
||||
}
|
||||
|
||||
case MinecartBeehouseGUI: {
|
||||
Entity entity = world.getEntityByID(x);
|
||||
if (!(entity instanceof EntityMinecartBeehouse)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
EntityMinecartBeehouse beeCart = (EntityMinecartBeehouse) entity;
|
||||
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, beeCart, false);
|
||||
return new GuiBeeHousing<>(beeCart, container, GuiBeeHousing.Icon.BEE_HOUSE);
|
||||
}
|
||||
|
||||
case MinecartApiaryGUI: {
|
||||
Entity entity = world.getEntityByID(x);
|
||||
if (!(entity instanceof EntityMinecartApiary)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
EntityMinecartApiary beeCart = (EntityMinecartApiary) entity;
|
||||
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, beeCart, true);
|
||||
return new GuiBeeHousing<>(beeCart, container, GuiBeeHousing.Icon.APIARY);
|
||||
}
|
||||
|
||||
case HabitatLocatorGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new GuiHabitatLocator(player, new ItemInventoryHabitatLocator(player, equipped));
|
||||
|
||||
case HygroregulatorGUI:
|
||||
return new GuiAlvearyHygroregulator(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearyHygroregulator.class));
|
||||
|
||||
case ImprinterGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
return new GuiImprinter(player.inventory, new ItemInventoryImprinter(player, equipped));
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
int cleanId = decodeGuiID(id);
|
||||
int guiData = decodeGuiData(id);
|
||||
|
||||
if (cleanId >= GuiId.values().length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack equipped;
|
||||
switch (GuiId.values()[cleanId]) {
|
||||
|
||||
case AlvearyGUI:
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerAlveary(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearyPlain.class));
|
||||
|
||||
case AlvearySieveGUI:
|
||||
return new ContainerAlvearySieve(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearySieve.class));
|
||||
|
||||
case AlvearySwarmerGUI:
|
||||
return new ContainerAlvearySwarmer(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearySwarmer.class));
|
||||
|
||||
case ApiaristChestGUI:
|
||||
return getNaturalistChestContainer(BeeManager.beeRoot, player, world, x, y, z, guiData);
|
||||
|
||||
case ApiaryGUI:
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerBeeHousing(player.inventory, TileUtil.getTile(world, x, y, z, TileApiary.class), true);
|
||||
|
||||
case BeealyzerGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerAlyzer(new ItemInventoryBeealyzer(player, equipped), player);
|
||||
|
||||
case BeehouseGUI:
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerBeeHousing(player.inventory, TileUtil.getTile(world, x, y, z, TileBeehouse.class), false);
|
||||
|
||||
case MinecartBeehouseGUI: {
|
||||
Entity entity = world.getEntityByID(x);
|
||||
if (!(entity instanceof EntityMinecartBeehouse)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerMinecartBeehouse(player.inventory, (EntityMinecartBeehouse) entity, false);
|
||||
}
|
||||
|
||||
case MinecartApiaryGUI: {
|
||||
Entity entity = world.getEntityByID(x);
|
||||
if (!(entity instanceof EntityMinecartApiary)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerMinecartBeehouse(player.inventory, (EntityMinecartApiary) entity, true);
|
||||
}
|
||||
|
||||
case HabitatLocatorGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ContainerHabitatLocator(player, new ItemInventoryHabitatLocator(player, equipped));
|
||||
|
||||
case HygroregulatorGUI:
|
||||
return new ContainerAlvearyHygroregulator(player.inventory, TileUtil.getTile(world, x, y, z, TileAlvearyHygroregulator.class));
|
||||
|
||||
case ImprinterGUI:
|
||||
synchApiaristTracker(world, player);
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
return new ContainerImprinter(player.inventory, new ItemInventoryImprinter(player, equipped));
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void synchApiaristTracker(World world, EntityPlayer player) {
|
||||
BeeManager.beeRoot.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,8 @@ public class InventoryBeeHousing extends InventoryAdapterRestricted implements I
|
||||
public static final int SLOT_PRODUCT_1 = 2;
|
||||
public static final int SLOT_PRODUCT_COUNT = 7;
|
||||
|
||||
public InventoryBeeHousing(int size, String name, IAccessHandler accessHandler) {
|
||||
super(size, name, accessHandler);
|
||||
public InventoryBeeHousing(int size, IAccessHandler accessHandler) {
|
||||
super(size, "Items", accessHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,13 +29,11 @@ import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.apiculture.blocks.BlockApicultureType;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import forestry.apiculture.items.ItemHoneycomb;
|
||||
import forestry.apiculture.worldgen.ComponentVillageBeeHouse;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class VillageHandlerApiculture implements IVillageCreationHandler, IVillageTradeHandler {
|
||||
|
||||
@@ -50,11 +48,38 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
|
||||
recipeList.add(new MerchantRecipe(ForestryItem.beePrincessGE.getItemStack(1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.emerald, 1)));
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.wheat, 2), ItemHoneycomb.getRandomComb(1, random, false)));
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Blocks.log, 24, OreDictionary.WILDCARD_VALUE), ForestryBlock.apiculture.getItemStack(1, Constants.DEFINITION_APIARY_META)));
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1), ForestryItem.frameProven.getItemStack(6)));
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 12), ForestryItem.beePrincessGE.getItemStack(1, OreDictionary.WILDCARD_VALUE), BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE)));
|
||||
ItemStack wildcardPrincess = new ItemStack(PluginApiculture.items.beePrincessGE, 1, OreDictionary.WILDCARD_VALUE);
|
||||
ItemStack wildcardDrone = new ItemStack(PluginApiculture.items.beeDroneGE, 4, OreDictionary.WILDCARD_VALUE);
|
||||
recipeList.add(new MerchantRecipe(wildcardPrincess, new ItemStack(Items.emerald, 1)));
|
||||
|
||||
ItemStack randomComb = PluginApiculture.items.beeComb.getRandomComb(1, random, false);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.wheat, 2), randomComb));
|
||||
|
||||
ItemStack apiary = PluginApiculture.blocks.apiculture.get(BlockApicultureType.APIARY);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Blocks.log, 24, OreDictionary.WILDCARD_VALUE), apiary));
|
||||
|
||||
ItemStack provenFrames = PluginApiculture.items.frameProven.getItemStack(6);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1), provenFrames));
|
||||
|
||||
ItemStack monasticDrone = BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 12), wildcardPrincess, monasticDrone));
|
||||
|
||||
ItemStack endDrone = BeeDefinition.ENDED.getMemberStack(EnumBeeType.DRONE);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.ender_eye, 16), wildcardPrincess, endDrone));
|
||||
|
||||
ItemStack propolis = new ItemStack(PluginApiculture.items.propolis,1);
|
||||
ItemStack forestDrone = BeeDefinition.FOREST.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack meadowsDrone = BeeDefinition.MEADOWS.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack modestDrone = BeeDefinition.MODEST.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack tropicalDrone = BeeDefinition.TROPICAL.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack wintryDrone = BeeDefinition.WINTRY.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack marshyDrone = BeeDefinition.MARSHY.getMemberStack(EnumBeeType.DRONE);
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, forestDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, meadowsDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, modestDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, tropicalDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, wintryDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, marshyDrone));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,11 +40,24 @@ import forestry.core.blocks.BlockStructure;
|
||||
import forestry.core.render.TextureManager;
|
||||
|
||||
public class BlockAlveary extends BlockStructure {
|
||||
public enum Type {
|
||||
PLAIN,
|
||||
ENTRANCE,
|
||||
SWARMER,
|
||||
FAN,
|
||||
HEATER,
|
||||
HYGRO,
|
||||
STABILIZER,
|
||||
SIEVE;
|
||||
|
||||
public static final Type[] VALUES = values();
|
||||
}
|
||||
|
||||
public BlockAlveary() {
|
||||
super(new MaterialBeehive(false));
|
||||
setHardness(1.0f);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@@ -85,19 +98,25 @@ public class BlockAlveary extends BlockStructure {
|
||||
/* TILE ENTITY CREATION */
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
switch (metadata) {
|
||||
case TileAlveary.SWARMER_META:
|
||||
if (metadata < 0 || metadata > Type.VALUES.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Type type = Type.VALUES[metadata];
|
||||
switch (type) {
|
||||
case SWARMER:
|
||||
return new TileAlvearySwarmer();
|
||||
case TileAlveary.FAN_META:
|
||||
case FAN:
|
||||
return new TileAlvearyFan();
|
||||
case TileAlveary.HEATER_META:
|
||||
case HEATER:
|
||||
return new TileAlvearyHeater();
|
||||
case TileAlveary.HYGRO_META:
|
||||
case HYGRO:
|
||||
return new TileAlvearyHygroregulator();
|
||||
case TileAlveary.STABILIZER_META:
|
||||
case STABILIZER:
|
||||
return new TileAlvearyStabiliser();
|
||||
case TileAlveary.SIEVE_META:
|
||||
case SIEVE:
|
||||
return new TileAlvearySieve();
|
||||
case PLAIN:
|
||||
default:
|
||||
return new TileAlvearyPlain();
|
||||
}
|
||||
@@ -151,27 +170,29 @@ public class BlockAlveary extends BlockStructure {
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if ((metadata <= 1
|
||||
|| metadata == TileAlveary.SIEVE_META || metadata == TileAlveary.SWARMER_META || metadata == TileAlveary.STABILIZER_META)
|
||||
|| metadata == Type.SIEVE.ordinal() || metadata == Type.SWARMER.ordinal() || metadata == Type.STABILIZER.ordinal())
|
||||
&& (side == 1 || side == 0)) {
|
||||
return icons[BOTTOM];
|
||||
}
|
||||
|
||||
switch (metadata) {
|
||||
case TileAlveary.PLAIN_META:
|
||||
Type type = Type.VALUES[metadata];
|
||||
|
||||
switch (type) {
|
||||
case PLAIN:
|
||||
return icons[PLAIN];
|
||||
case TileAlveary.ENTRANCE_META:
|
||||
case ENTRANCE:
|
||||
return icons[ENTRANCE];
|
||||
case TileAlveary.SWARMER_META:
|
||||
case SWARMER:
|
||||
return icons[ALVEARY_SWARMER_OFF];
|
||||
case TileAlveary.FAN_META:
|
||||
case FAN:
|
||||
return icons[ALVEARY_FAN_OFF];
|
||||
case TileAlveary.HEATER_META:
|
||||
case HEATER:
|
||||
return icons[ALVEARY_HEATER_OFF];
|
||||
case TileAlveary.HYGRO_META:
|
||||
case HYGRO:
|
||||
return icons[ALVEARY_HYGRO];
|
||||
case TileAlveary.STABILIZER_META:
|
||||
case STABILIZER:
|
||||
return icons[STABILISER];
|
||||
case TileAlveary.SIEVE_META:
|
||||
case SIEVE:
|
||||
return icons[SIEVE];
|
||||
default:
|
||||
return null;
|
||||
@@ -263,4 +284,8 @@ public class BlockAlveary extends BlockStructure {
|
||||
tileAlveary.getMultiblockLogic().getController().reassemble();
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack get(Type type) {
|
||||
return new ItemStack(this, 1, type.ordinal());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.blocks;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
|
||||
public class BlockApiculture extends BlockBase<BlockApicultureType> {
|
||||
public BlockApiculture() {
|
||||
super();
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.blocks;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import forestry.apiculture.tiles.TileApiaristChest;
|
||||
import forestry.apiculture.tiles.TileApiary;
|
||||
import forestry.apiculture.tiles.TileBeehouse;
|
||||
import forestry.core.blocks.IMachineProperties;
|
||||
import forestry.core.tiles.TileForestry;
|
||||
|
||||
public enum BlockApicultureType implements IMachineProperties {
|
||||
APIARY(TileApiary.class),
|
||||
APIARIST_CHEST_LEGACY(TileApiaristChest.class, "ApiaristChest"),
|
||||
BEEHOUSE(TileBeehouse.class);
|
||||
|
||||
public static final BlockApicultureType[] VALUES = values();
|
||||
|
||||
private final String teIdent;
|
||||
private final Class<? extends TileForestry> teClass;
|
||||
|
||||
BlockApicultureType(Class<? extends TileForestry> teClass) {
|
||||
String name = toString().toLowerCase(Locale.ENGLISH);
|
||||
this.teIdent = "forestry." + WordUtils.capitalize(name);
|
||||
this.teClass = teClass;
|
||||
}
|
||||
|
||||
BlockApicultureType(Class<? extends TileForestry> teClass, String name) {
|
||||
this.teIdent = "forestry." + name;
|
||||
this.teClass = teClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTeIdent() {
|
||||
return teIdent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends TileForestry> getTeClass() {
|
||||
return teClass;
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,11 @@ import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class BlockBeehives extends BlockContainer {
|
||||
public enum Type {
|
||||
LEGACY,
|
||||
FOREST,
|
||||
MEADOWS;
|
||||
}
|
||||
|
||||
public BlockBeehives() {
|
||||
super(new MaterialBeehive(true));
|
||||
|
||||
@@ -326,4 +326,11 @@ public class BlockCandle extends BlockTorch {
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getUnlitCandle(int amount) {
|
||||
return new ItemStack(this, amount, 0);
|
||||
}
|
||||
|
||||
public ItemStack getLitCandle(int amount) {
|
||||
return new ItemStack(this, amount, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.blocks;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.items.ItemBlockCandle;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import forestry.core.blocks.BlockRegistry;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
|
||||
public class BlockRegistryApiculture extends BlockRegistry {
|
||||
public final BlockApiculture apiculture;
|
||||
public final BlockBase apicultureChest;
|
||||
public final BlockBeehives beehives;
|
||||
public final BlockCandle candle;
|
||||
public final BlockStump stump;
|
||||
public final BlockAlveary alveary;
|
||||
|
||||
public BlockRegistryApiculture() {
|
||||
apiculture = registerBlock(new BlockApiculture(), ItemBlockForestry.class, "apiculture");
|
||||
|
||||
apicultureChest = registerBlock(new BlockBase(true), ItemBlockForestry.class, "apicultureChest");
|
||||
apicultureChest.setCreativeTab(Tabs.tabApiculture);
|
||||
apicultureChest.setHarvestLevel("axe", 0);
|
||||
|
||||
beehives = registerBlock(new BlockBeehives(), ItemBlockForestry.class, "beehives");
|
||||
|
||||
candle = registerBlock(new BlockCandle(), ItemBlockCandle.class, "candle");
|
||||
stump = registerBlock(new BlockStump(), ItemBlockForestry.class, "stump");
|
||||
|
||||
alveary = registerBlock(new BlockAlveary(), ItemBlockForestry.class, "alveary");
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class BlockStump extends BlockTorch {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BlockStump extends BlockTorch {
|
||||
(held.getItem() == Items.flint_and_steel ||
|
||||
held.getItem() == Items.flint ||
|
||||
ItemStackUtil.equals(Blocks.torch, held))) {
|
||||
world.setBlock(x, y, z, ForestryBlock.candle.block(), world.getBlockMetadata(x, y, z) | 0x08, Constants.FLAG_BLOCK_SYNCH);
|
||||
world.setBlock(x, y, z, PluginApiculture.blocks.candle, world.getBlockMetadata(x, y, z) | 0x08, Constants.FLAG_BLOCK_SYNCH);
|
||||
TileCandle tc = new TileCandle();
|
||||
tc.setColour(0); // default to white
|
||||
world.setTileEntity(x, y, z, tc);
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -26,14 +27,14 @@ import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.apiculture.ApiaryBeeListener;
|
||||
import forestry.apiculture.ApiaryBeeModifier;
|
||||
import forestry.apiculture.IApiary;
|
||||
import forestry.apiculture.blocks.BlockApicultureType;
|
||||
import forestry.apiculture.gui.ContainerMinecartBeehouse;
|
||||
import forestry.apiculture.gui.GuiBeeHousing;
|
||||
import forestry.apiculture.inventory.IApiaryInventory;
|
||||
import forestry.apiculture.inventory.InventoryApiary;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implements IApiary {
|
||||
private static final IBeeModifier beeModifier = new ApiaryBeeModifier();
|
||||
@@ -49,11 +50,6 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
|
||||
super(world, posX, posY, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiId getGuiId() {
|
||||
return GuiId.MinecartApiaryGUI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("apiary");
|
||||
@@ -76,17 +72,17 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
|
||||
|
||||
@Override
|
||||
public Block func_145820_n() {
|
||||
return ForestryBlock.apiculture.block();
|
||||
return PluginApiculture.blocks.apiculture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisplayTileData() {
|
||||
return Constants.DEFINITION_APIARY_META;
|
||||
return BlockApicultureType.APIARY.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCartItem() {
|
||||
return ForestryItem.minecartBeehouse.getItemStack(1, 1);
|
||||
return PluginApiculture.items.minecartBeehouse.getApiaryMinecart();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,4 +102,20 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, this, true);
|
||||
return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.APIARY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerMinecartBeehouse(player.inventory, this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdOfEntity() {
|
||||
return getEntityId();
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.IErrorLogic;
|
||||
import forestry.apiculture.gui.IGuiBeeHousingInventory;
|
||||
import forestry.apiculture.network.PacketBeeLogicEntityRequest;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicEntityRequest;
|
||||
import forestry.apiculture.tiles.TileBeeHousingBase;
|
||||
import forestry.core.entities.EntityMinecartContainerForestry;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -23,17 +24,17 @@ import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.apiculture.BeehouseBeeModifier;
|
||||
import forestry.apiculture.InventoryBeeHousing;
|
||||
import forestry.apiculture.blocks.BlockApicultureType;
|
||||
import forestry.apiculture.gui.ContainerMinecartBeehouse;
|
||||
import forestry.apiculture.gui.GuiBeeHousing;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
private static final IBeeModifier beeModifier = new BeehouseBeeModifier();
|
||||
private static final IBeeListener beeListener = new DefaultBeeListener();
|
||||
private final InventoryBeeHousing beeInventory = new InventoryBeeHousing(9, "Items", getAccessHandler());
|
||||
private final InventoryBeeHousing beeInventory = new InventoryBeeHousing(9, getAccessHandler());
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityMinecartBeehouse(World world) {
|
||||
@@ -46,11 +47,6 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
beeInventory.disableAutomation();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiId getGuiId() {
|
||||
return GuiId.MinecartBeehouseGUI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("bee.house");
|
||||
@@ -58,17 +54,17 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
|
||||
@Override
|
||||
public Block func_145820_n() {
|
||||
return ForestryBlock.apiculture.block();
|
||||
return PluginApiculture.blocks.apiculture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisplayTileData() {
|
||||
return Constants.DEFINITION_BEEHOUSE_META;
|
||||
return BlockApicultureType.BEEHOUSE.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCartItem() {
|
||||
return ForestryItem.minecartBeehouse.getItemStack(1, 0);
|
||||
return PluginApiculture.items.minecartBeehouse.getBeeHouseMinecart();
|
||||
}
|
||||
|
||||
/* IBeeHousing */
|
||||
@@ -91,4 +87,20 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
protected IInventoryAdapter getInternalInventory() {
|
||||
return beeInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, this, false);
|
||||
return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.BEE_HOUSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerMinecartBeehouse(player.inventory, this, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdOfEntity() {
|
||||
return getEntityId();
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
|
||||
if (PluginManager.Module.AGRICRAFT.isEnabled()) {
|
||||
Block cropBlock = GameRegistry.findBlock("AgriCraft", "crops");
|
||||
if (block == cropBlock) {
|
||||
if(block instanceof IPlantable) {
|
||||
if (block instanceof IPlantable) {
|
||||
//For agricraft versions which implement IPlantable in the BlockCrop class
|
||||
block = ((IPlantable) block).getPlant(world, x, y, z);
|
||||
} else {
|
||||
|
||||
@@ -13,8 +13,6 @@ package forestry.apiculture.genetics;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.IApiaristTracker;
|
||||
@@ -27,11 +25,7 @@ public class ApiaristTracker extends BreedingTracker implements IApiaristTracker
|
||||
|
||||
/** Required for creation from map storage */
|
||||
public ApiaristTracker(String s) {
|
||||
this(s, null);
|
||||
}
|
||||
|
||||
public ApiaristTracker(String s, GameProfile player) {
|
||||
super(s, player);
|
||||
super(s);
|
||||
}
|
||||
|
||||
private int queensTotal = 0;
|
||||
|
||||
@@ -283,7 +283,7 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
}
|
||||
|
||||
// / Check for the sky, except if in hell
|
||||
if (biome != null && !BiomeHelper.isBiomeHellish(biome)) {
|
||||
if (!world.provider.hasNoSky) {
|
||||
if (!housing.canBlockSeeTheSky() && !canWorkUnderground(beeModifier)) {
|
||||
errorStates.add(EnumErrorCode.NO_SKY);
|
||||
}
|
||||
|
||||
@@ -33,16 +33,19 @@ import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.apiculture.genetics.alleles.AlleleEffect;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.apiculture.items.EnumHoneyComb;
|
||||
import forestry.apiculture.items.EnumPollenCluster;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginCore;
|
||||
|
||||
public enum BeeDefinition implements IBeeDefinition {
|
||||
/* HONEY BRANCH */
|
||||
FOREST(BeeBranchDefinition.HONEY, "nigrocincta", true, new Color(0x19d0ec), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 0), 0.30f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.30f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,7 +62,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MEADOWS(BeeBranchDefinition.HONEY, "florea", true, new Color(0xef131e), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 0), 0.30f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.30f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +78,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
COMMON(BeeBranchDefinition.HONEY, "cerana", true, new Color(0xb2b2b2), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 0), 0.35f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.35f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,7 +100,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
CULTIVATED(BeeBranchDefinition.HONEY, "mellifera", true, new Color(0x5734ec), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 0), 0.40f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.40f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,7 +121,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
NOBLE(BeeBranchDefinition.NOBLE, "nobilis", false, new Color(0xec9a19), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 5), 0.20f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.20f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,7 +139,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MAJESTIC(BeeBranchDefinition.NOBLE, "regalis", true, new Color(0x7f0000), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 5), 0.30f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.30f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,8 +157,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
IMPERIAL(BeeBranchDefinition.NOBLE, "imperatorius", false, new Color(0xa3e02f), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 5), 0.20f)
|
||||
.addProduct(ForestryItem.royalJelly.getItemStack(), 0.15f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.20f)
|
||||
.addProduct(PluginApiculture.items.royalJelly.getItemStack(), 0.15f)
|
||||
.setHasEffect();
|
||||
}
|
||||
|
||||
@@ -176,7 +179,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
DILIGENT(BeeBranchDefinition.INDUSTRIOUS, "sedulus", false, new Color(0xc219ec), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 3), 0.20f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.20f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -194,7 +197,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
UNWEARY(BeeBranchDefinition.INDUSTRIOUS, "assiduus", true, new Color(0x19ec5a), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 3), 0.30f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.30f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,8 +214,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
INDUSTRIOUS(BeeBranchDefinition.INDUSTRIOUS, "industria", false, new Color(0xffffff), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 3), 0.20f)
|
||||
.addProduct(ForestryItem.pollenCluster.getItemStack(), 0.15f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.20f)
|
||||
.addProduct(PluginApiculture.items.pollenCluster.get(EnumPollenCluster.NORMAL, 1), 0.15f)
|
||||
.setHasEffect();
|
||||
}
|
||||
|
||||
@@ -233,7 +236,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
STEADFAST(BeeBranchDefinition.HEROIC, "legio", false, new Color(0x4d2b15), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 1), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.20f)
|
||||
.setHasEffect();
|
||||
}
|
||||
|
||||
@@ -253,7 +256,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
VALIANT(BeeBranchDefinition.HEROIC, "centurio", true, new Color(0x626bdd), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 1), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.30f)
|
||||
.addSpecialty(new ItemStack(Items.sugar), 0.15f);
|
||||
}
|
||||
|
||||
@@ -273,7 +276,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
HEROIC(BeeBranchDefinition.HEROIC, "kraphti", false, new Color(0xb3d5e4), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 1), 0.40f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.40f)
|
||||
.setHasEffect();
|
||||
}
|
||||
|
||||
@@ -297,7 +300,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
SINISTER(BeeBranchDefinition.INFERNAL, "caecus", false, new Color(0xb3d5e4), new Color(0x9a2323)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 2), 0.45f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.45f)
|
||||
.setTemperature(EnumTemperature.HELLISH)
|
||||
.setHumidity(EnumHumidity.ARID);
|
||||
}
|
||||
@@ -320,8 +323,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
FIENDISH(BeeBranchDefinition.INFERNAL, "diabolus", true, new Color(0xd7bee5), new Color(0x9a2323)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 2), 0.55f)
|
||||
.addProduct(ForestryItem.ash.getItemStack(), 0.15f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.55f)
|
||||
.addProduct(PluginCore.items.ash.getItemStack(), 0.15f)
|
||||
.setTemperature(EnumTemperature.HELLISH)
|
||||
.setHumidity(EnumHumidity.ARID);
|
||||
}
|
||||
@@ -344,7 +347,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
DEMONIC(BeeBranchDefinition.INFERNAL, "draco", false, new Color(0xf4e400), new Color(0x9a2323)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 2), 0.45f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.45f)
|
||||
.addProduct(new ItemStack(Items.glowstone_dust), 0.15f)
|
||||
.setHasEffect()
|
||||
.setTemperature(EnumTemperature.HELLISH)
|
||||
@@ -369,7 +372,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MODEST(BeeBranchDefinition.AUSTERE, "modicus", false, new Color(0xc5be86), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 7), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.20f)
|
||||
.setTemperature(EnumTemperature.HOT)
|
||||
.setHumidity(EnumHumidity.ARID);
|
||||
}
|
||||
@@ -388,7 +391,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
FRUGAL(BeeBranchDefinition.AUSTERE, "permodestus", true, new Color(0xe8dcb1), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 7), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.30f)
|
||||
.setTemperature(EnumTemperature.HOT)
|
||||
.setHumidity(EnumHumidity.ARID);
|
||||
}
|
||||
@@ -412,8 +415,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
AUSTERE(BeeBranchDefinition.AUSTERE, "correpere", false, new Color(0xfffac2), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 7), 0.20f)
|
||||
.addSpecialty(ForestryItem.beeComb.getItemStack(1, 10), 0.50f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.20f)
|
||||
.addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.POWDERY, 1), 0.50f)
|
||||
.setHasEffect()
|
||||
.setTemperature(EnumTemperature.HOT)
|
||||
.setHumidity(EnumHumidity.ARID);
|
||||
@@ -439,7 +442,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
TROPICAL(BeeBranchDefinition.TROPICAL, "mendelia", false, new Color(0x378020), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 6), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.20f)
|
||||
.setTemperature(EnumTemperature.WARM)
|
||||
.setHumidity(EnumHumidity.DAMP);
|
||||
}
|
||||
@@ -458,7 +461,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
EXOTIC(BeeBranchDefinition.TROPICAL, "darwini", true, new Color(0x304903), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 6), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.30f)
|
||||
.setTemperature(EnumTemperature.WARM)
|
||||
.setHumidity(EnumHumidity.DAMP);
|
||||
}
|
||||
@@ -477,7 +480,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
EDENIC(BeeBranchDefinition.TROPICAL, "humboldti", false, new Color(0x393d0d), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 6), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.20f)
|
||||
.setHasEffect()
|
||||
.setTemperature(EnumTemperature.WARM)
|
||||
.setHumidity(EnumHumidity.DAMP);
|
||||
@@ -501,7 +504,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
ENDED(BeeBranchDefinition.END, "notchi", false, new Color(0xe079fa), new Color(0xd9de9e)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 8), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.30f)
|
||||
.setTemperature(EnumTemperature.COLD);
|
||||
}
|
||||
|
||||
@@ -518,7 +521,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
SPECTRAL(BeeBranchDefinition.END, "idolum", true, new Color(0xa98bed), new Color(0xd9de9e)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 8), 0.50f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.50f)
|
||||
.setTemperature(EnumTemperature.COLD);
|
||||
}
|
||||
|
||||
@@ -535,7 +538,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
PHANTASMAL(BeeBranchDefinition.END, "lemur", false, new Color(0xcc00fa), new Color(0xd9de9e)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 8), 0.40f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.40f)
|
||||
.setHasEffect()
|
||||
.setTemperature(EnumTemperature.COLD);
|
||||
}
|
||||
@@ -557,7 +560,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
WINTRY(BeeBranchDefinition.FROZEN, "brumalis", false, new Color(0xa0ffc8), new Color(0xdaf5f3)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 4), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f)
|
||||
.setTemperature(EnumTemperature.ICY);
|
||||
}
|
||||
|
||||
@@ -576,8 +579,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
ICY(BeeBranchDefinition.FROZEN, "coagulis", true, new Color(0xa0ffff), new Color(0xdaf5f3)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 4), 0.20f)
|
||||
.addProduct(ForestryItem.craftingMaterial.getItemStack(1, 5), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.20f)
|
||||
.addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.20f)
|
||||
.setTemperature(EnumTemperature.ICY);
|
||||
}
|
||||
|
||||
@@ -596,8 +599,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
GLACIAL(BeeBranchDefinition.FROZEN, "glacialis", false, new Color(0xefffff), new Color(0xdaf5f3)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 4), 0.20f)
|
||||
.addProduct(ForestryItem.craftingMaterial.getItemStack(1, 5), 0.40f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.20f)
|
||||
.addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.40f)
|
||||
.setTemperature(EnumTemperature.ICY)
|
||||
.setHasEffect();
|
||||
}
|
||||
@@ -619,7 +622,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
VINDICTIVE(BeeBranchDefinition.VENGEFUL, "ultio", false, new Color(0xeafff3), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 9), 0.25f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.25f)
|
||||
.setIsNotCounted();
|
||||
}
|
||||
|
||||
@@ -637,7 +640,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
VENGEFUL(BeeBranchDefinition.VENGEFUL, "punire", false, new Color(0xc2de00), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 9), 0.40f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.40f)
|
||||
.setIsNotCounted();
|
||||
}
|
||||
|
||||
@@ -656,7 +659,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
AVENGING(BeeBranchDefinition.VENGEFUL, "hostimentum", false, new Color(0xddff00), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 9), 0.40f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.40f)
|
||||
.setHasEffect()
|
||||
.setIsNotCounted();
|
||||
}
|
||||
@@ -678,7 +681,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
LEPORINE(BeeBranchDefinition.FESTIVE, "lepus", false, new Color(0xfeff8f), new Color(0x3cd757)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 6), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.30f)
|
||||
.addProduct(new ItemStack(Items.egg), 0.10f)
|
||||
.setHasEffect()
|
||||
.setIsNotCounted();
|
||||
@@ -700,8 +703,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MERRY(BeeBranchDefinition.FESTIVE, "feliciter", false, new Color(0xffffff), new Color(0xd40000)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 4), 0.30f)
|
||||
.addProduct(ForestryItem.craftingMaterial.getItemStack(1, 5), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f)
|
||||
.addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.20f)
|
||||
.setTemperature(EnumTemperature.ICY)
|
||||
.setHasEffect()
|
||||
.setIsNotCounted();
|
||||
@@ -724,8 +727,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
TIPSY(BeeBranchDefinition.FESTIVE, "ebrius", false, new Color(0xffffff), new Color(0xc219ec)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 4), 0.30f)
|
||||
.addProduct(ForestryItem.craftingMaterial.getItemStack(1, 5), 0.20f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f)
|
||||
.addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.20f)
|
||||
.setTemperature(EnumTemperature.ICY)
|
||||
.setHasEffect()
|
||||
.setIsNotCounted();
|
||||
@@ -749,7 +752,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
TRICKY(BeeBranchDefinition.FESTIVE, "libita", false, new Color(0x49413B), new Color(0xFF6A00)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 0), 0.40f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.40f)
|
||||
.addProduct(new ItemStack(Items.cookie), 0.15f)
|
||||
.addSpecialty(new ItemStack(Items.skull, 1, 0), 0.02f)
|
||||
.addSpecialty(new ItemStack(Items.skull, 1, 2), 0.02f)
|
||||
@@ -779,7 +782,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
RURAL(BeeBranchDefinition.AGRARIAN, "rustico", false, new Color(0xfeff8f), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 14), 0.20f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.20f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -796,7 +799,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
FARMERLY(BeeBranchDefinition.AGRARIAN, "arator", true, new Color(0xD39728), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 14), 0.27f);
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.27f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -814,7 +817,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
AGRARIAN(BeeBranchDefinition.AGRARIAN, "arator", true, new Color(0xFFCA75), new Color(0xFFE047)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 14), 0.35f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.35f)
|
||||
.setHasEffect();
|
||||
}
|
||||
|
||||
@@ -837,7 +840,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MARSHY(BeeBranchDefinition.BOGGY, "adorasti", true, new Color(0x546626), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 15), 0.30f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.30f)
|
||||
.setHumidity(EnumHumidity.DAMP);
|
||||
}
|
||||
|
||||
@@ -854,7 +857,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MIRY(BeeBranchDefinition.BOGGY, "humidium", true, new Color(0x92AF42), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 15), 0.36f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.36f)
|
||||
.setHumidity(EnumHumidity.DAMP);
|
||||
}
|
||||
|
||||
@@ -875,8 +878,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
BOGGY(BeeBranchDefinition.BOGGY, "paluster", true, new Color(0x698948), new Color(0xffdc16)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 15), 0.39f)
|
||||
.addSpecialty(ForestryItem.peat.getItemStack(), 0.08f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.39f)
|
||||
.addSpecialty(PluginCore.items.peat.getItemStack(), 0.08f)
|
||||
.setHumidity(EnumHumidity.DAMP);
|
||||
}
|
||||
|
||||
@@ -900,8 +903,8 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
MONASTIC(BeeBranchDefinition.MONASTIC, "monachus", false, new Color(0x42371c), new Color(0xfff7b6)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addProduct(ForestryItem.beeComb.getItemStack(1, 14), 0.30f)
|
||||
.addSpecialty(ForestryItem.beeComb.getItemStack(1, 16), 0.10f)
|
||||
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.30f)
|
||||
.addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.10f)
|
||||
.setJubilanceProvider(new JubilanceProviderHermit());
|
||||
}
|
||||
|
||||
@@ -918,7 +921,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
SECLUDED(BeeBranchDefinition.MONASTIC, "contractus", true, new Color(0x7b6634), new Color(0xfff7b6)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addSpecialty(ForestryItem.beeComb.getItemStack(1, 16), 0.20f)
|
||||
beeSpecies.addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.20f)
|
||||
.setJubilanceProvider(new JubilanceProviderHermit());
|
||||
}
|
||||
|
||||
@@ -935,7 +938,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
HERMITIC(BeeBranchDefinition.MONASTIC, "anachoreta", false, new Color(0xffd46c), new Color(0xfff7b6)) {
|
||||
@Override
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies.addSpecialty(ForestryItem.beeComb.getItemStack(1, 16), 0.20f)
|
||||
beeSpecies.addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.20f)
|
||||
.setJubilanceProvider(new JubilanceProviderHermit())
|
||||
.setHasEffect();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ import forestry.api.genetics.IMutation;
|
||||
import forestry.apiculture.BeeHousingListener;
|
||||
import forestry.apiculture.BeeHousingModifier;
|
||||
import forestry.apiculture.BeekeepingLogic;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.genetics.SpeciesRoot;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
@@ -108,20 +107,20 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot {
|
||||
Item beeItem;
|
||||
switch (EnumBeeType.VALUES[type]) {
|
||||
case QUEEN:
|
||||
beeItem = ForestryItem.beeQueenGE.item();
|
||||
beeItem = PluginApiculture.items.beeQueenGE;
|
||||
// ensure a queen is always mated
|
||||
if (bee.getMate() == null) {
|
||||
bee.mate(bee);
|
||||
}
|
||||
break;
|
||||
case PRINCESS:
|
||||
beeItem = ForestryItem.beePrincessGE.item();
|
||||
beeItem = PluginApiculture.items.beePrincessGE;
|
||||
break;
|
||||
case DRONE:
|
||||
beeItem = ForestryItem.beeDroneGE.item();
|
||||
beeItem = PluginApiculture.items.beeDroneGE;
|
||||
break;
|
||||
case LARVAE:
|
||||
beeItem = ForestryItem.beeLarvaeGE.item();
|
||||
beeItem = PluginApiculture.items.beeLarvaeGE;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Cannot instantiate a bee of type " + type);
|
||||
@@ -140,13 +139,15 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot {
|
||||
return EnumBeeType.NONE;
|
||||
}
|
||||
|
||||
if (ForestryItem.beeDroneGE.isItemEqual(stack)) {
|
||||
Item item = stack.getItem();
|
||||
|
||||
if (PluginApiculture.items.beeDroneGE == item) {
|
||||
return EnumBeeType.DRONE;
|
||||
} else if (ForestryItem.beePrincessGE.isItemEqual(stack)) {
|
||||
} else if (PluginApiculture.items.beePrincessGE == item) {
|
||||
return EnumBeeType.PRINCESS;
|
||||
} else if (ForestryItem.beeQueenGE.isItemEqual(stack)) {
|
||||
} else if (PluginApiculture.items.beeQueenGE == item) {
|
||||
return EnumBeeType.QUEEN;
|
||||
} else if (ForestryItem.beeLarvaeGE.isItemEqual(stack)) {
|
||||
} else if (PluginApiculture.items.beeLarvaeGE == item) {
|
||||
return EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@@ -327,10 +328,13 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot {
|
||||
|
||||
// Create a tracker if there is none yet.
|
||||
if (tracker == null) {
|
||||
tracker = new ApiaristTracker(filename, player);
|
||||
tracker = new ApiaristTracker(filename);
|
||||
world.setItemData(filename, tracker);
|
||||
}
|
||||
|
||||
tracker.setUsername(player);
|
||||
tracker.setWorld(world);
|
||||
|
||||
return tracker;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.genetics;
|
||||
|
||||
import forestry.api.apiculture.IBeeIconColourProvider;
|
||||
|
||||
public class DefaultBeeIconColourProvider implements IBeeIconColourProvider {
|
||||
private final int primaryColour;
|
||||
private final int secondaryColour;
|
||||
|
||||
public DefaultBeeIconColourProvider(int primaryColour, int secondaryColour) {
|
||||
this.primaryColour = primaryColour;
|
||||
this.secondaryColour = secondaryColour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconColour(int renderPass) {
|
||||
if (renderPass == 0) {
|
||||
return primaryColour;
|
||||
}
|
||||
if (renderPass == 1) {
|
||||
return secondaryColour;
|
||||
}
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.genetics;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBeeIconProvider;
|
||||
import forestry.core.render.TextureManager;
|
||||
|
||||
public class DefaultBeeIconProvider implements IBeeIconProvider {
|
||||
|
||||
public static final DefaultBeeIconProvider instance = new DefaultBeeIconProvider();
|
||||
|
||||
private DefaultBeeIconProvider() {
|
||||
|
||||
}
|
||||
|
||||
private static final IIcon[][] icons = new IIcon[EnumBeeType.values().length][3];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
String beeIconDir = "bees/default/";
|
||||
IIcon body1 = TextureManager.registerTex(register, beeIconDir + "body1");
|
||||
|
||||
for (int i = 0; i < EnumBeeType.values().length; i++) {
|
||||
EnumBeeType beeType = EnumBeeType.values()[i];
|
||||
if (beeType == EnumBeeType.NONE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String beeTypeNameBase = beeIconDir + beeType.toString().toLowerCase(Locale.ENGLISH);
|
||||
|
||||
icons[i][0] = TextureManager.registerTex(register, beeTypeNameBase + ".outline");
|
||||
if (beeType == EnumBeeType.LARVAE) {
|
||||
icons[i][1] = TextureManager.registerTex(register, beeTypeNameBase + ".body");
|
||||
} else {
|
||||
icons[i][1] = body1;
|
||||
}
|
||||
icons[i][2] = TextureManager.registerTex(register, beeTypeNameBase + ".body2");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(EnumBeeType type, int renderPass) {
|
||||
return icons[type.ordinal()][renderPass];
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ package forestry.apiculture.genetics;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -33,9 +34,17 @@ public class JubilanceRequiresResource implements IJubilanceProvider {
|
||||
public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates housingCoords = housing.getCoordinates();
|
||||
Block block;
|
||||
TileEntity tile;
|
||||
int meta;
|
||||
int i = 1;
|
||||
do {
|
||||
block = world.getBlock(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
|
||||
meta = world.getBlockMetadata(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
|
||||
tile = world.getTileEntity(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
|
||||
i++;
|
||||
} while (tile instanceof IBeeHousing);
|
||||
|
||||
Block block = world.getBlock(housingCoords.posX, housingCoords.posY - 1, housingCoords.posZ);
|
||||
int meta = world.getBlockMetadata(housingCoords.posX, housingCoords.posY - 1, housingCoords.posZ);
|
||||
return ItemStackUtil.equals(block, meta, blockRequired);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ package forestry.apiculture.genetics.alleles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -27,39 +26,38 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeSpeciesCustom;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeIconColourProvider;
|
||||
import forestry.api.apiculture.IBeeIconProvider;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.apiculture.IJubilanceProvider;
|
||||
import forestry.api.core.IIconProvider;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.apiculture.genetics.DefaultBeeIconColourProvider;
|
||||
import forestry.apiculture.genetics.DefaultBeeIconProvider;
|
||||
import forestry.apiculture.genetics.JubilanceDefault;
|
||||
import forestry.core.genetics.alleles.AlleleSpecies;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.core.utils.GeneticsUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
|
||||
public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpeciesCustom {
|
||||
private final Map<ItemStack, Float> productChances = new HashMap<>();
|
||||
private final Map<ItemStack, Float> specialtyChances = new HashMap<>();
|
||||
|
||||
private final int primaryColour;
|
||||
private final int secondaryColour;
|
||||
|
||||
private IBeeIconProvider beeIconProvider = DefaultBeeIconProvider.instance;
|
||||
private IJubilanceProvider jubilanceProvider = JubilanceDefault.instance;
|
||||
private IBeeIconProvider beeIconProvider;
|
||||
private IBeeIconColourProvider beeIconColourProvider;
|
||||
private IJubilanceProvider jubilanceProvider;
|
||||
private boolean nocturnal = false;
|
||||
|
||||
public AlleleBeeSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
|
||||
super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial);
|
||||
|
||||
this.primaryColour = primaryColor;
|
||||
this.secondaryColour = secondaryColor;
|
||||
beeIconProvider = DefaultBeeIconProvider.instance;
|
||||
beeIconColourProvider = new DefaultBeeIconColourProvider(primaryColor, secondaryColor);
|
||||
jubilanceProvider = JubilanceDefault.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,12 +107,13 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
|
||||
return this;
|
||||
}
|
||||
|
||||
/* RESEARCH */
|
||||
@Override
|
||||
public int getComplexity() {
|
||||
return GeneticsUtil.getResearchComplexity(this, EnumBeeChromosome.SPECIES);
|
||||
public IAlleleBeeSpeciesCustom setCustomBeeIconColourProvider(IBeeIconColourProvider beeIconColourProvider) {
|
||||
this.beeIconColourProvider = beeIconColourProvider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/* RESEARCH */
|
||||
@Override
|
||||
public float getResearchSuitability(ItemStack itemstack) {
|
||||
if (itemstack == null) {
|
||||
@@ -185,13 +184,7 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
|
||||
|
||||
@Override
|
||||
public int getIconColour(int renderPass) {
|
||||
if (renderPass == 0) {
|
||||
return primaryColour;
|
||||
}
|
||||
if (renderPass == 1) {
|
||||
return secondaryColour;
|
||||
}
|
||||
return 0xffffff;
|
||||
return beeIconColourProvider.getIconColour(renderPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,47 +192,6 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class DefaultBeeIconProvider implements IBeeIconProvider {
|
||||
|
||||
public static final DefaultBeeIconProvider instance = new DefaultBeeIconProvider();
|
||||
|
||||
private DefaultBeeIconProvider() {
|
||||
|
||||
}
|
||||
|
||||
private static final IIcon[][] icons = new IIcon[EnumBeeType.values().length][3];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
String beeIconDir = "bees/default/";
|
||||
IIcon body1 = TextureManager.registerTex(register, beeIconDir + "body1");
|
||||
|
||||
for (int i = 0; i < EnumBeeType.values().length; i++) {
|
||||
EnumBeeType beeType = EnumBeeType.values()[i];
|
||||
if (beeType == EnumBeeType.NONE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String beeTypeNameBase = beeIconDir + beeType.toString().toLowerCase(Locale.ENGLISH);
|
||||
|
||||
icons[i][0] = TextureManager.registerTex(register, beeTypeNameBase + ".outline");
|
||||
if (beeType == EnumBeeType.LARVAE) {
|
||||
icons[i][1] = TextureManager.registerTex(register, beeTypeNameBase + ".body");
|
||||
} else {
|
||||
icons[i][1] = body1;
|
||||
}
|
||||
icons[i][2] = TextureManager.registerTex(register, beeTypeNameBase + ".body2");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(EnumBeeType type, int renderPass) {
|
||||
return icons[type.ordinal()][renderPass];
|
||||
}
|
||||
}
|
||||
|
||||
private static class BeeIconProviderWrapper implements IIconProvider {
|
||||
|
||||
private final IBeeIconProvider beeIconProvider;
|
||||
|
||||
@@ -13,9 +13,12 @@ package forestry.apiculture.genetics.alleles;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
@@ -58,8 +61,8 @@ public class AlleleEffectFertile extends AlleleEffectThrottled {
|
||||
|
||||
private static boolean tryTickColumn(World world, int x, int z, int maxY, int minY) {
|
||||
for (int y = maxY; y >= minY; --y) {
|
||||
if (!world.isAirBlock(x, y, z)) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block.getTickRandomly() && (block instanceof IGrowable || block instanceof IPlantable)) {
|
||||
world.scheduleBlockUpdate(x, y, z, block, 5);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class AlleleEffectRadioactive extends AlleleEffectThrottled {
|
||||
|
||||
// Entities are not attacked if they wear a full set of apiarist's armor.
|
||||
int count = BeeManager.armorApiaristHelper.wearsItems(entity, getUID(), true);
|
||||
damage -= count;
|
||||
damage -= (count * 2);
|
||||
if (damage <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ package forestry.apiculture.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.apiculture.multiblock.TileAlvearyPlain;
|
||||
import forestry.apiculture.multiblock.TileAlveary;
|
||||
import forestry.core.gui.ContainerTile;
|
||||
import forestry.core.network.PacketGuiUpdate;
|
||||
import forestry.core.network.packets.PacketGuiUpdate;
|
||||
|
||||
public class ContainerAlveary extends ContainerTile<TileAlvearyPlain> {
|
||||
public class ContainerAlveary extends ContainerTile<TileAlveary> {
|
||||
|
||||
public ContainerAlveary(InventoryPlayer player, TileAlvearyPlain tile) {
|
||||
public ContainerAlveary(InventoryPlayer player, TileAlveary tile) {
|
||||
super(tile, player, 8, 108);
|
||||
ContainerBeeHelper.addSlots(this, tile, false);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import forestry.apiculture.tiles.TileBeeHousingBase;
|
||||
import forestry.core.gui.ContainerTile;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketGuiUpdate;
|
||||
import forestry.core.network.packets.PacketGuiUpdate;
|
||||
|
||||
public class ContainerBeeHousing extends ContainerTile<TileBeeHousingBase> implements IContainerBeeHousing {
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.apiculture.inventory.ItemInventoryImprinter;
|
||||
import forestry.apiculture.network.PacketImprintSelectionResponse;
|
||||
import forestry.apiculture.network.packets.PacketImprintSelectionResponse;
|
||||
import forestry.core.gui.ContainerItemInventory;
|
||||
import forestry.core.gui.IGuiSelectable;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.core.network.PacketGuiSelectRequest;
|
||||
import forestry.core.network.packets.PacketGuiSelectRequest;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class ContainerImprinter extends ContainerItemInventory<ItemInventoryImprinter> implements IGuiSelectable {
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import forestry.apiculture.entities.EntityMinecartBeeHousingBase;
|
||||
import forestry.core.gui.ContainerEntity;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketGuiUpdateEntity;
|
||||
import forestry.core.network.packets.PacketGuiUpdateEntity;
|
||||
|
||||
public class ContainerMinecartBeehouse extends ContainerEntity<EntityMinecartBeeHousingBase> implements IContainerBeeHousing {
|
||||
public ContainerMinecartBeehouse(InventoryPlayer player, EntityMinecartBeeHousingBase entity, boolean hasFrames) {
|
||||
|
||||
@@ -13,14 +13,14 @@ package forestry.apiculture.gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.apiculture.multiblock.IAlvearyControllerInternal;
|
||||
import forestry.apiculture.multiblock.TileAlvearyPlain;
|
||||
import forestry.apiculture.multiblock.TileAlveary;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.gui.GuiForestryTitled;
|
||||
import forestry.core.render.EnumTankLevel;
|
||||
|
||||
public class GuiAlveary extends GuiForestryTitled<ContainerAlveary, TileAlvearyPlain> {
|
||||
public class GuiAlveary extends GuiForestryTitled<ContainerAlveary, TileAlveary> {
|
||||
|
||||
public GuiAlveary(InventoryPlayer inventory, TileAlvearyPlain tile) {
|
||||
public GuiAlveary(InventoryPlayer inventory, TileAlveary tile) {
|
||||
super(Constants.TEXTURE_PATH_GUI + "/alveary.png", new ContainerAlveary(inventory, tile), tile);
|
||||
|
||||
ySize = 190;
|
||||
|
||||
@@ -25,13 +25,12 @@ import forestry.api.genetics.IAlleleInteger;
|
||||
import forestry.api.genetics.IAlleleTolerance;
|
||||
import forestry.apiculture.genetics.BeeGenome;
|
||||
import forestry.apiculture.inventory.ItemInventoryBeealyzer;
|
||||
import forestry.apiculture.items.ItemBeeGE;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.genetics.alleles.AlleleBoolean;
|
||||
import forestry.core.gui.ContainerAlyzer;
|
||||
import forestry.core.gui.GuiAlyzer;
|
||||
import forestry.core.gui.widgets.ItemStackWidget;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class GuiBeealyzer extends GuiAlyzer {
|
||||
|
||||
@@ -39,7 +38,7 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
super(BeeManager.beeRoot, player, new ContainerAlyzer(inventory, player), inventory, "gui.beealyzer");
|
||||
|
||||
ArrayList<ItemStack> beeList = new ArrayList<>();
|
||||
((ItemBeeGE) ForestryItem.beeDroneGE.item()).addCreativeItems(beeList, false);
|
||||
PluginApiculture.items.beeDroneGE.addCreativeItems(beeList, false);
|
||||
for (ItemStack beeStack : beeList) {
|
||||
IAlleleBeeSpecies species = BeeGenome.getSpecies(beeStack);
|
||||
if (species != null) {
|
||||
|
||||
@@ -21,14 +21,13 @@ import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.apiculture.genetics.BeeGenome;
|
||||
import forestry.apiculture.inventory.ItemInventoryImprinter;
|
||||
import forestry.apiculture.items.ItemBeeGE;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.gui.GuiForestry;
|
||||
import forestry.core.gui.GuiUtil;
|
||||
import forestry.core.network.PacketGuiSelectRequest;
|
||||
import forestry.core.network.packets.PacketGuiSelectRequest;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class GuiImprinter extends GuiForestry<ContainerImprinter, ItemInventoryImprinter> {
|
||||
|
||||
@@ -44,7 +43,7 @@ public class GuiImprinter extends GuiForestry<ContainerImprinter, ItemInventoryI
|
||||
ySize = 185;
|
||||
|
||||
List<ItemStack> beeList = new ArrayList<>();
|
||||
((ItemBeeGE) ForestryItem.beeDroneGE.item()).addCreativeItems(beeList, false);
|
||||
PluginApiculture.items.beeDroneGE.addCreativeItems(beeList, false);
|
||||
for (ItemStack beeStack : beeList) {
|
||||
IAlleleBeeSpecies species = BeeGenome.getSpecies(beeStack);
|
||||
if (species != null) {
|
||||
|
||||
@@ -14,10 +14,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.apiculture.multiblock.TileAlvearySieve;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.inventory.InventoryAdapterTile;
|
||||
import forestry.core.inventory.watchers.ISlotPickupWatcher;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.plugins.PluginCore;
|
||||
|
||||
public class InventoryAlvearySieve extends InventoryAdapterTile<TileAlvearySieve> implements ISlotPickupWatcher {
|
||||
public static final int SLOT_POLLEN_1 = 0;
|
||||
@@ -30,7 +30,7 @@ public class InventoryAlvearySieve extends InventoryAdapterTile<TileAlvearySieve
|
||||
|
||||
@Override
|
||||
public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
|
||||
return ItemStackUtil.isIdenticalItem(ForestryItem.craftingMaterial.getItemStack(1, 3), itemStack);
|
||||
return ItemStackUtil.isIdenticalItem(PluginCore.items.craftingMaterial.getWovenSilk(), itemStack);
|
||||
}
|
||||
|
||||
public boolean canStorePollen() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class InventoryApiary extends InventoryBeeHousing implements IApiaryInven
|
||||
public static final int SLOT_FRAMES_COUNT = 3;
|
||||
|
||||
public InventoryApiary(IAccessHandler accessHandler) {
|
||||
super(12, "Items", accessHandler);
|
||||
super(12, accessHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,10 +27,10 @@ import forestry.api.core.IErrorState;
|
||||
import forestry.apiculture.items.HabitatLocatorLogic;
|
||||
import forestry.apiculture.items.ItemHabitatLocator;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.gui.IHintSource;
|
||||
import forestry.core.inventory.ItemInventory;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class ItemInventoryHabitatLocator extends ItemInventory implements IErrorSource, IHintSource {
|
||||
|
||||
@@ -51,7 +51,8 @@ public class ItemInventoryHabitatLocator extends ItemInventory implements IError
|
||||
return false;
|
||||
}
|
||||
|
||||
return ForestryItem.honeyDrop.isItemEqual(itemstack) || ForestryItem.honeydew.isItemEqual(itemstack);
|
||||
Item item = itemstack.getItem();
|
||||
return PluginApiculture.items.honeyDrop == item || PluginApiculture.items.honeydew == item;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,8 +120,7 @@ public class ItemInventoryHabitatLocator extends ItemInventory implements IError
|
||||
@Override
|
||||
public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
|
||||
if (slotIndex == SLOT_ENERGY) {
|
||||
Item item = itemStack.getItem();
|
||||
return item == ForestryItem.honeydew.item() || item == ForestryItem.honeyDrop.item();
|
||||
return isEnergy(itemStack);
|
||||
} else if (slotIndex == SLOT_SPECIMEN) {
|
||||
return BeeManager.beeRoot.isMember(itemStack);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum EnumHoneyComb {
|
||||
HONEY(new Color(0xe8d56a), new Color(0xffa12b)),
|
||||
COCOA(new Color(0x674016), new Color(0xffb62b), true),
|
||||
SIMMERING(new Color(0x981919), new Color(0xffb62b)),
|
||||
STRINGY(new Color(0xc8be67), new Color(0xbda93e)),
|
||||
FROZEN(new Color(0xf9ffff), new Color(0xa0ffff)),
|
||||
DRIPPING(new Color(0xdc7613), new Color(0xffff00)),
|
||||
SILKY(new Color(0x508907), new Color(0xddff00)),
|
||||
PARCHED(new Color(0xdcbe13), new Color(0xffff00)),
|
||||
MYSTERIOUS(new Color(0x161616), new Color(0xe099ff), true),
|
||||
IRRADIATED(new Color(0xeafff3), new Color(0xeeff00), true),
|
||||
POWDERY(new Color(0xe4e4e4), new Color(0xffffff), true),
|
||||
REDDENED(new Color(0x4b0000), new Color(0x6200e7), true),
|
||||
DARKENED(new Color(0x353535), new Color(0x33ebcb), true),
|
||||
OMEGA(new Color(0x191919), new Color(0x6dcff6), true),
|
||||
WHEATEN(new Color(0xfeff8f), new Color(0xffffff), true),
|
||||
MOSSY(new Color(0x2a3313), new Color(0x7e9939)),
|
||||
MELLOW(new Color(0x886000), new Color(0xfff960));
|
||||
//""(new Color(0xd7bee5), new Color(0xfd58ab)); // kindof pinkish
|
||||
|
||||
public static final EnumHoneyComb[] VALUES = values();
|
||||
|
||||
public final String name;
|
||||
public final int primaryColor;
|
||||
public final int secondaryColor;
|
||||
private final boolean secret;
|
||||
|
||||
EnumHoneyComb(Color primary, Color secondary) {
|
||||
this(primary, secondary, false);
|
||||
}
|
||||
|
||||
EnumHoneyComb(Color primary, Color secondary, boolean secret) {
|
||||
this.name = toString().toLowerCase(Locale.ENGLISH);
|
||||
this.primaryColor = primary.getRGB();
|
||||
this.secondaryColor = secondary.getRGB();
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
public boolean isSecret() {
|
||||
return secret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.core.items.ItemOverlay;
|
||||
|
||||
public enum EnumHoneyDrop implements ItemOverlay.IOverlayInfo {
|
||||
HONEY(new Color(0xecb42d), new Color(0xe8c814)),
|
||||
CHARGED(new Color(0x800505), new Color(0x9c0707), true),
|
||||
OMEGA(new Color(0x191919), new Color(0x4a8ca7), true);
|
||||
|
||||
public static final EnumHoneyDrop[] VALUES = values();
|
||||
|
||||
private final String name;
|
||||
private final int primaryColor;
|
||||
private final int secondaryColor;
|
||||
private final boolean secret;
|
||||
|
||||
EnumHoneyDrop(Color primary, Color secondary) {
|
||||
this(primary, secondary, false);
|
||||
}
|
||||
|
||||
EnumHoneyDrop(Color primary, Color secondary, boolean secret) {
|
||||
this.name = toString().toLowerCase(Locale.ENGLISH);
|
||||
this.primaryColor = primary.getRGB();
|
||||
this.secondaryColor = secondary.getRGB();
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPrimaryColor() {
|
||||
return primaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSecondaryColor() {
|
||||
return secondaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return secret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.core.items.ItemOverlay;
|
||||
|
||||
public enum EnumPollenCluster implements ItemOverlay.IOverlayInfo {
|
||||
NORMAL(new Color(0xa28a25), new Color(0xa28a25)),
|
||||
CRYSTALLINE(new Color(0xffffff), new Color(0xc5feff));
|
||||
|
||||
public static final EnumPollenCluster[] VALUES = values();
|
||||
|
||||
private final String name;
|
||||
private final int primaryColor;
|
||||
private final int secondaryColor;
|
||||
|
||||
EnumPollenCluster(Color primary, Color secondary) {
|
||||
this.name = toString().toLowerCase(Locale.ENGLISH);
|
||||
this.primaryColor = primary.getRGB();
|
||||
this.secondaryColor = secondary.getRGB();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPrimaryColor() {
|
||||
return primaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSecondaryColor() {
|
||||
return secondaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.core.items.ItemOverlay;
|
||||
|
||||
public enum EnumPropolis implements ItemOverlay.IOverlayInfo {
|
||||
NORMAL(new Color(0xc5b24e)),
|
||||
STICKY(new Color(0xc68e57)),
|
||||
PULSATING(new Color(0x2ccdb1), true),
|
||||
SILKY(new Color(0xddff00));
|
||||
|
||||
public static final EnumPropolis[] VALUES = values();
|
||||
|
||||
private final String name;
|
||||
private final int primaryColor;
|
||||
private final boolean secret;
|
||||
|
||||
EnumPropolis(Color color) {
|
||||
this(color, false);
|
||||
}
|
||||
|
||||
EnumPropolis(Color color, boolean secret) {
|
||||
this.name = toString().toLowerCase(Locale.ENGLISH);
|
||||
this.primaryColor = color.getRGB();
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPrimaryColor() {
|
||||
return primaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSecondaryColor() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return secret;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.apiculture.network.PacketHabitatBiomePointer;
|
||||
import forestry.apiculture.network.packets.PacketHabitatBiomePointer;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class ItemArmorApiarist extends ItemArmor implements IArmorApiarist, IArmorNaturalist {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ItemArmorApiarist extends ItemArmor implements IArmorApiarist, IArm
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
if (ForestryItem.apiaristLegs.isItemEqual(stack)) {
|
||||
if (stack != null && stack.getItem() == PluginApiculture.items.apiaristLegs) {
|
||||
return Constants.ID + ":" + Constants.TEXTURE_APIARIST_ARMOR_SECONDARY;
|
||||
} else {
|
||||
return Constants.ID + ":" + Constants.TEXTURE_APIARIST_ARMOR_PRIMARY;
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
@@ -33,7 +32,6 @@ import forestry.api.core.Tabs;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.apiculture.genetics.BeeGenome;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.genetics.ItemGE;
|
||||
@@ -44,9 +42,8 @@ public class ItemBeeGE extends ItemGE {
|
||||
private final EnumBeeType type;
|
||||
|
||||
public ItemBeeGE(EnumBeeType type) {
|
||||
super();
|
||||
super(Tabs.tabApiculture);
|
||||
this.type = type;
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
if (type != EnumBeeType.DRONE) {
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.gui.GuiBeealyzer;
|
||||
import forestry.apiculture.inventory.ItemInventoryBeealyzer;
|
||||
import forestry.core.gui.ContainerAlyzer;
|
||||
import forestry.core.items.ItemWithGui;
|
||||
|
||||
public class ItemBeealyzer extends ItemWithGui {
|
||||
public ItemBeealyzer() {
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
ItemInventoryBeealyzer inventory = new ItemInventoryBeealyzer(player, heldItem);
|
||||
return new GuiBeealyzer(player, inventory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
ItemInventoryBeealyzer inventory = new ItemInventoryBeealyzer(player, heldItem);
|
||||
return new ContainerAlyzer(inventory, player);
|
||||
}
|
||||
}
|
||||
@@ -28,9 +28,11 @@ import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.apiculture.gui.ContainerHabitatLocator;
|
||||
import forestry.apiculture.gui.GuiHabitatLocator;
|
||||
import forestry.apiculture.inventory.ItemInventoryHabitatLocator;
|
||||
import forestry.apiculture.render.TextureHabitatLocator;
|
||||
import forestry.core.items.ItemWithGui;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.StringUtil;
|
||||
|
||||
public class ItemHabitatLocator extends ItemWithGui {
|
||||
@@ -39,9 +41,8 @@ public class ItemHabitatLocator extends ItemWithGui {
|
||||
private final HabitatLocatorLogic locatorLogic;
|
||||
|
||||
public ItemHabitatLocator() {
|
||||
super(GuiId.HabitatLocatorGUI);
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setMaxStackSize(1);
|
||||
locatorLogic = new HabitatLocatorLogic();
|
||||
}
|
||||
|
||||
@@ -80,4 +81,14 @@ public class ItemHabitatLocator extends ItemWithGui {
|
||||
list.add(StringUtil.localize("gui.temperature") + ": " + AlleleManager.climateHelper.toDisplay(temperature));
|
||||
list.add(StringUtil.localize("gui.humidity") + ": " + AlleleManager.climateHelper.toDisplay(humidity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
return new GuiHabitatLocator(player, new ItemInventoryHabitatLocator(player, heldItem));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
return new ContainerHabitatLocator(player, new ItemInventoryHabitatLocator(player, heldItem));
|
||||
}
|
||||
}
|
||||
@@ -20,51 +20,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.items.ItemForestryMultiPass;
|
||||
|
||||
public class ItemHoneycomb extends ItemForestryMultiPass {
|
||||
|
||||
private static class CombInfo {
|
||||
|
||||
public final String name;
|
||||
public final int primaryColor;
|
||||
public final int secondaryColor;
|
||||
public boolean isSecret = false;
|
||||
|
||||
public CombInfo(String name, int primaryColor, int secondaryColor) {
|
||||
this.name = name;
|
||||
this.primaryColor = primaryColor;
|
||||
this.secondaryColor = secondaryColor;
|
||||
}
|
||||
|
||||
public CombInfo setIsSecret() {
|
||||
this.isSecret = true;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
private final CombInfo[] combs = new CombInfo[]{
|
||||
new CombInfo("honey", 0xe8d56a, 0xffa12b), // 0
|
||||
new CombInfo("cocoa", 0x674016, 0xffb62b).setIsSecret(), // 1
|
||||
new CombInfo("simmering", 0x981919, 0xffb62b), // 2
|
||||
new CombInfo("stringy", 0xc8be67, 0xbda93e), // 3
|
||||
new CombInfo("frozen", 0xf9ffff, 0xa0ffff), // 4
|
||||
new CombInfo("dripping", 0xdc7613, 0xffff00), // 5
|
||||
new CombInfo("silky", 0x508907, 0xddff00), // 6
|
||||
new CombInfo("parched", 0xdcbe13, 0xffff00), // 7
|
||||
new CombInfo("mysterious", 0x161616, 0xe099ff).setIsSecret(), // 8
|
||||
new CombInfo("irradiated", 0xeafff3, 0xeeff00).setIsSecret(), // 9
|
||||
new CombInfo("powdery", 0xe4e4e4, 0xffffff).setIsSecret(), // 10
|
||||
new CombInfo("reddened", 0x4b0000, 0x6200e7).setIsSecret(), // 11
|
||||
new CombInfo("darkened", 0x353535, 0x33ebcb).setIsSecret(), // 12
|
||||
new CombInfo("omega", 0x191919, 0x6dcff6).setIsSecret(), // 13
|
||||
new CombInfo("wheaten", 0xfeff8f, 0xffffff).setIsSecret(), // 14
|
||||
new CombInfo("mossy", 0x2a3313, 0x7e9939), // 15
|
||||
new CombInfo("mellow", 0x886000, 0xfff960) // 16
|
||||
// new CombInfo("", 0xd7bee5, 0xfd58ab), // kindof pinkish
|
||||
};
|
||||
|
||||
public ItemHoneycomb() {
|
||||
super();
|
||||
setMaxDamage(0);
|
||||
@@ -84,44 +42,53 @@ public class ItemHoneycomb extends ItemForestryMultiPass {
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + "." + combs[stack.getItemDamage()].name;
|
||||
EnumHoneyComb honeyComb = EnumHoneyComb.VALUES[stack.getItemDamage()];
|
||||
return super.getUnlocalizedName(stack) + "." + honeyComb.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(ItemStack itemstack, int j) {
|
||||
EnumHoneyComb honeyComb = EnumHoneyComb.VALUES[itemstack.getItemDamage()];
|
||||
if (j == 0) {
|
||||
return combs[itemstack.getItemDamage()].primaryColor;
|
||||
return honeyComb.primaryColor;
|
||||
} else {
|
||||
return combs[itemstack.getItemDamage()].secondaryColor;
|
||||
return honeyComb.secondaryColor;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (int i = 0; i < combs.length; i++) {
|
||||
if (!combs[i].isSecret || Config.isDebug) {
|
||||
for (int i = 0; i < EnumHoneyComb.VALUES.length; i++) {
|
||||
EnumHoneyComb honeyComb = EnumHoneyComb.VALUES[i];
|
||||
if (!honeyComb.isSecret() || Config.isDebug) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getRandomCombType(Random random, boolean includeSecret) {
|
||||
List<Integer> validCombs = new ArrayList<>(combs.length);
|
||||
for (int i = 0; i < combs.length; i++) {
|
||||
if (!combs[i].isSecret || includeSecret) {
|
||||
validCombs.add(i);
|
||||
private static EnumHoneyComb getRandomCombType(Random random, boolean includeSecret) {
|
||||
List<EnumHoneyComb> validCombs = new ArrayList<>(EnumHoneyComb.VALUES.length);
|
||||
for (int i = 0; i < EnumHoneyComb.VALUES.length; i++) {
|
||||
EnumHoneyComb honeyComb = EnumHoneyComb.VALUES[i];
|
||||
if (!honeyComb.isSecret() || includeSecret) {
|
||||
validCombs.add(honeyComb);
|
||||
}
|
||||
}
|
||||
|
||||
if (validCombs.isEmpty()) {
|
||||
return 0;
|
||||
return null;
|
||||
} else {
|
||||
return validCombs.get(random.nextInt(validCombs.size()));
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getRandomComb(int qty, Random random, boolean includeSecret) {
|
||||
return ForestryItem.beeComb.getItemStack(qty, ((ItemHoneycomb) ForestryItem.beeComb.item()).getRandomCombType(random, includeSecret));
|
||||
public ItemStack getRandomComb(int amount, Random random, boolean includeSecret) {
|
||||
EnumHoneyComb honeyComb = getRandomCombType(random, includeSecret);
|
||||
return get(honeyComb, amount);
|
||||
}
|
||||
|
||||
public ItemStack get(EnumHoneyComb honeyComb, int amount) {
|
||||
return new ItemStack(this, amount, honeyComb.ordinal());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.gui.ContainerImprinter;
|
||||
import forestry.apiculture.gui.GuiImprinter;
|
||||
import forestry.apiculture.inventory.ItemInventoryImprinter;
|
||||
import forestry.core.items.ItemWithGui;
|
||||
|
||||
public class ItemImprinter extends ItemWithGui {
|
||||
public ItemImprinter() {
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
return new GuiImprinter(player.inventory, new ItemInventoryImprinter(player, heldItem));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
return new ContainerImprinter(player.inventory, new ItemInventoryImprinter(player, heldItem));
|
||||
}
|
||||
}
|
||||
@@ -105,4 +105,12 @@ public class ItemMinecartBeehouse extends ItemMinecart {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getBeeHouseMinecart() {
|
||||
return new ItemStack(this, 1, 0);
|
||||
}
|
||||
|
||||
public ItemStack getApiaryMinecart() {
|
||||
return new ItemStack(this, 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.items.ItemOverlay;
|
||||
|
||||
public class ItemPollenCluster extends ItemOverlay {
|
||||
public ItemPollenCluster() {
|
||||
super(Tabs.tabApiculture, EnumPollenCluster.VALUES);
|
||||
}
|
||||
|
||||
public ItemStack get(EnumPollenCluster pollenCluster, int amount) {
|
||||
return new ItemStack(this, amount, pollenCluster.ordinal());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.items.ItemOverlay;
|
||||
|
||||
public class ItemPropolis extends ItemOverlay {
|
||||
public ItemPropolis() {
|
||||
super(Tabs.tabApiculture, EnumPropolis.VALUES);
|
||||
}
|
||||
|
||||
public ItemStack get(EnumPropolis propolis, int amount) {
|
||||
return new ItemStack(this, amount, propolis.ordinal());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.items.ItemForestry;
|
||||
import forestry.core.items.ItemOverlay;
|
||||
import forestry.core.items.ItemRegistry;
|
||||
import forestry.core.items.ItemScoop;
|
||||
|
||||
public class ItemRegistryApiculture extends ItemRegistry {
|
||||
public final ItemBeeGE beeQueenGE;
|
||||
public final ItemBeeGE beeDroneGE;
|
||||
public final ItemBeeGE beePrincessGE;
|
||||
public final ItemBeeGE beeLarvaeGE;
|
||||
|
||||
public final ItemHabitatLocator habitatLocator;
|
||||
public final ItemBeealyzer beealyzer;
|
||||
public final ItemImprinter imprinter;
|
||||
|
||||
public final ItemMinecartBeehouse minecartBeehouse;
|
||||
|
||||
public final ItemHiveFrame frameUntreated;
|
||||
public final ItemHiveFrame frameImpregnated;
|
||||
public final ItemHiveFrame frameProven;
|
||||
|
||||
public final ItemOverlay honeyDrop;
|
||||
public final ItemPollenCluster pollenCluster;
|
||||
public final ItemPropolis propolis;
|
||||
public final ItemForestry honeydew;
|
||||
public final ItemForestry royalJelly;
|
||||
public final ItemForestry waxCast;
|
||||
public final ItemHoneycomb beeComb;
|
||||
|
||||
public final ItemArmorApiarist apiaristHat;
|
||||
public final ItemArmorApiarist apiaristChest;
|
||||
public final ItemArmorApiarist apiaristLegs;
|
||||
public final ItemArmorApiarist apiaristBoots;
|
||||
|
||||
public final ItemScoop scoop;
|
||||
|
||||
public ItemRegistryApiculture() {
|
||||
// / BEES
|
||||
beeQueenGE = registerItem(new ItemBeeGE(EnumBeeType.QUEEN), "beeQueenGE");
|
||||
beeDroneGE = registerItem(new ItemBeeGE(EnumBeeType.DRONE), "beeDroneGE");
|
||||
beePrincessGE = registerItem(new ItemBeeGE(EnumBeeType.PRINCESS), "beePrincessGE");
|
||||
beeLarvaeGE = registerItem(new ItemBeeGE(EnumBeeType.LARVAE), "beeLarvaeGE");
|
||||
|
||||
beealyzer = registerItem(new ItemBeealyzer(), "beealyzer");
|
||||
habitatLocator = registerItem(new ItemHabitatLocator(), "habitatLocator");
|
||||
imprinter = registerItem(new ItemImprinter(), "imprinter");
|
||||
|
||||
minecartBeehouse = registerItem(new ItemMinecartBeehouse(), "cart.beehouse");
|
||||
|
||||
// / COMB FRAMES
|
||||
frameUntreated = registerItem(new ItemHiveFrame(80, 0.9f), "frameUntreated");
|
||||
frameImpregnated = registerItem(new ItemHiveFrame(240, 0.4f), "frameImpregnated");
|
||||
frameProven = registerItem(new ItemHiveFrame(720, 0.3f), "frameProven");
|
||||
|
||||
// / BEE RESOURCES
|
||||
honeyDrop = registerItem(new ItemOverlay(Tabs.tabApiculture, EnumHoneyDrop.VALUES), "honeyDrop");
|
||||
OreDictionary.registerOre("dropHoney", honeyDrop);
|
||||
|
||||
pollenCluster = registerItem(new ItemPollenCluster(), "pollen");
|
||||
OreDictionary.registerOre("itemPollen", pollenCluster);
|
||||
|
||||
propolis = registerItem(new ItemPropolis(), "propolis");
|
||||
|
||||
honeydew = registerItem(new ItemForestry(Tabs.tabApiculture), "honeydew");
|
||||
OreDictionary.registerOre("dropHoneydew", honeydew);
|
||||
|
||||
royalJelly = registerItem(new ItemForestry(Tabs.tabApiculture), "royalJelly");
|
||||
OreDictionary.registerOre("dropRoyalJelly", royalJelly);
|
||||
|
||||
waxCast = registerItem(new ItemWaxCast(), "waxCast");
|
||||
|
||||
// / BEE COMBS
|
||||
beeComb = registerItem(new ItemHoneycomb(), "beeCombs");
|
||||
OreDictionary.registerOre("beeComb", beeComb.getWildcard());
|
||||
|
||||
// / APIARIST'S CLOTHES
|
||||
apiaristHat = registerItem(new ItemArmorApiarist(0), "apiaristHelmet");
|
||||
apiaristChest = registerItem(new ItemArmorApiarist(1), "apiaristChest");
|
||||
apiaristLegs = registerItem(new ItemArmorApiarist(2), "apiaristLegs");
|
||||
apiaristBoots = registerItem(new ItemArmorApiarist(3), "apiaristBoots");
|
||||
|
||||
// TOOLS
|
||||
scoop = registerItem(new ItemScoop(), "scoop");
|
||||
scoop.setHarvestLevel("scoop", 3);
|
||||
}
|
||||
}
|
||||
@@ -12,15 +12,16 @@ package forestry.apiculture.items;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.items.ICraftingPlan;
|
||||
import forestry.core.items.ItemForestry;
|
||||
|
||||
public class ItemWaxCast extends ItemForestry implements ICraftingPlan {
|
||||
|
||||
public ItemWaxCast() {
|
||||
super();
|
||||
super(Tabs.tabApiculture);
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(10);
|
||||
setMaxDamage(16);
|
||||
setNoRepair();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.api.core.BiomeHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -53,7 +54,6 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
private final InventoryBeeHousing inventory;
|
||||
private final IBeekeepingLogic beekeepingLogic;
|
||||
|
||||
private BiomeGenBase cachedBiome;
|
||||
private float tempChange = 0.0f;
|
||||
private float humidChange = 0.0f;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
|
||||
public AlvearyController(World world) {
|
||||
super(world, AlvearyMultiblockSizeLimits.instance);
|
||||
this.inventory = new InventoryBeeHousing(9, "Items", getAccessHandler());
|
||||
this.inventory = new InventoryBeeHousing(9, getAccessHandler());
|
||||
this.beekeepingLogic = BeeManager.beeRoot.createBeekeepingLogic(this);
|
||||
|
||||
this.beeModifiers.add(new AlvearyBeeModifier());
|
||||
@@ -290,7 +290,6 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
|
||||
data.setFloat("TempChange", tempChange);
|
||||
data.setFloat("HumidChange", humidChange);
|
||||
|
||||
beekeepingLogic.writeToNBT(data);
|
||||
inventory.writeToNBT(data);
|
||||
}
|
||||
@@ -359,8 +358,11 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(this);
|
||||
if (beeModifier.isHellish() && tempChange >= 0) {
|
||||
return EnumTemperature.HELLISH;
|
||||
BiomeGenBase biome = getBiome();
|
||||
if (beeModifier.isHellish() || BiomeHelper.isBiomeHellish(biome)) {
|
||||
if (tempChange >= 0) {
|
||||
return EnumTemperature.HELLISH;
|
||||
}
|
||||
}
|
||||
|
||||
return EnumTemperature.getFromValue(getExactTemperature());
|
||||
@@ -383,11 +385,8 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
if (cachedBiome == null) {
|
||||
ChunkCoordinates coords = getReferenceCoord();
|
||||
cachedBiome = worldObj.getBiomeGenForCoords(coords.posX, coords.posZ);
|
||||
}
|
||||
return cachedBiome;
|
||||
ChunkCoordinates coords = getReferenceCoord();
|
||||
return worldObj.getBiomeGenForCoords(coords.posX, coords.posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -25,23 +29,31 @@ import forestry.api.core.IErrorLogic;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.api.multiblock.IMultiblockController;
|
||||
import forestry.apiculture.blocks.BlockAlveary;
|
||||
import forestry.apiculture.gui.ContainerAlveary;
|
||||
import forestry.apiculture.gui.GuiAlveary;
|
||||
import forestry.core.access.EnumAccess;
|
||||
import forestry.core.access.IAccessHandler;
|
||||
import forestry.core.access.IRestrictedAccess;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.gui.IHintSource;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.multiblock.MultiblockTileEntityForestry;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
import forestry.core.tiles.ITitled;
|
||||
|
||||
public abstract class TileAlveary extends MultiblockTileEntityForestry<MultiblockLogicAlveary> implements IBeeHousing, IRestrictedAccess, IAlvearyComponent {
|
||||
public static final int PLAIN_META = 0;
|
||||
public static final int ENTRANCE_META = 1;
|
||||
public static final int SWARMER_META = 2;
|
||||
public static final int FAN_META = 3;
|
||||
public static final int HEATER_META = 4;
|
||||
public static final int HYGRO_META = 5;
|
||||
public static final int STABILIZER_META = 6;
|
||||
public static final int SIEVE_META = 7;
|
||||
public abstract class TileAlveary extends MultiblockTileEntityForestry<MultiblockLogicAlveary> implements IBeeHousing, IAlvearyComponent, IRestrictedAccess, IStreamableGui, ITitled, IClimatised, IHintSource {
|
||||
private final String unlocalizedTitle;
|
||||
|
||||
protected TileAlveary() {
|
||||
this(BlockAlveary.Type.PLAIN);
|
||||
}
|
||||
|
||||
protected TileAlveary(BlockAlveary.Type type) {
|
||||
super(new MultiblockLogicAlveary());
|
||||
this.unlocalizedTitle = "tile.for.alveary." + type.ordinal() + ".name";
|
||||
}
|
||||
|
||||
/* TEXTURES */
|
||||
@@ -136,4 +148,52 @@ public abstract class TileAlveary extends MultiblockTileEntityForestry<Multibloc
|
||||
public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess) {
|
||||
getMultiblockLogic().getController().onSwitchAccess(oldAccess, newAccess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventoryAdapter getInternalInventory() {
|
||||
return getMultiblockLogic().getController().getInternalInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedTitle() {
|
||||
return unlocalizedTitle;
|
||||
}
|
||||
|
||||
/* IHintSource */
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("apiary");
|
||||
}
|
||||
|
||||
/* IClimatised */
|
||||
@Override
|
||||
public float getExactTemperature() {
|
||||
return getMultiblockLogic().getController().getExactTemperature();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExactHumidity() {
|
||||
return getMultiblockLogic().getController().getExactHumidity();
|
||||
}
|
||||
|
||||
/* IStreamableGui */
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
getMultiblockLogic().getController().writeGuiData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
getMultiblockLogic().getController().readGuiData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
return new GuiAlveary(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerAlveary(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import forestry.api.core.IClimateControlled;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.apiculture.network.PacketActiveUpdate;
|
||||
import forestry.apiculture.network.packets.PacketActiveUpdate;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IActivatable;
|
||||
import forestry.energy.EnergyManager;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -22,6 +23,8 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import forestry.api.core.IClimateControlled;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.apiculture.blocks.BlockAlveary;
|
||||
import forestry.apiculture.gui.ContainerAlvearyHygroregulator;
|
||||
import forestry.apiculture.gui.GuiAlvearyHygroregulator;
|
||||
import forestry.apiculture.inventory.InventoryHygroregulator;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.FluidHelper;
|
||||
@@ -29,10 +32,9 @@ import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.tiles.ILiquidTankTile;
|
||||
|
||||
public class TileAlvearyHygroregulator extends TileAlvearyWithGui implements IInventory, ILiquidTankTile, IFluidHandler, IAlvearyComponent.Climatiser {
|
||||
public class TileAlvearyHygroregulator extends TileAlveary implements IInventory, ILiquidTankTile, IFluidHandler, IAlvearyComponent.Climatiser {
|
||||
private final HygroregulatorRecipe[] recipes;
|
||||
|
||||
private final TankManager tankManager;
|
||||
@@ -43,7 +45,7 @@ public class TileAlvearyHygroregulator extends TileAlvearyWithGui implements IIn
|
||||
private int transferTime;
|
||||
|
||||
public TileAlvearyHygroregulator() {
|
||||
super(TileAlveary.HYGRO_META, GuiId.HygroregulatorGUI);
|
||||
super(BlockAlveary.Type.HYGRO);
|
||||
|
||||
this.inventory = new InventoryHygroregulator(this);
|
||||
|
||||
@@ -178,6 +180,16 @@ public class TileAlvearyHygroregulator extends TileAlvearyWithGui implements IIn
|
||||
return tankManager.getTankInfo(from);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
return new GuiAlvearyHygroregulator(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerAlvearyHygroregulator(player.inventory, this);
|
||||
}
|
||||
|
||||
private static class HygroregulatorRecipe {
|
||||
public final FluidStack liquid;
|
||||
public final int transferTime;
|
||||
|
||||
@@ -10,12 +10,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
@@ -23,18 +20,9 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.multiblock.IMultiblockController;
|
||||
import forestry.apiculture.blocks.BlockAlveary;
|
||||
import forestry.apiculture.trigger.ApicultureTriggers;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.gui.IHintSource;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
import forestry.core.tiles.ITitled;
|
||||
|
||||
import buildcraft.api.statements.IStatementContainer;
|
||||
import buildcraft.api.statements.ITriggerExternal;
|
||||
@@ -42,7 +30,7 @@ import buildcraft.api.statements.ITriggerInternal;
|
||||
import buildcraft.api.statements.ITriggerProvider;
|
||||
|
||||
@Optional.Interface(iface = "buildcraft.api.statements.ITriggerProvider", modid = "BuildCraftAPI|statements")
|
||||
public class TileAlvearyPlain extends TileAlveary implements IClimatised, IHintSource, ITitled, ITriggerProvider, IStreamableGui {
|
||||
public class TileAlvearyPlain extends TileAlveary implements ITriggerProvider {
|
||||
|
||||
@Override
|
||||
public void onMachineAssembled(IMultiblockController multiblockController, ChunkCoordinates minCoord, ChunkCoordinates maxCoord) {
|
||||
@@ -52,7 +40,7 @@ public class TileAlvearyPlain extends TileAlveary implements IClimatised, IHintS
|
||||
// set alveary entrance block meta
|
||||
if (yCoord == maxCoord.posY) {
|
||||
if ((xCoord > minCoord.posX && xCoord < maxCoord.posX) || (zCoord > minCoord.posZ && zCoord < maxCoord.posZ)) {
|
||||
this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, TileAlveary.ENTRANCE_META, 2);
|
||||
this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, BlockAlveary.Type.ENTRANCE.ordinal(), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,48 +52,15 @@ public class TileAlvearyPlain extends TileAlveary implements IClimatised, IHintS
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
// set alveary entrance block meta back to normal
|
||||
this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, TileAlveary.PLAIN_META, 2);
|
||||
this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, BlockAlveary.Type.PLAIN.ordinal(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventoryAdapter getInternalInventory() {
|
||||
return getMultiblockLogic().getController().getInternalInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowsAutomation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* GUI */
|
||||
@Override
|
||||
public void openGui(EntityPlayer player) {
|
||||
player.openGui(ForestryAPI.instance, GuiId.AlvearyGUI.ordinal(), worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
/* IStreamableGui */
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
getMultiblockLogic().getController().writeGuiData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
getMultiblockLogic().getController().readGuiData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedTitle() {
|
||||
return "tile.for.alveary.0.name";
|
||||
}
|
||||
|
||||
/* IHintSource */
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("apiary");
|
||||
}
|
||||
|
||||
/* ITRIGGERPROVIDER */
|
||||
@Optional.Method(modid = "BuildCraftAPI|statements")
|
||||
@Override
|
||||
@@ -121,15 +76,4 @@ public class TileAlvearyPlain extends TileAlveary implements IClimatised, IHintS
|
||||
res.add(ApicultureTriggers.missingDrone);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* IClimatised */
|
||||
@Override
|
||||
public float getExactTemperature() {
|
||||
return getMultiblockLogic().getController().getExactTemperature();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExactHumidity() {
|
||||
return getMultiblockLogic().getController().getExactHumidity();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeListener;
|
||||
@@ -20,18 +21,19 @@ import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.apiculture.blocks.BlockAlveary;
|
||||
import forestry.apiculture.gui.ContainerAlvearySieve;
|
||||
import forestry.apiculture.gui.GuiAlvearySieve;
|
||||
import forestry.apiculture.inventory.InventoryAlvearySieve;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.inventory.watchers.ISlotPickupWatcher;
|
||||
import forestry.core.network.GuiId;
|
||||
|
||||
public class TileAlvearySieve extends TileAlvearyWithGui implements IAlvearyComponent.BeeListener {
|
||||
public class TileAlvearySieve extends TileAlveary implements IAlvearyComponent.BeeListener {
|
||||
|
||||
private final IBeeListener beeListener;
|
||||
private final InventoryAlvearySieve inventory;
|
||||
|
||||
public TileAlvearySieve() {
|
||||
super(TileAlveary.SIEVE_META, GuiId.AlvearySieveGUI);
|
||||
super(BlockAlveary.Type.SIEVE);
|
||||
this.inventory = new InventoryAlvearySieve(this);
|
||||
this.beeListener = new AlvearySieveBeeListener(inventory);
|
||||
}
|
||||
@@ -58,6 +60,16 @@ public class TileAlvearySieve extends TileAlvearyWithGui implements IAlvearyComp
|
||||
return BlockAlveary.SIEVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
return new GuiAlvearySieve(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerAlvearySieve(player.inventory, this);
|
||||
}
|
||||
|
||||
static class AlvearySieveBeeListener extends DefaultBeeListener {
|
||||
private final InventoryAlvearySieve inventory;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.apiculture.multiblock;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Stack;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -23,28 +24,28 @@ import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.apiculture.blocks.BlockAlveary;
|
||||
import forestry.apiculture.gui.ContainerAlvearySwarmer;
|
||||
import forestry.apiculture.gui.GuiAlvearySwarmer;
|
||||
import forestry.apiculture.inventory.InventorySwarmer;
|
||||
import forestry.apiculture.network.PacketActiveUpdate;
|
||||
import forestry.apiculture.network.packets.PacketActiveUpdate;
|
||||
import forestry.apiculture.worldgen.Hive;
|
||||
import forestry.apiculture.worldgen.HiveDecorator;
|
||||
import forestry.apiculture.worldgen.HiveDescriptionSwarmer;
|
||||
import forestry.core.access.EnumAccess;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.inventory.wrappers.IInvSlot;
|
||||
import forestry.core.inventory.wrappers.InventoryIterator;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IActivatable;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
|
||||
public class TileAlvearySwarmer extends TileAlvearyWithGui implements ISidedInventory, IActivatable, IAlvearyComponent.Active {
|
||||
public class TileAlvearySwarmer extends TileAlveary implements ISidedInventory, IActivatable, IAlvearyComponent.Active {
|
||||
|
||||
private final InventorySwarmer inventory;
|
||||
private final Stack<ItemStack> pendingSpawns = new Stack<>();
|
||||
private boolean active;
|
||||
|
||||
public TileAlvearySwarmer() {
|
||||
super(TileAlveary.SWARMER_META, GuiId.AlvearySwarmerGUI);
|
||||
super(BlockAlveary.Type.SWARMER);
|
||||
this.inventory = new InventorySwarmer(this);
|
||||
}
|
||||
|
||||
@@ -201,15 +202,6 @@ public class TileAlvearySwarmer extends TileAlvearyWithGui implements ISidedInve
|
||||
nbttagcompound.setTag("PendingSpawns", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess) {
|
||||
if (oldAccess == EnumAccess.SHARED || newAccess == EnumAccess.SHARED) {
|
||||
// pipes connected to this need to update
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
@@ -227,4 +219,14 @@ public class TileAlvearySwarmer extends TileAlvearyWithGui implements ISidedInve
|
||||
Proxies.net.sendNetworkPacket(new PacketActiveUpdate(this), worldObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
return new GuiAlvearySwarmer(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerAlvearySwarmer(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.access.AccessHandler;
|
||||
import forestry.core.access.EnumAccess;
|
||||
import forestry.core.access.IAccessHandler;
|
||||
import forestry.core.access.IRestrictedAccess;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.tiles.ITitled;
|
||||
|
||||
public abstract class TileAlvearyWithGui extends TileAlveary implements ITitled, IRestrictedAccess {
|
||||
|
||||
private final AccessHandler accessHandler;
|
||||
private final String unlocalizedTitle;
|
||||
private final GuiId guiId;
|
||||
|
||||
protected TileAlvearyWithGui(int meta, GuiId guiId) {
|
||||
this.accessHandler = new AccessHandler(this);
|
||||
this.unlocalizedTitle = "tile.for.alveary." + meta + ".name";
|
||||
this.guiId = guiId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IAccessHandler getAccessHandler() {
|
||||
return accessHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess) {
|
||||
if (oldAccess == EnumAccess.SHARED || newAccess == EnumAccess.SHARED) {
|
||||
// pipes connected to this need to update
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data) {
|
||||
super.writeToNBT(data);
|
||||
accessHandler.writeToNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data) {
|
||||
super.readFromNBT(data);
|
||||
accessHandler.readFromNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getUnlocalizedTitle() {
|
||||
return unlocalizedTitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void openGui(EntityPlayer player) {
|
||||
player.openGui(ForestryAPI.instance, guiId.ordinal(), worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
|
||||
import forestry.apiculture.network.packets.PacketActiveUpdate;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicActive;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicActiveEntity;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicEntityRequest;
|
||||
import forestry.apiculture.network.packets.PacketCandleUpdate;
|
||||
import forestry.apiculture.network.packets.PacketHabitatBiomePointer;
|
||||
import forestry.apiculture.network.packets.PacketImprintSelectionResponse;
|
||||
import forestry.core.network.PacketRegistry;
|
||||
|
||||
public class PacketRegistryApiculture extends PacketRegistry {
|
||||
@Override
|
||||
public void registerPackets() {
|
||||
registerClientPacket(new PacketImprintSelectionResponse());
|
||||
registerClientPacket(new PacketActiveUpdate());
|
||||
registerClientPacket(new PacketBeeLogicActive());
|
||||
registerClientPacket(new PacketBeeLogicActiveEntity());
|
||||
registerClientPacket(new PacketHabitatBiomePointer());
|
||||
registerClientPacket(new PacketCandleUpdate());
|
||||
|
||||
registerServerPacket(new PacketBeeLogicEntityRequest());
|
||||
}
|
||||
}
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -18,8 +18,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketCoordinates;
|
||||
import forestry.core.network.PacketIdClient;
|
||||
import forestry.core.network.packets.PacketCoordinates;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IActivatable;
|
||||
|
||||
@@ -31,10 +31,15 @@ public class PacketActiveUpdate extends PacketCoordinates implements IForestryPa
|
||||
}
|
||||
|
||||
public PacketActiveUpdate(IActivatable tile) {
|
||||
super(PacketIdClient.TILE_FORESTRY_ACTIVE, tile.getCoordinates());
|
||||
super(tile.getCoordinates());
|
||||
this.active = tile.isActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdClient getPacketId() {
|
||||
return PacketIdClient.TILE_FORESTRY_ACTIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeData(DataOutputStreamForestry data) throws IOException {
|
||||
super.writeData(data);
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -21,8 +21,8 @@ import forestry.apiculture.BeekeepingLogic;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketCoordinates;
|
||||
import forestry.core.network.PacketIdClient;
|
||||
import forestry.core.network.packets.PacketCoordinates;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class PacketBeeLogicActive extends PacketCoordinates implements IForestryPacketClient {
|
||||
@@ -32,10 +32,15 @@ public class PacketBeeLogicActive extends PacketCoordinates implements IForestry
|
||||
}
|
||||
|
||||
public PacketBeeLogicActive(IBeeHousing tile) {
|
||||
super(PacketIdClient.BEE_LOGIC_ACTIVE, tile.getCoordinates());
|
||||
super(tile.getCoordinates());
|
||||
this.beekeepingLogic = (BeekeepingLogic) tile.getBeekeepingLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdClient getPacketId() {
|
||||
return PacketIdClient.BEE_LOGIC_ACTIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeData(DataOutputStreamForestry data) throws IOException {
|
||||
super.writeData(data);
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -21,8 +21,8 @@ import forestry.apiculture.BeekeepingLogic;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketEntityUpdate;
|
||||
import forestry.core.network.PacketIdClient;
|
||||
import forestry.core.network.packets.PacketEntityUpdate;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class PacketBeeLogicActiveEntity extends PacketEntityUpdate implements IForestryPacketClient {
|
||||
@@ -32,10 +32,15 @@ public class PacketBeeLogicActiveEntity extends PacketEntityUpdate implements IF
|
||||
}
|
||||
|
||||
public PacketBeeLogicActiveEntity(IBeeHousing housing, Entity entity) {
|
||||
super(PacketIdClient.BEE_LOGIC_ACTIVE_ENTITY, entity);
|
||||
super(entity);
|
||||
this.beekeepingLogic = (BeekeepingLogic) housing.getBeekeepingLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdClient getPacketId() {
|
||||
return PacketIdClient.BEE_LOGIC_ACTIVE_ENTITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeData(DataOutputStreamForestry data) throws IOException {
|
||||
super.writeData(data);
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -19,8 +19,8 @@ import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeekeepingLogic;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketServer;
|
||||
import forestry.core.network.PacketEntityUpdate;
|
||||
import forestry.core.network.PacketIdServer;
|
||||
import forestry.core.network.packets.PacketEntityUpdate;
|
||||
|
||||
public class PacketBeeLogicEntityRequest extends PacketEntityUpdate implements IForestryPacketServer {
|
||||
|
||||
@@ -28,7 +28,12 @@ public class PacketBeeLogicEntityRequest extends PacketEntityUpdate implements I
|
||||
}
|
||||
|
||||
public PacketBeeLogicEntityRequest(Entity entity) {
|
||||
super(PacketIdServer.BEE_LOGIC_ACTIVE_ENTITY_REQUEST, entity);
|
||||
super(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdServer getPacketId() {
|
||||
return PacketIdServer.BEE_LOGIC_ACTIVE_ENTITY_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -19,8 +19,8 @@ import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketCoordinates;
|
||||
import forestry.core.network.PacketIdClient;
|
||||
import forestry.core.network.packets.PacketCoordinates;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class PacketCandleUpdate extends PacketCoordinates implements IForestryPacketClient {
|
||||
@@ -32,12 +32,17 @@ public class PacketCandleUpdate extends PacketCoordinates implements IForestryPa
|
||||
}
|
||||
|
||||
public PacketCandleUpdate(TileCandle tileCandle) {
|
||||
super(PacketIdClient.CANDLE_UPDATE, tileCandle);
|
||||
super(tileCandle);
|
||||
|
||||
colour = tileCandle.getColour();
|
||||
lit = tileCandle.isLit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdClient getPacketId() {
|
||||
return PacketIdClient.CANDLE_UPDATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(DataOutputStreamForestry data) throws IOException {
|
||||
super.writeData(data);
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -17,8 +17,8 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketCoordinates;
|
||||
import forestry.core.network.PacketIdClient;
|
||||
import forestry.core.network.packets.PacketCoordinates;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class PacketHabitatBiomePointer extends PacketCoordinates implements IForestryPacketClient {
|
||||
@@ -27,7 +27,12 @@ public class PacketHabitatBiomePointer extends PacketCoordinates implements IFor
|
||||
}
|
||||
|
||||
public PacketHabitatBiomePointer(ChunkCoordinates coordinates) {
|
||||
super(PacketIdClient.HABITAT_BIOME_POINTER, coordinates);
|
||||
super(coordinates);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdClient getPacketId() {
|
||||
return PacketIdClient.HABITAT_BIOME_POINTER;
|
||||
}
|
||||
|
||||
@Override
|
||||
+8
-3
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.network;
|
||||
package forestry.apiculture.network.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -18,8 +18,8 @@ import net.minecraft.inventory.Container;
|
||||
import forestry.apiculture.gui.ContainerImprinter;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketGuiSelect;
|
||||
import forestry.core.network.PacketIdClient;
|
||||
import forestry.core.network.packets.PacketGuiSelect;
|
||||
|
||||
public class PacketImprintSelectionResponse extends PacketGuiSelect implements IForestryPacketClient {
|
||||
|
||||
@@ -27,7 +27,12 @@ public class PacketImprintSelectionResponse extends PacketGuiSelect implements I
|
||||
}
|
||||
|
||||
public PacketImprintSelectionResponse(int primaryIndex, int secondaryIndex) {
|
||||
super(PacketIdClient.IMPRINT_SELECTION_RESPONSE, primaryIndex, secondaryIndex);
|
||||
super(primaryIndex, secondaryIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketIdClient getPacketId() {
|
||||
return PacketIdClient.IMPRINT_SELECTION_RESPONSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -17,7 +17,6 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import forestry.apiculture.entities.EntityBee;
|
||||
import forestry.apiculture.render.RenderBeeEntity;
|
||||
import forestry.apiculture.render.RenderBeeItem;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.render.IBlockRenderer;
|
||||
import forestry.core.render.RenderAnalyzer;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
@@ -29,9 +28,9 @@ public class ProxyApicultureClient extends ProxyApiculture {
|
||||
if (PluginApiculture.fancyRenderedBees) {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBee.class, new RenderBeeEntity());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ForestryItem.beeDroneGE.item(), new RenderBeeItem());
|
||||
MinecraftForgeClient.registerItemRenderer(ForestryItem.beePrincessGE.item(), new RenderBeeItem());
|
||||
MinecraftForgeClient.registerItemRenderer(ForestryItem.beeQueenGE.item(), new RenderBeeItem());
|
||||
MinecraftForgeClient.registerItemRenderer(PluginApiculture.items.beeDroneGE, new RenderBeeItem());
|
||||
MinecraftForgeClient.registerItemRenderer(PluginApiculture.items.beePrincessGE, new RenderBeeItem());
|
||||
MinecraftForgeClient.registerItemRenderer(PluginApiculture.items.beeQueenGE, new RenderBeeItem());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,25 +16,24 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.inventory.InventoryPlain;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.tiles.TileNaturalistChest;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class TileApiaristChest extends TileNaturalistChest {
|
||||
|
||||
private boolean checkedForLegacyBlock = false;
|
||||
|
||||
public TileApiaristChest() {
|
||||
super(BeeManager.beeRoot, GuiId.ApiaristChestGUI);
|
||||
super(BeeManager.beeRoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateServerSide() {
|
||||
if (worldObj != null && !checkedForLegacyBlock) {
|
||||
Block block = worldObj.getBlock(xCoord, yCoord, zCoord);
|
||||
if (ForestryBlock.apiculture.isBlockEqual(block)) {
|
||||
if (PluginApiculture.blocks.apiculture == block) {
|
||||
migrateFromLegacyBlock();
|
||||
}
|
||||
|
||||
@@ -52,7 +51,7 @@ public class TileApiaristChest extends TileNaturalistChest {
|
||||
}
|
||||
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ForestryBlock.apicultureChest.block(), Constants.DEFINITION_APIARISTCHEST_META, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, PluginApiculture.blocks.apicultureChest, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
|
||||
TileApiaristChest tile = TileUtil.getTile(worldObj, xCoord, yCoord, zCoord, TileApiaristChest.class);
|
||||
for (int i = 0; i < getSizeInventory(); i++) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -29,10 +30,11 @@ import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.apiculture.ApiaryBeeListener;
|
||||
import forestry.apiculture.ApiaryBeeModifier;
|
||||
import forestry.apiculture.IApiary;
|
||||
import forestry.apiculture.gui.ContainerBeeHousing;
|
||||
import forestry.apiculture.gui.GuiBeeHousing;
|
||||
import forestry.apiculture.inventory.IApiaryInventory;
|
||||
import forestry.apiculture.inventory.InventoryApiary;
|
||||
import forestry.apiculture.trigger.ApicultureTriggers;
|
||||
import forestry.core.network.GuiId;
|
||||
|
||||
import buildcraft.api.statements.ITriggerExternal;
|
||||
|
||||
@@ -42,7 +44,7 @@ public class TileApiary extends TileBeeHousingBase implements IApiary {
|
||||
private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
|
||||
|
||||
public TileApiary() {
|
||||
super(GuiId.ApiaryGUI, "apiary");
|
||||
super("apiary");
|
||||
setInternalInventory(inventory);
|
||||
}
|
||||
|
||||
@@ -84,4 +86,15 @@ public class TileApiary extends TileBeeHousingBase implements IApiary {
|
||||
res.add(ApicultureTriggers.noFrames);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
ContainerBeeHousing container = new ContainerBeeHousing(player.inventory, this, true);
|
||||
return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.APIARY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerBeeHousing(player.inventory, this, true);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import forestry.api.core.EnumTemperature;
|
||||
import forestry.apiculture.gui.IGuiBeeHousingInventory;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
@@ -36,13 +35,12 @@ import forestry.core.tiles.TileBase;
|
||||
|
||||
public abstract class TileBeeHousingBase extends TileBase implements IBeeHousing, IClimatised, IGuiBeeHousingInventory, IStreamableGui {
|
||||
private final IBeekeepingLogic beeLogic;
|
||||
private BiomeGenBase cachedBiome;
|
||||
|
||||
// CLIENT
|
||||
private int breedingProgressPercent = 0;
|
||||
|
||||
protected TileBeeHousingBase(GuiId guiId, String hintKey) {
|
||||
super(guiId, hintKey);
|
||||
protected TileBeeHousingBase(String hintKey) {
|
||||
super(hintKey);
|
||||
this.beeLogic = BeeManager.beeRoot.createBeekeepingLogic(this);
|
||||
}
|
||||
|
||||
@@ -143,10 +141,7 @@ public abstract class TileBeeHousingBase extends TileBase implements IBeeHousing
|
||||
// / IBEEHOUSING
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
if (cachedBiome == null) {
|
||||
cachedBiome = worldObj.getBiomeGenForCoordsBody(xCoord, zCoord);
|
||||
}
|
||||
return cachedBiome;
|
||||
return worldObj.getBiomeGenForCoordsBody(xCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,13 +12,16 @@ package forestry.apiculture.tiles;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeListener;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.apiculture.BeehouseBeeModifier;
|
||||
import forestry.apiculture.InventoryBeeHousing;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.apiculture.gui.ContainerBeeHousing;
|
||||
import forestry.apiculture.gui.GuiBeeHousing;
|
||||
|
||||
public class TileBeehouse extends TileBeeHousingBase {
|
||||
private static final IBeeModifier beeModifier = new BeehouseBeeModifier();
|
||||
@@ -27,10 +30,10 @@ public class TileBeehouse extends TileBeeHousingBase {
|
||||
private final InventoryBeeHousing beeInventory;
|
||||
|
||||
public TileBeehouse() {
|
||||
super(GuiId.BeehouseGUI, "bee.house");
|
||||
super("bee.house");
|
||||
this.beeListener = new DefaultBeeListener();
|
||||
|
||||
beeInventory = new InventoryBeeHousing(12, "Items", getAccessHandler());
|
||||
beeInventory = new InventoryBeeHousing(12, getAccessHandler());
|
||||
beeInventory.disableAutomation();
|
||||
setInternalInventory(beeInventory);
|
||||
}
|
||||
@@ -49,4 +52,15 @@ public class TileBeehouse extends TileBeeHousingBase {
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, int data) {
|
||||
ContainerBeeHousing container = new ContainerBeeHousing(player.inventory, this, false);
|
||||
return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.BEE_HOUSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerBeeHousing(player.inventory, this, false);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import forestry.apiculture.network.PacketCandleUpdate;
|
||||
import forestry.apiculture.network.packets.PacketCandleUpdate;
|
||||
|
||||
public class TileCandle extends TileEntity {
|
||||
private int colour;
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
||||
@@ -39,18 +38,21 @@ import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IFlower;
|
||||
import forestry.apiculture.blocks.BlockApicultureType;
|
||||
import forestry.apiculture.inventory.InventoryApiary;
|
||||
import forestry.apiculture.tiles.TileApiary;
|
||||
import forestry.arboriculture.worldgen.BlockTypeLog;
|
||||
import forestry.arboriculture.worldgen.BlockTypeVanillaStairs;
|
||||
import forestry.arboriculture.worldgen.BlockTypeWood;
|
||||
import forestry.arboriculture.worldgen.BlockTypeWoodStairs;
|
||||
import forestry.core.blocks.BlockCoreType;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import forestry.core.worldgen.BlockType;
|
||||
import forestry.core.worldgen.BlockTypeTileForestry;
|
||||
import forestry.core.worldgen.IBlockType;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
@@ -180,7 +182,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
|
||||
// Escritoire
|
||||
if (random.nextInt(2) == 0) {
|
||||
IBlockType escritoireBlock = new BlockTypeTileForestry(ForestryBlock.core, Constants.DEFINITION_ESCRITOIRE_META);
|
||||
IBlockType escritoireBlock = new BlockTypeTileForestry(PluginCore.blocks.core, BlockCoreType.ESCRITOIRE.ordinal());
|
||||
escritoireBlock.setDirection(getRotatedDirection(ForgeDirection.EAST));
|
||||
placeBlockAtCurrentPosition(world, escritoireBlock, 1, 1, 3, structBoundingBox);
|
||||
}
|
||||
@@ -283,20 +285,22 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
int yCoord = getYWithOffset(y);
|
||||
int zCoord = getZWithOffset(x, z);
|
||||
|
||||
if (!box.isVecInside(xCoord, yCoord, zCoord) || ForestryBlock.apiculture.isBlockEqual(world, xCoord, yCoord, zCoord)
|
||||
|| !world.blockExists(xCoord, yCoord - 1, zCoord)) {
|
||||
if (!box.isVecInside(xCoord, yCoord, zCoord)) {
|
||||
return;
|
||||
}
|
||||
|
||||
world.setBlock(xCoord, yCoord, zCoord, ForestryBlock.apiculture.block(), Constants.DEFINITION_APIARY_META, Constants.FLAG_BLOCK_SYNCH);
|
||||
ForestryBlock.apiculture.block().onBlockAdded(world, xCoord, yCoord, zCoord);
|
||||
|
||||
TileEntity tile = world.getTileEntity(xCoord, yCoord, zCoord);
|
||||
if (!(tile instanceof TileApiary)) {
|
||||
Block block = world.getBlock(xCoord, yCoord, zCoord);
|
||||
if (PluginApiculture.blocks.apiculture == block || !world.blockExists(xCoord, yCoord - 1, zCoord)) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileApiary apiary = (TileApiary) tile;
|
||||
world.setBlock(xCoord, yCoord, zCoord, PluginApiculture.blocks.apiculture, BlockApicultureType.APIARY.ordinal(), Constants.FLAG_BLOCK_SYNCH);
|
||||
PluginApiculture.blocks.apiculture.onBlockAdded(world, xCoord, yCoord, zCoord);
|
||||
|
||||
TileApiary apiary = TileUtil.getTile(world, xCoord, yCoord, zCoord, TileApiary.class);
|
||||
if (apiary == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack randomVillagePrincess = getRandomVillageBeeStack(world, xCoord, yCoord, zCoord, EnumBeeType.PRINCESS);
|
||||
apiary.getBeeInventory().setQueen(randomVillagePrincess);
|
||||
@@ -313,11 +317,11 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
private static ItemStack getRandomFrame(Random random) {
|
||||
float roll = random.nextFloat();
|
||||
if (roll < 0.2f) {
|
||||
return ForestryItem.frameUntreated.getItemStack();
|
||||
return PluginApiculture.items.frameUntreated.getItemStack();
|
||||
} else if (roll < 0.4f) {
|
||||
return ForestryItem.frameImpregnated.getItemStack();
|
||||
return PluginApiculture.items.frameImpregnated.getItemStack();
|
||||
} else if (roll < 0.6) {
|
||||
return ForestryItem.frameProven.getItemStack();
|
||||
return PluginApiculture.items.frameProven.getItemStack();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public enum HiveDescription implements IHiveDescription {
|
||||
|
||||
@@ -70,7 +70,7 @@ public enum HiveDescription implements IHiveDescription {
|
||||
|
||||
@Override
|
||||
public Block getBlock() {
|
||||
return ForestryBlock.beehives.block();
|
||||
return PluginApiculture.blocks.beehives;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,7 @@ import forestry.api.apiculture.hives.IHiveGen;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.apiculture.tiles.TileSwarm;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
|
||||
public class HiveDescriptionSwarmer implements IHiveDescription {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class HiveDescriptionSwarmer implements IHiveDescription {
|
||||
|
||||
@Override
|
||||
public Block getBlock() {
|
||||
return ForestryBlock.beehives.block();
|
||||
return PluginApiculture.blocks.beehives;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,5 +74,4 @@ public class HiveDescriptionSwarmer implements IHiveDescription {
|
||||
((TileSwarm) tile).setContained(bees);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ public class FruitProviderPod extends FruitProviderNone {
|
||||
PAPAYA((short) 2013, (short) 2014, (short) 2015);//, COCONUT((short)2016, (short)2017, (short)2018);
|
||||
|
||||
public final short[] uids;
|
||||
|
||||
EnumPodType(short stage1, short stage2, short stage3) {
|
||||
uids = new short[]{stage1, stage2, stage3};
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture;
|
||||
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.arboriculture.gui.GuiTreealyzer;
|
||||
import forestry.arboriculture.inventory.ItemInventoryTreealyzer;
|
||||
import forestry.core.GuiHandlerBase;
|
||||
import forestry.core.gui.ContainerAlyzer;
|
||||
import forestry.core.network.GuiId;
|
||||
|
||||
public class GuiHandlerArboriculture extends GuiHandlerBase {
|
||||
|
||||
@Override
|
||||
public Container getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
int cleanId = decodeGuiID(id);
|
||||
|
||||
if (cleanId >= GuiId.values().length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (GuiId.values()[cleanId]) {
|
||||
|
||||
case ArboristChestGUI:
|
||||
return this.getNaturalistChestContainer(TreeManager.treeRoot, player, world, x, y, z, decodeGuiData(id));
|
||||
|
||||
case TreealyzerGUI:
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ContainerAlyzer(new ItemInventoryTreealyzer(player, equipped), player);
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public Gui getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
int cleanId = decodeGuiID(id);
|
||||
|
||||
if (cleanId >= GuiId.values().length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (GuiId.values()[cleanId]) {
|
||||
|
||||
case ArboristChestGUI:
|
||||
return this.getNaturalistChestGui(TreeManager.treeRoot, player, world, x, y, z, decodeGuiData(id));
|
||||
|
||||
case TreealyzerGUI:
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new GuiTreealyzer(player, new ItemInventoryTreealyzer(player, equipped));
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
|
||||
public class VillageHandlerArboriculture implements IVillageTradeHandler {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class VillageHandlerArboriculture implements IVillageTradeHandler {
|
||||
ItemStack randomTreeStack = TreeManager.treeRoot.getMemberStack(randomTree, EnumGermlingType.SAPLING.ordinal());
|
||||
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 8), randomTreeStack));
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 2), ForestryItem.grafterProven.getItemStack()));
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 2), PluginArboriculture.items.grafterProven.getItemStack()));
|
||||
|
||||
EnumWoodType randomWoodType = EnumWoodType.getRandom(random);
|
||||
ItemStack planks = TreeManager.woodItemAccess.getPlanks(randomWoodType, false);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.blocks;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
|
||||
public class BlockArboriculture extends BlockBase<BlockArboricultureType> {
|
||||
public BlockArboriculture() {
|
||||
super(true);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.blocks;
|
||||
|
||||
import forestry.arboriculture.tiles.TileArboristChest;
|
||||
import forestry.core.blocks.IMachinePropertiesTESR;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.render.IBlockRenderer;
|
||||
import forestry.core.tiles.TileForestry;
|
||||
|
||||
public enum BlockArboricultureType implements IMachinePropertiesTESR {
|
||||
ARBCHEST(TileArboristChest.class, "ArbChest") {
|
||||
@Override
|
||||
public IBlockRenderer getRenderer() {
|
||||
return Proxies.render.getRenderChest("arbchest");
|
||||
}
|
||||
};
|
||||
|
||||
public static final BlockArboricultureType[] VALUES = values();
|
||||
|
||||
private final String teIdent;
|
||||
private final Class<? extends TileForestry> teClass;
|
||||
|
||||
BlockArboricultureType(Class<? extends TileForestry> teClass, String teName) {
|
||||
this.teIdent = "forestry." + teName;
|
||||
this.teClass = teClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTeIdent() {
|
||||
return teIdent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends TileForestry> getTeClass() {
|
||||
return teClass;
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,9 @@ public class BlockPlanks extends BlockWood {
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
EnumWoodType woodType = EnumWoodType.LARCH;
|
||||
if (meta > 0 && meta < EnumWoodType.VALUES.length)
|
||||
if (meta > 0 && meta < EnumWoodType.VALUES.length) {
|
||||
woodType = EnumWoodType.VALUES[meta];
|
||||
}
|
||||
return IconProviderWood.getPlankIcon(woodType);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.blocks;
|
||||
|
||||
import forestry.arboriculture.items.ItemBlockLeaves;
|
||||
import forestry.arboriculture.items.ItemBlockWood;
|
||||
import forestry.arboriculture.items.ItemBlockWoodSlab;
|
||||
import forestry.core.blocks.BlockRegistry;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
|
||||
public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
public final BlockLog logs;
|
||||
public final BlockPlanks planks;
|
||||
public final BlockSlab slabs;
|
||||
public final BlockSlab slabsDouble;
|
||||
public final BlockArbFence fences;
|
||||
public final BlockArbStairs stairs;
|
||||
public final BlockLog logsFireproof;
|
||||
public final BlockPlanks planksFireproof;
|
||||
public final BlockSlab slabsFireproof;
|
||||
public final BlockSlab slabsDoubleFireproof;
|
||||
public final BlockArbFence fencesFireproof;
|
||||
public final BlockArbStairs stairsFireproof;
|
||||
|
||||
public final BlockSapling saplingGE;
|
||||
public final BlockForestryLeaves leaves;
|
||||
public final BlockFruitPod pods;
|
||||
|
||||
public final BlockArboriculture arboriculture;
|
||||
|
||||
public BlockRegistryArboriculture() {
|
||||
// Wood blocks
|
||||
logs = registerBlock(new BlockLog(false), ItemBlockWood.class, "logs");
|
||||
registerOreDictWildcard("logWood", logs);
|
||||
|
||||
planks = registerBlock(new BlockPlanks(false), ItemBlockWood.class, "planks");
|
||||
registerOreDictWildcard("plankWood", planks);
|
||||
|
||||
BlockSlab blockSlab = new BlockSlab(false, false);
|
||||
BlockSlab blockSlabDouble = new BlockSlab(true, false);
|
||||
slabs = registerBlock(blockSlab, ItemBlockWoodSlab.class, "slabs", blockSlabDouble, blockSlab);
|
||||
registerOreDictWildcard("slabWood", slabs);
|
||||
|
||||
slabsDouble = registerBlock(blockSlabDouble, ItemBlockWoodSlab.class, "slabsDouble", blockSlabDouble, blockSlab);
|
||||
|
||||
fences = registerBlock(new BlockArbFence(false), ItemBlockWood.class, "fences");
|
||||
registerOreDictWildcard("fenceWood", fences);
|
||||
|
||||
stairs = registerBlock(new BlockArbStairs(planks, false), ItemBlockWood.class, "stairs");
|
||||
registerOreDictWildcard("stairWood", stairs);
|
||||
|
||||
logsFireproof = registerBlock(new BlockLog(true), ItemBlockWood.class, "logsFireproof");
|
||||
registerOreDictWildcard("logWood", logsFireproof);
|
||||
|
||||
planksFireproof = registerBlock(new BlockPlanks(true), ItemBlockWood.class, "planksFireproof");
|
||||
registerOreDictWildcard("plankWood", planksFireproof);
|
||||
|
||||
BlockSlab blockSlabFireproof = new BlockSlab(false, true);
|
||||
BlockSlab blockSlabDoubleFireproof = new BlockSlab(true, true);
|
||||
slabsFireproof = registerBlock(blockSlabFireproof, ItemBlockWoodSlab.class, "slabsFireproof", blockSlabDoubleFireproof, blockSlabFireproof);
|
||||
registerOreDictWildcard("slabWood", slabsFireproof);
|
||||
|
||||
slabsDoubleFireproof = registerBlock(blockSlabDoubleFireproof, ItemBlockWoodSlab.class, "slabsDoubleFireproof", blockSlabDoubleFireproof, blockSlabFireproof);
|
||||
|
||||
fencesFireproof = registerBlock(new BlockArbFence(true), ItemBlockWood.class, "fencesFireproof");
|
||||
registerOreDictWildcard("fenceWood", fencesFireproof);
|
||||
|
||||
stairsFireproof = registerBlock(new BlockArbStairs(planksFireproof, true), ItemBlockWood.class, "stairsFireproof");
|
||||
registerOreDictWildcard("stairWood", stairsFireproof);
|
||||
|
||||
// Saplings
|
||||
saplingGE = registerBlock(new BlockSapling(), ItemBlockForestry.class, "saplingGE");
|
||||
registerOreDictWildcard("treeSapling", saplingGE);
|
||||
|
||||
// Leaves
|
||||
leaves = registerBlock(new BlockForestryLeaves(), ItemBlockLeaves.class, "leaves");
|
||||
registerOreDictWildcard("treeLeaves", leaves);
|
||||
|
||||
// Pods
|
||||
pods = registerBlock(new BlockFruitPod(), ItemBlockForestry.class, "pods");
|
||||
|
||||
// Machines
|
||||
arboriculture = registerBlock(new BlockArboriculture(), ItemBlockForestry.class, "arboriculture");
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,8 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp
|
||||
private final ParticleHelper.Callback particleCallback;
|
||||
private final boolean fireproof;
|
||||
|
||||
public BlockSlab(boolean fireproof) {
|
||||
super(false, Material.wood);
|
||||
public BlockSlab(boolean doubleSlab, boolean fireproof) {
|
||||
super(doubleSlab, Material.wood);
|
||||
|
||||
this.fireproof = fireproof;
|
||||
|
||||
@@ -61,9 +61,8 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp
|
||||
this.particleCallback = new ParticleHelper.DefaultCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
public boolean isDoubleSlab() {
|
||||
return field_150004_a;
|
||||
}
|
||||
|
||||
/* ICONS */
|
||||
@@ -100,8 +99,10 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
list.add(TreeManager.woodItemAccess.getSlab(woodType, fireproof));
|
||||
if (!isDoubleSlab()) {
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
list.add(TreeManager.woodItemAccess.getSlab(woodType, fireproof));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ package forestry.arboriculture.genetics;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.arboriculture.IArboristTracker;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
@@ -24,11 +22,7 @@ public class ArboristTracker extends BreedingTracker implements IArboristTracker
|
||||
|
||||
/** Required for creation from map storage */
|
||||
public ArboristTracker(String s) {
|
||||
this(s, null);
|
||||
}
|
||||
|
||||
public ArboristTracker(String s, GameProfile player) {
|
||||
super(s, player);
|
||||
super(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import forestry.api.arboriculture.EnumFruitFamily;
|
||||
@@ -45,7 +46,6 @@ import forestry.arboriculture.genetics.alleles.AlleleFruit;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleGrowth;
|
||||
import forestry.arboriculture.render.IconProviderGermling;
|
||||
import forestry.arboriculture.render.IconProviderGermlingVanilla;
|
||||
import forestry.arboriculture.render.IconProviderLeaves;
|
||||
import forestry.arboriculture.tiles.TileLeaves;
|
||||
import forestry.arboriculture.worldgen.BlockTypeLog;
|
||||
import forestry.arboriculture.worldgen.WorldGenAcacia;
|
||||
@@ -84,7 +84,6 @@ import forestry.arboriculture.worldgen.WorldGenWenge;
|
||||
import forestry.arboriculture.worldgen.WorldGenWillow;
|
||||
import forestry.arboriculture.worldgen.WorldGenZebrawood;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.genetics.alleles.AlleleBoolean;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.genetics.alleles.AllelePlantType;
|
||||
@@ -460,10 +459,10 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
|
||||
|
||||
@Override
|
||||
protected void registerMutations() {
|
||||
// only available by rare villager trade
|
||||
registerMutation(Sequioa,Baobab,1).requireNight().restrictBiomeType(BiomeDictionary.Type.FOREST);
|
||||
}
|
||||
},
|
||||
Jungle(TreeBranchDefinition.TROPICAL, "jungle", "tectona", false, EnumLeafType.JUNGLE, new Color(4764952), new Color(0x539d12), 3, new ItemStack(Blocks.log, 1, 3)) {
|
||||
Jungle(TreeBranchDefinition.TROPICAL, "jungle", "tectona", false, EnumLeafType.JUNGLE, new Color(4764952), new Color(0x658917), 3, new ItemStack(Blocks.log, 1, 3)) {
|
||||
@Override
|
||||
public WorldGenerator getWorldGenerator(ITreeGenData tree) {
|
||||
return new WorldGenJungle(tree);
|
||||
@@ -869,7 +868,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
|
||||
.restrictHumidity(EnumHumidity.DAMP);
|
||||
}
|
||||
},
|
||||
Papaya(TreeBranchDefinition.CARICA, "papaya", "papaya", true, EnumLeafType.PALM, new Color(0x6d9f58), new Color(0x9ee67f), EnumWoodType.PAPAYA) {
|
||||
Papaya(TreeBranchDefinition.CARICA, "papaya", "papaya", true, EnumLeafType.PALM, new Color(0x6d9f58), new Color(0x75E675), EnumWoodType.PAPAYA) {
|
||||
@Override
|
||||
public WorldGenerator getWorldGenerator(ITreeGenData tree) {
|
||||
return new WorldGenPapaya(tree);
|
||||
@@ -894,7 +893,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
|
||||
registerMutation(Jungle, Cherry, 5);
|
||||
}
|
||||
},
|
||||
Date(TreeBranchDefinition.PHOENIX, "datePalm", "dactylifera", true, EnumLeafType.PALM, new Color(0xcbcd79), new Color(0xf0f38f), EnumWoodType.PALM) {
|
||||
Date(TreeBranchDefinition.PHOENIX, "datePalm", "dactylifera", true, EnumLeafType.PALM, new Color(0xcbcd79), new Color(0xB3F370), EnumWoodType.PALM) {
|
||||
@Override
|
||||
public WorldGenerator getWorldGenerator(ITreeGenData tree) {
|
||||
return new WorldGenDate(tree);
|
||||
@@ -958,13 +957,13 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
|
||||
|
||||
// vanilla tree constructor
|
||||
TreeDefinition(TreeBranchDefinition branch, String speciesName, String binomial, boolean dominant, EnumLeafType leafType, Color primary, Color secondary, int vanillaMeta, ItemStack vanillaWood) {
|
||||
String uid = "forestry.tree" + this.toString();
|
||||
String unlocalizedDescription = "for.description.tree" + this.toString();
|
||||
String uid = "forestry.tree" + this;
|
||||
String unlocalizedDescription = "for.description.tree" + this;
|
||||
String unlocalizedName = "for.trees.species." + speciesName;
|
||||
|
||||
this.branch = branch;
|
||||
|
||||
ILeafIconProvider leafIconProvider = new IconProviderLeaves(leafType, primary, secondary);
|
||||
ILeafIconProvider leafIconProvider = TreeManager.treeFactory.getLeafIconProvider(leafType, primary, secondary);
|
||||
IGermlingIconProvider germlingIconProvider = new IconProviderGermlingVanilla(vanillaMeta);
|
||||
|
||||
this.species = TreeManager.treeFactory.createSpecies(uid, unlocalizedName, "Sengir", unlocalizedDescription, dominant, branch.getBranch(), binomial, leafIconProvider, germlingIconProvider, this);
|
||||
@@ -974,13 +973,13 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
|
||||
|
||||
// forestry tree constructor
|
||||
TreeDefinition(TreeBranchDefinition branch, String speciesName, String binomial, boolean dominant, EnumLeafType leafType, Color primary, Color secondary, EnumWoodType woodType) {
|
||||
String uid = "forestry.tree" + this.toString();
|
||||
String unlocalizedDescription = "for.description.tree" + this.toString();
|
||||
String uid = "forestry.tree" + this;
|
||||
String unlocalizedDescription = "for.description.tree" + this;
|
||||
String unlocalizedName = "for.trees.species." + speciesName;
|
||||
|
||||
this.branch = branch;
|
||||
|
||||
ILeafIconProvider leafIconProvider = new IconProviderLeaves(leafType, primary, secondary);
|
||||
ILeafIconProvider leafIconProvider = TreeManager.treeFactory.getLeafIconProvider(leafType, primary, secondary);
|
||||
IGermlingIconProvider germlingIconProvider = new IconProviderGermling(uid);
|
||||
|
||||
this.species = TreeManager.treeFactory.createSpecies(uid, unlocalizedName, "Sengir", unlocalizedDescription, dominant, branch.getBranch(), binomial, leafIconProvider, germlingIconProvider, this);
|
||||
@@ -1029,12 +1028,13 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
|
||||
|
||||
@Override
|
||||
public void setLeaves(ITreeGenome genome, World world, GameProfile owner, int x, int y, int z, boolean decorative) {
|
||||
boolean placed = world.setBlock(x, y, z, ForestryBlock.leaves.block(), 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
boolean placed = world.setBlock(x, y, z, PluginArboriculture.blocks.leaves, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
if (!placed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ForestryBlock.leaves.isBlockEqual(world, x, y, z)) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (PluginArboriculture.blocks.leaves != block) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -52,8 +53,6 @@ import forestry.arboriculture.blocks.BlockFruitPod;
|
||||
import forestry.arboriculture.tiles.TileFruitPod;
|
||||
import forestry.arboriculture.tiles.TileSapling;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.genetics.SpeciesRoot;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
@@ -119,9 +118,11 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
return EnumGermlingType.NONE;
|
||||
}
|
||||
|
||||
if (ForestryItem.sapling.isItemEqual(stack)) {
|
||||
Item item = stack.getItem();
|
||||
|
||||
if (PluginArboriculture.items.sapling == item) {
|
||||
return EnumGermlingType.SAPLING;
|
||||
} else if (ForestryItem.pollenFertile.isItemEqual(stack)) {
|
||||
} else if (PluginArboriculture.items.pollenFertile == item) {
|
||||
return EnumGermlingType.POLLEN;
|
||||
}
|
||||
|
||||
@@ -169,10 +170,10 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
Item germlingItem;
|
||||
switch (EnumGermlingType.VALUES[type]) {
|
||||
case SAPLING:
|
||||
germlingItem = ForestryItem.sapling.item();
|
||||
germlingItem = PluginArboriculture.items.sapling;
|
||||
break;
|
||||
case POLLEN:
|
||||
germlingItem = ForestryItem.pollenFertile.item();
|
||||
germlingItem = PluginArboriculture.items.pollenFertile;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Cannot instantiate a tree of type " + type);
|
||||
@@ -191,12 +192,13 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
@Override
|
||||
public boolean plantSapling(World world, ITree tree, GameProfile owner, int x, int y, int z) {
|
||||
|
||||
boolean placed = world.setBlock(x, y, z, ForestryBlock.saplingGE.block(), 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
boolean placed = world.setBlock(x, y, z, PluginArboriculture.blocks.saplingGE, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
if (!placed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ForestryBlock.saplingGE.isBlockEqual(world, x, y, z)) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (PluginArboriculture.blocks.saplingGE != block) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -220,12 +222,14 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
if (direction < 0) {
|
||||
return false;
|
||||
}
|
||||
boolean placed = ForestryBlock.pods.setBlock(world, x, y, z, direction);
|
||||
|
||||
boolean placed = world.setBlock(x, y, z, PluginArboriculture.blocks.pods, direction, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
if (!placed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ForestryBlock.pods.isBlockEqual(world, x, y, z)) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (PluginArboriculture.blocks.pods != block) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -268,10 +272,13 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
|
||||
// Create a tracker if there is none yet.
|
||||
if (tracker == null) {
|
||||
tracker = new ArboristTracker(filename, player);
|
||||
tracker = new ArboristTracker(filename);
|
||||
world.setItemData(filename, tracker);
|
||||
}
|
||||
|
||||
tracker.setUsername(player);
|
||||
tracker.setWorld(world);
|
||||
|
||||
return tracker;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,10 +54,6 @@ public class AlleleFruit extends AlleleCategorized implements IAlleleFruit {
|
||||
fruitCherry = new AlleleFruit("cherry", new FruitProviderRipening("cherry", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.CHERRY.getStack(), 1.0f).setColours(0xff2e2e, 0xc4d24a).setOverlay("berries"), true),
|
||||
fruitDates = new AlleleFruit("dates", new FruitProviderPod("dates", EnumFruitFamily.JUNGLE, FruitProviderPod.EnumPodType.DATES, ItemFruit.EnumFruit.DATES.getStack(4))),
|
||||
fruitPapaya = new AlleleFruit("papaya", new FruitProviderPod("papaya", EnumFruitFamily.JUNGLE, FruitProviderPod.EnumPodType.PAPAYA, ItemFruit.EnumFruit.PAPAYA.getStack())),
|
||||
// Allele.fruitCoconut = new AlleleFruit("fruitCoconut", new
|
||||
// FruitProviderPod("coconut", jungle, EnumPodType.COCONUT, new
|
||||
// ItemStack[] { new ItemStack(
|
||||
// ForestryItem.fruits, 1, EnumFruit.COCONUT.ordinal()) }));
|
||||
fruitLemon = new AlleleFruit("lemon", new FruitProviderRipening("lemon", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.LEMON.getStack(), 1.0f).setColours(0xeeee00, 0x99ff00).setOverlay("citrus"), true),
|
||||
fruitPlum = new AlleleFruit("plum", new FruitProviderRipening("plum", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.PLUM.getStack(), 1.0f).setColours(0x663446, 0xeeff1a).setOverlay("plums"), true)
|
||||
);
|
||||
|
||||
@@ -22,7 +22,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpeciesCustom;
|
||||
import forestry.api.arboriculture.IGermlingIconProvider;
|
||||
import forestry.api.arboriculture.ILeafIconProvider;
|
||||
@@ -34,10 +33,8 @@ import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.core.genetics.alleles.AlleleSpecies;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.core.utils.GeneticsUtil;
|
||||
|
||||
public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeciesCustom, IIconProvider {
|
||||
|
||||
private final ITreeGenerator generator;
|
||||
private final IGermlingIconProvider germlingIconProvider;
|
||||
private final ILeafIconProvider leafIconProvider;
|
||||
@@ -70,12 +67,6 @@ public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeci
|
||||
return this;
|
||||
}
|
||||
|
||||
/* RESEARCH */
|
||||
@Override
|
||||
public int getComplexity() {
|
||||
return GeneticsUtil.getResearchComplexity(this, EnumTreeChromosome.SPECIES);
|
||||
}
|
||||
|
||||
/* OTHER */
|
||||
@Override
|
||||
public EnumPlantType getPlantType() {
|
||||
|
||||
@@ -34,13 +34,12 @@ import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.arboriculture.genetics.TreeGenome;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleFruit;
|
||||
import forestry.arboriculture.inventory.ItemInventoryTreealyzer;
|
||||
import forestry.arboriculture.items.ItemGermlingGE;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.genetics.alleles.AlleleBoolean;
|
||||
import forestry.core.genetics.alleles.AllelePlantType;
|
||||
import forestry.core.gui.ContainerAlyzer;
|
||||
import forestry.core.gui.GuiAlyzer;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
|
||||
public class GuiTreealyzer extends GuiAlyzer {
|
||||
|
||||
@@ -48,7 +47,7 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
super(TreeManager.treeRoot, player, new ContainerAlyzer(inventory, player), inventory, "gui.treealyzer");
|
||||
|
||||
ArrayList<ItemStack> treeList = new ArrayList<>();
|
||||
((ItemGermlingGE) ForestryItem.sapling.item()).addCreativeItems(treeList, false);
|
||||
PluginArboriculture.items.sapling.addCreativeItems(treeList, false);
|
||||
for (ItemStack treeStack : treeList) {
|
||||
IAlleleTreeSpecies species = TreeGenome.getSpecies(treeStack);
|
||||
if (species != null) {
|
||||
|
||||
@@ -44,6 +44,10 @@ public class ItemBlockWood extends ItemBlockForestry {
|
||||
EnumWoodType woodType = getWoodType(stack);
|
||||
Block block = Block.getBlockFromItem(stack.getItem());
|
||||
|
||||
return placeWood(stack, woodType, block, player, world, x, y, z, metadata);
|
||||
}
|
||||
|
||||
public static boolean placeWood(ItemStack stack, EnumWoodType woodType, Block block, @Nullable EntityPlayer player, World world, int x, int y, int z, int metadata) {
|
||||
boolean placed = world.setBlock(x, y, z, block, metadata, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
if (!placed) {
|
||||
return false;
|
||||
@@ -117,7 +121,12 @@ public class ItemBlockWood extends ItemBlockForestry {
|
||||
if (ordinal >= 0 && ordinal < EnumWoodType.VALUES.length) {
|
||||
return EnumWoodType.VALUES[ordinal];
|
||||
}
|
||||
return null;
|
||||
return EnumWoodType.LARCH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package forestry.arboriculture.items;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.arboriculture.blocks.BlockSlab;
|
||||
import forestry.arboriculture.tiles.TileWood;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
|
||||
public class ItemBlockWoodSlab extends ItemBlockWood {
|
||||
private final BlockSlab slab;
|
||||
private final BlockSlab doubleSlab;
|
||||
private final boolean isDoubleSlab;
|
||||
|
||||
public ItemBlockWoodSlab(Block block, BlockSlab doubleSlab, BlockSlab slab) {
|
||||
super(block);
|
||||
this.doubleSlab = doubleSlab;
|
||||
this.slab = slab;
|
||||
this.isDoubleSlab = (block == doubleSlab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
|
||||
if (isDoubleSlab) {
|
||||
return super.onItemUse(itemStack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
} else if (itemStack.stackSize == 0) {
|
||||
return false;
|
||||
} else if (!player.canPlayerEdit(x, y, z, side, itemStack)) {
|
||||
return false;
|
||||
} else {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int i1 = world.getBlockMetadata(x, y, z);
|
||||
boolean flag = (i1 & 8) != 0;
|
||||
|
||||
EnumWoodType blockWoodType = null;
|
||||
EnumWoodType stackWoodType = getWoodType(itemStack);
|
||||
TileWood tile = TileUtil.getTile(world, x, y, z, TileWood.class);
|
||||
if (tile != null) {
|
||||
blockWoodType = tile.getWoodType();
|
||||
}
|
||||
|
||||
if ((side == 1 && !flag || side == 0 && flag) && block == this.slab && blockWoodType == stackWoodType) {
|
||||
if (world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))) {
|
||||
if (placeWood(itemStack, stackWoodType, doubleSlab, player, world, x, y, z, 0)) {
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.doubleSlab.stepSound.func_150496_b(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F);
|
||||
--itemStack.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
if (this.func_150946_a(itemStack, player, world, x, y, z, side)) {
|
||||
return true;
|
||||
} else {
|
||||
return super.onItemUse(itemStack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack itemStack) {
|
||||
int i1 = x;
|
||||
int j1 = y;
|
||||
int k1 = z;
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int l1 = world.getBlockMetadata(x, y, z);
|
||||
boolean flag = (l1 & 8) != 0;
|
||||
|
||||
EnumWoodType blockWoodType = null;
|
||||
EnumWoodType stackWoodType = getWoodType(itemStack);
|
||||
TileWood tile = TileUtil.getTile(world, x, y, z, TileWood.class);
|
||||
if (tile != null) {
|
||||
blockWoodType = tile.getWoodType();
|
||||
}
|
||||
|
||||
if ((side == 1 && !flag || side == 0 && flag) && block == this.slab && stackWoodType == blockWoodType) {
|
||||
return true;
|
||||
} else {
|
||||
if (side == 0) {
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1) {
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2) {
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3) {
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4) {
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5) {
|
||||
++x;
|
||||
}
|
||||
|
||||
Block block1 = world.getBlock(x, y, z);
|
||||
tile = TileUtil.getTile(world, x, y, z, TileWood.class);
|
||||
if (tile == null) {
|
||||
blockWoodType = null;
|
||||
} else {
|
||||
blockWoodType = tile.getWoodType();
|
||||
}
|
||||
|
||||
if (block1 == this.slab && stackWoodType == blockWoodType) {
|
||||
return true;
|
||||
} else {
|
||||
return super.func_150936_a(world, i1, j1, k1, side, player, itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean func_150946_a(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if (side == 0) {
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1) {
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2) {
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3) {
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4) {
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5) {
|
||||
++x;
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
EnumWoodType blockWoodType = null;
|
||||
EnumWoodType stackWoodType = getWoodType(itemStack);
|
||||
TileWood tile = TileUtil.getTile(world, x, y, z, TileWood.class);
|
||||
if (tile != null) {
|
||||
blockWoodType = tile.getWoodType();
|
||||
}
|
||||
|
||||
if (block == this.slab && blockWoodType == stackWoodType) {
|
||||
if (world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))) {
|
||||
if (placeWood(itemStack, stackWoodType, doubleSlab, player, world, x, y, z, 0)) {
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.doubleSlab.stepSound.func_150496_b(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F);
|
||||
--itemStack.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 464 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user