mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 09:34:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0a0ab5594 | ||
|
|
29d96db1e8 | ||
|
|
3769ec42d2 | ||
|
|
d0c1133304 | ||
|
|
c3ff59fbfb | ||
|
|
aa52b063b7 | ||
|
|
a74b3c87c4 | ||
|
|
6c38a6a28e | ||
|
|
db49d305f4 | ||
|
|
5df7b9252b | ||
|
|
f4d0979bb1 | ||
|
|
199200cb01 | ||
|
|
419cebef33 | ||
|
|
716167e3ec | ||
|
|
60debc45f3 | ||
|
|
2c04d42717 | ||
|
|
9e21ed9670 | ||
|
|
095e710bec | ||
|
|
888c5268d5 | ||
|
|
1180c16f45 | ||
|
|
dea1fb144a | ||
|
|
a01190a242 | ||
|
|
0ebced9609 | ||
|
|
ab4489c5aa | ||
|
|
d2ea1d820c | ||
|
|
4d0dfd837e | ||
|
|
e07f10d981 | ||
|
|
d48e9484b8 | ||
|
|
b9924ea98b | ||
|
|
5707d27598 | ||
|
|
42bde9e576 | ||
|
|
76f09be39d | ||
|
|
3aa328a522 | ||
|
|
2b0f5bfdf4 | ||
|
|
bbe6f919c4 | ||
|
|
4441d78eb2 | ||
|
|
e6cb758e0e | ||
|
|
6d774de5a6 | ||
|
|
0a2ca1febc | ||
|
|
6d3ff67efd | ||
|
|
d37a52dcf4 | ||
|
|
c03fa0e955 | ||
|
|
b3549edf51 | ||
|
|
e09d159935 | ||
|
|
66f0da433e | ||
|
|
4cb2610b1c | ||
|
|
c44f11cf09 | ||
|
|
b69c31ed8a | ||
|
|
6a2231f8fb | ||
|
|
a3a6c71c42 | ||
|
|
8d5c0c6f8b | ||
|
|
56603fd00c | ||
|
|
ed69411d2e | ||
|
|
d8c8aec2ee | ||
|
|
e1d017f077 | ||
|
|
9269af7a13 | ||
|
|
8ffdba5021 | ||
|
|
e00aecd886 | ||
|
|
98f859f2fb | ||
|
|
55a15d23b2 | ||
|
|
38189388f6 | ||
|
|
8bb1b74b1c | ||
|
|
465d32af25 | ||
|
|
13b8a023a3 | ||
|
|
54ca3488df | ||
|
|
26bf69effc | ||
|
|
307580aed8 | ||
|
|
d2d93004e0 | ||
|
|
e1df424bfd | ||
|
|
6a75347b05 | ||
|
|
cfd513ea80 | ||
|
|
edcc47a6b3 | ||
|
|
6593118f3d | ||
|
|
8f29faa28a | ||
|
|
fd724d147a | ||
|
|
1e6716f8ec | ||
|
|
787395494c | ||
|
|
b0b6ffb963 | ||
|
|
d3d57ab0df | ||
|
|
375515937d | ||
|
|
b2e1b2dc9b | ||
|
|
6c869cab98 | ||
|
|
212f857692 | ||
|
|
c40adda51c | ||
|
|
35f7ba6153 | ||
|
|
327b7bba87 | ||
|
|
defc47000b | ||
|
|
694cd8103a | ||
|
|
f50e7281c5 | ||
|
|
0a37ad0666 | ||
|
|
13d4907bff | ||
|
|
78725009c1 | ||
|
|
a1bc9144bd | ||
|
|
1034111985 | ||
|
|
b897056824 | ||
|
|
0c27bf850c | ||
|
|
87563b6c97 | ||
|
|
62d6294da2 | ||
|
|
78489a6146 | ||
|
|
b4d71543db | ||
|
|
b4db0f32e4 | ||
|
|
8ad42a8918 | ||
|
|
96ed44a186 | ||
|
|
4e17804997 | ||
|
|
e391d06f32 | ||
|
|
353fcb1ba7 | ||
|
|
73db1a608a | ||
|
|
322327e1f4 | ||
|
|
1c6b60122e | ||
|
|
c2ca77ecae | ||
|
|
441f57d027 | ||
|
|
1e7a042b53 | ||
|
|
2e0bb5a3b2 | ||
|
|
bf08336bc5 | ||
|
|
62cbf31ac2 | ||
|
|
a2eac214b4 | ||
|
|
32933ce90b | ||
|
|
44cdc191fc | ||
|
|
e4f77e42d3 | ||
|
|
9f91832c7e | ||
|
|
6d4af0fb5d | ||
|
|
4345739a87 | ||
|
|
0a881a81f8 | ||
|
|
b066f7ad4c | ||
|
|
a19380347a | ||
|
|
9bc1211e57 | ||
|
|
cbce5d0fc0 | ||
|
|
b20b56c5d4 | ||
|
|
27041c205c | ||
|
|
00504d4096 | ||
|
|
ed0c5e1a7e | ||
|
|
ddf90f4ee0 | ||
|
|
39290512cf | ||
|
|
09ea20729d | ||
|
|
736e6c5fa2 | ||
|
|
e96f4fc8a0 | ||
|
|
bbe1f539dd | ||
|
|
1fcaacd41b | ||
|
|
7306764c51 | ||
|
|
d3c7280f3f | ||
|
|
2c6ed06574 | ||
|
|
81e2e18089 | ||
|
|
7b7e7eb7e7 | ||
|
|
944aaf3297 | ||
|
|
5a5793f243 | ||
|
|
5e41a4d2c0 | ||
|
|
c4ac0bc7a5 | ||
|
|
5549cfaaa1 | ||
|
|
ae4d246c59 | ||
|
|
2622557a00 | ||
|
|
339abedeee | ||
|
|
149b35224a | ||
|
|
d148279224 | ||
|
|
554fe8bad1 | ||
|
|
27e8259ff6 | ||
|
|
3a51df154a | ||
|
|
a3c79c0427 | ||
|
|
f569a04797 | ||
|
|
610ddfed12 | ||
|
|
438883bb8e | ||
|
|
828dd63acd | ||
|
|
f7cc35d949 | ||
|
|
ec9004b50b | ||
|
|
8b4c1a5dab | ||
|
|
853355062e | ||
|
|
834e3ed55a | ||
|
|
5b2b0bfc95 | ||
|
|
4fae8c26d9 | ||
|
|
0aa4a0f794 | ||
|
|
ac0864303c | ||
|
|
8811b24811 | ||
|
|
904293f407 | ||
|
|
3e175aa8e6 | ||
|
|
c4ecdde110 | ||
|
|
4aa978023d | ||
|
|
50009786d8 | ||
|
|
032d706fc4 | ||
|
|
dcd9e90898 | ||
|
|
bab3479cde | ||
|
|
a5b79c97d2 | ||
|
|
05d6dc3d4a | ||
|
|
6e2ed37e80 | ||
|
|
c840945706 | ||
|
|
ca7d6dbc66 | ||
|
|
81ef5d536f | ||
|
|
f911100c3d |
No files matched your search
Executable → Regular
+14
-23
@@ -4,16 +4,18 @@ buildscript {
|
||||
maven { url = "http://files.minecraftforge.net/maven" }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.matthewprenger.cursegradle" version "1.0.7"
|
||||
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.32"
|
||||
id "com.matthewprenger.cursegradle" version "1.0.9"
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
|
||||
|
||||
version = version_major + '.' + version_minor + '.' + version_patch + '.' + getBuildNumber()
|
||||
if (project.hasProperty('buildQualifier')) {
|
||||
@@ -26,8 +28,8 @@ ext.dirDest = './build/dist'
|
||||
ext.dirLang = "./lang"
|
||||
|
||||
// java version
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
minecraft {
|
||||
version = mcversion + "-" + forgeversion
|
||||
@@ -60,10 +62,10 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
deobfCompile "net.darkhax.tesla:Tesla:${tesla_version}"
|
||||
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api"
|
||||
runtime "mezz.jei:jei_${mcversion}:${jei_version}"
|
||||
// deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
deobfCompile "net.darkhax.tesla:Tesla-${tesla_mcversion}:${tesla_version}"
|
||||
deobfCompile "mezz.jei:jei_${jei_mcversion}:${jei_version}:api"
|
||||
runtime "mezz.jei:jei_${jei_mcversion}:${jei_version}"
|
||||
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -149,27 +151,16 @@ task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
|
||||
untaggedName = "Current release ${project.version}"
|
||||
fromCommit = "5a3850c2642e535656d090d1473054d5fa8d3331"
|
||||
toRef = "HEAD"
|
||||
templateContent = """
|
||||
Alpha version, still buggy. Do not create a world you care about with this version, it can and will break things severely.<br/>
|
||||
Please help the project by trying it out and <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
|
||||
{{#tags}}
|
||||
<h3>{{name}}</h3>
|
||||
<ul>
|
||||
{{#commits}}
|
||||
<li>{{{message}}} - {{authorName}}</li>
|
||||
{{/commits}}
|
||||
</ul>
|
||||
{{/tags}}
|
||||
"""
|
||||
templateContent = file('changelog.mustache').getText('UTF-8')
|
||||
}
|
||||
|
||||
curseforge {
|
||||
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
|
||||
project {
|
||||
id = '59751'
|
||||
id = curse_project_id
|
||||
changelog = file('changelog.html')
|
||||
changelogType = 'html'
|
||||
releaseType = 'alpha'
|
||||
releaseType = 'beta'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Please help the Forestry project by <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
|
||||
{{#tags}}
|
||||
<h3>{{name}}</h3>
|
||||
<ul>
|
||||
{{#commits}}
|
||||
<li>{{{message}}} - {{authorName}}</li>
|
||||
{{/commits}}
|
||||
</ul>
|
||||
{{/tags}}
|
||||
Binary file not shown.
Regular → Executable
+11
-8
@@ -1,11 +1,14 @@
|
||||
mcversion=1.11.2
|
||||
forgeversion=13.20.0.2262
|
||||
mcp_mappings=snapshot_20161220
|
||||
mcversion=1.12.2
|
||||
forgeversion=14.23.0.2501
|
||||
mcp_mappings=snapshot_20170918
|
||||
curse_project_id=59751
|
||||
|
||||
tesla_version=1.11-1.3.0.51
|
||||
jei_version=4.3.0.252
|
||||
#ic2_version=2.6.76-ex110
|
||||
tesla_version=1.0.60
|
||||
tesla_mcversion=1.12
|
||||
jei_version=4.8.0.103
|
||||
jei_mcversion=1.12.2
|
||||
ic2_version=2.8.24-ex112
|
||||
|
||||
version_major=5
|
||||
version_minor=3
|
||||
version_patch=2
|
||||
version_minor=6
|
||||
version_patch=0
|
||||
Vendored
BIN
Binary file not shown.
+6
-6
@@ -1,6 +1,6 @@
|
||||
#Mon Sep 14 12:28:28 PDT 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
#Mon Jul 03 15:24:47 PDT 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
|
||||
@@ -42,11 +42,6 @@ case "`uname`" in
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@@ -114,6 +109,7 @@ fi
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
|
||||
+1
-1
Submodule lang updated: addea45c4f...c3244f4499.
Regular → Executable
+39
-27
@@ -10,13 +10,31 @@
|
||||
******************************************************************************/
|
||||
package forestry;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.ForestryEvent;
|
||||
import forestry.core.EventHandlerCore;
|
||||
import forestry.core.climate.ClimateEventHandler;
|
||||
import forestry.core.climate.ClimateStates;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.GameMode;
|
||||
@@ -26,22 +44,10 @@ import forestry.core.gui.GuiHandler;
|
||||
import forestry.core.multiblock.MultiblockEventHandler;
|
||||
import forestry.core.network.PacketHandler;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.MigrationHelper;
|
||||
import forestry.core.worldgen.WorldGenerator;
|
||||
import forestry.plugins.PluginManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
import forestry.plugins.compat.PluginNatura;
|
||||
|
||||
/**
|
||||
* Forestry Minecraft Mod
|
||||
@@ -50,13 +56,15 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
*/
|
||||
@Mod(
|
||||
modid = Constants.MOD_ID,
|
||||
name = "Forestry",
|
||||
name = Constants.MOD_NAME,
|
||||
version = Constants.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
acceptedMinecraftVersions = "[1.11]",
|
||||
dependencies = "required-after:forge@[13.20.0.2230,);"
|
||||
+ "after:JEI@[4.3.0,);")
|
||||
// + "after:" + PluginIC2.modId + ";")
|
||||
acceptedMinecraftVersions = "[1.12.2,1.13.0)",
|
||||
dependencies = "required-after:forge@[14.23.0.2500,);"
|
||||
+ "after:jei@[4.7.8.91,);"
|
||||
+ "after:" + PluginIC2.modId + ";"
|
||||
+ "after:" + PluginNatura.modId + ";"
|
||||
+ "after:toughasnails;")
|
||||
public class Forestry {
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@@ -69,8 +77,10 @@ public class Forestry {
|
||||
ForestryAPI.instance = this;
|
||||
ForestryAPI.forestryConstants = new Constants();
|
||||
ForestryAPI.errorStateRegistry = new ErrorStateRegistry();
|
||||
ForestryAPI.states = ClimateStates.INSTANCE;
|
||||
EnumErrorCode.init();
|
||||
FluidRegistry.enableUniversalBucket();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -89,12 +99,14 @@ public class Forestry {
|
||||
EventHandlerCore eventHandlerCore = new EventHandlerCore();
|
||||
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new ClimateEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(Config.class);
|
||||
Proxies.common.registerEventHandlers();
|
||||
|
||||
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
|
||||
Config.load(event.getSide());
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new ForestryEvent.PreInit(this, event));
|
||||
|
||||
PluginManager.runSetup(event);
|
||||
|
||||
String gameMode = Config.gameMode;
|
||||
@@ -103,6 +115,11 @@ public class Forestry {
|
||||
|
||||
PluginManager.runPreInit(event.getSide());
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void registerModels(ModelRegistryEvent event) {
|
||||
PluginManager.runRegisterBackpacksAndCrates();
|
||||
Proxies.render.registerModels();
|
||||
}
|
||||
|
||||
@@ -145,9 +162,4 @@ public class Forestry {
|
||||
public void processIMCMessages(IMCEvent event) {
|
||||
PluginManager.processIMCMessages(event.getMessages());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onMissingMappings(FMLMissingMappingsEvent event) {
|
||||
MigrationHelper.onMissingMappings(event);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
@@ -9,15 +9,19 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Other implementations than Forestry's default one are not supported.
|
||||
@@ -85,8 +89,27 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
List<IBee> spawnDrones(IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.5.4. Use {@link #plantFlowerRandom(IBeeHousing, List)}
|
||||
*/
|
||||
@Deprecated
|
||||
void plantFlowerRandom(IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* Plants a random flower from the given list near the housing
|
||||
*
|
||||
* @param housing the location the bee is living
|
||||
* @param potentialFlowers the flowers to choose from
|
||||
* @return the position of the planted flower, or null of none were planted
|
||||
* @since Forestry 5.5.4
|
||||
*/
|
||||
@Nullable
|
||||
default BlockPos plantFlowerRandom(IBeeHousing housing, List<IBlockState> potentialFlowers) {
|
||||
//noinspection deprecation
|
||||
plantFlowerRandom(housing);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
IIndividual retrievePollen(IBeeHousing housing);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ public interface IBeeFactory {
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
|
||||
*
|
||||
* @param modId The modId of the mod that is creating the species
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
@@ -24,8 +25,9 @@ public interface IBeeFactory {
|
||||
* @param primaryColor The outline color of this species
|
||||
* @param secondaryColor The body color of this species
|
||||
* @return a new bee species allele.
|
||||
* @since Forestry 5.6.0.
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String modId, String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
|
||||
/**
|
||||
* Creates a new bee branch.
|
||||
@@ -36,4 +38,10 @@ public interface IBeeFactory {
|
||||
* @return a new bee branch
|
||||
*/
|
||||
IClassification createBranch(String uid, String scientific);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, boolean, String, String, String, IClassification, String, int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
}
|
||||
@@ -5,16 +5,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Stores beekeeping logic for bee housings.
|
||||
@@ -79,4 +83,12 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
|
||||
* These positions are synced to the client from the server.
|
||||
*/
|
||||
List<BlockPos> getFlowerPositions();
|
||||
|
||||
default void readData(PacketBuffer data) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
default void writeData(PacketBuffer data) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,5 +20,18 @@ public interface IHiveFrame {
|
||||
*/
|
||||
ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear);
|
||||
|
||||
/**
|
||||
* @param frame ItemStack containing the actual frame.
|
||||
* @return the {@link IBeeModifier} for this frame.
|
||||
* @since Forestry 5.5.1
|
||||
*/
|
||||
default IBeeModifier getBeeModifier(ItemStack frame) {
|
||||
return getBeeModifier();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.5.1. Use {@link #getBeeModifier(ItemStack)}
|
||||
*/
|
||||
@Deprecated
|
||||
IBeeModifier getBeeModifier();
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.CapabilityInject;
|
||||
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
|
||||
public class ArboricultureCapabilities {
|
||||
/**
|
||||
* Capability for {@link IArmorNaturalist}.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
@@ -5,32 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.Color;
|
||||
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public interface ITreeFactory {
|
||||
/**
|
||||
* Creates a new tree species.
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleTreeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
|
||||
*
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
* @param unlocalizedDescription Unlocalized description for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param modID The modID from the mod of the species
|
||||
* @param leafSpriteProvider The leaf sprite provider for this species
|
||||
* @param germlingModelProvider The germling model provider for this species
|
||||
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
|
||||
* @param generator The tree generator
|
||||
* @return a new tree species allele.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
|
||||
|
||||
/**
|
||||
* Creates a new tree species.
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
@@ -48,10 +28,18 @@ public interface ITreeFactory {
|
||||
* @param germlingModelProvider The germling model provider for this species
|
||||
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
|
||||
* @param generator The tree generator
|
||||
* @param leafProvider The leaf provider
|
||||
* @return a new tree species allele.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, ILeafProvider leafProvider);
|
||||
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, @Nullable ILeafProvider leafProvider);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, String, String, boolean, IClassification, String, String, ILeafSpriteProvider, IGermlingModelProvider, IWoodProvider, ITreeGenerator, ILeafProvider)}
|
||||
*/
|
||||
@Deprecated
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
|
||||
|
||||
|
||||
/**
|
||||
* Get one of the built-in Forestry leaf types. Default type is deciduous.
|
||||
*/
|
||||
|
||||
@@ -44,4 +44,9 @@ public interface ITreeGenome extends IGenome {
|
||||
* @return A ItemStack that is used in getPickBlock of the leave block.
|
||||
*/
|
||||
ItemStack getDecorativeLeaves();
|
||||
|
||||
/**
|
||||
* @return true if this genome matches one of the default template genomes
|
||||
*/
|
||||
boolean matchesTemplateGenome();
|
||||
}
|
||||
@@ -9,15 +9,18 @@ import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.ISpeciesRootPollinatable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.api.genetics.ISpeciesRootPollinatable;
|
||||
|
||||
public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
|
||||
@Override
|
||||
@@ -101,4 +104,6 @@ public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
/* MUTATIONS */
|
||||
@Override
|
||||
List<ITreeMutation> getMutations(boolean shuffle);
|
||||
|
||||
Collection<IFruitProvider> getFruitProvidersForFruitFamily(IFruitFamily fruitFamily);
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
Regular → Executable
+8
-3
@@ -1,12 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelProcessingHelper;
|
||||
|
||||
public enum WoodBlockKind {
|
||||
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR;
|
||||
@@ -57,6 +62,6 @@ public enum WoodBlockKind {
|
||||
break;
|
||||
}
|
||||
textures.putAll(customTextures);
|
||||
return ModelProcessingHelper.retexture(model, new ImmutableMap.Builder<String, String>().putAll(textures).build());
|
||||
return model.retexture(ImmutableMap.copyOf(textures));
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ package forestry.api.circuits;
|
||||
public enum CircuitSocketType implements ICircuitSocketType {
|
||||
NONE("none"),
|
||||
FARM("forestry.farm"),
|
||||
GREENHOUSE_CLIMATISER("forestry.greenhouse.climatiser"),
|
||||
ELECTRIC_ENGINE("forestry.electric.engine"),
|
||||
MACHINE("forestry.machine");
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public enum ClimateStateType {
|
||||
DEFAULT(0.0F, 2.0F),
|
||||
EXTENDED(-3.0F, 3.0F);
|
||||
|
||||
public final float boundDown, boundUp;
|
||||
|
||||
ClimateStateType(Float boundDown, Float boundUp) {
|
||||
this.boundDown = boundDown;
|
||||
this.boundUp = boundUp;
|
||||
}
|
||||
|
||||
public float clamp(float value) {
|
||||
return MathHelper.clamp(value, boundDown, boundUp);
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -5,14 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
public interface IClimatiserDefinition {
|
||||
import java.util.Locale;
|
||||
|
||||
float getChange();
|
||||
|
||||
float getRange();
|
||||
|
||||
EnumClimatiserModes getMode();
|
||||
|
||||
EnumClimatiserTypes getType();
|
||||
public enum ClimateType {
|
||||
TEMPERATURE, HUMIDITY;
|
||||
|
||||
public String getName(){
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package forestry.api.climate;
|
||||
|
||||
public enum EnumClimatiserModes {
|
||||
|
||||
POSITIVE, NEGATIVE, BOTH
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package forestry.api.climate;
|
||||
|
||||
public enum EnumClimatiserTypes {
|
||||
|
||||
TEMPERATURE, HUMIDITY, BOTH
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
public interface IClimateControl {
|
||||
|
||||
IClimateInfo getControlClimate();
|
||||
|
||||
void setControlClimate(IClimateInfo climateInfo);
|
||||
|
||||
float getControlTemperature();
|
||||
|
||||
float getControlHumidity();
|
||||
|
||||
void setControlTemperature(float temperature);
|
||||
|
||||
void setControlHumidity(float humidity);
|
||||
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
/**
|
||||
* @deprecated Use IClimateState
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IClimateInfo {
|
||||
|
||||
float getTemperature();
|
||||
|
||||
float getHumidity();
|
||||
|
||||
}
|
||||
@@ -5,37 +5,37 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IClimateManager {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link IClimateStates#create(float, float)}
|
||||
*/
|
||||
@Deprecated
|
||||
IClimateInfo createInfo(float temperature, float humidity);
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getClimateState(World, BlockPos)}
|
||||
*/
|
||||
@Deprecated
|
||||
IClimateInfo getInfo(World world, BlockPos pos);
|
||||
|
||||
IClimateProvider getDefaultClimate(World world, BlockPos pos);
|
||||
|
||||
void addRegion(IClimateRegion region);
|
||||
|
||||
void removeRegion(IClimateRegion region);
|
||||
|
||||
void addSource(IClimateSourceProvider source);
|
||||
|
||||
void removeSource(IClimateSourceProvider source);
|
||||
|
||||
void onWorldUnload(World world);
|
||||
/**
|
||||
* Gets the current state of a container at this position or setSettings one with the datas from the biome.
|
||||
* @since 5.3.4
|
||||
*/
|
||||
IClimateState getClimateState(World world, BlockPos pos);
|
||||
|
||||
@Nullable
|
||||
IClimatePosition getPosition(World world, BlockPos pos);
|
||||
|
||||
@Nullable
|
||||
IClimateRegion getRegionForPos(World world, BlockPos pos);
|
||||
|
||||
Map<World, List<IClimateRegion>> getRegions();
|
||||
/**
|
||||
* Creates a climate state with the help of the biome on this position.
|
||||
* @since 5.3.4
|
||||
*/
|
||||
IClimateState getBiomeState(World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* @return Create a climate manager.
|
||||
*/
|
||||
IClimateProvider getDefaultClimate(World world, BlockPos pos);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* A IClimatePosition contains the climate infos (temperature and humidity) of one position.
|
||||
*/
|
||||
public interface IClimatePosition extends INbtReadable, INbtWritable {
|
||||
|
||||
IClimateRegion getClimateRegion();
|
||||
|
||||
BlockPos getPos();
|
||||
|
||||
void setTemperature(float temperature);
|
||||
|
||||
void addTemperature(float temperature);
|
||||
|
||||
float getTemperature();
|
||||
|
||||
void setHumidity(float humidity);
|
||||
|
||||
void addHumidity(float humidity);
|
||||
|
||||
float getHumidity();
|
||||
|
||||
IClimateInfo getInfo();
|
||||
|
||||
}
|
||||
@@ -5,9 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
public interface IClimateProvider {
|
||||
Biome getBiome();
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IClimateRegion extends INbtReadable, INbtWritable {
|
||||
|
||||
World getWorld();
|
||||
|
||||
int getTicksPerUpdate();
|
||||
|
||||
void setPosition(BlockPos pos, float temperature, float humidity);
|
||||
|
||||
@Nullable
|
||||
IClimatePosition getPosition(BlockPos pos);
|
||||
|
||||
Collection<IClimatePosition> getPositions();
|
||||
|
||||
void addSource(IClimateSource source);
|
||||
|
||||
void removeSource(IClimateSource source);
|
||||
|
||||
Collection<IClimateSource> getSources();
|
||||
|
||||
void calculateAverageClimate();
|
||||
|
||||
float getAverageTemperature();
|
||||
|
||||
float getAverageHumidity();
|
||||
|
||||
/**
|
||||
* Update the climate in a region.
|
||||
*/
|
||||
void updateClimate(int ticks);
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* A climate source is used to change the climate in a region.
|
||||
*/
|
||||
public interface IClimateSource {
|
||||
|
||||
/**
|
||||
* @param tickCount The current tick count.
|
||||
* @param region The climate region, in that the source stands.
|
||||
* @return Return true if the the climate has changed.
|
||||
*/
|
||||
boolean changeClimate(int tickCount, IClimateRegion region);
|
||||
|
||||
/**
|
||||
* @return The ticks that are required for one change.
|
||||
*/
|
||||
int getTicksForChange(IClimateRegion region);
|
||||
|
||||
@Nullable
|
||||
IClimateSourceProvider getProvider();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.core.INbtWritable;
|
||||
|
||||
/**
|
||||
* A {@link IClimateState} is used to store and handle temperature and humidity.
|
||||
*
|
||||
* The values are oriented on the values of {@link Biome#getTemperature()} and {@link Biome#getRainfall()}.
|
||||
*/
|
||||
public interface IClimateState extends INbtWritable {
|
||||
|
||||
float getTemperature();
|
||||
|
||||
float getHumidity();
|
||||
|
||||
IClimateState addTemperature(float temperature);
|
||||
|
||||
IClimateState addHumidity(float humidity);
|
||||
|
||||
IClimateState add(IClimateState state);
|
||||
|
||||
IClimateState scale(double factor);
|
||||
|
||||
IClimateState remove(IClimateState state);
|
||||
|
||||
default float get(ClimateType type){
|
||||
return type == ClimateType.HUMIDITY ? getHumidity() : getTemperature();
|
||||
}
|
||||
|
||||
IClimateState copy(ClimateStateType type);
|
||||
|
||||
IClimateState copy();
|
||||
|
||||
boolean isPresent();
|
||||
|
||||
ClimateStateType getType();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public interface IClimateStates {
|
||||
|
||||
IClimateState create(NBTTagCompound compound);
|
||||
|
||||
IClimateState create(NBTTagCompound compound, ClimateStateType type);
|
||||
|
||||
IClimateState create(float temperature, float humidity, ClimateStateType type);
|
||||
|
||||
IClimateState create(IClimateState climateState, ClimateStateType type);
|
||||
|
||||
IClimateState absent();
|
||||
|
||||
IClimateState min();
|
||||
|
||||
IClimateState max();
|
||||
}
|
||||
@@ -5,10 +5,11 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "2.1.0", owner = "Forestry", provides = "ForestryAPI|climate")
|
||||
@API(apiVersion = "5.0.0", owner = "Forestry", provides = "ForestryAPI|climate")
|
||||
package forestry.api.climate;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -9,12 +9,4 @@ public class CamouflageManager {
|
||||
|
||||
public static ICamouflageAccess camouflageAccess;
|
||||
|
||||
public static final String BLOCK = "block";
|
||||
|
||||
public static final String GLASS = "glass";
|
||||
|
||||
public static final String DOOR = "door";
|
||||
|
||||
public static final String NONE = "none";
|
||||
|
||||
}
|
||||
@@ -20,6 +20,8 @@ public enum EnumHumidity {
|
||||
*/
|
||||
DAMP("Damp");
|
||||
|
||||
public static final EnumHumidity[] VALUES = values();
|
||||
|
||||
public final String name;
|
||||
|
||||
EnumHumidity(String name) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import forestry.api.climate.IClimateState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -73,7 +74,8 @@ public enum EnumTemperature {
|
||||
if (BiomeHelper.isBiomeHellish(biome)) {
|
||||
return HELLISH;
|
||||
}
|
||||
float temperature = ForestryAPI.climateManager.getInfo(world, pos).getTemperature();
|
||||
IClimateState state = ForestryAPI.climateManager.getClimateState(world, pos);
|
||||
float temperature = state.getTemperature();
|
||||
return getFromValue(temperature);
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,14 @@ package forestry.api.core;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.climate.IClimateStates;
|
||||
import forestry.greenhouse.api.climate.IClimateFactory;
|
||||
import forestry.api.climate.IClimateManager;
|
||||
import forestry.api.farming.IFarmRegistry;
|
||||
import forestry.api.farming.ISimpleFarmLogic;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Forestry's API is divided into several subcategories to make it easier to understand.
|
||||
@@ -48,6 +51,14 @@ public class ForestryAPI {
|
||||
public static IModelManager modelManager;
|
||||
|
||||
public static IClimateManager climateManager;
|
||||
|
||||
/**
|
||||
* A factory to create climate related things.
|
||||
* @since 5.3.4
|
||||
*/
|
||||
public static IClimateFactory climateFactory;
|
||||
|
||||
public static IClimateStates states;
|
||||
|
||||
/**
|
||||
* A registry for register fertilizers, {@link IFarmabeles}s and {@link ISimpleFarmLogic}s
|
||||
|
||||
@@ -5,13 +5,17 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public abstract class ForestryEvent extends Event {
|
||||
|
||||
@@ -53,6 +57,21 @@ public abstract class ForestryEvent extends Event {
|
||||
this.tracker = tracker;
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Posted before forestry registers all items and blocks.
|
||||
*/
|
||||
public static class PreInit extends ForestryEvent{
|
||||
/**
|
||||
* The main mod instance for Forestry.
|
||||
*/
|
||||
public Object instance;
|
||||
public final FMLPreInitializationEvent event;
|
||||
|
||||
public PreInit(Object instance, FMLPreInitializationEvent event) {
|
||||
this.instance = instance;
|
||||
this.event = event;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-12
@@ -3,19 +3,11 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.greenhouse;
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IInternalBlockFace {
|
||||
|
||||
boolean isTested();
|
||||
|
||||
void setTested(boolean tested);
|
||||
|
||||
EnumFacing getFace();
|
||||
|
||||
BlockPos getPos();
|
||||
|
||||
public interface IBlockPosPredicate {
|
||||
boolean test(World world, BlockPos blockPos);
|
||||
}
|
||||
@@ -7,6 +7,8 @@ package forestry.api.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ICamouflageAccess {
|
||||
@@ -16,21 +18,20 @@ public interface ICamouflageAccess {
|
||||
*
|
||||
* @param itemHandler The handler that is to register.
|
||||
*/
|
||||
void registerCamouflageItemHandler(ICamouflageItemHandler itemHandler);
|
||||
void registerItemHandler(ICamouflageItemHandler itemHandler);
|
||||
|
||||
/**
|
||||
* @return A list of all item camouflage handler's that are registered for that camouflage type.
|
||||
*/
|
||||
List<ICamouflageItemHandler> getCamouflageItemHandler(String type);
|
||||
List<ICamouflageItemHandler> getItemHandlers();
|
||||
|
||||
void addItemToBlackList(String type, ItemStack camouflageBlock);
|
||||
void addItemToBlackList(ItemStack camouflageBlock);
|
||||
|
||||
void addModIdToBlackList(String type, String modID);
|
||||
void addModIdToBlackList(String modID);
|
||||
|
||||
boolean isItemBlackListed(String type, ItemStack camouflageBlock);
|
||||
|
||||
ICamouflageItemHandler getNoneItemHandler();
|
||||
boolean isItemBlackListed(ItemStack camouflageBlock);
|
||||
|
||||
ICamouflageItemHandler getHandlerFromItem(ItemStack stack);
|
||||
@Nullable
|
||||
ICamouflageItemHandler getHandler(ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -12,22 +12,17 @@ public interface ICamouflageHandler extends ILocatable {
|
||||
/**
|
||||
* @return The item of the block that is the camouflage of this handler for the type.
|
||||
*/
|
||||
ItemStack getCamouflageBlock(String type);
|
||||
ItemStack getCamouflageBlock();
|
||||
|
||||
/**
|
||||
* @return The default camouflage block item for the type.
|
||||
*/
|
||||
ItemStack getDefaultCamouflageBlock(String type);
|
||||
|
||||
/**
|
||||
* @return True if the handler can handle this type of camouflage.
|
||||
*/
|
||||
boolean canHandleType(String type);
|
||||
ItemStack getDefaultCamouflageBlock();
|
||||
|
||||
/**
|
||||
* Set the camouflage block item for the type.
|
||||
*
|
||||
* @return True if the block has chanced.
|
||||
*/
|
||||
boolean setCamouflageBlock(String type, ItemStack camouflageBlock, boolean sendClientUpdate);
|
||||
boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate);
|
||||
}
|
||||
@@ -5,22 +5,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
public interface ICamouflageItemHandler {
|
||||
|
||||
|
||||
boolean canHandle(ItemStack stack);
|
||||
|
||||
String getType();
|
||||
|
||||
float getLightTransmittance(ItemStack stack, ICamouflageHandler camouflageHandler);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
Pair<IBlockState, IBakedModel> getModel(ItemStack stack, ICamouflageHandler camouflageHandler, ICamouflagedTile camouflageTile);
|
||||
Pair<IBlockState, IBakedModel> getModel(ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -5,12 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public interface ICamouflagedTile {
|
||||
|
||||
String getCamouflageType();
|
||||
|
||||
BlockPos getCoordinates();
|
||||
public interface ICamouflagedTile extends ILocatable {
|
||||
|
||||
}
|
||||
@@ -1,23 +1,20 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Interface for things, that have a location.
|
||||
* Must not be named "getWorld" and "getPos" to avoid
|
||||
* SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*/
|
||||
public interface ILocatable {
|
||||
BlockPos getCoordinates();
|
||||
|
||||
/**
|
||||
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*/
|
||||
World getWorldObj();
|
||||
}
|
||||
@@ -34,6 +34,8 @@ public interface IModelBaker {
|
||||
|
||||
void addBakedModel(@Nullable IBlockState state, IBakedModel model);
|
||||
|
||||
void addBakedModelPost(@Nullable IBlockState state, IBakedModel model);
|
||||
|
||||
void addFace(EnumFacing facing, TextureAtlasSprite sprite);
|
||||
|
||||
void setModelState(@Nullable IModelState modelState);
|
||||
|
||||
Regular → Executable
+3
-2
@@ -8,14 +8,15 @@ package forestry.api.core;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IModelBakerModel extends IPerspectiveAwareModel {
|
||||
public interface IModelBakerModel extends IBakedModel {
|
||||
|
||||
void setGui3d(boolean gui3d);
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "5.1.0", owner = "Forestry", provides = "ForestryAPI|core")
|
||||
@API(apiVersion = "5.2.0", owner = "Forestry", provides = "ForestryAPI|core")
|
||||
package forestry.api.core;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
@@ -11,7 +11,6 @@ import java.util.Map;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class Farmables {
|
||||
|
||||
@@ -7,6 +7,7 @@ package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -33,6 +34,8 @@ public interface IFarmLogic {
|
||||
|
||||
IFarmLogic setManual(boolean manual);
|
||||
|
||||
void addSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ResourceLocation getTextureMap();
|
||||
|
||||
|
||||
@@ -5,12 +5,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IFarmRegistry {
|
||||
|
||||
/**
|
||||
* Registers farming logic in registry under given identifier
|
||||
* @param identifier Valid identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
|
||||
* @param logic corresponding instance of logic
|
||||
*/
|
||||
void registerFarmLogic(String identifier, IFarmLogic logic);
|
||||
|
||||
/**
|
||||
* Can be used to add IFarmables to some of the vanilla farm logics.
|
||||
* <p>
|
||||
@@ -22,7 +30,10 @@ public interface IFarmRegistry {
|
||||
|
||||
/**
|
||||
* Can be used to create a simple version of a farm logic, like the vanilla vegetable or wheat farm logic.
|
||||
*
|
||||
* @return Null if the farming plugin is not active.
|
||||
*/
|
||||
@Nullable
|
||||
IFarmLogic createLogic(ISimpleFarmLogic simpleFarmLogic);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "2.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
|
||||
@API(apiVersion = "2.2.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
|
||||
package forestry.api.farming;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Called after Forestry has registered all his alleles of an specific type. Like IAlleleFruit or IAlleleSpecies
|
||||
* @since 5.3.3
|
||||
*/
|
||||
public class AlleleRegisterEvent<A extends IAllele> extends Event {
|
||||
|
||||
private final Class<? extends A> alleleClass;
|
||||
|
||||
public AlleleRegisterEvent(Class<? extends A> alleleClass) {
|
||||
this.alleleClass = alleleClass;
|
||||
}
|
||||
|
||||
public Class<? extends A> getAlleleClass() {
|
||||
return alleleClass;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Called after Forestry has registered all his species alleles of a individual.
|
||||
*/
|
||||
public class AlleleSpeciesRegisterEvent extends Event {
|
||||
public class AlleleSpeciesRegisterEvent<A extends IAlleleSpecies> extends AlleleRegisterEvent<A> {
|
||||
|
||||
private final ISpeciesRoot root;
|
||||
|
||||
public AlleleSpeciesRegisterEvent(ISpeciesRoot root) {
|
||||
public AlleleSpeciesRegisterEvent(ISpeciesRoot root, Class<? extends A> alleleClass) {
|
||||
super(alleleClass);
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,14 @@ public interface IAllele {
|
||||
*/
|
||||
String getUID();
|
||||
|
||||
/**
|
||||
* @return modId of the mod that created this allele
|
||||
* @since Forestry 5.6.0
|
||||
*/
|
||||
default String getModID() {
|
||||
return "forestry";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the allele is dominant, false otherwise.
|
||||
*/
|
||||
@@ -28,9 +36,20 @@ public interface IAllele {
|
||||
|
||||
/**
|
||||
* @return Localized short, human-readable identifier used in tooltips and beealyzer.
|
||||
* @deprecated since Forestry 5.3.4. Use {@link #getAlleleName()}.
|
||||
*/
|
||||
@Deprecated
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return Localized short, human-readable identifier used in tooltips and beealyzer.
|
||||
* @since Forestry 5.3.4
|
||||
* @apiNote This can't be named "getName" or it can conflict during obfuscation. https://github.com/md-5/SpecialSource/issues/12
|
||||
*/
|
||||
default String getAlleleName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The unlocalized identifier
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
public interface IAlleleProperty<A extends IAlleleProperty<A>> extends IAllele, Comparable<A> {
|
||||
|
||||
@@ -207,7 +207,7 @@ public interface IAlleleRegistry {
|
||||
* @param handler IAlleleHandler to register.
|
||||
*/
|
||||
void registerAlleleHandler(IAlleleHandler handler);
|
||||
|
||||
|
||||
/* BLACKLIST */
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -13,6 +16,20 @@ public interface IFlowerGrowthHelper {
|
||||
* Plants a random flower from flowerType at the specified position.
|
||||
*
|
||||
* @return true if successful, false if it could not be planted.
|
||||
* @deprecated since Forestry 5.5.4. Use {@link #plantRandomFlower(String, World, BlockPos, Collection)}
|
||||
*/
|
||||
@Deprecated
|
||||
boolean plantRandomFlower(String flowerType, World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* Plants a random flower from flowerType at the specified position.
|
||||
*
|
||||
* @param flowerType the flower type that can be planted
|
||||
* @param world the world to plant flowers in
|
||||
* @param pos the position to plant the flowers
|
||||
* @param potentialFlowers the potential flowers that can be planted
|
||||
* @return true if a flower was planted, false otherwise
|
||||
* @since Forestry 5.5.4
|
||||
*/
|
||||
boolean plantRandomFlower(String flowerType, World world, BlockPos pos, Collection<IBlockState> potentialFlowers);
|
||||
}
|
||||
@@ -5,6 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -18,6 +21,20 @@ public interface IFlowerGrowthRule {
|
||||
* For implementers, you can plant a random flower using IFlowerGrowthHelper.plantRandomFlower
|
||||
*
|
||||
* @since Forestry 4.0.8
|
||||
* @deprecated since Forestry 5.5.4. Use {@link #growFlower(IFlowerGrowthHelper, String, World, BlockPos, Collection)}
|
||||
*/
|
||||
@Deprecated
|
||||
boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* Checks a position for suitability, and then plants a flower there.
|
||||
* Returns true on success.
|
||||
* For implementers, you can plant a random flower using IFlowerGrowthHelper.plantRandomFlower
|
||||
*
|
||||
* @since Forestry 5.5.4
|
||||
*/
|
||||
default boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos, Collection<IBlockState> potentialFlowers) {
|
||||
//noinspection deprecation
|
||||
return growFlower(helper, flowerType, world, pos);
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,19 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.core.IBlockPosPredicate;
|
||||
|
||||
// See {@link forestry.api.apiculture.FlowerManager}.FlowerType___ for basic Forestry flower types.
|
||||
// Each IFlowerProvider has one flower type, and multiple IFlowerProviders may share one type.
|
||||
// "Acceptable flowers" allow nearby bees to do work.
|
||||
@@ -57,8 +61,26 @@ public interface IFlowerRegistry {
|
||||
|
||||
/**
|
||||
* Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position.
|
||||
* @since Forestry 5.5.4
|
||||
*/
|
||||
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos);
|
||||
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos, Collection<IBlockState> potentialFlowers);
|
||||
|
||||
/**
|
||||
* Gets an iterator over the area a bee can travel from its beeHousing.
|
||||
* Starts at the bee housing and spirals outward.
|
||||
*
|
||||
* @param beeHousing The bee housing that will help determine the size of the area to check.
|
||||
* @param bee The bee that will help determine the size of the area to check.
|
||||
* @return an iterator over the area a bee can travel from its beeHousing.
|
||||
* @since Forestry 5.5.2
|
||||
*/
|
||||
Iterator<BlockPos.MutableBlockPos> getAreaIterator(IBeeHousing beeHousing, IBee bee);
|
||||
|
||||
/**
|
||||
* Checks a single coordinate to see if it is an accepted flower.
|
||||
* @since Forestry 5.5.2
|
||||
*/
|
||||
IBlockPosPredicate createAcceptedFlowerPredicate(String flowerType);
|
||||
|
||||
/**
|
||||
* @param beeHousing The bee housing that will help determine the size of the area to check.
|
||||
@@ -66,11 +88,23 @@ public interface IFlowerRegistry {
|
||||
* @param flowerType See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX
|
||||
* @param maxFlowers the largest number of flowers to check for before returning. Use 1 if you only need 1.
|
||||
* @return the coordinates of nearby accepted flowers, with size from 0 to maxFlowers.
|
||||
* @deprecated since Forestry 5.5.2. Use {@link #getAreaIterator(IBeeHousing, IBee)} and {@link #createAcceptedFlowerPredicate(String)}.
|
||||
*/
|
||||
@Deprecated
|
||||
List<BlockPos> getAcceptedFlowerCoordinates(IBeeHousing beeHousing, IBee bee, String flowerType, int maxFlowers);
|
||||
|
||||
/**
|
||||
* Checks a single coordinate to see if it is an accepted flower.
|
||||
* @deprecated since Forestry 5.5.2. Use {@link #createAcceptedFlowerPredicate(String)}.
|
||||
*/
|
||||
@Deprecated
|
||||
boolean isAcceptedFlower(String flowerType, World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position.
|
||||
*
|
||||
* @deprecated since Forestry 5.5.4. Use {@link #growFlower(String, World, IIndividual, BlockPos, Collection)}
|
||||
*/
|
||||
@Deprecated
|
||||
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos);
|
||||
}
|
||||
@@ -1,11 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
/**
|
||||
* @author Nedelosk
|
||||
* @since 5.12.16
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.greenhouse;
|
||||
|
||||
import forestry.api.multiblock.IGreenhouseController;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public class GreenhouseEvents extends Event {
|
||||
|
||||
public final IGreenhouseController controller;
|
||||
|
||||
public GreenhouseEvents(IGreenhouseController state) {
|
||||
this.controller = state;
|
||||
}
|
||||
|
||||
public static class InternalBlockEvent extends GreenhouseEvents {
|
||||
public final IInternalBlock internalBlock;
|
||||
|
||||
public InternalBlockEvent(IGreenhouseController controller, IInternalBlock internalBlock) {
|
||||
super(controller);
|
||||
|
||||
this.internalBlock = internalBlock;
|
||||
}
|
||||
}
|
||||
|
||||
public static class CreateInternalBlockEvent extends InternalBlockEvent {
|
||||
public CreateInternalBlockEvent(IGreenhouseController controller, IInternalBlock internalBlock) {
|
||||
super(controller, internalBlock);
|
||||
}
|
||||
}
|
||||
|
||||
public static class CheckInternalBlockFaceEvent extends InternalBlockEvent {
|
||||
public final IInternalBlockFace face;
|
||||
|
||||
public CheckInternalBlockFaceEvent(IGreenhouseController controller, IInternalBlock internalBlock, IInternalBlockFace face) {
|
||||
super(controller, internalBlock);
|
||||
|
||||
this.face = face;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.greenhouse;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.climate.IClimateState;
|
||||
|
||||
public interface IClimateHousing {
|
||||
|
||||
/**
|
||||
* @return The size of the region in blocks.
|
||||
*/
|
||||
int getSize();
|
||||
|
||||
void onUpdateClimate();
|
||||
|
||||
/**
|
||||
* @return The default climate state. It is calculated out of all biomedata that this region contains.
|
||||
*/
|
||||
IClimateState getDefaultClimate();
|
||||
|
||||
/**
|
||||
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*
|
||||
* @return The position at that the housing is.
|
||||
*/
|
||||
BlockPos getCoordinates();
|
||||
|
||||
/**
|
||||
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*
|
||||
* @return The world in that the housing is.
|
||||
*/
|
||||
World getWorldObj();
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.greenhouse;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import forestry.api.multiblock.IGreenhouseController;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IGreenhouseHelper {
|
||||
|
||||
/**
|
||||
* @return A {@link IGreenhouseController} of a greenhouse, when the pos is a greenhouse
|
||||
*/
|
||||
@Nullable
|
||||
IGreenhouseController getGreenhouseController(World world, BlockPos pos);
|
||||
|
||||
}
|
||||
@@ -8,23 +8,26 @@ package forestry.api.greenhouse;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.IErrorLogicSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IGreenhouseHousing extends IErrorLogicSource {
|
||||
|
||||
EnumTemperature getTemperature();
|
||||
|
||||
EnumHumidity getHumidity();
|
||||
|
||||
float getExactTemperature();
|
||||
|
||||
float getExactHumidity();
|
||||
|
||||
public interface IGreenhouseHousing extends IErrorLogicSource, IClimateHousing{
|
||||
|
||||
/**
|
||||
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*
|
||||
* @return The world in that the housing is.
|
||||
* @return The current tempreture as an enum.
|
||||
*/
|
||||
World getWorldObj();
|
||||
|
||||
EnumTemperature getTemperature();
|
||||
|
||||
/**
|
||||
* @return The current humidity as an enum.
|
||||
*/
|
||||
EnumHumidity getHumidity();
|
||||
|
||||
/**
|
||||
* @return The current tempreture as an float. Range: 0.0F ~ 2.0F
|
||||
*/
|
||||
float getExactTemperature();
|
||||
|
||||
/**
|
||||
* @return The current humidity as an float. Range: 0.0F ~ 2.0F
|
||||
*/
|
||||
float getExactHumidity();
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import forestry.api.multiblock.IGreenhouseController;
|
||||
public interface IGreenhouseListener {
|
||||
|
||||
/**
|
||||
* Called before the greenhouse update the climate system.
|
||||
* Called before the greenhouse updates the climate system.
|
||||
*
|
||||
* @param greenhouse The greenhouse of the listener.
|
||||
* @param canWork The actual {@link Boolean} value.
|
||||
|
||||
@@ -10,5 +10,6 @@ package forestry.api.greenhouse;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
@@ -48,6 +51,27 @@ public interface IButterfly extends IIndividualLiving {
|
||||
*/
|
||||
@Nullable
|
||||
IButterfly spawnCaterpillar(World world, IButterflyNursery nursery);
|
||||
|
||||
/**
|
||||
* Determines whether the caterpillar can grow.
|
||||
*
|
||||
* @param cocoon the {@link IButterflyCocoon} the caterpillar resides in.
|
||||
* @param nursery the {@link IButterflyNursery} of the caterpillar.
|
||||
* @return an empty set if the caterpillar can grow, a set of error states if the caterpillar can not grow
|
||||
* @since 5.3.3
|
||||
*/
|
||||
Set<IErrorState> getCanGrow(IButterflyNursery nursery, @Nullable IButterflyCocoon cocoon);
|
||||
|
||||
/**
|
||||
* Determines whether the caterpillar can spawn. (Used to auto-spawn butterflies out of a cocoon.)
|
||||
*
|
||||
* @param cocoon the {@link IButterflyCocoon} the caterpillar resides in.
|
||||
* @param nursery the {@link IButterflyNursery} of the caterpillar.
|
||||
* @return an empty set if the caterpillar can spawn, a set of error states if the caterpillar can not spawn
|
||||
* @since 5.3.3
|
||||
*/
|
||||
Set<IErrorState> getCanSpawn(IButterflyNursery nursery, @Nullable IButterflyCocoon cocoon);
|
||||
|
||||
|
||||
/**
|
||||
* @param playerKill Whether or not the butterfly was killed by a player.
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
import forestry.api.genetics.IHousing;
|
||||
|
||||
public interface IButterflyCocoon extends IHousing {
|
||||
|
||||
|
||||
IButterfly getCaterpillar();
|
||||
|
||||
void setCaterpillar(IButterfly butterfly);
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
|
||||
@@ -10,15 +10,19 @@ import javax.annotation.Nullable;
|
||||
import forestry.api.climate.IClimateProvider;
|
||||
import forestry.api.genetics.IHousing;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IButterflyNursery extends IHousing, IClimateProvider {
|
||||
@Nullable
|
||||
IButterfly getCaterpillar();
|
||||
|
||||
@Nullable
|
||||
IIndividual getNanny();
|
||||
|
||||
void setCaterpillar(@Nullable IButterfly caterpillar);
|
||||
|
||||
boolean canNurse(IButterfly caterpillar);
|
||||
|
||||
World getWorldObj();
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "1.3.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology")
|
||||
@API(apiVersion = "1.4.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology")
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@@ -5,13 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.multiblock;
|
||||
|
||||
import forestry.api.climate.IClimateControlProvider;
|
||||
import forestry.api.climate.IClimateSourceProvider;
|
||||
import forestry.api.climate.IClimatiserDefinition;
|
||||
import forestry.api.greenhouse.IGreenhouseListener;
|
||||
import forestry.api.lepidopterology.IButterflyCocoon;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
public interface IGreenhouseComponent<T extends IMultiblockLogicGreenhouse> extends IMultiblockComponent {
|
||||
@Override
|
||||
@@ -20,22 +14,7 @@ public interface IGreenhouseComponent<T extends IMultiblockLogicGreenhouse> exte
|
||||
interface Listener extends IGreenhouseComponent {
|
||||
IGreenhouseListener getGreenhouseListener();
|
||||
}
|
||||
|
||||
interface ClimateControl extends IGreenhouseComponent, IClimateControlProvider {
|
||||
|
||||
}
|
||||
|
||||
interface Door extends IGreenhouseComponent {
|
||||
}
|
||||
|
||||
interface Climatiser extends IGreenhouseComponent, IClimateSourceProvider {
|
||||
IClimatiserDefinition getDefinition();
|
||||
}
|
||||
|
||||
interface Nursery extends IGreenhouseComponent {
|
||||
void addCocoonLoot(IButterflyCocoon cocoon, NonNullList<ItemStack> loot);
|
||||
}
|
||||
|
||||
|
||||
interface Active extends IGreenhouseComponent {
|
||||
void updateServer(int tickCount);
|
||||
|
||||
|
||||
@@ -5,24 +5,19 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.multiblock;
|
||||
|
||||
import java.util.Set;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import forestry.api.climate.IClimateControlProvider;
|
||||
import forestry.api.climate.IClimateRegion;
|
||||
import forestry.api.core.ICamouflageHandler;
|
||||
import forestry.api.greenhouse.IGreenhouseHousing;
|
||||
import forestry.api.greenhouse.IInternalBlock;
|
||||
import forestry.api.lepidopterology.IButterfly;
|
||||
|
||||
public interface IGreenhouseController extends IMultiblockController, IGreenhouseHousing, ICamouflageHandler, IClimateControlProvider {
|
||||
public interface IGreenhouseController extends IMultiblockController, IGreenhouseHousing, ICamouflageHandler {
|
||||
|
||||
/**
|
||||
* @return All internal blocks of the greenhouse.
|
||||
*
|
||||
* @return the position of the block at the top of the greenhouse structure that shows the state of the greenhouse.
|
||||
*/
|
||||
Set<IInternalBlock> getInternalBlocks();
|
||||
BlockPos getCenterCoordinates();
|
||||
|
||||
boolean spawnButterfly(IButterfly butterfly);
|
||||
void setCenterCoordinates(BlockPos coordinates);
|
||||
|
||||
IClimateRegion getRegion();
|
||||
|
||||
}
|
||||
Regular → Executable
+1
-1
@@ -30,7 +30,7 @@ public interface IDescriptiveRecipe {
|
||||
* @return array of all the ingredients in the crafting table.
|
||||
* Each inner list represents one slot's accepted ItemStacks
|
||||
*/
|
||||
NonNullList<NonNullList<ItemStack>> getIngredients();
|
||||
NonNullList<NonNullList<ItemStack>> getRawIngredients();
|
||||
|
||||
NonNullList<String> getOreDicts();
|
||||
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.recipes;
|
||||
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* 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
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.recipes;
|
||||
|
||||
|
||||
@@ -49,4 +49,33 @@ public interface IFermenterManager extends ICraftingProvider<IFermenterRecipe> {
|
||||
* @throws NullPointerException if resource, output or liquid is null
|
||||
*/
|
||||
void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output);
|
||||
|
||||
/**
|
||||
* Add a recipe to the fermenter
|
||||
*
|
||||
* @param resource String representing the resource as a {@link net.minecraftforge.oredict.OreDictionary} name.
|
||||
* @param fermentationValue Value of the given resource, i.e. how much needs
|
||||
* to be fermented for the output to be deposited into the product tank.
|
||||
* @param modifier Modifies the amount of liquid output per work cycle.
|
||||
* (water = 1.0f, honey = 1.5f)
|
||||
* @param output LiquidStack representing output liquid. Amount is
|
||||
* determined by fermentationValue*modifier.
|
||||
* @param liquid LiquidStack representing resource liquid and amount.
|
||||
* @throws NullPointerException if resource, output or liquid is null
|
||||
*/
|
||||
void addRecipe(String resource, int fermentationValue, float modifier, FluidStack output, FluidStack liquid);
|
||||
|
||||
/**
|
||||
* Add a recipe to the fermenter. Defaults to water as input liquid.
|
||||
*
|
||||
* @param resource String representing the resource as a {@link net.minecraftforge.oredict.OreDictionary} name.
|
||||
* @param modifier Modifies the amount of liquid output per work cycle.
|
||||
* (water = 1.0f, honey = 1.5f)
|
||||
* @param fermentationValue Value of the given resource, i.e. how much needs
|
||||
* to be fermented for the output to be deposited into the product tank.
|
||||
* @param output LiquidStack representing output liquid. Amount is
|
||||
* determined by fermentationValue*modifier.
|
||||
* @throws NullPointerException if resource, output or liquid is null
|
||||
*/
|
||||
void addRecipe(String resource, int fermentationValue, float modifier, FluidStack output);
|
||||
}
|
||||
@@ -5,16 +5,26 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.recipes;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public interface IFermenterRecipe extends IForestryRecipe {
|
||||
public interface IFermenterRecipe extends IForestryRecipe, Comparable<IFermenterRecipe> {
|
||||
|
||||
/**
|
||||
* @return ItemStack representing the input resource.
|
||||
*/
|
||||
ItemStack getResource();
|
||||
|
||||
/**
|
||||
* @return String representing the input resource as a {@link net.minecraftforge.oredict.OreDictionary} name.
|
||||
*/
|
||||
@Nullable
|
||||
String getResourceOreName();
|
||||
|
||||
/**
|
||||
* @return FluidStack representing the input fluid resource.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.storage;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
Regular → Executable
+4
-2
@@ -8,12 +8,14 @@ package forestry.api.storage;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.IForgeRegistryEntry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
/**
|
||||
* The Backpack Interface allows you to add items to Forestry backpacks or create your own backpacks.
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -19,7 +21,21 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IApiaristTracker;
|
||||
@@ -38,23 +54,10 @@ import forestry.apiculture.network.packets.PacketBeeLogicActive;
|
||||
import forestry.apiculture.network.packets.PacketBeeLogicActiveEntity;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.network.IStreamable;
|
||||
import forestry.core.network.PacketBufferForestry;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.NetworkUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
public class BeekeepingLogic implements IBeekeepingLogic {
|
||||
|
||||
private static final int totalBreedingTime = Constants.APIARY_BREEDING_TIME;
|
||||
|
||||
@@ -136,7 +139,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(PacketBufferForestry data) {
|
||||
public void writeData(PacketBuffer data) {
|
||||
data.writeBoolean(active);
|
||||
if (active) {
|
||||
data.writeItemStack(queenStack);
|
||||
@@ -145,7 +148,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(PacketBufferForestry data) throws IOException {
|
||||
public void readData(PacketBuffer data) throws IOException {
|
||||
boolean active = data.readBoolean();
|
||||
setActive(active);
|
||||
if (active) {
|
||||
@@ -203,11 +206,13 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
if (this.queenStack != queenStack) {
|
||||
if (!queenStack.isEmpty()) {
|
||||
this.queen = BeeManager.beeRoot.getMember(queenStack);
|
||||
if (this.queen != null) {
|
||||
hasFlowersCache.onNewQueen(queen, housing);
|
||||
}
|
||||
} else {
|
||||
this.queen = null;
|
||||
}
|
||||
this.queenStack = queenStack;
|
||||
hasFlowersCache.clear();
|
||||
queenCanWorkCache.clear();
|
||||
}
|
||||
|
||||
@@ -222,7 +227,8 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
errorLogic.setCondition(true, errorState);
|
||||
}
|
||||
|
||||
boolean hasFlowers = hasFlowersCache.hasFlowers(queen, housing);
|
||||
hasFlowersCache.update(queen, housing);
|
||||
boolean hasFlowers = hasFlowersCache.hasFlowers();
|
||||
boolean flowerCacheNeedsSync = hasFlowersCache.needsSync();
|
||||
errorLogic.setCondition(!hasFlowers, EnumErrorCode.NO_FLOWER);
|
||||
|
||||
@@ -250,9 +256,11 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
@Override
|
||||
public void clearCachedValues() {
|
||||
if (!housing.getWorldObj().isRemote) {
|
||||
hasFlowersCache.clear();
|
||||
queenCanWorkCache.clear();
|
||||
canWork();
|
||||
if (queen != null) {
|
||||
hasFlowersCache.forceLookForFlowers(queen, housing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,14 +280,21 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
queenWorkCycleThrottle = 0;
|
||||
|
||||
doProduction(queen, housing, beeListener);
|
||||
queen.plantFlowerRandom(housing);
|
||||
World world = housing.getWorldObj();
|
||||
List<IBlockState> flowers = hasFlowersCache.getFlowers(world);
|
||||
if (flowers.size() < PluginApiculture.maxFlowersSpawnedPerHive) {
|
||||
BlockPos blockPos = queen.plantFlowerRandom(housing, flowers);
|
||||
if (blockPos != null) {
|
||||
hasFlowersCache.addFlowerPos(blockPos);
|
||||
}
|
||||
}
|
||||
pollenHandler.doPollination(queen, housing, beeListener);
|
||||
|
||||
// Age the queen
|
||||
IBeeGenome mate = queen.getMate();
|
||||
Preconditions.checkState(mate != null);
|
||||
float lifespanModifier = beeModifier.getLifespanModifier(queen.getGenome(), mate, 1.0f);
|
||||
queen.age(housing.getWorldObj(), lifespanModifier);
|
||||
queen.age(world, lifespanModifier);
|
||||
|
||||
// Write the changed queen back into the item stack.
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
|
||||
@@ -10,80 +10,100 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.core.network.IStreamable;
|
||||
import forestry.core.network.PacketBufferForestry;
|
||||
import forestry.core.utils.VectUtil;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable {
|
||||
private static final String nbtKey = "hasFlowerCache";
|
||||
private static final String nbtKeyFlowers = "flowers";
|
||||
private static final String nbtKeyCooldown = "cooldown";
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.core.IBlockPosPredicate;
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.core.utils.TickHelper;
|
||||
|
||||
private static final Random random = new Random();
|
||||
private static final int flowerCheckInterval = 128;
|
||||
public class HasFlowersCache implements INbtWritable, INbtReadable {
|
||||
private static final String NBT_KEY = "hasFlowerCache";
|
||||
private static final String NBT_KEY_FLOWERS = "flowers";
|
||||
private static final int FLOWER_CHECK_INTERVAL = 200;
|
||||
|
||||
private final int flowerCheckTime = random.nextInt(flowerCheckInterval);
|
||||
private List<BlockPos> flowerCoords = new ArrayList<>();
|
||||
private int cooldown = 0;
|
||||
private final TickHelper tickHelper = new TickHelper();
|
||||
|
||||
@Nullable
|
||||
private FlowerData flowerData;
|
||||
private final List<BlockPos> flowerCoords = new ArrayList<>();
|
||||
private final List<IBlockState> flowers = new ArrayList<>();
|
||||
|
||||
private boolean needsSync = false;
|
||||
|
||||
public boolean hasFlowers(IBee queen, IBeeHousing beeHousing) {
|
||||
IFlowerProvider flowerProvider = queen.getGenome().getFlowerProvider();
|
||||
String flowerType = flowerProvider.getFlowerType();
|
||||
private static class FlowerData {
|
||||
public final String flowerType;
|
||||
public final Vec3i territory;
|
||||
public final IBlockPosPredicate flowerPredicate;
|
||||
public Iterator<BlockPos.MutableBlockPos> areaIterator;
|
||||
|
||||
public FlowerData(IBee queen, IBeeHousing beeHousing) {
|
||||
IFlowerProvider flowerProvider = queen.getGenome().getFlowerProvider();
|
||||
this.flowerType = flowerProvider.getFlowerType();
|
||||
this.territory = queen.getGenome().getTerritory();
|
||||
this.flowerPredicate = FlowerManager.flowerRegistry.createAcceptedFlowerPredicate(flowerType);
|
||||
this.areaIterator = FlowerManager.flowerRegistry.getAreaIterator(beeHousing, queen);
|
||||
}
|
||||
|
||||
public void resetIterator(IBee queen, IBeeHousing beeHousing) {
|
||||
this.areaIterator = FlowerManager.flowerRegistry.getAreaIterator(beeHousing, queen);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(IBee queen, IBeeHousing beeHousing) {
|
||||
if (flowerData == null) {
|
||||
this.flowerData = new FlowerData(queen, beeHousing);
|
||||
this.flowerCoords.clear();
|
||||
this.flowers.clear();
|
||||
}
|
||||
World world = beeHousing.getWorldObj();
|
||||
tickHelper.onTick();
|
||||
|
||||
if (!flowerCoords.isEmpty()) {
|
||||
if (world.getTotalWorldTime() % flowerCheckInterval != flowerCheckTime) {
|
||||
return true;
|
||||
}
|
||||
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(beeHousing);
|
||||
BlockPos housingCoords = beeHousing.getCoordinates();
|
||||
|
||||
Vec3i genomeTerritory = queen.getGenome().getTerritory();
|
||||
float housingModifier = beeModifier.getTerritoryModifier(queen.getGenome(), 1f);
|
||||
Vec3i area = VectUtil.scale(genomeTerritory, housingModifier * 3.0f);
|
||||
BlockPos min = VectUtil.scale(area, -0.5f).add(housingCoords);
|
||||
BlockPos max = VectUtil.scale(area, 0.5f).add(housingCoords);
|
||||
|
||||
for (BlockPos flowerPos : flowerCoords) {
|
||||
if (!isFlowerValid(world, flowerPos, flowerType, min, max)) {
|
||||
cooldown = 0;
|
||||
break;
|
||||
if (!flowerCoords.isEmpty() && tickHelper.updateOnInterval(FLOWER_CHECK_INTERVAL)) {
|
||||
Iterator<BlockPos> iterator = flowerCoords.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
BlockPos flowerPos = iterator.next();
|
||||
if (!flowerData.flowerPredicate.test(world, flowerPos) && world.isBlockLoaded(flowerPos)) {
|
||||
iterator.remove();
|
||||
flowers.clear();
|
||||
needsSync = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cooldown <= 0) {
|
||||
List<BlockPos> newFlowerCoords = FlowerManager.flowerRegistry.getAcceptedFlowerCoordinates(beeHousing, queen, flowerType, 5);
|
||||
cooldown = PluginApiculture.ticksPerBeeWorkCycle;
|
||||
if (!flowerCoords.equals(newFlowerCoords)) {
|
||||
flowerCoords = newFlowerCoords;
|
||||
needsSync = true;
|
||||
}
|
||||
} else {
|
||||
cooldown--;
|
||||
}
|
||||
final int flowerCount = flowerCoords.size();
|
||||
final int ticksPerCheck = 1 + (flowerCount * flowerCount);
|
||||
|
||||
if (tickHelper.updateOnInterval(ticksPerCheck)) {
|
||||
if (flowerData.areaIterator.hasNext()) {
|
||||
BlockPos.MutableBlockPos blockPos = flowerData.areaIterator.next();
|
||||
if (flowerData.flowerPredicate.test(world, blockPos)) {
|
||||
addFlowerPos(blockPos.toImmutable());
|
||||
}
|
||||
} else {
|
||||
flowerData.resetIterator(queen, beeHousing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasFlowers() {
|
||||
return !flowerCoords.isEmpty();
|
||||
}
|
||||
|
||||
@@ -93,37 +113,65 @@ public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
flowerCoords.clear();
|
||||
cooldown = 0;
|
||||
public void onNewQueen(IBee queen, IBeeHousing housing) {
|
||||
if (this.flowerData != null) {
|
||||
IBeeGenome genome = queen.getGenome();
|
||||
String flowerType = genome.getFlowerProvider().getFlowerType();
|
||||
if (!this.flowerData.flowerType.equals(flowerType)
|
||||
|| !this.flowerData.territory.equals(genome.getTerritory())) {
|
||||
flowerData = new FlowerData(queen, housing);
|
||||
flowerCoords.clear();
|
||||
flowers.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<BlockPos> getFlowerCoords() {
|
||||
return Collections.unmodifiableList(flowerCoords);
|
||||
}
|
||||
|
||||
private static boolean isFlowerValid(World world, BlockPos flowerCoords, String flowerType, BlockPos min, BlockPos max) {
|
||||
if (!isFlowerCoordInRange(flowerCoords, min, max)) {
|
||||
return false;
|
||||
public List<IBlockState> getFlowers(World world) {
|
||||
if (flowers.isEmpty() && !flowerCoords.isEmpty()) {
|
||||
flowers.clear();
|
||||
for (BlockPos flowerCoord : flowerCoords) {
|
||||
IBlockState blockState = world.getBlockState(flowerCoord);
|
||||
flowers.add(blockState);
|
||||
}
|
||||
}
|
||||
return FlowerManager.flowerRegistry.isAcceptedFlower(flowerType, world, flowerCoords);
|
||||
return Collections.unmodifiableList(flowers);
|
||||
}
|
||||
|
||||
private static boolean isFlowerCoordInRange(BlockPos flowerCoords, BlockPos min, BlockPos max) {
|
||||
return flowerCoords.getX() >= min.getX() && flowerCoords.getX() <= max.getX() && flowerCoords.getY() >= min.getY() && flowerCoords.getY() <= max.getY() && flowerCoords.getZ() >= min.getZ() && flowerCoords.getZ() <= max.getZ();
|
||||
public void addFlowerPos(BlockPos blockPos) {
|
||||
flowerCoords.add(blockPos);
|
||||
flowers.clear();
|
||||
needsSync = true;
|
||||
}
|
||||
|
||||
public void forceLookForFlowers(IBee queen, IBeeHousing housing) {
|
||||
if (flowerData != null) {
|
||||
flowerCoords.clear();
|
||||
flowers.clear();
|
||||
flowerData.resetIterator(queen, housing);
|
||||
World world = housing.getWorldObj();
|
||||
while (flowerData.areaIterator.hasNext()) {
|
||||
BlockPos.MutableBlockPos blockPos = flowerData.areaIterator.next();
|
||||
if (flowerData.flowerPredicate.test(world, blockPos)) {
|
||||
addFlowerPos(blockPos.toImmutable());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
if (!nbttagcompound.hasKey(nbtKey)) {
|
||||
if (!nbttagcompound.hasKey(NBT_KEY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound hasFlowerCacheNBT = nbttagcompound.getCompoundTag(nbtKey);
|
||||
NBTTagCompound hasFlowerCacheNBT = nbttagcompound.getCompoundTag(NBT_KEY);
|
||||
|
||||
if (hasFlowerCacheNBT.hasKey(nbtKeyFlowers)) {
|
||||
int[] flowersList = hasFlowerCacheNBT.getIntArray(nbtKeyFlowers);
|
||||
if (hasFlowerCacheNBT.hasKey(NBT_KEY_FLOWERS)) {
|
||||
int[] flowersList = hasFlowerCacheNBT.getIntArray(NBT_KEY_FLOWERS);
|
||||
if (flowersList.length % 3 == 0) {
|
||||
int flowerCount = flowersList.length / 3;
|
||||
for (int i = 0; i < flowerCount; i++) {
|
||||
@@ -133,8 +181,7 @@ public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable
|
||||
needsSync = true;
|
||||
}
|
||||
}
|
||||
|
||||
cooldown = hasFlowerCacheNBT.getInteger(nbtKeyCooldown);
|
||||
flowers.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,17 +198,14 @@ public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable
|
||||
i++;
|
||||
}
|
||||
|
||||
hasFlowerCacheNBT.setIntArray(nbtKeyFlowers, flowersList);
|
||||
hasFlowerCacheNBT.setIntArray(NBT_KEY_FLOWERS, flowersList);
|
||||
}
|
||||
|
||||
hasFlowerCacheNBT.setInteger(nbtKeyCooldown, cooldown);
|
||||
|
||||
nbttagcompound.setTag(nbtKey, hasFlowerCacheNBT);
|
||||
nbttagcompound.setTag(NBT_KEY, hasFlowerCacheNBT);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(PacketBufferForestry data) {
|
||||
public void writeData(PacketBuffer data) {
|
||||
int size = flowerCoords.size();
|
||||
data.writeVarInt(size);
|
||||
if (size > 0) {
|
||||
@@ -173,9 +217,9 @@ public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(PacketBufferForestry data) throws IOException {
|
||||
public void readData(PacketBuffer data) throws IOException {
|
||||
flowerCoords.clear();
|
||||
flowers.clear();
|
||||
|
||||
int size = data.readVarInt();
|
||||
while (size > 0) {
|
||||
|
||||
Regular → Executable
+101
-70
@@ -10,6 +10,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -18,8 +21,42 @@ import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.PotionTypes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionUtils;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
|
||||
import net.minecraftforge.common.capabilities.CapabilityManager;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.Forestry;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
@@ -38,6 +75,7 @@ import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.apiculture.blocks.BlockAlvearyType;
|
||||
import forestry.apiculture.blocks.BlockCandle;
|
||||
import forestry.apiculture.blocks.BlockHoneyComb;
|
||||
import forestry.apiculture.blocks.BlockRegistryApiculture;
|
||||
import forestry.apiculture.capabilities.ArmorApiarist;
|
||||
import forestry.apiculture.commands.CommandBee;
|
||||
@@ -95,39 +133,8 @@ import forestry.food.items.ItemRegistryFood;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.PotionTypes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionType;
|
||||
import net.minecraft.potion.PotionUtils;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
|
||||
import net.minecraftforge.common.capabilities.CapabilityManager;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.APICULTURE, name = "Apiculture", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.apiculture.description")
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.APICULTURE, name = "Apiculture", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.apiculture.description", lootTable = "apiculture")
|
||||
public class PluginApiculture extends BlankForestryPlugin {
|
||||
private static final String CONFIG_CATEGORY = "apiculture";
|
||||
private static float secondPrincessChance = 0;
|
||||
@@ -144,6 +151,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
|
||||
public static String beekeepingMode = "NORMAL";
|
||||
public static final int ticksPerBeeWorkCycle = 550;
|
||||
public static int maxFlowersSpawnedPerHive = 20;
|
||||
@Nullable
|
||||
public static VillagerRegistry.VillagerProfession villagerApiarist;
|
||||
|
||||
@@ -254,6 +262,8 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
|
||||
secondPrincessChance = config.getFloatLocalized("beekeeping", "second.princess", secondPrincessChance, 0.0f, 100.0f);
|
||||
|
||||
maxFlowersSpawnedPerHive = config.getIntLocalized("beekeeping", "flowers.spawn", 20, 0, 1000);
|
||||
|
||||
String[] blacklist = config.getStringListLocalized("species", "blacklist", Constants.EMPTY_STRINGS);
|
||||
parseBeeBlacklist(blacklist);
|
||||
|
||||
@@ -306,7 +316,8 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
villagerRegistry.registerVillageCreationHandler(villageHandler);
|
||||
|
||||
villagerApiarist = new VillagerRegistry.VillagerProfession(Constants.ID_VILLAGER_APIARIST, Constants.TEXTURE_SKIN_BEEKPEEPER, Constants.TEXTURE_SKIN_ZOMBIE_BEEKPEEPER);
|
||||
villagerRegistry.register(villagerApiarist);
|
||||
IForgeRegistry<VillagerRegistry.VillagerProfession> villagerProfessions = ForgeRegistries.VILLAGER_PROFESSIONS;
|
||||
villagerProfessions.register(villagerApiarist);
|
||||
|
||||
ItemStack wildcardPrincess = new ItemStack(items.beePrincessGE, 1);
|
||||
ItemStack wildcardDrone = new ItemStack(items.beeDroneGE, 1);
|
||||
@@ -431,78 +442,88 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
// / APIARIST'S ARMOR
|
||||
|
||||
ItemStack wovenSilk = coreItems.craftingMaterial.getWovenSilk();
|
||||
RecipeUtil.addRecipe(items.apiaristHat,
|
||||
RecipeUtil.addRecipe("apiarist_hat", items.apiaristHat,
|
||||
"###", "# #",
|
||||
'#', wovenSilk);
|
||||
RecipeUtil.addRecipe(items.apiaristChest,
|
||||
RecipeUtil.addRecipe("apiarist_chest", items.apiaristChest,
|
||||
"# #", "###", "###",
|
||||
'#', wovenSilk);
|
||||
RecipeUtil.addRecipe(items.apiaristLegs,
|
||||
RecipeUtil.addRecipe("apiarist_legs", items.apiaristLegs,
|
||||
"###", "# #", "# #",
|
||||
'#', wovenSilk);
|
||||
RecipeUtil.addRecipe(items.apiaristBoots,
|
||||
RecipeUtil.addRecipe("apiarist_boots", items.apiaristBoots,
|
||||
"# #", "# #",
|
||||
'#', wovenSilk);
|
||||
|
||||
// / HABITAT LOCATOR
|
||||
RecipeUtil.addRecipe(items.habitatLocator,
|
||||
RecipeUtil.addRecipe("habitat_locator", items.habitatLocator,
|
||||
" X ",
|
||||
"X#X",
|
||||
" X ",
|
||||
'#', OreDictUtil.DUST_REDSTONE, 'X', OreDictUtil.INGOT_BRONZE);
|
||||
|
||||
// Bees
|
||||
RecipeUtil.addRecipe(items.scoop,
|
||||
RecipeUtil.addRecipe("scoop", items.scoop,
|
||||
"#X#", "###", " # ",
|
||||
'#', OreDictUtil.STICK_WOOD,
|
||||
'X', Blocks.WOOL);
|
||||
RecipeUtil.addRecipe(items.smoker,
|
||||
RecipeUtil.addRecipe("smoker", items.smoker,
|
||||
"LS#",
|
||||
"LF#",
|
||||
"###",
|
||||
'#', "ingotTin", 'S', OreDictUtil.STICK_WOOD, 'F', Items.FLINT_AND_STEEL, 'L', OreDictUtil.LEATHER);
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.SLIME_BALL),
|
||||
RecipeUtil.addRecipe("propolis_to_slime", new ItemStack(Items.SLIME_BALL),
|
||||
"#X#", "#X#", "#X#",
|
||||
'#', items.propolis,
|
||||
'X', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.SPECKLED_MELON),
|
||||
RecipeUtil.addRecipe("honey_melon", new ItemStack(Items.SPECKLED_MELON),
|
||||
"#X#", "#Y#", "#X#",
|
||||
'#', items.honeyDrop,
|
||||
'X', items.honeydew,
|
||||
'Y', Items.MELON);
|
||||
RecipeUtil.addRecipe(items.frameUntreated,
|
||||
RecipeUtil.addRecipe("frame_untreated", items.frameUntreated,
|
||||
"###", "#S#", "###",
|
||||
'#', OreDictUtil.STICK_WOOD,
|
||||
'S', Items.STRING);
|
||||
RecipeUtil.addRecipe(items.frameImpregnated,
|
||||
RecipeUtil.addRecipe("frame_impregnated", items.frameImpregnated,
|
||||
"###", "#S#", "###",
|
||||
'#', coreItems.stickImpregnated,
|
||||
'S', Items.STRING);
|
||||
RecipeUtil.addRecipe(items.minecartBeehouse.getBeeHouseMinecart(),
|
||||
RecipeUtil.addRecipe("bee_house_minecart", items.minecartBeehouse.getBeeHouseMinecart(),
|
||||
"B",
|
||||
"C",
|
||||
'B', new ItemStack(blocks.beeHouse),
|
||||
'C', Items.MINECART);
|
||||
RecipeUtil.addRecipe(items.minecartBeehouse.getApiaryMinecart(),
|
||||
RecipeUtil.addRecipe("apiary_minecart", items.minecartBeehouse.getApiaryMinecart(),
|
||||
"B",
|
||||
"C",
|
||||
'B', new ItemStack(blocks.apiary),
|
||||
'C', Items.MINECART);
|
||||
for(int blockCount = 0;blockCount < blocks.beeCombs.length;blockCount++){
|
||||
BlockHoneyComb block = blocks.beeCombs[blockCount];
|
||||
for(int blockMeta = 0;blockMeta < EnumHoneyComb.VALUES.length - blockCount * 16;blockMeta++){
|
||||
int itemMeta = blockMeta + blockCount * 16;
|
||||
RecipeUtil.addRecipe("comb." + itemMeta, new ItemStack(block, 1, blockMeta),
|
||||
"###",
|
||||
"###",
|
||||
"###", '#', items.beeComb.get(EnumHoneyComb.get(itemMeta), 1));
|
||||
}
|
||||
}
|
||||
|
||||
// FOOD STUFF
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FOOD)) {
|
||||
ItemRegistryFood foodItems = PluginFood.getItems();
|
||||
RecipeUtil.addRecipe(new ItemStack(foodItems.honeyedSlice, 4),
|
||||
RecipeUtil.addRecipe("honeyed_slice", new ItemStack(foodItems.honeyedSlice, 4),
|
||||
"###", "#X#", "###",
|
||||
'#', items.honeyDrop,
|
||||
'X', Items.BREAD);
|
||||
|
||||
RecipeUtil.addRecipe(foodItems.honeyPot,
|
||||
RecipeUtil.addRecipe("honey_pot", foodItems.honeyPot,
|
||||
"# #", " X ", "# #",
|
||||
'#', items.honeyDrop,
|
||||
'X', fluidItems.waxCapsuleEmpty);
|
||||
|
||||
RecipeUtil.addRecipe(foodItems.ambrosia,
|
||||
RecipeUtil.addRecipe("ambrosia", foodItems.ambrosia,
|
||||
"#Y#", "XXX", "###",
|
||||
'#', items.honeydew,
|
||||
'X', items.royalJelly,
|
||||
@@ -514,33 +535,33 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
int outputCapsuleAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.capsule");
|
||||
if (outputCapsuleAmount > 0) {
|
||||
ItemStack capsule = fluidItems.waxCapsuleEmpty.getItemStack(outputCapsuleAmount);
|
||||
RecipeUtil.addRecipe(capsule, "###", '#', coreItems.beeswax);
|
||||
RecipeUtil.addRecipe("wax_capsule", capsule, "###", '#', coreItems.beeswax);
|
||||
}
|
||||
|
||||
int outputRefractoryAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.refractory");
|
||||
if (outputRefractoryAmount > 0) {
|
||||
ItemStack capsule = fluidItems.refractoryEmpty.getItemStack(outputRefractoryAmount);
|
||||
RecipeUtil.addRecipe(capsule, "###", '#', coreItems.refractoryWax);
|
||||
RecipeUtil.addRecipe("refractory_capsule", capsule, "###", '#', coreItems.refractoryWax);
|
||||
}
|
||||
|
||||
// / BITUMINOUS PEAT
|
||||
RecipeUtil.addRecipe(coreItems.bituminousPeat.getItemStack(),
|
||||
RecipeUtil.addRecipe("bituminous_peat", coreItems.bituminousPeat.getItemStack(),
|
||||
" # ", "XYX", " # ",
|
||||
'#', OreDictUtil.DUST_ASH,
|
||||
'X', coreItems.peat,
|
||||
'Y', items.propolis);
|
||||
|
||||
// / TORCHES
|
||||
RecipeUtil.addRecipe(new ItemStack(Blocks.TORCH, 3),
|
||||
RecipeUtil.addRecipe("beeswax_worth", new ItemStack(Blocks.TORCH, 3),
|
||||
" # ", " # ", " Y ",
|
||||
'#', coreItems.beeswax,
|
||||
'Y', OreDictUtil.STICK_WOOD);
|
||||
RecipeUtil.addRecipe(coreItems.craftingMaterial.getPulsatingMesh(),
|
||||
RecipeUtil.addRecipe("pulsating_mesh", coreItems.craftingMaterial.getPulsatingMesh(),
|
||||
"# #", " # ", "# #",
|
||||
'#', items.propolis.get(EnumPropolis.PULSATING, 1));
|
||||
|
||||
// / WAX CAST
|
||||
RecipeUtil.addRecipe(items.waxCast,
|
||||
RecipeUtil.addRecipe("wax_cast", items.waxCast,
|
||||
"###",
|
||||
"# #",
|
||||
"###",
|
||||
@@ -548,14 +569,14 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
|
||||
// / ALVEARY
|
||||
ItemStack alvearyPlainBlock = blocks.getAlvearyBlock(BlockAlvearyType.PLAIN);
|
||||
RecipeUtil.addRecipe(alvearyPlainBlock,
|
||||
RecipeUtil.addRecipe("alveary_plain", alvearyPlainBlock,
|
||||
"###",
|
||||
"#X#",
|
||||
"###",
|
||||
'X', coreItems.impregnatedCasing,
|
||||
'#', coreItems.craftingMaterial.getScentedPaneling());
|
||||
// SWARMER
|
||||
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.SWARMER),
|
||||
RecipeUtil.addRecipe("alveary_swarmer", blocks.getAlvearyBlock(BlockAlvearyType.SWARMER),
|
||||
"#G#",
|
||||
" X ",
|
||||
"#G#",
|
||||
@@ -563,7 +584,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'X', alvearyPlainBlock,
|
||||
'G', OreDictUtil.INGOT_GOLD);
|
||||
// FAN
|
||||
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.FAN),
|
||||
RecipeUtil.addRecipe("alveary_fan", blocks.getAlvearyBlock(BlockAlvearyType.FAN),
|
||||
"I I",
|
||||
" X ",
|
||||
"I#I",
|
||||
@@ -571,7 +592,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'X', alvearyPlainBlock,
|
||||
'I', OreDictUtil.INGOT_IRON);
|
||||
// HEATER
|
||||
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.HEATER),
|
||||
RecipeUtil.addRecipe("alveary_heater", blocks.getAlvearyBlock(BlockAlvearyType.HEATER),
|
||||
"#I#",
|
||||
" X ",
|
||||
"YYY",
|
||||
@@ -579,7 +600,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'X', alvearyPlainBlock,
|
||||
'I', OreDictUtil.INGOT_IRON, 'Y', OreDictUtil.STONE);
|
||||
// HYGROREGULATOR
|
||||
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.HYGRO),
|
||||
RecipeUtil.addRecipe("alveary_hygro", blocks.getAlvearyBlock(BlockAlvearyType.HYGRO),
|
||||
"GIG",
|
||||
"GXG",
|
||||
"GIG",
|
||||
@@ -587,14 +608,14 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'I', OreDictUtil.INGOT_IRON,
|
||||
'G', OreDictUtil.BLOCK_GLASS);
|
||||
// STABILISER
|
||||
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.STABILISER),
|
||||
RecipeUtil.addRecipe("alveary_stabiliser", blocks.getAlvearyBlock(BlockAlvearyType.STABILISER),
|
||||
"G G",
|
||||
"GXG",
|
||||
"G G",
|
||||
'X', alvearyPlainBlock,
|
||||
'G', OreDictUtil.GEM_QUARTZ);
|
||||
// SIEVE
|
||||
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.SIEVE),
|
||||
RecipeUtil.addRecipe("alveary_sieve", blocks.getAlvearyBlock(BlockAlvearyType.SIEVE),
|
||||
"III",
|
||||
" X ",
|
||||
"WWW",
|
||||
@@ -642,8 +663,8 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
"#X#",
|
||||
'#', coreItems.beeswax,
|
||||
'X', coreItems.craftingMaterial.getSilkWisp());
|
||||
RecipeUtil.addShapelessRecipe(blocks.candle.getUnlitCandle(1), blocks.candle.getUnlitCandle(1));
|
||||
RecipeUtil.addShapelessRecipe(blocks.candle.getLitCandle(1), blocks.candle.getLitCandle(1));
|
||||
RecipeUtil.addShapelessRecipe("candle_unlit_reset", blocks.candle.getUnlitCandle(1), blocks.candle.getUnlitCandle(1));
|
||||
RecipeUtil.addShapelessRecipe("candle_lit_reset", blocks.candle.getLitCandle(1), blocks.candle.getLitCandle(1));
|
||||
|
||||
// / CENTRIFUGE
|
||||
// Honey combs
|
||||
@@ -743,7 +764,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeManagers.fermenterManager.addRecipe(items.honeydew.getItemStack(), 500, 1.0f, Fluids.SHORT_MEAD.getFluid(1), Fluids.FOR_HONEY.getFluid(1));
|
||||
}
|
||||
|
||||
RecipeUtil.addRecipe(blocks.apiary,
|
||||
RecipeUtil.addRecipe("apiary", blocks.apiary,
|
||||
"XXX",
|
||||
"#C#",
|
||||
"###",
|
||||
@@ -751,7 +772,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'#', OreDictUtil.PLANK_WOOD,
|
||||
'C', coreItems.impregnatedCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.beeChest,
|
||||
RecipeUtil.addRecipe("bee_chest", blocks.beeChest,
|
||||
" # ",
|
||||
"XYX",
|
||||
"XXX",
|
||||
@@ -759,7 +780,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'X', OreDictUtil.BEE_COMB,
|
||||
'Y', OreDictUtil.CHEST_WOOD);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.beeHouse,
|
||||
RecipeUtil.addRecipe("bee_house", blocks.beeHouse,
|
||||
"XXX",
|
||||
"#C#",
|
||||
"###",
|
||||
@@ -884,8 +905,18 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void populateChunk(IChunkGenerator chunkGenerator, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
if(!world.provider.getDimensionType().equals(DimensionType.THE_END)) return;
|
||||
if (Config.getBeehivesAmount() > 0.0) {
|
||||
HiveDecorator.decorateHives(chunkGenerator, world, rand, chunkX, chunkZ, hasVillageGenerated);
|
||||
HiveDecorator.decorateHives(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorateBiome(World world, Random rand, BlockPos pos) {
|
||||
if (Config.getBeehivesAmount() > 0.0) {
|
||||
int chunkX = pos.getX() >> 4;
|
||||
int chunkZ = pos.getZ() >> 4;
|
||||
HiveDecorator.decorateHives(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SaveEventHandlerApiculture implements ISaveEventHandler {
|
||||
|
||||
|
||||
Loaded 100 of 919 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user