Compare commits

...
167 Commits
Author SHA1 Message Date
mezz 202d19df93 Version 5.2.17 2017-01-10 07:41:20 -08:00
mezz 333334190a Prevent exception from accessing tile entities from ChunkCache 2017-01-10 07:40:14 -08:00
mezz 7c00ea2965 Fix #1560 network sync issue for genome tracker when player logs in 2017-01-10 07:29:08 -08:00
mezz 79cf866a96 Clean up backpack resupply handler 2017-01-02 12:41:57 -08:00
Nedelosk 504ec8acfc Fix #1554 1.10.2 Game Crash and Ticking Block Exception when using Reanimation effect on Skeleton and Zombie Drops 2016-12-28 23:55:45 +01:00
Nedelosk 44a926f897 Fix #1548 EntityMinecartBeeHousingBase.isRaining 2016-12-23 13:31:17 +01:00
Nedelosk 30d7365518 Fix #1508 Bee buildup during pause 2016-12-22 13:24:12 +01:00
Nedelosk 56800af94d Fix #1477 Electrical Engine places backwards 2016-12-22 03:17:35 +01:00
Nedelosk 043571b659 Improve farm control 2016-12-22 02:56:55 +01:00
Nedelosk 7fd2776147 Fix gamemode commit 2016-12-22 02:50:44 +01:00
Nedelosk d4c2d7220d Fix #580, Fix #1479 Add a way to register items to work as fertilizer in farms in a config 2016-12-22 02:47:00 +01:00
Nedelosk d392666dc4 Add missing methods 2016-12-20 06:48:35 +01:00
mezz 07b88d36fc Check that fluids are not null when auto-dumping from bottler 2016-12-19 16:33:33 -08:00
Nedelosk 408d1dc7c3 Fix #1521 IC2 + Foresty crash 2016-12-19 19:20:47 +01:00
Nedelosk 7b1aead339 Fix #1509 Alveary ignores rain 2016-12-19 19:15:28 +01:00
Nedelosk 21969649a2 Fix #1542 SidedInvWrapper used when facing is null 2016-12-19 17:12:06 +01:00
Nedelosk f9b8b89340 Adding a debug message 2016-12-12 14:21:12 +01:00
Nedelosk 65712adcb3 Delete 9864a84a13 2016-12-10 10:26:42 +01:00
Nedelosk 9864a84a13 Make that the climate event handler only work on the server thread 2016-12-10 10:24:46 +01:00
Nedelosk 8f9ae45147 Fix greenhouse climate info 2016-12-10 10:20:45 +01:00
mezz 2965f28403 Fix #1522 log spam with Reliquary void tear 2016-12-01 21:28:37 -08:00
Nirek-K cb93c217e0 Fix #1520 Add Chorus flower/plant to End flower. 2016-11-30 11:53:04 -06:00
mezz 219e9bf355 Fix EntityItemPickupEvent when there are multiple modded handlers 2016-11-29 12:44:13 -08:00
mezz 43a2f0ae76 Fix farm picking up items off Immersive Engineering conveyors 2016-11-25 12:24:15 -08:00
mezz 098b739dca Fix crash with TOP looking at new papaya fruit pods 2016-11-16 21:57:17 -08:00
mezz 4dfa29b1ad Add more null annotations 2016-11-16 21:56:31 -08:00
mezz 60d2820ed6 Update Forge and MCP 2016-11-12 19:12:57 -08:00
Nedelosk 91ec6cff9b Fix #1504 [1.10.2] [5.2.15.296] Butterflies gravitating towards 0,0 where huge swarms are found 2016-11-13 00:30:11 +01:00
mezz 1775e59880 Fix #1507 Crash with Energy Transfer to Mekanism 2016-11-11 20:38:59 -08:00
mezz f62745b233 Clean up bottler updateServerSide 2016-11-11 20:38:59 -08:00
mezz 1d6293c788 Clean up bottler canDump 2016-11-11 20:38:58 -08:00
mezz 3fd07f2a7a Clean up bottler JEI recipes 2016-11-11 20:38:58 -08:00
marcin212 856e800e0e Add Immersive Engineering compat (#1506) 2016-11-11 13:11:58 -08:00
Nirek-K d9561fd7af Re-Add Harvestcraft plugin, covers everything it did in 1.7 (new things will have to be suggested/added later) 2016-11-11 03:07:27 -06:00
Nirek-K e0623f7d57 Minor logic fixes for orchard, to get it to see crops again. 2016-11-07 18:31:12 -06:00
Nirek-K d48b979ac3 Add Actuallly Additions crops also to orchard.
Add Actuallly Additions crops also to orchard.
2016-11-07 10:25:27 -06:00
mezz 63494c40a7 Fix #1497 Chisel integration with digging backpack 2016-11-06 17:15:18 -08:00
mezz 2c57aef3b3 Fix backpack IMC handling 2016-11-06 17:14:06 -08:00
mezz 1392823fae Fix #1498 Crash when Arboriculture plugin is disabled 2016-11-06 16:55:12 -08:00
mezz 67693961ac Change address texture back to 32x32 to avoid breaking texture packs 2016-11-06 16:42:25 -08:00
mezz 8ad8597ff0 Fix #1499 Server Error when trying to access a GUI 2016-11-06 13:59:42 -08:00
mezz 4c8d5e2f43 Move Forestry GUI icons to a new TextureMap 2016-11-06 01:51:43 -08:00
mezz d04713339c Fix the build 2016-11-04 18:40:58 -07:00
Nedelosk 844aea7431 Improve butterfly item texture atlas and model, Fix #1312 2016-11-05 02:26:59 +01:00
mezz 53a9bf458e Update JEI version 2016-11-03 22:44:45 -07:00
mezz 2ae52451b2 Implement JEI lookups on fluid tanks 2016-11-03 21:24:42 -07:00
Speiger d3054c33e7 Improve Crate Renderer (#1493) 2016-11-01 15:43:03 -07:00
mezz bf61462a2a Rename centrifuge gui texture for compat with older texture packs 2016-10-31 20:59:42 -07:00
marcin212 41f3ae4b1f Allow multipass rendering for sapling 2016-10-30 17:21:13 -07:00
mezz b1d7c1721d Add strict null checking for ActuallyAdditions plugin 2016-10-30 15:01:33 -07:00
Ellpeck 2944165741 Added Actually Additions compatibility 2016-10-30 15:01:33 -07:00
Nedelosk e316526675 Fix Charcoal Pile 2016-10-30 13:35:09 +01:00
Nedelosk 411cbd913c Fix #1473 New Bottler issues 2016-10-30 13:32:55 +01:00
Nedelosk 2191d00f3d Fix #1487 Random crash in WeightedRandomModel 2016-10-30 12:54:25 +01:00
Nedelosk a02af0ddf2 Fix #1490 Crash in 1.10.2 when trying to render a Hill Cherry sapling 2016-10-30 12:51:58 +01:00
Nedelosk a8e4f5dde7 Fix #1476 Wood Pile processes instantly 2016-10-30 12:40:22 +01:00
mezz 85718b1df8 Fix and improve Bottler JEI integration 2016-10-29 18:22:40 -07:00
mezz 781b4d883b Fix #1486 Crash from candle block 2016-10-26 13:55:55 -07:00
Nedelosk c5c056750a Fix butterfly 2016-10-25 00:50:58 +02:00
Nedelosk 3b8af4e4c9 Fix IPollinatable and New Version 2016-10-25 00:47:49 +02:00
Nedelosk f58938ff32 Improve IPollinatable 2016-10-25 00:27:26 +02:00
Nedelosk a05bc13852 Fix Climate Handler and add climate test mod for devs 2016-10-22 17:37:49 +02:00
Nedelosk 1cd3e15ef9 Make climate update to a Runnable 2016-10-20 02:44:57 +02:00
Nedelosk 1ac7a7de42 Add Fluid Container Output and processing Slots to the Bottler 2016-10-19 18:58:55 +02:00
Nedelosk 90ed57c742 Merge branch 'mc-1.10' of https://github.com/ForestryMC/ForestryMC into mc-1.10 2016-10-19 13:01:26 +02:00
Nedelosk 94b0b44f51 Fix inverted climate infos 2016-10-19 13:00:56 +02:00
mezz c0fafc20da Improve bee hive performance (#1470) 2016-10-18 17:35:03 -07:00
mezz 4f85236475 Fix #1470 Prevent bees from loading new chunks 2016-10-18 16:15:44 -07:00
Nedelosk 41ab1ea374 Update Version 2016-10-19 00:34:11 +02:00
Nedelosk 52b8d56ff0 Make that the ash drop of the kiln is never 0 2016-10-19 00:04:17 +02:00
Nedelosk a61879daff Fix Alveary 2016-10-18 23:25:20 +02:00
Nedelosk e71edd5855 Fix #1469 Wrong climate info when apiary is placed in greenhouse. 2016-10-18 23:18:15 +02:00
Nedelosk 321e316665 Fix #1456 Breaking a Swarm Hive with Botania's Bore Lens crashes the game 2016-10-18 22:05:44 +02:00
Nedelosk aca6ed1fd8 Add CircuitBoard to colour.properties and Fix #1468 [1.10.2-5.2.14.283] Server side crash 2016-10-18 21:00:16 +02:00
Nedelosk b135593733 Fix #1466 Add Malisis Doors to camouflage Blacklist 2016-10-18 20:31:14 +02:00
Nedelosk ac7fe4b2d2 Fix #1467 Green House Camouflage Glitch 2016-10-18 19:58:01 +02:00
Nedelosk 5e0e045053 Fix #1465 1.10.2-5.2.14.276 - Electrical Engines no longer allow levers to attach to the back 2016-10-18 17:53:23 +02:00
Nedelosk f01dab6f58 Fix #1420 Tweak the effects of three placed fluids 2016-10-18 17:47:07 +02:00
Nedelosk 9385a4caca Fix and Add model caches and Fix #1102Invisible butterflies in itemframes 2016-10-18 17:27:24 +02:00
Nedelosk 582c8d64df Fix greenhouse tiles 2016-10-18 16:20:30 +02:00
Nedelosk 26c40b2006 Fix #1447 Flickering Greenhouse 2016-10-18 16:15:49 +02:00
Nedelosk b7eaaf6804 Fix #1460 Empty bucket can't be pulled out of (i.e.) Biogas engine 2016-10-18 15:56:09 +02:00
Nedelosk 3f07e68952 Fix #1071 Butterflies spread out of control 2016-10-18 15:42:12 +02:00
Nedelosk 2b40762934 Fix #1459 Greenhouse Door Crash w/ Malisis' Doors Mod Doors 2016-10-18 15:28:36 +02:00
Nedelosk dcaf6e144f Fix #1294 JEI Integration for Thermionic Fab and Carpenter 2016-10-18 15:12:59 +02:00
Nedelosk 413e1b9a0d Fix #1439 Cocoons config bug in 1.10.2 2016-10-18 14:13:28 +02:00
Nedelosk 64f64f2b5c Fix #1441 Centrifuge preview slot should show item being centrifuged, not its result 2016-10-18 14:10:30 +02:00
Nedelosk 2d25754731 Fix 1444 Apiarist's Chest collision box is acting weird., Fix # 1422 Cacoons cause suffocation if you walk into them 2016-10-18 13:58:47 +02:00
Nedelosk 2df6cfb7f7 Fix #1455 Igniting a Wood Pile built by a fake player crashes the game 2016-10-18 13:40:11 +02:00
Nedelosk 2d0ca49359 Fix 1408 Floating desert acacia "trees" appear in the middle of nowere 2016-10-18 13:04:54 +02:00
Nedelosk d567138365 Fix #1463, Fix #1457 Make charcoal drop with % chance, remove custom charcoals. 2016-10-18 11:57:27 +02:00
Nedelosk 72380251f3 Fix #1432 multiblock.error.small.x when right-clicking Wood Piles 2016-10-10 10:17:55 +02:00
Nedelosk 05a263826e Fix #1438 Crash after Breaking Chest 2016-10-10 10:13:17 +02:00
Nedelosk 61aa8bdcf0 Fix #1437 Drone in the analyzer 2016-10-10 10:06:53 +02:00
Nedelosk e0694842b6 Improve Camouflage Packet 2016-10-10 10:00:58 +02:00
mezz ff9942d0bc Fix "upper half" wood slabs having the wrong wood type 2016-10-08 20:05:43 -07:00
mezz dcf7776cc1 Fix #1451 Crash when placing decorative leaf blocks 2016-10-08 19:55:20 -07:00
mezz a0d355d0aa Fix some nullable annotation errors 2016-10-07 21:49:54 -07:00
mezz 649a061b6e Fix ModelBlockCached not resetting after a texture remap 2016-10-07 21:28:57 -07:00
mezz 2ca743a931 Clean up ModelBlockCached slightly 2016-10-07 21:28:25 -07:00
mezz 76a34a603b Update ApicultureJeiPlugin to stop using deprecated methods 2016-10-07 17:22:19 -07:00
mezz 68651939e7 Fix crash when getting wood blocks with invalid variants 2016-10-07 15:42:20 -07:00
Adrian Siekierka 9dcc818a17 Add model caching (#1449) 2016-10-07 15:10:09 -07:00
mezz 5e3c23e4eb Bump version 2016-10-02 17:52:43 -07:00
mezz d8ffc5c4b8 Fix #1403 worktable bug with items it can't craft 2016-10-02 17:52:35 -07:00
mezz 737f64eeab Fix uppercase variable name 2016-10-02 15:18:11 -07:00
mezz 0db27d83b0 Add worktable to JEI's Crafting Table items 2016-10-02 15:17:59 -07:00
mezz f57de19b06 Fix #1442 Let BeeHousings detect biome changes 2016-10-02 15:17:32 -07:00
mezz 1fed58fae5 Bump version 2016-09-30 23:29:41 -07:00
mezz 1d8d61daf1 Fix missing Squeezer recipes in JEI 2016-09-30 23:29:15 -07:00
mezz 65bd93749c Fix missing itemHandler capability for Farm hatch 2016-09-28 21:49:58 -07:00
mezz ac48b4b5c6 Update JEI integration 2016-09-27 02:53:06 -07:00
Nedelosk 3be3ecfc8a Fix #1436 Placing lit candles does not cause a lighting update, Fix #1435 Freshly crafted candle items are not the same as just-broken candle items. 2016-09-24 15:48:56 +02:00
mezz 10aae6b6bc Clean up IBeeHousing slightly 2016-09-19 21:12:58 -07:00
mezz d84560926c Make IArmorNaturalist into a capability 2016-09-19 21:12:58 -07:00
mezz ab3de49198 Make IArmorApiarist into a capability 2016-09-19 21:12:57 -07:00
Nedelosk b2b743398c Adding a preview slot to the centrifuge 2016-09-19 20:28:52 +02:00
Nedelosk 52f233e84a Fix the clockwork engine 2016-09-18 01:30:58 +02:00
Nedelosk 2f2ec91670 Fix #1253 2016-09-18 00:20:11 +02:00
Nedelosk 2e2fa8e6df Removed a comment because it is not true anymore 2016-09-17 23:41:02 +02:00
Nedelosk 3de6e0c5b7 Bump version 2016-09-17 23:27:51 +02:00
Nedelosk 0f4ba8d8fa Clean Up 2016-09-17 23:26:58 +02:00
Nedelosk 9570d26c83 Fix #1429 [API-TreeManager] TreeManager doesn't work properly 2016-09-17 23:19:39 +02:00
Nedelosk 01dc4f2bfe Fix the alyzer plugin api 2016-09-17 23:18:53 +02:00
Nedelosk 80de4d6490 Fix #1427 Engines do not show RF/t output properly 2016-09-17 22:50:46 +02:00
Nedelosk 253e9f18ed Fix #1078 Adding a work Cycle for every pending product 2016-09-17 22:23:11 +02:00
Nedelosk bbda5c8ba9 Fix #1419 Disabled greenhouse in plugins (as they're buggy) and having crash with 'cocoon's 2016-09-17 22:00:53 +02:00
mezz c289590740 Bump version 2016-09-15 14:53:26 -07:00
mezz 714858be99 Fix cable connections with Engines 2016-09-15 14:53:19 -07:00
mezz 5bb60cad8a Bump version 2016-09-14 14:24:24 -07:00
mezz b8cf4ef1cf Update zh_CN.lang 2016-09-14 14:24:23 -07:00
mezz d35075d681 Prevent farms on a chunk edge from loading unloaded chunks 2016-09-14 14:23:06 -07:00
mezz 79c56311c2 Refactor Energy systems and make RF optional 2016-09-13 00:37:39 -07:00
mezz 77cea8a645 Add support for new Forge energy capability 2016-09-12 16:07:47 -07:00
Nedelosk ed00ca3158 Merge pull request #1407 from ForestryMC/Greenhouse
Adding Greenhouse Window, Climate Control,  Camouflage Spray Can and Improve Recipes
2016-09-12 18:00:45 +02:00
Nedelosk 418f00abf2 Merge branch 'mc-1.10' of https://github.com/ForestryMC/ForestryMC into mc-1.10 2016-09-12 14:47:01 +02:00
mezz 0fa8fdad39 Remove access-related hints and the power-required hint 2016-09-11 22:23:38 -07:00
Aroma1997 0a110eb761 Fix #1414 greenhouse climate blocks crash (#1418) 2016-09-11 13:27:27 -07:00
Nedelosk 9feb5cb114 Merge branch 'mc-1.10' of https://github.com/ForestryMC/ForestryMC into mc-1.10 2016-09-11 10:51:16 +02:00
Nirek-K 7aa44fb1fa Fix #1413 phospor should give lava 2016-09-03 22:36:33 -05:00
Nedelosk 84fa956ce4 Improve greenhouse glass 2016-08-24 14:38:54 +02:00
Nedelosk 0c14a85c31 Adding new recipes and improve other recipes 2016-08-24 14:03:09 +02:00
Nedelosk a20fbbe60f Adding Greenhouse windows and climate control and improve recipes 2016-08-24 00:33:53 +02:00
mezz 27d932ee34 Do not allow rain tanks to be filled from the bottom 2016-08-18 18:47:32 -07:00
mezz 52b1784f25 Close #1400 Reduce frequency of End Hives 2016-08-17 21:11:24 -07:00
mezz 154f4f2712 Close #1398 Make wild bees friendlier to endermen 2016-08-17 21:03:35 -07:00
mezz 806ca2cf7b Bump version 2016-08-16 16:50:19 -07:00
mezz 9f171977bb Add some more tooltips and JEI description pages 2016-08-16 16:50:00 -07:00
mezz 2031f7fe02 Unify the way item and itemBlock tooltips are added 2016-08-16 16:49:28 -07:00
mezz 4259a55e7a Close #955 Automatically output water from the bottom of the Rain Tank 2016-08-15 00:12:47 -07:00
mezz 065344ba5e Clean up Rain Tank implementation 2016-08-14 22:52:53 -07:00
mezz d0c9a77528 Update dependencies 2016-08-14 21:40:39 -07:00
Nedelosk 604429f267 Fix #1388 Rendering Crash in Inventory and a climate crash 2016-08-14 13:27:12 +02:00
Nedelosk f5a9dcccb8 Fix #1387 Crash when creating a new world 2016-08-14 00:42:20 +02:00
Nedelosk b056cce707 Fix the woodTextures 2016-08-13 17:47:23 +02:00
Nedelosk 1497aada57 Improve the woodtextures class. 2016-08-13 17:24:26 +02:00
Nedelosk fb8ddf54b7 Adding a way to add costum wood models 2016-08-13 17:16:38 +02:00
Nedelosk 9a05322d45 Fix a mistake 2016-08-12 21:57:47 +02:00
Nedelosk 8c2008b06c Bump version 2016-08-12 21:54:08 +02:00
Nedelosk e3cc08a624 Fix #1382 Crash on load wood models and clean up 2016-08-12 21:46:41 +02:00
Nedelosk 36cd4663d9 Fix a cocoon bug and add a default cocoon loot 2016-08-12 13:59:05 +02:00
Nedelosk a014ef6d14 Fix #1381 Greenhouse climate switches between normal and very high levels and fix a cocoon bug 2016-08-12 13:48:19 +02:00
Nedelosk 34fa218c38 Try to fix the greengouse climate ledget and fix the greenhouse sprinklers 2016-08-12 13:18:08 +02:00
Nedelosk f422b577fe Fix model baker models 2016-08-12 12:42:52 +02:00
Nedelosk e379465227 Fix #1380 Forestry camoflaged blocks do not render the same as regular blocks 2016-08-12 12:36:10 +02:00
Nedelosk eb63e75200 Add new Wood Model Loader (#1367) 2016-08-11 21:22:02 -07:00
Nedelosk b5faab51c3 Update greenhouse climate system and improve camouflage system (#1334) 2016-08-11 20:53:04 -07:00
1551 changed files with 12548 additions and 15420 deletions

No files matched your search

+7 -16
View File
@@ -1,14 +1,7 @@
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
@@ -16,11 +9,10 @@ buildscript {
}
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
id "com.matthewprenger.cursegradle" version "1.0.7"
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.32"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'
version = version_major + '.' + version_minor + '.' + version_patch + '.' + getBuildNumber()
@@ -98,6 +90,9 @@ processResources {
exclude 'mcmod.info'
exclude '**/*.md'
}
// Move access transformers to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
// prevent java 8's strict doclint for javadocs from failing builds
@@ -108,12 +103,8 @@ allprojects {
}
jar {
// Copy redstone api into the jar, should shade this as a maven dep...
from (sourceSets.api.allSource) {
include 'cofh/**/*.txt'
}
from (sourceSets.api.output.classesDir) {
include 'cofh/**/*.*'
manifest {
attributes 'FMLAT': 'forestry_at.cfg'
}
}
+6 -6
View File
@@ -1,11 +1,11 @@
mcversion=1.10.2
forgeversion=12.18.1.2050
mcp_mappings=snapshot_20160525
forgeversion=12.18.2.2125
mcp_mappings=snapshot_20161111
tesla_version=1.10.2-1.2.1.41
jei_version=3.8.0.240
ic2_version=2.6.15-ex110
tesla_version=1.10.2-1.2.1.49
jei_version=3.13.2.349
ic2_version=2.6.76-ex110
version_major=5
version_minor=2
version_patch=8
version_patch=17
+1 -1
Submodule lang updated: 0d52088d32...e919e4ad51.
+17 -16
View File
@@ -12,6 +12,20 @@ package forestry;
import java.io.File;
import forestry.api.core.ForestryAPI;
import forestry.core.EventHandlerCore;
import forestry.core.climate.ClimateEventHandler;
import forestry.core.config.Config;
import forestry.core.config.Constants;
import forestry.core.config.GameMode;
import forestry.core.errors.EnumErrorCode;
import forestry.core.errors.ErrorStateRegistry;
import forestry.core.gui.GuiHandler;
import forestry.core.multiblock.MultiblockEventHandler;
import forestry.core.network.PacketHandler;
import forestry.core.proxy.Proxies;
import forestry.core.worldgen.WorldGenerator;
import forestry.plugins.PluginManager;
import forestry.plugins.compat.PluginIC2;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
@@ -26,20 +40,6 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.api.core.ForestryAPI;
import forestry.core.EventHandlerCore;
import forestry.core.config.Config;
import forestry.core.config.Constants;
import forestry.core.config.GameMode;
import forestry.core.errors.EnumErrorCode;
import forestry.core.errors.ErrorStateRegistry;
import forestry.core.gui.GuiHandler;
import forestry.core.multiblock.MultiblockEventHandler;
import forestry.core.network.PacketHandler;
import forestry.core.proxy.Proxies;
import forestry.core.worldgen.WorldGenerator;
import forestry.plugins.PluginManager;
/**
* Forestry Minecraft Mod
*
@@ -51,8 +51,8 @@ import forestry.plugins.PluginManager;
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
acceptedMinecraftVersions = "[1.10]",
dependencies = "required-after:Forge@[12.18.0.1989,);"
+ "after:JEI@[3.8.0,);"
dependencies = "required-after:Forge@[12.18.1.2080,);"
+ "after:JEI@[3.11.2.278,);"
+ "after:" + PluginIC2.modId + ";")
public class Forestry {
@@ -78,6 +78,7 @@ public class Forestry {
EventHandlerCore eventHandlerCore = new EventHandlerCore();
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
MinecraftForge.EVENT_BUS.register(new ClimateEventHandler());
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
Config.load();
@@ -0,0 +1,13 @@
package forestry.api.apiculture;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
public class ApicultureCapabilities {
/**
* Capability for {@link IArmorApiarist}.
* The {@link Capability#getDefaultInstance()} will always protect the wearer with no side effects.
*/
@CapabilityInject(IArmorApiarist.class)
public static Capability<IArmorApiarist> ARMOR_APIARIST;
}
@@ -5,21 +5,24 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nullable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
/**
* When implemented by armor piece items, allows them to act as apiarist's armor.
* When implemented as a capability by armor items, protects the wearer from negative bee effects.
* @see ApicultureCapabilities#ARMOR_APIARIST
*/
public interface IArmorApiarist {
/**
* Called when the apiarist's armor acts as protection against an attack.
*
* @param entity Entity being attacked
* @param armor Armor item
* @param cause Optional cause of attack, such as a bee effect identifier
* @param entity Entity being attacked
* @param armor Armor item
* @param cause Optional cause of attack, such as a bee effect identifier
* @param doProtect Whether or not to actually do the side effects of protection
* @return Whether or not the armor should protect the player from that attack
*/
boolean protectEntity(EntityLivingBase entity, ItemStack armor, String cause, boolean doProtect);
boolean protectEntity(EntityLivingBase entity, ItemStack armor, @Nullable String cause, boolean doProtect);
}
@@ -13,9 +13,9 @@ import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.Biome;
import forestry.api.arboriculture.ITree;
import forestry.api.core.IErrorState;
import forestry.api.genetics.IEffectData;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IIndividualLiving;
/**
@@ -85,8 +85,8 @@ public interface IBee extends IIndividualLiving {
void plantFlowerRandom(IBeeHousing housing);
ITree retrievePollen(IBeeHousing housing);
IIndividual retrievePollen(IBeeHousing housing);
boolean pollinateRandom(IBeeHousing housing, ITree pollen);
boolean pollinateRandom(IBeeHousing housing, IIndividual pollen);
}
@@ -5,6 +5,8 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nonnull;
import net.minecraft.util.math.Vec3i;
import forestry.api.genetics.EnumTolerance;
@@ -20,9 +22,11 @@ import forestry.api.genetics.IGenome;
public interface IBeeGenome extends IGenome {
@Override
@Nonnull
IAlleleBeeSpecies getPrimary();
@Override
@Nonnull
IAlleleBeeSpecies getSecondary();
float getSpeed();
@@ -5,37 +5,29 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nonnull;
import forestry.api.core.IClimateProvider;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import com.mojang.authlib.GameProfile;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.climate.IClimateProvider;
import forestry.api.core.IErrorLogicSource;
import forestry.api.core.ILocatable;
import forestry.api.genetics.IHousing;
import net.minecraft.util.math.Vec3d;
public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvider {
public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvider, ILocatable {
/**
* Used by BeeManager.beeRoot.createBeeHousingModifier(IBeeHousing housing)
* Used by {@link IBeeRoot#createBeeHousingModifier(IBeeHousing)}
* to combine bee modifiers from several sources that can change over time.
* @return IBeeModifiers from the housing, frames, etc.
*/
Iterable<IBeeModifier> getBeeModifiers();
/**
* Used by BeeManager.beeRoot.createBeeHousingListener(IBeeHousing housing)
* Used by {@link IBeeRoot#createBeeHousingListener(IBeeHousing)}
* to combine bee listeners from several sources that can change over time.
* @return IBeeListeners from the housing, multiblock parts, etc.
*/
Iterable<IBeeListener> getBeeListeners();
@Nonnull
IBeeHousingInventory getBeeInventory();
IBeekeepingLogic getBeekeepingLogic();
@@ -43,15 +35,14 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvid
int getBlockLightValue();
boolean canBlockSeeTheSky();
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
World getWorldObj();
boolean isRaining();
GameProfile getOwner();
/**
* @since Forestry 4.2
* @return exact coordinates where bee FX should spawn from
* @return exact coordinates where bee particle FX should spawn from
*/
Vec3d getBeeFXCoordinates();
}
@@ -0,0 +1,14 @@
package forestry.api.arboriculture;
import forestry.api.core.IArmorNaturalist;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
public class ArboricultureCapabilities {
/**
* Capability for {@link IArmorNaturalist}.
* The {@link Capability#getDefaultInstance()} will always show pollination with no side effects.
*/
@CapabilityInject(IArmorNaturalist.class)
public static Capability<IArmorNaturalist> ARMOR_NATURALIST;
}
@@ -10,53 +10,51 @@ import java.util.Locale;
import java.util.Random;
public enum EnumForestryWoodType implements IWoodType {
LARCH(4, 20),
TEAK(4, 20),
ACACIA(4, 20),
LIME(4, 19),
CHESTNUT(4, 21),
WENGE(4, 20),
BAOBAB(4, 20),
SEQUOIA(3, 18, 4.0f),
LARCH(4),
TEAK(4),
ACACIA(4),
LIME(4),
CHESTNUT(4),
WENGE(4),
BAOBAB(4),
SEQUOIA(3, 4.0f),
KAPOK(4, 20),
EBONY(4, 20),
MAHOGANY(4, 20),
BALSA(4, 20, 1.0f),
WILLOW(4, 20),
WALNUT(4, 21),
GREENHEART(4, 20, 7.5f),
CHERRY(4, 20),
KAPOK(4),
EBONY(4),
MAHOGANY(4),
BALSA(4, 1.0f),
WILLOW(4),
WALNUT(4),
GREENHEART(4, 7.5f),
CHERRY(4),
MAHOE(4, 20),
POPLAR(4, 20),
PALM(4, 20),
PAPAYA(4, 20),
PINE(4, 20, 3.0f),
PLUM(4, 20),
MAPLE(4, 20),
CITRUS(4, 20),
MAHOE(4),
POPLAR(4),
PALM(4),
PAPAYA(4),
PINE(4, 3.0f),
PLUM(4),
MAPLE(4),
CITRUS(4),
GIGANTEUM(3, 18, 4.0f),
IPE(4, 20),
PADAUK(4, 20),
COCOBOLO(4, 20),
ZEBRAWOOD(4, 20);
GIGANTEUM(3, 4.0f),
IPE(4),
PADAUK(4),
COCOBOLO(4),
ZEBRAWOOD(4);
public static final float DEFAULT_HARDNESS = 2.0f;
public static final EnumForestryWoodType[] VALUES = values();
private final int carbonization;
private final int combustability;
private final float hardness;
EnumForestryWoodType(int carbonization, int combustability) {
this(carbonization, combustability, DEFAULT_HARDNESS);
EnumForestryWoodType(int carbonization) {
this(carbonization, DEFAULT_HARDNESS);
}
EnumForestryWoodType(int carbonization, int combustability, float hardness) {
EnumForestryWoodType(int carbonization, float hardness) {
this.carbonization = carbonization;
this.combustability = combustability;
this.hardness = hardness;
}
@@ -92,11 +90,45 @@ public enum EnumForestryWoodType implements IWoodType {
return VALUES[meta];
}
@Override
public int getCarbonization() {
return carbonization;
}
@Override
public float getCharcoalChance(int numberOfCharcoal) {
if(numberOfCharcoal == 3){
return 0.75F;
}else if(numberOfCharcoal == 4){
return 0.5F;
}else if(numberOfCharcoal == 5){
return 0.25F;
}
return 0.15F;
}
public int getCombustability() {
return combustability;
@Override
public String getPlankTexture() {
return "forestry:blocks/wood/planks." + getName();
}
@Override
public String getDoorLowerTexture() {
return "forestry:blocks/doors/" + getName() + "_lower";
}
@Override
public String getDoorUpperTexture() {
return "forestry:blocks/doors/" + getName() + "_upper";
}
@Override
public String getBarkTexture() {
return "forestry:blocks/wood/bark." + getName();
}
@Override
public String getHeartTexture() {
return "forestry:blocks/wood/heart." + getName();
}
}
@@ -7,12 +7,12 @@ import java.util.Random;
import net.minecraft.block.BlockPlanks;
public enum EnumVanillaWoodType implements IWoodType {
OAK(BlockPlanks.EnumType.OAK, 5, 20),
SPRUCE(BlockPlanks.EnumType.SPRUCE, 4, 19),
BIRCH(BlockPlanks.EnumType.BIRCH, 4, 19),
JUNGLE(BlockPlanks.EnumType.JUNGLE, 5, 20),
ACACIA(BlockPlanks.EnumType.ACACIA, 4, 20),
DARK_OAK(BlockPlanks.EnumType.DARK_OAK, 5, 20);
OAK(BlockPlanks.EnumType.OAK, 5),
SPRUCE(BlockPlanks.EnumType.SPRUCE, 4),
BIRCH(BlockPlanks.EnumType.BIRCH, 4),
JUNGLE(BlockPlanks.EnumType.JUNGLE, 5),
ACACIA(BlockPlanks.EnumType.ACACIA, 4),
DARK_OAK(BlockPlanks.EnumType.DARK_OAK, 5);
public static final EnumVanillaWoodType[] VALUES = values();
@@ -22,12 +22,10 @@ public enum EnumVanillaWoodType implements IWoodType {
private final BlockPlanks.EnumType vanillaType;
private final int carbonization;
private final int combustability;
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType, int carbonization, int combustability) {
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType, int carbonization) {
this.vanillaType = vanillaType;
this.carbonization = carbonization;
this.combustability = combustability;
}
public BlockPlanks.EnumType getVanillaType() {
@@ -66,9 +64,56 @@ public enum EnumVanillaWoodType implements IWoodType {
public int getCarbonization() {
return carbonization;
}
@Override
public float getCharcoalChance(int numberOfCharcoal) {
if(numberOfCharcoal == 3){
return 0.75F;
}else if(numberOfCharcoal == 4){
return 0.5F;
}else if(numberOfCharcoal == 5){
return 0.25F;
}
return 0.15F;
}
@Override
public int getCombustability() {
return combustability;
public String getPlankTexture() {
if(this == DARK_OAK){
return "blocks/planks_big_oak";
}
return "blocks/planks_" + getName();
}
@Override
public String getDoorLowerTexture() {
if(this == OAK){
return "blocks/door_wood_lower";
}
return "blocks/door_wood_lower";
}
@Override
public String getDoorUpperTexture() {
if(this == OAK){
return "blocks/door_wood_upper";
}
return "blocks/door_" + getName() + "_upper";
}
@Override
public String getBarkTexture() {
if(this == DARK_OAK){
return "blocks/log_big_oak";
}
return "blocks/log_" + getName();
}
@Override
public String getHeartTexture() {
if(this == DARK_OAK){
return "blocks/log_big_oak_top";
}
return "blocks/log_" + getName() + "_top";
}
}
@@ -26,4 +26,12 @@ public interface IGermlingModelProvider {
@Nonnull
ModelResourceLocation getModel(EnumGermlingType type);
/**
* Provides color for sapling. See {@link ILeafSpriteProvider} for pollen color.
* @param type the germling type to render
* @param renderPass renderPass of rendering
* @return sapling color for renderPass
*/
int getSpriteColor(EnumGermlingType type, int renderPass);
}
@@ -12,9 +12,11 @@ import forestry.api.genetics.IGenome;
public interface ITreeGenome extends IGenome {
@Override
@Nonnull
IAlleleTreeSpecies getPrimary();
@Override
@Nonnull
IAlleleTreeSpecies getSecondary();
@Nonnull
@@ -5,6 +5,7 @@
******************************************************************************/
package forestry.api.arboriculture;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
@@ -13,13 +14,13 @@ import java.util.List;
import com.mojang.authlib.GameProfile;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IChromosome;
import forestry.api.genetics.ISpeciesRoot;
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;
public interface ITreeRoot extends ISpeciesRoot {
public interface ITreeRoot extends ISpeciesRootPollinatable {
@Override
boolean isMember(ItemStack itemstack);
@@ -78,7 +79,7 @@ public interface ITreeRoot extends ISpeciesRoot {
@Override
IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive);
boolean setFruitBlock(World world, IAlleleFruit allele, float sappiness, BlockPos pos);
boolean setFruitBlock(@Nonnull World world, @Nonnull IAlleleFruit allele, float sappiness, BlockPos pos);
/* GAME MODE */
List<ITreekeepingMode> getTreekeepingModes();
@@ -5,6 +5,8 @@
******************************************************************************/
package forestry.api.arboriculture;
import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
@@ -22,5 +24,7 @@ public interface IWoodAccess {
ItemStack getStack(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
IBlockState getBlock(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
List<IWoodType> getRegisteredWoodTypes();
}
@@ -0,0 +1,19 @@
/*******************************************************************************
* 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.client.renderer.ItemMeshDefinition;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IWoodItemMeshDefinition extends ItemMeshDefinition {
ResourceLocation getDefaultModelLocation(ItemStack stack);
}
@@ -31,13 +31,13 @@ public interface IWoodProvider {
*/
ItemStack getWoodStack();
/**
* @return how long this wood's charcoal burns / 1000
*/
int getCombustibility();
/**
* The amount of charcoal dropped from a charcoal pile of this wood.
*/
int getCarbonization();
/**
* The chance that a pile has to drop a extra charcoal
*/
float getCharcoalChance(int numberOfCharcoal);
}
@@ -0,0 +1,21 @@
/*******************************************************************************
* 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.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.IStateMapper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IWoodStateMapper extends IStateMapper {
ModelResourceLocation getModelLocation(IBlockState state);
ModelResourceLocation getDefaultModelResourceLocation(IBlockState state);
}
@@ -12,6 +12,16 @@ public interface IWoodType extends IStringSerializable {
float getHardness();
int getCarbonization();
int getCombustability();
float getCharcoalChance(int numberOfCharcoal);
String getPlankTexture();
String getDoorLowerTexture();
String getDoorUpperTexture();
String getBarkTexture();
String getHeartTexture();
}
@@ -1,12 +1,68 @@
package forestry.api.arboriculture;
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;
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR(false);
public final boolean retextureItem;
private WoodBlockKind() {
this(true);
}
private WoodBlockKind(boolean retextureItem) {
this.retextureItem = retextureItem;
}
@Override
public String toString() {
return super.toString().toLowerCase(Locale.ENGLISH);
}
public IModel retextureModel(IModel model, IWoodType type, ImmutableMap<String, String> customTextures){
Map<String, String> textures = new HashMap<>();
switch (this) {
case SLAB:
case STAIRS:
String textureLocation = type.getPlankTexture();
textures.put("particle", textureLocation);
textures.put("side", textureLocation);
textures.put("top", textureLocation);
textures.put("bottom", textureLocation);
textures.put("all", textureLocation);
break;
case PLANKS:
textures.put("particle", type.getPlankTexture());
textures.put("all", type.getPlankTexture());
break;
case FENCE_GATE:
case FENCE:
textures.put("particle", type.getPlankTexture());
textures.put("side", type.getPlankTexture());
textures.put("texture", type.getPlankTexture());
break;
case DOOR:
textures.put("particle", type.getDoorLowerTexture());
textures.put("bottom", type.getDoorLowerTexture());
textures.put("top", type.getDoorUpperTexture());
break;
case LOG:
textures.put("particle", type.getBarkTexture());
textures.put("side", type.getBarkTexture());
textures.put("all", type.getBarkTexture());
textures.put("end", type.getHeartTexture());
break;
default:
break;
}
textures.putAll(customTextures);
return ModelProcessingHelper.retexture(model, new ImmutableMap.Builder<String, String>().putAll(textures).build());
}
}
@@ -0,0 +1,7 @@
package forestry.api.climate;
public enum EnumClimatiserModes {
POSITIVE, NEGATIVE, NONE
}
@@ -0,0 +1,7 @@
package forestry.api.climate;
public enum EnumClimatiserTypes {
TEMPERATURE, HUMIDITY, NONE
}
@@ -0,0 +1,18 @@
/*******************************************************************************
* 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 {
float getControlTemperature();
float getControlHumidity();
void setControlTemperature(float temperature);
void setControlHumidity(float humidity);
}
@@ -0,0 +1,14 @@
/*******************************************************************************
* 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.ILocatable;
public interface IClimateControlProvider extends ILocatable {
IClimateControl getClimateControl();
}
@@ -1,14 +1,9 @@
/*******************************************************************************
* 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;
package forestry.api.climate;
public interface IClimateControlled {
/**
@@ -0,0 +1,43 @@
/*******************************************************************************
* 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.List;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IClimateManager {
float getTemperature(World world, BlockPos pos);
float getHumidity(World world, BlockPos pos);
@Nonnull
IClimateProvider getDefaultClimate(World world, BlockPos pos);
void addRegion(IClimateRegion region);
void removeRegion(IClimateRegion region);
void addSource(IClimateSourceProvider source);
void removeSource(IClimateSourceProvider source);
@Nullable
IClimatePosition getPosition(World world, BlockPos pos);
@Nullable
IClimateRegion getRegionForPos(World world, BlockPos pos);
@Nonnull
Map<Integer, List<IClimateRegion>> getRegions();
}
@@ -0,0 +1,34 @@
/*******************************************************************************
* 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.Nonnull;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import net.minecraft.util.math.BlockPos;
public interface IClimatePosition extends INbtReadable, INbtWritable {
@Nonnull
IClimateRegion getClimateRegion();
@Nonnull
BlockPos getPos();
void setTemperature(float temperature);
void addTemperature(float temperature);
float getTemperature();
void setHumidity(float humidity);
void addHumidity(float humidity);
float getHumidity();
}
@@ -0,0 +1,18 @@
/*******************************************************************************
* 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.EnumHumidity;
import forestry.api.core.EnumTemperature;
import net.minecraft.world.biome.Biome;
public interface IClimateProvider {
Biome getBiome();
EnumTemperature getTemperature();
EnumHumidity getHumidity();
}
@@ -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 java.util.Collection;
import java.util.Map;
import javax.annotation.Nonnull;
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 {
@Nonnull
World getWorld();
/**
* Update the climate in a region.
*/
void updateClimate(int ticks);
int getTicksPerUpdate();
@Nonnull
Map<BlockPos, IClimatePosition> getPositions();
void addSource(IClimateSource source);
void removeSource(IClimateSource source);
Collection<IClimateSource> getSources();
Collection<BlockPos> getOtherPositions();
float getTemperature();
float getHumidity();
}
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
/**
* 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);
IClimateSourceProvider getProvider();
}
@@ -0,0 +1,13 @@
/*******************************************************************************
* 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.ILocatable;
public interface IClimateSourceProvider extends ILocatable {
IClimateSource getClimateSource();
}
@@ -0,0 +1,18 @@
/*******************************************************************************
* 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 IClimatiserDefinition {
float getChange();
double getRange();
EnumClimatiserModes getMode();
EnumClimatiserTypes getType();
}
@@ -3,10 +3,7 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
@API(apiVersion = "2.1.0", owner = "Forestry", provides = "ForestryAPI|climate")
package forestry.api.climate;
public enum EnumCamouflageType {
DEFAULT, GLASS, DOOR;
public static final EnumCamouflageType[] VALUES = values();
}
import net.minecraftforge.fml.common.API;
@@ -5,15 +5,14 @@
******************************************************************************/
package forestry.api.core;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IClimateManager {
float getTemperature(World world, BlockPos pos);
public class CamouflageManager {
float getHumidity(World world, BlockPos pos);
IClimateProvider getDefaultClimate(World world, BlockPos pos);
public static ICamouflageAccess camouflageAccess;
public static final String DEFAULT = "default";
public static final String GLASS = "glass";
public static final String DOOR = "door";
}
@@ -60,15 +60,15 @@ public enum EnumTemperature {
}
}
public static EnumTemperature getFromBiome(Biome Biome) {
if (BiomeHelper.isBiomeHellish(Biome)) {
public static EnumTemperature getFromBiome(Biome biome) {
if (BiomeHelper.isBiomeHellish(biome)) {
return HELLISH;
}
return getFromValue(Biome.getTemperature());
return getFromValue(biome.getTemperature());
}
public static EnumTemperature getFromBiome(Biome Biome, World world, BlockPos pos) {
if (BiomeHelper.isBiomeHellish(Biome)) {
public static EnumTemperature getFromBiome(Biome biome, World world, BlockPos pos) {
if (BiomeHelper.isBiomeHellish(biome)) {
return HELLISH;
}
float temperature = ForestryAPI.climateManager.getTemperature(world, pos);
@@ -7,6 +7,7 @@ package forestry.api.core;
import java.util.Set;
import forestry.api.climate.IClimateManager;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -5,20 +5,23 @@
******************************************************************************/
package forestry.api.core;
import forestry.api.arboriculture.ArboricultureCapabilities;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Naturalist armor allows players to see pollinated tree leaves.
*
* @see ArboricultureCapabilities#ARMOR_NATURALIST
*/
public interface IArmorNaturalist {
/**
* Called when the naturalist's armor acts as spectacles for seeing pollinated tree leaves/flowers.
* Called to see if this naturalist's armor allows for seeing pollinated tree leaves/flowers.
*
* @param player
* Player doing the viewing
* @param armor
* Armor item
* @param doSee
* Whether or not to actually do the side effects of viewing
* @param player Player doing the viewing
* @param armor Armor item
* @param doSee Whether or not to actually do the side effects of viewing
* @return true if the armor actually allows the player to see pollination.
*/
boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee);
@@ -0,0 +1,37 @@
/*******************************************************************************
* 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.List;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
public interface ICamouflageAccess {
/**
* Register a item camouflage handler for a type.
*
* @param type The camouflage type for of handler.
* @param itemHandler The handler that is to register.
*/
void registerCamouflageItemHandler(@Nonnull ICamouflageItemHandler itemHandler);
/**
* @return A list of all item camouflage handler's that are registered for that camouflage type.
*/
List<ICamouflageItemHandler> getCamouflageItemHandler(@Nonnull String type);
void addItemToBlackList(@Nonnull String type, @Nonnull ItemStack camouflageBlock);
void addModIdToBlackList(@Nonnull String type, @Nonnull String modID);
boolean isItemBlackListed(@Nonnull String type, @Nonnull ItemStack camouflageBlock);
ICamouflageItemHandler getHandlerFromItem(ItemStack stack);
}
@@ -6,28 +6,27 @@
package forestry.api.core;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
public interface ICamouflageHandler{
public interface ICamouflageHandler extends ILocatable {
/**
* @return The item of the block that is the camouflage of this handler for the EnumCamouflageType.
* @return The item of the block that is the camouflage of this handler for the type.
*/
ItemStack getCamouflageBlock(EnumCamouflageType type);
/**
* @return The default camouflage block item for the EnumCamouflageType.
*/
ItemStack getDefaultCamouflageBlock(EnumCamouflageType type);
ItemStack getCamouflageBlock(String type);
/**
* Set the camouflage block item for the EnumCamouflageType.
* @return The default camouflage block item for the type.
*/
void setCamouflageBlock(EnumCamouflageType type, ItemStack camouflageBlock);
ItemStack getDefaultCamouflageBlock(String type);
/**
* @return The coordinates of the handler as a BlockPos.
* @return True if the handler can handle this type of camouflage.
*/
BlockPos getCoordinates();
boolean canHandleType(String type);
/**
* Set the camouflage block item for the type.
* @return True if the block has chanced.
*/
boolean setCamouflageBlock(String type, ItemStack camouflageBlock, boolean sendClientUpdate);
}
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
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;
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);
}
@@ -9,7 +9,7 @@ import net.minecraft.util.math.BlockPos;
public interface ICamouflagedTile {
EnumCamouflageType getCamouflageType();
String getCamouflageType();
BlockPos getCoordinates();
@@ -1,11 +0,0 @@
package forestry.api.core;
import net.minecraft.world.biome.Biome;
public interface IClimateProvider {
Biome getBiome();
EnumTemperature getTemperature();
EnumHumidity getHumidity();
}
@@ -6,7 +6,6 @@
package forestry.api.core;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -27,7 +26,10 @@ public interface IErrorState {
@SideOnly(Side.CLIENT)
void registerSprite();
@SideOnly(value = Side.CLIENT)
/**
* Sprite registered to the Gui Texture Map at {@link ITextureManager}
*/
@SideOnly(Side.CLIENT)
TextureAtlasSprite getSprite();
}
@@ -1,21 +1,21 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.core.tiles;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface ILocatable {
BlockPos getCoordinates();
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
World getWorldObj();
}
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.api.core;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface ILocatable {
BlockPos getCoordinates();
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
World getWorldObj();
}
@@ -8,8 +8,6 @@ package forestry.api.core;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -6,13 +6,29 @@
package forestry.api.core;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Get the instance from {@link ForestryAPI#textureManager}.
*/
@SideOnly(Side.CLIENT)
public interface ITextureManager {
/**
* Location of the Forestry Gui Texture Map.
* Used for binding with {@link net.minecraft.client.renderer.texture.TextureManager#bindTexture(ResourceLocation)}
*/
ResourceLocation getGuiTextureMap();
/**
* Get a texture atlas sprite that has been registered by Forestry, for Forestry's Gui Texture Map.
*/
TextureAtlasSprite getDefault(String ident);
/**
* Register a sprite with Forestry's Gui Texture Map.
*/
TextureAtlasSprite registerGuiSprite(ResourceLocation location);
}
@@ -3,7 +3,7 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
@API(apiVersion = "5.0.0", owner = "Forestry", provides = "ForestryAPI|core")
@API(apiVersion = "5.1.0", owner = "Forestry", provides = "ForestryAPI|core")
package forestry.api.core;
import net.minecraftforge.fml.common.API;
@@ -8,6 +8,10 @@ package forestry.api.farming;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.item.ItemStack;
import java.util.LinkedHashMap;
import javax.annotation.Nonnull;
public class Farmables {
@@ -18,5 +22,8 @@ public class Farmables {
*/
@Nonnull
public static final Multimap<String, IFarmable> farmables = HashMultimap.create();
@Nonnull
public static final LinkedHashMap<ItemStack, Integer> fertilizers = new LinkedHashMap();
}
@@ -0,0 +1,20 @@
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 {
private final ISpeciesRoot root;
public AlleleSpeciesRegisterEvent(ISpeciesRoot root) {
this.root = root;
}
public ISpeciesRoot getRoot() {
return root;
}
}
@@ -3,23 +3,22 @@ package forestry.api.genetics;
import java.util.List;
import java.util.Map;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.core.gui.GuiAlyzer;
public interface IAlyzerPlugin {
@SideOnly(Side.CLIENT)
void drawAnalyticsPage1(GuiAlyzer gui, ItemStack itemStack);
void drawAnalyticsPage1(GuiScreen gui, ItemStack itemStack);
@SideOnly(Side.CLIENT)
void drawAnalyticsPage2(GuiAlyzer gui, ItemStack itemStack);
void drawAnalyticsPage2(GuiScreen gui, ItemStack itemStack);
@SideOnly(Side.CLIENT)
void drawAnalyticsPage3(GuiAlyzer gui, ItemStack itemStack);
void drawAnalyticsPage3(GuiScreen gui, ItemStack itemStack);
Map<String, ItemStack> getIconStacks();
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.api.genetics;
import forestry.api.arboriculture.ITree;
import net.minecraftforge.common.EnumPlantType;
/**
@@ -28,7 +27,7 @@ public interface ICheckPollinatable {
/**
* @return IIndividual containing the genetic information of this IPollinatable
*/
ITree getPollen();
IIndividual getPollen();
/**
* Checks whether this can mate with the given pollen.
@@ -38,7 +37,7 @@ public interface ICheckPollinatable {
* @param pollen IIndividual representing the pollen.
* @return true if mating is possible, false otherwise.
*/
boolean canMateWith(ITree pollen);
boolean canMateWith(IIndividual pollen);
/**
* @return true if this has already been pollinated.
@@ -5,6 +5,8 @@
******************************************************************************/
package forestry.api.genetics;
import javax.annotation.Nonnull;
import forestry.api.core.INbtWritable;
/**
@@ -14,17 +16,23 @@ import forestry.api.core.INbtWritable;
*/
public interface IGenome extends INbtWritable {
@Nonnull
IAlleleSpecies getPrimary();
@Nonnull
IAlleleSpecies getSecondary();
@Nonnull
IChromosome[] getChromosomes();
@Nonnull
IAllele getActiveAllele(IChromosomeType chromosomeType);
@Nonnull
IAllele getInactiveAllele(IChromosomeType chromosomeType);
boolean isGeneticEqual(IGenome other);
@Nonnull
ISpeciesRoot getSpeciesRoot();
}
@@ -5,10 +5,12 @@
******************************************************************************/
package forestry.api.genetics;
import net.minecraft.block.state.IBlockState;
import net.minecraftforge.common.BiomeDictionary;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import net.minecraft.block.state.IBlockState;
import net.minecraftforge.common.BiomeDictionary;
/** Set custom mutation requirements */
public interface IMutationBuilder {
@@ -5,7 +5,7 @@
******************************************************************************/
package forestry.api.genetics;
import forestry.api.core.IClimateProvider;
import forestry.api.climate.IClimateProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -5,8 +5,6 @@
******************************************************************************/
package forestry.api.genetics;
import forestry.api.arboriculture.ITree;
/**
* Can be implemented by tile entities, if they wish to be pollinatable.
*
@@ -20,5 +18,5 @@ public interface IPollinatable extends ICheckPollinatable {
* @param pollen
* IIndividual representing the pollen.
*/
void mateWith(ITree pollen);
void mateWith(IIndividual pollen);
}
@@ -0,0 +1,18 @@
package forestry.api.genetics;
import com.mojang.authlib.GameProfile;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
* @since 5.12.16
* @author Nedelosk
*/
public interface ISpeciesRootPollinatable extends ISpeciesRoot {
ICheckPollinatable createPollinatable(IIndividual individual);
IPollinatable tryConvertToPollinatable(GameProfile owner, World world, final BlockPos pos, final IIndividual pollen);
}
@@ -10,7 +10,7 @@ import forestry.api.multiblock.IGreenhouseController;
public class DefaultGreenhouseListener implements IGreenhouseListener {
@Override
public <G extends IGreenhouseController & IGreenhouseHousing> boolean canWork(G greenhouse, boolean canWork) {
public boolean canWork(IGreenhouseController greenhouse, boolean canWork) {
return true;
}
@@ -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.greenhouse;
@@ -15,17 +10,17 @@ import javax.annotation.Nullable;
import net.minecraftforge.fml.common.eventhandler.Event;
import forestry.api.core.EnumCamouflageType;
import forestry.api.core.ICamouflageHandler;
import forestry.api.core.ICamouflagedTile;
import forestry.api.multiblock.IGreenhouseController;
public class GreenhouseEvents extends Event {
@Nullable
public final IGreenhouseState state;
public final IGreenhouseController controller;
public GreenhouseEvents(@Nullable IGreenhouseState state) {
this.state = state;
public GreenhouseEvents(@Nullable IGreenhouseController state) {
this.controller = state;
}
public static class CamouflageChangeEvent extends GreenhouseEvents{
@@ -35,10 +30,10 @@ public class GreenhouseEvents extends Event {
@Nonnull
public ICamouflageHandler camouflageHandler;
@Nonnull
public final EnumCamouflageType camouflageType;
public final String camouflageType;
public CamouflageChangeEvent(IGreenhouseState state, @Nullable ICamouflagedTile camouflagedBlock, @Nonnull ICamouflageHandler camouflageHandler, @Nonnull EnumCamouflageType camouflageType) {
super(state);
public CamouflageChangeEvent(IGreenhouseController controller, @Nullable ICamouflagedTile camouflagedBlock, @Nonnull ICamouflageHandler camouflageHandler, @Nonnull String camouflageType) {
super(controller);
this.camouflagedBlock = camouflagedBlock;
this.camouflageHandler = camouflageHandler;
@@ -51,8 +46,8 @@ public class GreenhouseEvents extends Event {
@Nonnull
public IInternalBlock internalBlock;
public InternalBlockEvent(IGreenhouseState state, @Nonnull IInternalBlock internalBlock) {
super(state);
public InternalBlockEvent(IGreenhouseController controller, @Nonnull IInternalBlock internalBlock) {
super(controller);
this.internalBlock = internalBlock;
}
@@ -60,8 +55,8 @@ public class GreenhouseEvents extends Event {
public static class CreateInternalBlockEvent extends InternalBlockEvent{
public CreateInternalBlockEvent(IGreenhouseState state, IInternalBlock internalBlock) {
super(state, internalBlock);
public CreateInternalBlockEvent(IGreenhouseController controller, IInternalBlock internalBlock) {
super(controller, internalBlock);
}
}
@@ -70,8 +65,8 @@ public class GreenhouseEvents extends Event {
@Nonnull
public final IInternalBlockFace face;
public CheckInternalBlockFaceEvent(IGreenhouseState state, IInternalBlock internalBlock, @Nonnull IInternalBlockFace face) {
super(state, internalBlock);
public CheckInternalBlockFaceEvent(IGreenhouseController controller, IInternalBlock internalBlock, @Nonnull IInternalBlockFace face) {
super(controller, internalBlock);
this.face = face;
}
@@ -5,15 +5,8 @@
******************************************************************************/
package forestry.api.greenhouse;
import java.util.ArrayList;
import java.util.List;
public class GreenhouseManager {
public static IGreenhouseAccess greenhouseAccess;
public static IGreenhouseHelper greenhouseHelper;
public static List<Class<? extends IGreenhouseLogic>> greenhouseLogics = new ArrayList<>();
}
@@ -1,25 +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.Nonnull;
import forestry.api.core.EnumCamouflageType;
import net.minecraft.item.ItemStack;
public interface IGreenhouseAccess {
void registerGreenhouseGlass(@Nonnull ItemStack glass, float lightTransmittance);
boolean isGreenhouseGlass(@Nonnull ItemStack glass);
float getGreenhouseGlassLightTransmittance(@Nonnull ItemStack glass);
void addToCamouflageBlockBlackList(@Nonnull EnumCamouflageType type, @Nonnull ItemStack camouflageBlock);
boolean isOnCamouflageBlockBlackList(@Nonnull EnumCamouflageType type, @Nonnull ItemStack camouflageBlock);
}
@@ -5,14 +5,21 @@
******************************************************************************/
package forestry.api.greenhouse;
import java.util.List;
import forestry.api.multiblock.IGreenhouseController;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IGreenhouseHelper {
/**
* @return A {@link IGreenhouseState} of a greenhouse, when the pos is a greenhouse
* @return A {@link IGreenhouseController} of a greenhouse, when the pos is a greenhouse
*/
IGreenhouseState getGreenhouseState(World world, BlockPos pos);
IGreenhouseController getGreenhouseController(World world, BlockPos pos);
void addGreenhouseLogic(Class<? extends IGreenhouseLogic> logic);
List<Class<? extends IGreenhouseLogic>> getGreenhouseLogics();
}
@@ -10,12 +10,12 @@ import forestry.api.multiblock.IGreenhouseController;
public interface IGreenhouseListener {
/**
* Called before the greenhouse work.
* Called before the greenhouse update the climate system.
*
* @param greenhouse The greenhouse multiblock.
* @param greenhouse The greenhouse of the listener.
* @param canWork The actual {@link Boolean} value.
* @return True if the greenhouse can work.
* @return True if the greenhouse can update the climate.
*/
<G extends IGreenhouseController & IGreenhouseHousing> boolean canWork(G greenhouse, boolean canWork);
boolean canWork(IGreenhouseController greenhouse, boolean canWork);
}
@@ -1,29 +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 java.util.Collection;
import java.util.Set;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.multiblock.IMultiblockComponent;
public interface IGreenhouseState {
EnumTemperature getTemperature();
EnumHumidity getHumidity();
float getExactTemperature();
float getExactHumidity();
Set<IInternalBlock> getInternalBlocks();
Collection<IMultiblockComponent> getGreenhouseComponents();
}
@@ -7,6 +7,7 @@ package forestry.api.greenhouse;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import net.minecraft.util.math.BlockPos;
@@ -3,7 +3,7 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
@API(apiVersion = "5.0.0", owner = "ForestryAPI|core", provides = "ForestryAPI|greenhouse")
@API(apiVersion = "5.2.0", owner = "ForestryAPI|core", provides = "ForestryAPI|greenhouse")
package forestry.api.greenhouse;
import net.minecraftforge.fml.common.API;
@@ -5,6 +5,8 @@
******************************************************************************/
package forestry.api.lepidopterology;
import javax.annotation.Nonnull;
import forestry.api.genetics.EnumTolerance;
import forestry.api.genetics.IFlowerProvider;
import forestry.api.genetics.IGenome;
@@ -12,9 +14,11 @@ import forestry.api.genetics.IGenome;
public interface IButterflyGenome extends IGenome {
@Override
@Nonnull
IAlleleButterflySpecies getPrimary();
@Override
@Nonnull
IAlleleButterflySpecies getSecondary();
float getSize();
@@ -5,7 +5,7 @@
******************************************************************************/
package forestry.api.lepidopterology;
import forestry.api.core.IClimateProvider;
import forestry.api.climate.IClimateProvider;
import forestry.api.genetics.IHousing;
import forestry.api.genetics.IIndividual;
@@ -8,7 +8,7 @@ package forestry.api.lepidopterology;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.passive.IAnimals;
import forestry.api.arboriculture.ITree;
import forestry.api.genetics.IIndividual;
public interface IEntityButterfly extends IAnimals {
@@ -23,9 +23,9 @@ public interface IEntityButterfly extends IAnimals {
*/
EntityCreature getEntity();
ITree getPollen();
IIndividual getPollen();
void setPollen(ITree pollen);
void setPollen(IIndividual pollen);
boolean canMateWith(IEntityButterfly butterfly);
@@ -5,10 +5,10 @@
******************************************************************************/
package forestry.api.mail;
import forestry.api.core.ITextureManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -31,6 +31,10 @@ public interface IPostalCarrier {
*/
String getName();
/**
* Sprite registered to the Gui Texture Map at {@link ITextureManager}.
* Must be 26 pixels wide and 15 pixels tall. The texture itself must be 32x32 square.
*/
@SideOnly(Side.CLIENT)
TextureAtlasSprite getSprite();
@@ -3,7 +3,7 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
@API(apiVersion = "3.0.0", owner = "ForestryAPI|core", provides = "ForestryAPI|mail")
@API(apiVersion = "3.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|mail")
package forestry.api.mail;
import net.minecraftforge.fml.common.API;
@@ -7,7 +7,7 @@ package forestry.api.multiblock;
import forestry.api.apiculture.IBeeListener;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.core.IClimateControlled;
import forestry.api.climate.IClimateControlled;
/**
* Needs to be implemented by TileEntities that want to be part of an alveary.
@@ -5,8 +5,10 @@
******************************************************************************/
package forestry.api.multiblock;
import forestry.api.core.IClimateControlled;
import forestry.api.greenhouse.IGreenhouseHousing;
import forestry.api.climate.IClimateControl;
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;
@@ -19,11 +21,17 @@ public interface IGreenhouseComponent<T extends IMultiblockLogicGreenhouse> exte
IGreenhouseListener getGreenhouseListener();
}
interface ClimateControl extends IGreenhouseComponent, IClimateControlProvider {
@Override
IClimateControl getClimateControl();
}
interface Door extends IGreenhouseComponent {
}
interface Climatiser extends IGreenhouseComponent {
<G extends IGreenhouseController & IGreenhouseHousing & IClimateControlled> void changeClimate(int tickCount, G greenhouse);
interface Climatiser extends IGreenhouseComponent, IClimateSourceProvider {
IClimatiserDefinition getDefinition();
}
interface ButterflyHatch extends IGreenhouseComponent {
@@ -7,13 +7,18 @@ package forestry.api.multiblock;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import forestry.api.climate.IClimateControl;
import forestry.api.climate.IClimateControlProvider;
import forestry.api.climate.IClimateRegion;
import forestry.api.core.ICamouflageHandler;
import forestry.api.core.IClimateControlled;
import forestry.api.greenhouse.EnumGreenhouseEventType;
import forestry.api.greenhouse.IGreenhouseHousing;
import forestry.api.greenhouse.IGreenhouseLogic;
public interface IGreenhouseController extends IMultiblockController, IGreenhouseHousing, ICamouflageHandler, IClimateControlled {
public interface IGreenhouseController extends IMultiblockController, IGreenhouseHousing, ICamouflageHandler, IClimateControlProvider {
/**
* Handle change events.
@@ -24,5 +29,12 @@ public interface IGreenhouseController extends IMultiblockController, IGreenhous
* @return The logics of the greenhouse.
*/
List<IGreenhouseLogic> getLogics();
@Nullable
IClimateRegion getRegion();
@Override
@Nonnull
IClimateControl getClimateControl();
}
@@ -15,4 +15,6 @@ public interface IMultiblockLogicFactory {
IMultiblockLogicFarm createFarmLogic();
IMultiblockLogicGreenhouse createGreenhouseLogic();
IMultiblockLogicCharcoalPile createCharcoalPileLogic();
}
@@ -8,7 +8,6 @@ package forestry.api.recipes;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public interface ICarpenterRecipe extends IForestryRecipe {
@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.recipes;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
/**
@@ -30,4 +33,7 @@ public interface IDescriptiveRecipe extends IRecipe {
*/
Object[] getIngredients();
@Nonnull
@Override
ItemStack getRecipeOutput();
}
@@ -10,13 +10,13 @@
******************************************************************************/
package forestry.apiculture;
import forestry.api.apiculture.ApicultureCapabilities;
import forestry.api.apiculture.IArmorApiarist;
import forestry.api.apiculture.IArmorApiaristHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IArmorApiarist;
import forestry.api.apiculture.IArmorApiaristHelper;
public class ArmorApiaristHelper implements IArmorApiaristHelper {
@Override
@@ -25,12 +25,16 @@ public class ArmorApiaristHelper implements IArmorApiaristHelper {
return false;
}
Item item = stack.getItem();
if (!(item instanceof IArmorApiarist)) {
final Item item = stack.getItem();
final IArmorApiarist armorApiarist;
if (item instanceof IArmorApiarist) { // legacy
armorApiarist = (IArmorApiarist) item;
} else if (stack.hasCapability(ApicultureCapabilities.ARMOR_APIARIST, null)) {
armorApiarist = stack.getCapability(ApicultureCapabilities.ARMOR_APIARIST, null);
} else {
return false;
}
IArmorApiarist armorApiarist = (IArmorApiarist) item;
return armorApiarist.protectEntity(entity, stack, cause, doProtect);
}
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Set;
import java.util.Stack;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -38,10 +39,10 @@ import forestry.api.apiculture.IBeeHousingInventory;
import forestry.api.apiculture.IBeeListener;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.apiculture.IBeekeepingLogic;
import forestry.api.arboriculture.ITree;
import forestry.api.core.IErrorLogic;
import forestry.api.core.IErrorState;
import forestry.api.genetics.IEffectData;
import forestry.api.genetics.IIndividual;
import forestry.apiculture.network.packets.PacketBeeLogicActive;
import forestry.apiculture.network.packets.PacketBeeLogicActiveEntity;
import forestry.core.config.Constants;
@@ -195,7 +196,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
queenStack = null;
}
if (!ItemStack.areItemStacksEqual(this.queenStack, queenStack)) {
if (this.queenStack != queenStack) {
this.queen = BeeManager.beeRoot.getMember(queenStack);
this.queenStack = queenStack;
hasFlowersCache.clear();
@@ -486,6 +487,9 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
@Override
public boolean canDoBeeFX() {
if(Proxies.common.getClientInstance().isGamePaused()){
return false;
}
return active;
}
@@ -528,7 +532,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
private static class PollenHandler {
private static final int MAX_POLLINATION_ATTEMPTS = 20;
private ITree pollen;
private IIndividual pollen;
private int attemptedPollinations = 0;
public void doPollination(IBee queen, IBeeHousing beeHousing, IBeeListener beeListener) {
@@ -22,6 +22,7 @@ import forestry.Forestry;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.FlowerManager;
import forestry.api.apiculture.IArmorApiarist;
import forestry.api.apiculture.IBeekeepingMode;
import forestry.api.apiculture.hives.HiveManager;
import forestry.api.apiculture.hives.IHiveRegistry.HiveType;
@@ -36,6 +37,7 @@ import forestry.api.storage.StorageManager;
import forestry.apiculture.blocks.BlockAlvearyType;
import forestry.apiculture.blocks.BlockCandle;
import forestry.apiculture.blocks.BlockRegistryApiculture;
import forestry.apiculture.capabilities.ArmorApiarist;
import forestry.apiculture.commands.CommandBee;
import forestry.apiculture.entities.EntityMinecartApiary;
import forestry.apiculture.entities.EntityMinecartBeehouse;
@@ -72,6 +74,7 @@ import forestry.apiculture.worldgen.HiveRegistry;
import forestry.core.ISaveEventHandler;
import forestry.core.PluginCore;
import forestry.core.PluginFluids;
import forestry.core.capabilities.NullStorage;
import forestry.core.config.Config;
import forestry.core.config.Constants;
import forestry.core.config.LocalizedConfiguration;
@@ -106,6 +109,7 @@ 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.capabilities.CapabilityManager;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
@@ -161,6 +165,9 @@ public class PluginApiculture extends BlankForestryPlugin {
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.hard);
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.hardcore);
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.insane);
// Capabilities
CapabilityManager.INSTANCE.register(IArmorApiarist.class, new NullStorage<>(), () -> ArmorApiarist.INSTANCE);
}
@Override
@@ -313,6 +320,8 @@ public class PluginApiculture extends BlankForestryPlugin {
// Register acceptable plants
flowerRegistry.registerAcceptableFlower(Blocks.DRAGON_EGG, FlowerManager.FlowerTypeEnd);
flowerRegistry.registerAcceptableFlower(Blocks.CHORUS_PLANT, FlowerManager.FlowerTypeEnd);
flowerRegistry.registerAcceptableFlower(Blocks.CHORUS_FLOWER, FlowerManager.FlowerTypeEnd);
flowerRegistry.registerAcceptableFlower(Blocks.VINE, FlowerManager.FlowerTypeJungle);
flowerRegistry.registerAcceptableFlower(Blocks.TALLGRASS, FlowerManager.FlowerTypeJungle);
flowerRegistry.registerAcceptableFlower(Blocks.WHEAT, FlowerManager.FlowerTypeWheat);
@@ -556,7 +565,7 @@ public class PluginApiculture extends BlankForestryPlugin {
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{items.honeydew.getItemStack()}, honeyDropFluid);
ItemStack phosphor = PluginCore.items.phosphor.getItemStack(2);
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND)}, new FluidStack(FluidRegistry.WATER, 2000));
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND)}, new FluidStack(FluidRegistry.LAVA, 2000));
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND, 1, 1)}, new FluidStack(FluidRegistry.LAVA, 2000));
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.DIRT)}, new FluidStack(FluidRegistry.LAVA, 1600));
@@ -162,7 +162,7 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
private static List<IHiveDrop> getDropsForHive(int meta) {
String hiveName = getHiveNameForMeta(meta);
if (hiveName == null) {
if (hiveName == null || hiveName.equals(HiveType.SWARM.getHiveUid())) {
return Collections.emptyList();
}
return PluginApiculture.hiveRegistry.getDrops(hiveName);
@@ -120,7 +120,8 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
if (((TileCandle) world.getTileEntity(pos)).isLit()) {
TileCandle tileCandle = TileUtil.getTile(world, pos, TileCandle.class);
if (tileCandle != null && tileCandle.isLit()) {
state = state.withProperty(STATE, State.ON);
}
return super.getActualState(state, world, pos);
@@ -286,6 +287,11 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
boolean isLit = isLit(stack);
tileCandle.setColour(colour);
tileCandle.setLit(isLit);
if (tileCandle.isLit()) {
world.theProfiler.startSection("checkLight");
world.checkLight(pos);
world.theProfiler.endSection();
}
}
@Override
@@ -322,19 +328,11 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
}
public ItemStack getUnlitCandle(int amount) {
ItemStack itemStack = new ItemStack(this, amount, 0);
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger(BlockCandle.colourTagName, 0xffffff);
itemStack.setTagCompound(tag);
return itemStack;
return new ItemStack(this, amount, 0);
}
public ItemStack getLitCandle(int amount) {
ItemStack itemStack = new ItemStack(this, amount, 1);
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger(BlockCandle.colourTagName, 0xffffff);
itemStack.setTagCompound(tag);
return itemStack;
return new ItemStack(this, amount, 1);
}
@Override
@@ -60,10 +60,11 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
if (heldItem != null && BlockCandle.lightingItems.contains(heldItem.getItem())) {
IBlockState blockState = worldIn.getBlockState(pos);
Block block = blockState.getBlock();
IBlockState activatedState = PluginApiculture.blocks.candle.getStateFromMeta(block.getMetaFromState(blockState) | 0x08);
IBlockState activatedState = PluginApiculture.blocks.candle.getStateFromMeta(block.getMetaFromState(blockState));
worldIn.setBlockState(pos, activatedState, Constants.FLAG_BLOCK_SYNC);
TileCandle tc = new TileCandle();
tc.setColour(0); // default to white
tc.setColour(16777215); // default to white
tc.setLit(true);
worldIn.setTileEntity(pos, tc);
return true;
}
@@ -34,7 +34,7 @@ public enum BlockTypeApicultureTesr implements IBlockTypeTesr {
private final IMachinePropertiesTesr<?> machineProperties;
<T extends TileForestry> BlockTypeApicultureTesr(@Nonnull Class<T> teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer<? super T> renderer, AxisAlignedBB boundingBox) {
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0");
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0", false);
}
@Nonnull
@@ -0,0 +1,20 @@
package forestry.apiculture.capabilities;
import javax.annotation.Nullable;
import forestry.api.apiculture.IArmorApiarist;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ArmorApiarist implements IArmorApiarist {
public static final ArmorApiarist INSTANCE = new ArmorApiarist();
protected ArmorApiarist() {
}
@Override
public boolean protectEntity(EntityLivingBase entity, ItemStack armor, @Nullable String cause, boolean doProtect) {
return true;
}
}
@@ -1,57 +1,55 @@
package forestry.apiculture.compat;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import forestry.api.apiculture.BeeManager;
import forestry.api.genetics.IAlleleSpecies;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.items.ItemRegistryApiculture;
import forestry.core.genetics.Genome;
import forestry.core.utils.JeiUtil;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ISubtypeRegistry;
import mezz.jei.api.JEIPlugin;
import net.minecraft.item.ItemStack;
@JEIPlugin
public class ApicultureJeiPlugin extends BlankModPlugin {
@Override
public void register(@Nonnull IModRegistry registry) {
List<ItemStack> frames = Arrays.asList(
new ItemStack(PluginApiculture.items.frameImpregnated),
new ItemStack(PluginApiculture.items.frameProven),
new ItemStack(PluginApiculture.items.frameUntreated)
);
registry.addDescription(frames, "for.jei.description.frames");
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
ItemRegistryApiculture items = PluginApiculture.items;
List<ItemStack> apiaristSuit = Arrays.asList(
new ItemStack(PluginApiculture.items.apiaristBoots),
new ItemStack(PluginApiculture.items.apiaristChest),
new ItemStack(PluginApiculture.items.apiaristHat),
new ItemStack(PluginApiculture.items.apiaristLegs)
);
registry.addDescription(apiaristSuit, "for.jei.description.apiarist.suit");
registry.addDescription(new ItemStack(PluginApiculture.items.habitatLocator), "for.jei.description.habitat.locator");
registry.addDescription(new ItemStack(PluginApiculture.items.scoop), "for.jei.description.scoop");
ISubtypeRegistry subtypeRegistry = registry.getJeiHelpers().getSubtypeRegistry();
subtypeRegistry.registerNbtInterpreter(PluginApiculture.items.beeDroneGE, BeeSubtypeInterpreter.INSTANCE);
subtypeRegistry.registerNbtInterpreter(PluginApiculture.items.beePrincessGE, BeeSubtypeInterpreter.INSTANCE);
subtypeRegistry.registerNbtInterpreter(PluginApiculture.items.beeQueenGE, BeeSubtypeInterpreter.INSTANCE);
}
private static class BeeSubtypeInterpreter implements ISubtypeRegistry.ISubtypeInterpreter {
public static BeeSubtypeInterpreter INSTANCE = new BeeSubtypeInterpreter();
@Nullable
@Override
public String getSubtypeInfo(@Nonnull ItemStack itemStack) {
ISubtypeRegistry.ISubtypeInterpreter beeSubtypeInterpreter = itemStack -> {
IAlleleSpecies species = Genome.getSpeciesDirectly(BeeManager.beeRoot, itemStack);
return species == null ? null : species.getUID();
}
};
subtypeRegistry.registerNbtInterpreter(items.beeDroneGE, beeSubtypeInterpreter);
subtypeRegistry.registerNbtInterpreter(items.beePrincessGE, beeSubtypeInterpreter);
subtypeRegistry.registerNbtInterpreter(items.beeQueenGE, beeSubtypeInterpreter);
}
@Override
public void register(@Nonnull IModRegistry registry) {
ItemRegistryApiculture items = PluginApiculture.items;
JeiUtil.addDescription(registry, "frames",
items.frameImpregnated,
items.frameProven,
items.frameUntreated
);
JeiUtil.addDescription(registry, "apiarist.suit",
items.apiaristBoots,
items.apiaristChest,
items.apiaristHat,
items.apiaristLegs
);
JeiUtil.addDescription(registry,
items.habitatLocator,
items.scoop,
items.imprinter
);
}
}
@@ -129,12 +129,17 @@ public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContain
@Override
public int getBlockLightValue() {
return worldObj.getLightFromNeighbors(getPosition().add(0, +1, 0));
return worldObj.getLightFromNeighbors(getPosition().up());
}
@Override
public boolean canBlockSeeTheSky() {
return worldObj.canBlockSeeSky(getPosition().add(0, +1, 0));
return worldObj.canBlockSeeSky(getPosition().up());
}
@Override
public boolean isRaining() {
return worldObj.isRainingAt(getPosition().up());
}
@Override
@@ -167,6 +167,9 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
List<BlockPos> flowerCoords = new ArrayList<>();
for (BlockPos.MutableBlockPos posBlock : VectUtil.getAllInBoxFromCenterMutable(world, minPos, beeHousing.getCoordinates(), maxPos)) {
if (!world.isBlockLoaded(posBlock)) {
continue;
}
IBlockState blockState = world.getBlockState(posBlock);
if (blockState.getBlock().isAir(blockState, world, posBlock)) {
continue;
@@ -194,6 +197,9 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
@Override
public boolean isAcceptedFlower(String flowerType, World world, BlockPos pos) {
if (!world.isBlockLoaded(pos)) {
return true; // Avoid actually checking until the flower's position is loaded.
}
IBlockState blockState = world.getBlockState(pos);
Set<IFlowerAcceptableRule> acceptedCustom = this.registeredRules.get(flowerType);
for (IFlowerAcceptableRule acceptableFlower : acceptedCustom) {
@@ -22,7 +22,7 @@ public class GrowthRuleDirtGrass implements IFlowerGrowthRule {
@Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) {
if (!world.isAirBlock(pos)) {
if (!world.isBlockLoaded(pos) || !world.isAirBlock(pos)) {
return false;
}
@@ -35,6 +35,10 @@ public class GrowthRuleFertilize implements IFlowerGrowthRule {
}
private boolean growFlower(World world, BlockPos pos) {
if (!world.isBlockLoaded(pos)) {
return false;
}
IBlockState state = world.getBlockState(pos);
Block ground = state.getBlock();
int groundMeta;
@@ -22,7 +22,7 @@ public class GrowthRuleMycelium implements IFlowerGrowthRule {
@Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) {
if (!world.isAirBlock(pos)) {
if (!world.isBlockLoaded(pos) || !world.isAirBlock(pos)) {
return false;
}
@@ -22,7 +22,7 @@ public class GrowthRuleSnow implements IFlowerGrowthRule {
@Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) {
if (world.getBlockState(pos).getBlock() != Blocks.SNOW) {
if (!world.isBlockLoaded(pos) || world.getBlockState(pos).getBlock() != Blocks.SNOW) {
return false;
}
@@ -43,8 +43,6 @@ import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.apiculture.IBeeMutation;
import forestry.api.apiculture.IBeekeepingMode;
import forestry.api.arboriculture.ITree;
import forestry.api.core.BiomeHelper;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.IErrorState;
@@ -248,7 +246,6 @@ public class Bee extends IndividualLiving implements IBee {
@Override
public Set<IErrorState> getCanWork(IBeeHousing housing) {
World world = housing.getWorldObj();
Biome biome = housing.getBiome();
BlockPos housingCoords = housing.getCoordinates();
Set<IErrorState> errorStates = new HashSet<>();
@@ -256,7 +253,7 @@ public class Bee extends IndividualLiving implements IBee {
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
// / Rain needs tolerant flyers
if (world.isRainingAt(housingCoords.up()) && !canFlyInRain(beeModifier)) {
if (housing.isRaining() && !canFlyInRain(beeModifier)) {
errorStates.add(EnumErrorCode.IS_RAINING);
}
@@ -282,7 +279,7 @@ public class Bee extends IndividualLiving implements IBee {
}
// / Check for the sky, except if in hell
if (biome != null && !BiomeHelper.isBiomeHellish(biome)) {
if (!world.provider.getHasNoSky()) {
if (!housing.canBlockSeeTheSky() && !canWorkUnderground(beeModifier)) {
errorStates.add(EnumErrorCode.NO_SKY);
}
@@ -668,7 +665,7 @@ public class Bee extends IndividualLiving implements IBee {
/* FLOWERS */
@Override
public ITree retrievePollen(IBeeHousing housing) {
public IIndividual retrievePollen(IBeeHousing housing) {
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
@@ -686,7 +683,7 @@ public class Bee extends IndividualLiving implements IBee {
Vec3i offset = new Vec3i(-area.getX() / 2, -area.getY() / 4, -area.getZ() / 2);
BlockPos housingPos = housing.getCoordinates();
ITree pollen = null;
IIndividual pollen = null;
for (int i = 0; i < 20; i++) {
BlockPos randomPos = VectUtil.getRandomPositionInArea(random, area);
@@ -711,7 +708,7 @@ public class Bee extends IndividualLiving implements IBee {
}
@Override
public boolean pollinateRandom(IBeeHousing housing, ITree pollen) {
public boolean pollinateRandom(IBeeHousing housing, IIndividual pollen) {
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
@@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -47,208 +48,217 @@ public class BeeAlyzerPlugin implements IAlyzerPlugin {
@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage1(GuiAlyzer gui, ItemStack itemStack) {
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
EnumBeeType type = BeeManager.beeRoot.getType(itemStack);
TextLayoutHelper textLayout = gui.getTextLayout();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.active"), GuiAlyzer.COLUMN_1);
textLayout.drawLine(Translator.translateToLocal("for.gui.inactive"), GuiAlyzer.COLUMN_2);
textLayout.newLine();
textLayout.newLine();
{
String customPrimaryBeeKey = "for.bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", "");
String customSecondaryBeeKey = "for.bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.", "");
gui.drawSpeciesRow(Translator.translateToLocal("for.gui.species"), bee, EnumBeeChromosome.SPECIES, GuiAlyzer.checkCustomName(customPrimaryBeeKey), GuiAlyzer.checkCustomName(customSecondaryBeeKey));
public void drawAnalyticsPage1(GuiScreen gui, ItemStack itemStack) {
if(gui instanceof GuiAlyzer){
GuiAlyzer guiAlyzer = (GuiAlyzer) gui;
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
EnumBeeType type = BeeManager.beeRoot.getType(itemStack);
TextLayoutHelper textLayout = guiAlyzer.getTextLayout();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.active"), GuiAlyzer.COLUMN_1);
textLayout.drawLine(Translator.translateToLocal("for.gui.inactive"), GuiAlyzer.COLUMN_2);
textLayout.newLine();
textLayout.newLine();
{
String customPrimaryBeeKey = "for.bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", "");
String customSecondaryBeeKey = "for.bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.", "");
guiAlyzer.drawSpeciesRow(Translator.translateToLocal("for.gui.species"), bee, EnumBeeChromosome.SPECIES, GuiAlyzer.checkCustomName(customPrimaryBeeKey), GuiAlyzer.checkCustomName(customSecondaryBeeKey));
textLayout.newLine();
}
guiAlyzer.drawChromosomeRow(Translator.translateToLocal("for.gui.lifespan"), bee, EnumBeeChromosome.LIFESPAN);
textLayout.newLine();
guiAlyzer.drawChromosomeRow(Translator.translateToLocal("for.gui.speed"), bee, EnumBeeChromosome.SPEED);
textLayout.newLine();
guiAlyzer.drawChromosomeRow(Translator.translateToLocal("for.gui.pollination"), bee, EnumBeeChromosome.FLOWERING);
textLayout.newLine();
guiAlyzer.drawChromosomeRow(Translator.translateToLocal("for.gui.flowers"), bee, EnumBeeChromosome.FLOWER_PROVIDER);
textLayout.newLine();
textLayout.drawLine(Translator.translateToLocal("for.gui.fertility"), GuiAlyzer.COLUMN_0);
IAlleleInteger primaryFertility = (IAlleleInteger) bee.getGenome().getActiveAllele(EnumBeeChromosome.FERTILITY);
IAlleleInteger secondaryFertility = (IAlleleInteger) bee.getGenome().getInactiveAllele(EnumBeeChromosome.FERTILITY);
guiAlyzer.drawFertilityInfo(primaryFertility.getValue(), GuiAlyzer.COLUMN_1, guiAlyzer.getColorCoding(primaryFertility.isDominant()), 0);
guiAlyzer.drawFertilityInfo(secondaryFertility.getValue(), GuiAlyzer.COLUMN_2, guiAlyzer.getColorCoding(secondaryFertility.isDominant()), 0);
textLayout.newLine();
guiAlyzer.drawChromosomeRow(Translator.translateToLocal("for.gui.area"), bee, EnumBeeChromosome.TERRITORY);
textLayout.newLine();
guiAlyzer.drawChromosomeRow(Translator.translateToLocal("for.gui.effect"), bee, EnumBeeChromosome.EFFECT);
textLayout.newLine();
textLayout.endPage();
}
gui.drawChromosomeRow(Translator.translateToLocal("for.gui.lifespan"), bee, EnumBeeChromosome.LIFESPAN);
textLayout.newLine();
gui.drawChromosomeRow(Translator.translateToLocal("for.gui.speed"), bee, EnumBeeChromosome.SPEED);
textLayout.newLine();
gui.drawChromosomeRow(Translator.translateToLocal("for.gui.pollination"), bee, EnumBeeChromosome.FLOWERING);
textLayout.newLine();
gui.drawChromosomeRow(Translator.translateToLocal("for.gui.flowers"), bee, EnumBeeChromosome.FLOWER_PROVIDER);
textLayout.newLine();
textLayout.drawLine(Translator.translateToLocal("for.gui.fertility"), GuiAlyzer.COLUMN_0);
IAlleleInteger primaryFertility = (IAlleleInteger) bee.getGenome().getActiveAllele(EnumBeeChromosome.FERTILITY);
IAlleleInteger secondaryFertility = (IAlleleInteger) bee.getGenome().getInactiveAllele(EnumBeeChromosome.FERTILITY);
gui.drawFertilityInfo(primaryFertility.getValue(), GuiAlyzer.COLUMN_1, gui.getColorCoding(primaryFertility.isDominant()), 0);
gui.drawFertilityInfo(secondaryFertility.getValue(), GuiAlyzer.COLUMN_2, gui.getColorCoding(secondaryFertility.isDominant()), 0);
textLayout.newLine();
gui.drawChromosomeRow(Translator.translateToLocal("for.gui.area"), bee, EnumBeeChromosome.TERRITORY);
textLayout.newLine();
gui.drawChromosomeRow(Translator.translateToLocal("for.gui.effect"), bee, EnumBeeChromosome.EFFECT);
textLayout.newLine();
textLayout.endPage();
}
@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage2(GuiAlyzer gui, ItemStack itemStack) {
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
EnumBeeType type = BeeManager.beeRoot.getType(itemStack);
TextLayoutHelper textLayout = gui.getTextLayout();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.active"), GuiAlyzer.COLUMN_1);
textLayout.drawLine(Translator.translateToLocal("for.gui.inactive"), GuiAlyzer.COLUMN_2);
textLayout.newLine();
gui.drawRow(Translator.translateToLocal("for.gui.climate"), AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getTemperature()),
AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getTemperature()), bee, EnumBeeChromosome.SPECIES);
textLayout.newLine();
IAlleleTolerance tempToleranceActive = (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE);
IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE);
textLayout.drawLine(" " + Translator.translateToLocal("for.gui.tolerance"), GuiAlyzer.COLUMN_0);
gui.drawToleranceInfo(tempToleranceActive, GuiAlyzer.COLUMN_1);
gui.drawToleranceInfo(tempToleranceInactive, GuiAlyzer.COLUMN_2);
textLayout.newLine(16);
gui.drawRow(Translator.translateToLocal("for.gui.humidity"), AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getHumidity()),
AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getHumidity()), bee, EnumBeeChromosome.SPECIES);
textLayout.newLine();
IAlleleTolerance humidToleranceActive = (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE);
IAlleleTolerance humidToleranceInactive = (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE);
textLayout.drawLine(" " + Translator.translateToLocal("for.gui.tolerance"), GuiAlyzer.COLUMN_0);
gui.drawToleranceInfo(humidToleranceActive, GuiAlyzer.COLUMN_1);
gui.drawToleranceInfo(humidToleranceInactive, GuiAlyzer.COLUMN_2);
textLayout.newLine(16);
String yes = Translator.translateToLocal("for.yes");
String no = Translator.translateToLocal("for.no");
String diurnal0, diurnal1, nocturnal0, nocturnal1;
if (bee.getGenome().getNeverSleeps()) {
nocturnal0 = diurnal0 = yes;
} else {
nocturnal0 = bee.getGenome().getPrimary().isNocturnal() ? yes : no;
diurnal0 = !bee.getGenome().getPrimary().isNocturnal() ? yes : no;
}
if (((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.NEVER_SLEEPS)).getValue()) {
nocturnal1 = diurnal1 = yes;
} else {
nocturnal1 = bee.getGenome().getSecondary().isNocturnal() ? yes : no;
diurnal1 = !bee.getGenome().getSecondary().isNocturnal() ? yes : no;
}
textLayout.drawLine(Translator.translateToLocal("for.gui.diurnal"), GuiAlyzer.COLUMN_0);
textLayout.drawLine(diurnal0, GuiAlyzer.COLUMN_1, gui.getColorCoding(false));
textLayout.drawLine(diurnal1, GuiAlyzer.COLUMN_2, gui.getColorCoding(false));
textLayout.newLineCompressed();
textLayout.drawLine(Translator.translateToLocal("for.gui.nocturnal"), GuiAlyzer.COLUMN_0);
textLayout.drawLine(nocturnal0, GuiAlyzer.COLUMN_1, gui.getColorCoding(false));
textLayout.drawLine(nocturnal1, GuiAlyzer.COLUMN_2, gui.getColorCoding(false));
textLayout.newLineCompressed();
String primary = StringUtil.readableBoolean(bee.getGenome().getToleratesRain(), yes, no);
String secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TOLERATES_RAIN)).getValue(), yes, no);
gui.drawRow(Translator.translateToLocal("for.gui.flyer"), primary, secondary, bee, EnumBeeChromosome.TOLERATES_RAIN);
textLayout.newLineCompressed();
primary = StringUtil.readableBoolean(bee.getGenome().getCaveDwelling(), yes, no);
secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.CAVE_DWELLING)).getValue(), yes, no);
gui.drawRow(Translator.translateToLocal("for.gui.cave"), primary, secondary, bee, EnumBeeChromosome.CAVE_DWELLING);
textLayout.newLine();
String displayText;
if (type == EnumBeeType.PRINCESS || type == EnumBeeType.QUEEN) {
String displayTextKey = "for.bees.stock.pristine";
if (!bee.isNatural()) {
displayTextKey = "for.bees.stock.ignoble";
public void drawAnalyticsPage2(GuiScreen gui, ItemStack itemStack) {
if(gui instanceof GuiAlyzer){
GuiAlyzer guiAlyzer = (GuiAlyzer) gui;
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
displayText = Translator.translateToLocal(displayTextKey);
textLayout.drawCenteredLine(displayText, 8, 208, gui.getFontColor().get("gui.beealyzer.binomial"));
}
if (bee.getGeneration() >= 0) {
EnumBeeType type = BeeManager.beeRoot.getType(itemStack);
TextLayoutHelper textLayout = guiAlyzer.getTextLayout();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.active"), GuiAlyzer.COLUMN_1);
textLayout.drawLine(Translator.translateToLocal("for.gui.inactive"), GuiAlyzer.COLUMN_2);
textLayout.newLine();
guiAlyzer.drawRow(Translator.translateToLocal("for.gui.climate"), AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getTemperature()),
AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getTemperature()), bee, EnumBeeChromosome.SPECIES);
textLayout.newLine();
IAlleleTolerance tempToleranceActive = (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE);
IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE);
textLayout.drawLine(" " + Translator.translateToLocal("for.gui.tolerance"), GuiAlyzer.COLUMN_0);
guiAlyzer.drawToleranceInfo(tempToleranceActive, GuiAlyzer.COLUMN_1);
guiAlyzer.drawToleranceInfo(tempToleranceInactive, GuiAlyzer.COLUMN_2);
textLayout.newLine(16);
guiAlyzer.drawRow(Translator.translateToLocal("for.gui.humidity"), AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getHumidity()),
AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getHumidity()), bee, EnumBeeChromosome.SPECIES);
textLayout.newLine();
IAlleleTolerance humidToleranceActive = (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE);
IAlleleTolerance humidToleranceInactive = (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE);
textLayout.drawLine(" " + Translator.translateToLocal("for.gui.tolerance"), GuiAlyzer.COLUMN_0);
guiAlyzer.drawToleranceInfo(humidToleranceActive, GuiAlyzer.COLUMN_1);
guiAlyzer.drawToleranceInfo(humidToleranceInactive, GuiAlyzer.COLUMN_2);
textLayout.newLine(16);
String yes = Translator.translateToLocal("for.yes");
String no = Translator.translateToLocal("for.no");
String diurnal0, diurnal1, nocturnal0, nocturnal1;
if (bee.getGenome().getNeverSleeps()) {
nocturnal0 = diurnal0 = yes;
} else {
nocturnal0 = bee.getGenome().getPrimary().isNocturnal() ? yes : no;
diurnal0 = !bee.getGenome().getPrimary().isNocturnal() ? yes : no;
}
if (((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.NEVER_SLEEPS)).getValue()) {
nocturnal1 = diurnal1 = yes;
} else {
nocturnal1 = bee.getGenome().getSecondary().isNocturnal() ? yes : no;
diurnal1 = !bee.getGenome().getSecondary().isNocturnal() ? yes : no;
}
textLayout.drawLine(Translator.translateToLocal("for.gui.diurnal"), GuiAlyzer.COLUMN_0);
textLayout.drawLine(diurnal0, GuiAlyzer.COLUMN_1, guiAlyzer.getColorCoding(false));
textLayout.drawLine(diurnal1, GuiAlyzer.COLUMN_2, guiAlyzer.getColorCoding(false));
textLayout.newLineCompressed();
displayText = Translator.translateToLocalFormatted("for.gui.beealyzer.generations", bee.getGeneration());
textLayout.drawCenteredLine(displayText, 8, 208, gui.getFontColor().get("gui.beealyzer.binomial"));
textLayout.drawLine(Translator.translateToLocal("for.gui.nocturnal"), GuiAlyzer.COLUMN_0);
textLayout.drawLine(nocturnal0, GuiAlyzer.COLUMN_1, guiAlyzer.getColorCoding(false));
textLayout.drawLine(nocturnal1, GuiAlyzer.COLUMN_2, guiAlyzer.getColorCoding(false));
textLayout.newLineCompressed();
String primary = StringUtil.readableBoolean(bee.getGenome().getToleratesRain(), yes, no);
String secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TOLERATES_RAIN)).getValue(), yes, no);
guiAlyzer.drawRow(Translator.translateToLocal("for.gui.flyer"), primary, secondary, bee, EnumBeeChromosome.TOLERATES_RAIN);
textLayout.newLineCompressed();
primary = StringUtil.readableBoolean(bee.getGenome().getCaveDwelling(), yes, no);
secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.CAVE_DWELLING)).getValue(), yes, no);
guiAlyzer.drawRow(Translator.translateToLocal("for.gui.cave"), primary, secondary, bee, EnumBeeChromosome.CAVE_DWELLING);
textLayout.newLine();
String displayText;
if (type == EnumBeeType.PRINCESS || type == EnumBeeType.QUEEN) {
String displayTextKey = "for.bees.stock.pristine";
if (!bee.isNatural()) {
displayTextKey = "for.bees.stock.ignoble";
}
displayText = Translator.translateToLocal(displayTextKey);
textLayout.drawCenteredLine(displayText, 8, 208, guiAlyzer.getFontColor().get("gui.beealyzer.binomial"));
}
if (bee.getGeneration() >= 0) {
textLayout.newLineCompressed();
displayText = Translator.translateToLocalFormatted("for.gui.beealyzer.generations", bee.getGeneration());
textLayout.drawCenteredLine(displayText, 8, 208, guiAlyzer.getFontColor().get("gui.beealyzer.binomial"));
}
textLayout.endPage();
}
textLayout.endPage();
}
@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage3(GuiAlyzer gui, ItemStack itemStack) {
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
TextLayoutHelper textLayout = gui.getTextLayout();
WidgetManager widgetManager = gui.getWidgetManager();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.beealyzer.produce") + ":", GuiAlyzer.COLUMN_0);
textLayout.newLine();
int x = GuiAlyzer.COLUMN_0;
for (ItemStack stack : bee.getProduceList()) {
widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), stack));
x += 18;
if (x > 148) {
x = GuiAlyzer.COLUMN_0;
textLayout.newLine();
public void drawAnalyticsPage3(GuiScreen gui, ItemStack itemStack) {
if(gui instanceof GuiAlyzer){
GuiAlyzer guiAlyzer = (GuiAlyzer) gui;
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
}
textLayout.newLine();
textLayout.newLine();
textLayout.newLine();
textLayout.newLine();
textLayout.drawLine(Translator.translateToLocal("for.gui.beealyzer.specialty") + ":", GuiAlyzer.COLUMN_0);
textLayout.newLine();
x = GuiAlyzer.COLUMN_0;
for (ItemStack stack : bee.getSpecialtyList()) {
widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), stack));
x += 18;
if (x > 148) {
x = GuiAlyzer.COLUMN_0;
textLayout.newLine();
TextLayoutHelper textLayout = guiAlyzer.getTextLayout();
WidgetManager widgetManager = guiAlyzer.getWidgetManager();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.beealyzer.produce") + ":", GuiAlyzer.COLUMN_0);
textLayout.newLine();
int x = GuiAlyzer.COLUMN_0;
for (ItemStack stack : bee.getProduceList()) {
widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), stack));
x += 18;
if (x > 148) {
x = GuiAlyzer.COLUMN_0;
textLayout.newLine();
}
}
textLayout.newLine();
textLayout.newLine();
textLayout.newLine();
textLayout.newLine();
textLayout.drawLine(Translator.translateToLocal("for.gui.beealyzer.specialty") + ":", GuiAlyzer.COLUMN_0);
textLayout.newLine();
x = GuiAlyzer.COLUMN_0;
for (ItemStack stack : bee.getSpecialtyList()) {
widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), stack));
x += 18;
if (x > 148) {
x = GuiAlyzer.COLUMN_0;
textLayout.newLine();
}
}
textLayout.endPage();
}
textLayout.endPage();
}
@Override
@@ -21,7 +21,7 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.MinecraftForge;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.EnumBeeType;
@@ -32,6 +32,7 @@ import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeMutationBuilder;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
import forestry.api.genetics.IAllele;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.genetics.alleles.AlleleEffect;
@@ -1019,6 +1020,7 @@ public enum BeeDefinition implements IBeeDefinition {
for (BeeDefinition bee : values()) {
bee.registerMutations();
}
MinecraftForge.EVENT_BUS.post(new AlleleSpeciesRegisterEvent(BeeManager.beeRoot));
}
public static void preInit() {
@@ -98,11 +98,13 @@ public class BeeGenome extends Genome implements IBeeGenome {
// / INFORMATION RETRIEVAL
@Override
@Nonnull
public IAlleleBeeSpecies getPrimary() {
return (IAlleleBeeSpecies) getActiveAllele(EnumBeeChromosome.SPECIES);
}
@Override
@Nonnull
public IAlleleBeeSpecies getSecondary() {
return (IAlleleBeeSpecies) getInactiveAllele(EnumBeeChromosome.SPECIES);
}
@@ -168,6 +170,7 @@ public class BeeGenome extends Genome implements IBeeGenome {
}
@Override
@Nonnull
public ISpeciesRoot getSpeciesRoot() {
return BeeManager.beeRoot;
}
@@ -180,7 +180,7 @@ public class BeeRoot extends SpeciesRoot implements IBeeRoot {
@Override
public IBee getMember(ItemStack stack) {
if (!isMember(stack)) {
if (!isMember(stack) || !stack.hasTagCompound()) {
return null;
}
@@ -45,11 +45,13 @@ public class AlleleEffectFertile extends AlleleEffectThrottled {
int blockMinY = housingCoordinates.getY() - area.getY() / 2 - 1;
for (int attempt = 0; attempt < MAX_BLOCK_FIND_TRIES; ++attempt) {
if (tryTickColumn(world, blockX, blockZ, blockMaxY, blockMinY)) {
break;
if (world.getChunkProvider().getLoadedChunk(blockX >> 4, blockZ >> 4) != null) {
if (tryTickColumn(world, blockX, blockZ, blockMaxY, blockMinY)) {
break;
}
blockX = getRandomOffset(world.rand, housingCoordinates.getX(), area.getX());
blockZ = getRandomOffset(world.rand, housingCoordinates.getZ(), area.getZ());
}
blockX = getRandomOffset(world.rand, housingCoordinates.getX(), area.getX());
blockZ = getRandomOffset(world.rand, housingCoordinates.getZ(), area.getZ());
}
return storedData;
@@ -61,12 +61,14 @@ public class AlleleEffectFungification extends AlleleEffectThrottled {
for (int attempt = 0; attempt < MAX_BLOCK_FIND_TRIES; ++attempt) {
BlockPos pos = VectUtil.getRandomPositionInArea(world.rand, area).subtract(halfArea).add(housingCoordinates);
IBlockState blockState = world.getBlockState(pos);
if (world.isBlockLoaded(pos)) {
IBlockState blockState = world.getBlockState(pos);
if (convertToMycelium(world, blockState, pos)) {
return;
} else if (growGiantMushroom(world, blockState, pos)) {
return;
if (convertToMycelium(world, blockState, pos)) {
return;
} else if (growGiantMushroom(world, blockState, pos)) {
return;
}
}
}
}
@@ -52,16 +52,14 @@ public class AlleleEffectGlacial extends AlleleEffectThrottled {
BlockPos posBlock = VectUtil.add(randomPos, housingCoords, offset);
// Freeze water
Block block = world.getBlockState(posBlock).getBlock();
if (block != Blocks.WATER) {
continue;
if (world.isBlockLoaded(posBlock)) {
Block block = world.getBlockState(posBlock).getBlock();
if (block == Blocks.WATER) {
if (world.isAirBlock(new BlockPos(posBlock.getX(), posBlock.getY() + 1, posBlock.getZ()))) {
world.setBlockState(posBlock, Blocks.ICE.getDefaultState());
}
}
}
if (!world.isAirBlock(new BlockPos(posBlock.getX(), posBlock.getY() + 1, posBlock.getZ()))) {
continue;
}
world.setBlockState(posBlock, Blocks.ICE.getDefaultState());
}
return storedData;
Loaded 100 of 1551 files, more files were not shown because too many files have changed in this diff. Show more