mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 06:24:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
319682ae2b | ||
|
|
c8f20bd513 | ||
|
|
6f6823b6d2 | ||
|
|
a65c593c9a | ||
|
|
55840ac08e | ||
|
|
a7076ce817 | ||
|
|
e5e6474ff9 | ||
|
|
1703e8a862 | ||
|
|
b16524e919 | ||
|
|
d8cd023876 | ||
|
|
d64ec3caa2 | ||
|
|
515e0e1751 | ||
|
|
cc9bbefa3f | ||
|
|
18c7790abd | ||
|
|
ccbfa4995d | ||
|
|
54faf63bab | ||
|
|
e14bbe254a | ||
|
|
50d914e846 | ||
|
|
3b8dec5425 | ||
|
|
a332d3f2e5 | ||
|
|
d921717965 | ||
|
|
55f9e58297 | ||
|
|
7930108032 | ||
|
|
0fd8b319de | ||
|
|
051cc96514 | ||
|
|
40fdbb29c6 | ||
|
|
52798c8175 | ||
|
|
a5fed5c9b7 | ||
|
|
07624a3a4c | ||
|
|
dc4cd3331c | ||
|
|
6ea6f1e017 | ||
|
|
cb7b515626 | ||
|
|
46cb2cb95a | ||
|
|
cc987d6ac8 | ||
|
|
4f39132e4e | ||
|
|
4938c29e8c | ||
|
|
cbb0b15dee | ||
|
|
b881283492 | ||
|
|
5d4b84727d | ||
|
|
ad9135590d | ||
|
|
5cd884929f | ||
|
|
7bd5e7ac54 | ||
|
|
8cda9b9f43 | ||
|
|
444303d06d | ||
|
|
b3ca22fd1f | ||
|
|
1f8f324c56 | ||
|
|
3d1cdfa9af | ||
|
|
1275abc1c4 | ||
|
|
3347afb0c3 | ||
|
|
016049ef67 | ||
|
|
33b0af6682 | ||
|
|
8bf47d8f5f | ||
|
|
e9c91cda37 | ||
|
|
f645076eeb | ||
|
|
8ccb8f4d75 | ||
|
|
142637151a | ||
|
|
469867bc1f | ||
|
|
712679d8ac | ||
|
|
8eb8363b31 | ||
|
|
cd758dfec2 | ||
|
|
629cd06ef6 | ||
|
|
8e11456ea3 | ||
|
|
2c5e6ca041 | ||
|
|
a739206e01 | ||
|
|
9b9926b340 | ||
|
|
dac7c0ddef | ||
|
|
a6d1a9f1a4 | ||
|
|
98a5e73ddf | ||
|
|
f68b47473f | ||
|
|
a0df95b36c | ||
|
|
6ff6b72580 | ||
|
|
2f5cbb7d3c | ||
|
|
250e5c159f | ||
|
|
0c5f27e192 | ||
|
|
a6c439c078 | ||
|
|
300a22efab | ||
|
|
fdf89303e4 | ||
|
|
ffe3f9d33e | ||
|
|
0e0eaac495 | ||
|
|
e9c423579b | ||
|
|
1be990eb0e | ||
|
|
87a918b7c6 | ||
|
|
580f1f4e12 | ||
|
|
2b0b729ad0 | ||
|
|
f5a6ca61ba | ||
|
|
44ecbbdc45 | ||
|
|
d3c6ad5433 | ||
|
|
5b053dd990 | ||
|
|
e416d09dde | ||
|
|
723506d04f | ||
|
|
c352b42fc1 | ||
|
|
95275e57d6 | ||
|
|
02659b2816 | ||
|
|
02655f092e | ||
|
|
03bc6c0d83 | ||
|
|
85f8ab960d | ||
|
|
2146249b9c | ||
|
|
a4ebd6d859 | ||
|
|
6c79dfb104 | ||
|
|
9233d45b33 | ||
|
|
7082436190 | ||
|
|
fb8873b781 | ||
|
|
12c1b3b5c3 | ||
|
|
ecaa9babf7 | ||
|
|
16086558e4 | ||
|
|
cc4390ec21 | ||
|
|
0cb6505fd4 | ||
|
|
52128123ef | ||
|
|
6136a59a15 | ||
|
|
0886fd1389 | ||
|
|
ea409d34de | ||
|
|
1f7fe61afe | ||
|
|
1cb45e24c5 | ||
|
|
7ab175d8b6 | ||
|
|
31ff948c6d | ||
|
|
fa2590d41e | ||
|
|
0e77348285 | ||
|
|
608656be73 | ||
|
|
58c56623af | ||
|
|
f05c12b2ee | ||
|
|
4b802d4727 | ||
|
|
ffd6f2ca94 | ||
|
|
c309c20268 | ||
|
|
3d75e97b20 | ||
|
|
e23ebd1011 | ||
|
|
707a9bd64e | ||
|
|
6c567e247a | ||
|
|
132d9b47f0 | ||
|
|
5090aa76ea | ||
|
|
61e6b82bc3 | ||
|
|
533d7d55a8 | ||
|
|
7513ba1255 | ||
|
|
a560085ac9 | ||
|
|
f9ceeba358 | ||
|
|
c5d59a4505 | ||
|
|
0a6f6eda09 | ||
|
|
ca8b206912 | ||
|
|
3aea0376bc | ||
|
|
7751c01463 | ||
|
|
5699937179 | ||
|
|
abb7e64613 | ||
|
|
f31d3b9b09 | ||
|
|
a7515baf69 | ||
|
|
888f86d8bb | ||
|
|
3989430408 | ||
|
|
99a88cf9bc | ||
|
|
6c50d89353 | ||
|
|
dbc6acb9c9 | ||
|
|
ff476ad969 | ||
|
|
e20ab2dfb9 | ||
|
|
c3210c0883 | ||
|
|
c2c21301a6 | ||
|
|
91777b1960 | ||
|
|
532042393b | ||
|
|
c89c9b0d33 | ||
|
|
0b000d68b9 | ||
|
|
2f286e8e2c | ||
|
|
406132babc | ||
|
|
b7a071d887 | ||
|
|
37e8965a3c | ||
|
|
b7714a1435 | ||
|
|
c9bffd18d8 | ||
|
|
48b9d59f33 | ||
|
|
f7fcf5ed9d | ||
|
|
a95036aa2e | ||
|
|
10da83f082 | ||
|
|
bc596ee3a6 | ||
|
|
6ae6a8afc0 | ||
|
|
bde2baab2d | ||
|
|
f33e48ead9 | ||
|
|
6152508a0b | ||
|
|
f3ceac50cd | ||
|
|
98a38a1f6e | ||
|
|
7aba3f5f53 | ||
|
|
66c1a89c32 | ||
|
|
5f9b122d77 | ||
|
|
71d203bffc | ||
|
|
092c076dba | ||
|
|
ebb8298c9d | ||
|
|
ab2f6a64d5 | ||
|
|
62b7d28020 | ||
|
|
e5ae2527a9 | ||
|
|
aca8b2dcb1 | ||
|
|
88ec668999 | ||
|
|
9729d75252 | ||
|
|
fc2f40d100 | ||
|
|
ce0424b468 | ||
|
|
940846d069 | ||
|
|
b2d18fbb64 | ||
|
|
96389b5329 | ||
|
|
61afb3a0bc | ||
|
|
bf57ac3491 | ||
|
|
e8421f40fe | ||
|
|
b8d12b1f9a | ||
|
|
1476470054 | ||
|
|
89fb41b814 | ||
|
|
f44591b47d | ||
|
|
fd82a0ef72 | ||
|
|
cbbf2558fd | ||
|
|
76f541bc3f | ||
|
|
7f95da0f6c | ||
|
|
3798f1f771 | ||
|
|
721a60c994 | ||
|
|
4a03a5f48c | ||
|
|
c6720b7417 | ||
|
|
575c799587 | ||
|
|
2c324174e4 | ||
|
|
28f5a15f0a | ||
|
|
9bed2d3749 | ||
|
|
1a394ce858 | ||
|
|
5d3bd8bde2 | ||
|
|
5279a6e64a | ||
|
|
2c2306b223 | ||
|
|
8aaa24c3c1 | ||
|
|
e32c05ab3e | ||
|
|
f21bd467c2 | ||
|
|
d3e93188c0 | ||
|
|
e92d9c131e | ||
|
|
1bee56adf3 | ||
|
|
85a2723ef8 | ||
|
|
29069e7e9f | ||
|
|
c8be483bf0 | ||
|
|
92ace4e9a3 | ||
|
|
aed979a19f | ||
|
|
0fa9a6ed23 | ||
|
|
b3660ecf58 | ||
|
|
5eb787352b | ||
|
|
a7774e1fca | ||
|
|
596ae798ec | ||
|
|
902812e015 | ||
|
|
0b510e8426 | ||
|
|
d4c5d1e356 | ||
|
|
5a2f360e50 | ||
|
|
84ad8b0d7b | ||
|
|
6a26bec4e1 | ||
|
|
827199b518 | ||
|
|
ead879a913 |
No files matched your search
+26
@@ -0,0 +1,26 @@
|
|||||||
|
# IntelliJ IDEA Files
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
out/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Eclipse Project Files
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
eclipse/
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.gradle
|
||||||
|
gradle/
|
||||||
|
build/
|
||||||
|
debug/
|
||||||
|
bin/
|
||||||
|
config/
|
||||||
|
crash-reports/
|
||||||
|
logs/
|
||||||
|
mods/
|
||||||
|
saves/
|
||||||
|
usernamecache.json
|
||||||
|
options.txt
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "src/api/java/thaumcraft/api"]
|
||||||
|
path = src/api/java/thaumcraft/api
|
||||||
|
url = https://github.com/Azanor/thaumcraft-api
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Copyright © 2013 MysteriousAges
|
||||||
|
This work is free. You can redistribute it and/or modify it under the
|
||||||
|
terms of the Do What The Fuck You Want To Public License, Version 2,
|
||||||
|
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
Version 2, December 2004
|
||||||
|
|
||||||
|
Copyright (C) 2004 Sam Hocevar <[email protected]>
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
copies of this license document, and changing it is allowed as long
|
||||||
|
as the name is changed.
|
||||||
|
|
||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
|||||||
|
# MagicBees
|
||||||
|
Magic Bees is an addon for Forestry that adds several new bee species with a magical theme. Breeding them will help you brew potions, or give you extra ways to make resources for other magic-themed mods such as Thaumcraft and Ars Magica.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Magic Bees depends on Forestry, which is required. You may [download Forestry here](http://www.curse.com/mc-mods/minecraft/forestry).
|
||||||
|
|
||||||
|
Minecraft Forge is also needed to run Forestry. Magic Bees will usually work with whichever version of Forge Forestry requires.
|
||||||
|
|
||||||
|
To install, simply download the mod from [CurseForge](http://minecraft.curseforge.com/mc-mods/65764-magic-bees) and place in the mods folder of your Minecraft instance.
|
||||||
|
|
||||||
|
## Compatability
|
||||||
|
Adding the following mods will result in additional features being unlocked:
|
||||||
|
* [Extra Bees](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1284348-1-7-10-1-6-4-forestry-binnies-mods-1-8-0-2-0-dev) - Mutations to get the Thaumic Bees species will use Extra Bees species in some cases. If Thaumcraft is installed, TB will add aspects to Extra Bees items. You will also get access to Thaumic Bees alleles though the genetic machines.
|
||||||
|
* [Thaumcraft](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130-thaumcraft-4-2-3-0-updated-2015-1-5) - Adds several tools related to Thaumcraft & Forestry, as well as adding Thaumcraft aspects to many Forestry items and blocks.
|
||||||
|
* [Equivalent Exchange 3](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286564-equivalent-exchange-3-0-1-142) - Adds the Minium Bee, which produces Minium Shards. More features to come in the future.
|
||||||
|
* [Ars Magica](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286036-ars-magica-v5-52-014-updated-august-2-1-5-2) - Adds 13 bee species that interact with Ars Magica, or produce AM items.
|
||||||
|
* [Tinker's Construct](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2218638-tinkers-construct) - Adds 3 new bee species to help produce some of the higher tier metals. The Aluminum bee will also help with producing some lower-tier alloys as well.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MagicBees is licesed under the WTFPL ( http://www.wtfpl.net/ )
|
||||||
|
|
||||||
|
Seriously, do whatever. Just don't ask us to support it if we didn't distribute it. =D
|
||||||
|
|
||||||
|
We didn't distribute it if you downloaded it from a site other than CurseForge, or from a modpack that does not use CurseForge as their source.
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
name = "forge"
|
||||||
|
url = "http://files.minecraftforge.net/maven"
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = "sonatype"
|
||||||
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "forestry"
|
||||||
|
url = "http://maven.ic2.player.to/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'forge'
|
||||||
|
|
||||||
|
ext.version_mod = "${project.version_major}.${project.version_minor}.${project.version_rev}"
|
||||||
|
version = project.version_mc + "-" + project.version_mod
|
||||||
|
group= "magicbees" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
archivesBaseName = "magicbees"
|
||||||
|
|
||||||
|
minecraft {
|
||||||
|
version = project.version_mc + "-" + project.version_forge
|
||||||
|
runDir = "."
|
||||||
|
|
||||||
|
replace '@VERSION@', project.version_mod
|
||||||
|
replace '@MCVERSION@', project.version_mc
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "net.sengir.forestry:forestry_${project.version_mc}:${project.version_forestry}:dev"
|
||||||
|
compile files("/libs/BloodMagic-${project.version_mc}-${project.version_bloodmagic}.jar")
|
||||||
|
compile files("/libs/Botania ${project.version_botania}-deobf.jar")
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources
|
||||||
|
{
|
||||||
|
// this will ensure that this task is redone when the versions change.
|
||||||
|
inputs.property "version", project.version
|
||||||
|
inputs.property "mcversion", project.minecraft.version
|
||||||
|
|
||||||
|
// replace stuff in mcmod.info, nothing else
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
include 'mcmod.info'
|
||||||
|
|
||||||
|
// replace version and mcversion
|
||||||
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy everything else, thats not the mcmod.info
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
exclude 'mcmod.info'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
idea {
|
||||||
|
module {
|
||||||
|
inheritOutputDirs = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+275
@@ -0,0 +1,275 @@
|
|||||||
|
2.1.22
|
||||||
|
+ Added configoption to change thaumcraft saplingdroprate using thaumiumgrafter
|
||||||
|
* First 1.7.10 update on CurseForge! Woohoo!
|
||||||
|
* Updated chinese translation courtesy of Astrologers
|
||||||
|
* Fixed texturebugs with thaumium scoop and grafter
|
||||||
|
* Fixed backpack issues. Hopefully fixed for real this time
|
||||||
|
|
||||||
|
2.1.21
|
||||||
|
* Bumped forestry requirement to 3.0.0.174 (Might work with lower versions, untested)
|
||||||
|
* Fixed issue with Thaumic tools not having icons/localized names
|
||||||
|
|
||||||
|
2.1.20
|
||||||
|
* Fixes crash due to not registrering backpack correctly
|
||||||
|
* Fixes crash when breeding metal bees
|
||||||
|
* Fixed a missing configoption
|
||||||
|
* Started work on ThaumicApiary
|
||||||
|
|
||||||
|
2.1.19
|
||||||
|
* Updated to Forestry 3. This is now required.
|
||||||
|
* Updated Thaumcraft integration to work in 1.7.10
|
||||||
|
* Updated ExtraBees integration
|
||||||
|
* Changed all language files to the .lang format
|
||||||
|
|
||||||
|
2.1.18
|
||||||
|
* A few critical bugfixes to stop centrifuge crashes.
|
||||||
|
|
||||||
|
2.1.13
|
||||||
|
Updated to 1.7.2.
|
||||||
|
|
||||||
|
2.1.12
|
||||||
|
Changing hive gen to use isGenMineableReplaceable, which should make Deep hives spawn in Underground Biomes stone.
|
||||||
|
Fixing logic error in handling world gen/retrogen
|
||||||
|
|
||||||
|
2.1.11
|
||||||
|
Thermal Expansion & Redstone Arsenal bees, courtesy of jadedcat.
|
||||||
|
Adding missing loc string for Blinding speed allele
|
||||||
|
|
||||||
|
2.1.10
|
||||||
|
Changing Aluminum bees to use changed ore dictionary entries. mDiyo Houuuuuuuuuuuuuuuuuse!
|
||||||
|
Updating AM2 mob-spawning bees to use newer names.
|
||||||
|
|
||||||
|
2.1.9
|
||||||
|
Adding configuration option to not spawn special hives in Magic Biomes for people who hate fun, and specialness.
|
||||||
|
Adding a shadow to the Tempus aspect for Vazkii.
|
||||||
|
Possibly fixing issues with fluid containers.
|
||||||
|
|
||||||
|
2.1.8
|
||||||
|
Fixing inconcistent recipes between Thaumonomicon & actual crafting
|
||||||
|
Added missing centrifuge recipe for the Transmuting combs. This is the source of Unstable Propolis.
|
||||||
|
|
||||||
|
2.1.7
|
||||||
|
Some non-bee bug removals.
|
||||||
|
Magnets are ... a bit expensive. >_>;
|
||||||
|
|
||||||
|
2.1.6
|
||||||
|
How about not crashing because I forgot a colour tuple? >.>
|
||||||
|
Presenting a new bee species: You can't see it though, because it's invisible. >_>
|
||||||
|
|
||||||
|
2.1.5
|
||||||
|
Behold! The Mysterious Magnet! It attracts items to it, and thus, you, from great distances! (well, greater than your arms anyhow.)
|
||||||
|
Updating TC4 API for when it releases.
|
||||||
|
|
||||||
|
2.1.4
|
||||||
|
Some cleanup of Helper code
|
||||||
|
Hammering out rest of Transmutation effect, and exposing parts of it in an API so other people can hook into it if they want.
|
||||||
|
Have some Ars Magica 2 integration.
|
||||||
|
Also, have some Thaumcraft 4 integration!
|
||||||
|
|
||||||
|
2.1.3
|
||||||
|
Added a new mini bee branch: Polymorphic. It is said Unusual bees can have some unusual effects on the world if they are advanced...
|
||||||
|
Altered mutation to get Minium bees to fit into the Polymorphic branch.
|
||||||
|
Crumbling effect ages the area around the hive.
|
||||||
|
Added an IMC Handler to allow other mods to send an IMC message with key 'addCrumblePair" and a value containing two NBT tags
|
||||||
|
'source' and 'target' for ItemStacks of the source block and target block. Blocks added on a first-come-first-serve basis.
|
||||||
|
Only one entry per source block is accepted. Several vanilla defaults are provided, can be overridden using IMC.
|
||||||
|
Changing humidity tolerance of Sorcerous bees to be actually useful.
|
||||||
|
Fixed issues with the bee effects rendering (the little bee icons that shoot out of the bee machine while they work) for custom effects.
|
||||||
|
|
||||||
|
2.1.2
|
||||||
|
Fixed issue with mob spawning effects incorrectly checking for effect data variables.
|
||||||
|
Updating localization files (RU, DE)
|
||||||
|
|
||||||
|
2.1.1
|
||||||
|
Reworking some language entries & code to enable string formatting in capsule names.
|
||||||
|
Localization file updates.
|
||||||
|
Tinker's Construct bees (Ardite, Cobalt, Manyullyn) and Aluminum bees.
|
||||||
|
|
||||||
|
2.1.0
|
||||||
|
Added new permanent methods for crafting all frames. These will be available even when Thaumcraft is installed.
|
||||||
|
Removed temporary frame recipes which used to be available when Thaumcraft was not installed.
|
||||||
|
Lowered the cost of creating several frames through Thaumcraft. These should still be a viable option with the new recipes.
|
||||||
|
Fixed issue with foundation-requiring mutations in Forestry Alvearies. (Will likely not work with Extra Bees Alveary blocks)
|
||||||
|
|
||||||
|
2.0.5
|
||||||
|
Fixed hard-coded value in a subroutine that should not have been hard-coded.
|
||||||
|
|
||||||
|
2.0.4
|
||||||
|
Fixed backwards mutation logic.
|
||||||
|
|
||||||
|
2.0.3
|
||||||
|
Adjusting Thaumcraft research notes to reflect recent (Hah!) changes.
|
||||||
|
|
||||||
|
2.0.2
|
||||||
|
Fixed Escritoire/Mutation Notes for bees which require a Thaumcraft Node.
|
||||||
|
Fixing colour data for Temporal Combs.
|
||||||
|
Adjusting the production rates on some nugget-producing bees.
|
||||||
|
Withering bee species now requires arid rather than normal humidity, to conform with the rest of the Infernal line.
|
||||||
|
Withering and Slow Effects should now correctly be reduced while wearing Apiarist's Armor or other protective gear.
|
||||||
|
|
||||||
|
2.0.1
|
||||||
|
Modifying mutation class to allow block-requiring mutations to work in Alvearies/other multiblock hive structures.
|
||||||
|
Tweaking hive gen
|
||||||
|
Fixing mistakes in bee genome templates
|
||||||
|
Updating Biofuel capsule to use the Ethanol liquid in Forestry
|
||||||
|
|
||||||
|
2.0.0
|
||||||
|
Enabling Retrogen of hives in case you missed them initially.
|
||||||
|
Tearing out all old mutations, rewriting from the ground up. Maybe these will be less frustrating. ;)
|
||||||
|
Adding subroutines to make MB species actually worthwhile to check out in the Escritoire. If you get stuck on a mutation, throw it into the table and try out the minigame!
|
||||||
|
New bee species (Too many to list. Have fun finding them!)
|
||||||
|
New hives
|
||||||
|
Added zh_CN localization by crafteverywhere
|
||||||
|
Added de_DE localization by philip98 and Vexatos
|
||||||
|
Added ru_RU localization by CrazyTechno and VeryBigBro
|
||||||
|
|
||||||
|
|
||||||
|
=========== Old Thaumic Bees Changelog ================
|
||||||
|
|
||||||
|
1.4.7b
|
||||||
|
Fix for creative mode crash when a certain config option is enabled.
|
||||||
|
|
||||||
|
1.4.7a
|
||||||
|
Update for Forestry Beta.
|
||||||
|
|
||||||
|
1.4.7
|
||||||
|
Added the Bee Collector's Jar.
|
||||||
|
Created an alternate recipe for the Temporal Frame that is always active.
|
||||||
|
Adjusted TC3 alternate recipe for the Temporal Frame.
|
||||||
|
Fixed an issue with the "Pick Block" function on the Greatwood & Silverwood planks. Should also stop NEI from providing incorrect block info on them.
|
||||||
|
Fixed the Node flower growing flowers.
|
||||||
|
Adding Apatite bees.
|
||||||
|
|
||||||
|
1.4.6
|
||||||
|
Ars Magica integration! 13 new bee species to help you research & cast spells.
|
||||||
|
Changing mutations around, because I'm still not happy with them. (Again.)
|
||||||
|
Many icon & texture fixes. (derp!)
|
||||||
|
|
||||||
|
1.4.5a
|
||||||
|
Repaired Thaumcraft 3 integration for 3.0.4a.
|
||||||
|
Fixed Biofuel capsules being shown as "Empty x Capsule"
|
||||||
|
Fixed missing texture for oil & fuel capsules
|
||||||
|
|
||||||
|
1.4.5
|
||||||
|
Added the Jade Moon Dial - tells you what moon phase it currently is for breeding purposes.
|
||||||
|
Added a creative menu tab for certain Thaumic Bees items - misc resources, capsules, tools.
|
||||||
|
|
||||||
|
1.4.4b
|
||||||
|
Ported to 1.5! Wooo!
|
||||||
|
|
||||||
|
1.4.4a
|
||||||
|
Fixed an isuse that caused GregTech to crash.
|
||||||
|
|
||||||
|
1.4.4
|
||||||
|
Made greatwood & silverwood planks fireproof by default - added a config option to toggle it.
|
||||||
|
Added Nuggets - Iron, Copper, Tin, Silver, Lead. Should craft into 1st ore dictionary ingot of appropriate type.
|
||||||
|
Added Shards - Diamond, Emerald.
|
||||||
|
Added 15 new bees. Have fun~ <3
|
||||||
|
Added Equivalent Exchange 3 compatability! (It's 1 thing, don't get terribly excited.)
|
||||||
|
New frame type! Search Strongholds for them.
|
||||||
|
|
||||||
|
1.4.3c
|
||||||
|
Thaumium Grafter now doubles your chance to get Greatwood & Silverwood saplings.
|
||||||
|
Thaumium Grafter now takes extra damage when trying to break Greatwood & Silverwood leaves.
|
||||||
|
Thaumium Grafter now has a balancing feature when repairing.
|
||||||
|
Extra... uh. "Enhancements". =D
|
||||||
|
|
||||||
|
1.4.3b
|
||||||
|
Greatwood & Silverwood planks support BuildCraft facades.
|
||||||
|
Tweaking Aura cost for Repair on Thaumium Grafters and other balance.
|
||||||
|
Turns out I can't get the version crap to work properly. More fixes.
|
||||||
|
|
||||||
|
1.4.3a
|
||||||
|
Changed Version info embedded in mod to match format supported by Version checking. Will need to make this more robust in the future.
|
||||||
|
Fixed bug with Thaumium Grafter not being enchantable.
|
||||||
|
|
||||||
|
1.4.3
|
||||||
|
Added automatic version-checking for ThaumicBees! From this version on, when a new version becomes available, it will notify you in-game. Notifications can be switched off via a config file option.
|
||||||
|
Fixed missing aspects on Extra Bees combs.
|
||||||
|
|
||||||
|
1.4.2
|
||||||
|
Added Void Capsules - hold up to 8 buckets of liquid with one! It's a waterproof bag of holding! Plus stacking.
|
||||||
|
Fix: Added Greatwood & Silverwood slabs to the ore dictionary so they should work as normal.
|
||||||
|
Added Thaumium Scoop - 30 uses, can be enchanted with Repair.
|
||||||
|
Added Thaumium Grafter - 15 uses, can be enchanted with Repair.
|
||||||
|
|
||||||
|
1.4.1
|
||||||
|
Added Greatwood and Silverwood planks. Since Greatwood and Silverwood are tougher than other trees, you'll need some extra machinery. To obtain these, jam a log of the appropriate tree into a Forestry carpenter and provide a half bucket of water.
|
||||||
|
Added slabs for the new planks also.
|
||||||
|
|
||||||
|
1.4.0a
|
||||||
|
Fixed some issues with the Node bee's effect.
|
||||||
|
|
||||||
|
1.4.0
|
||||||
|
New branch of bees containing 3 new species. A new type of frame!
|
||||||
|
Thaumaturge's Backpack now require Amber rather than Gold Nuggets.
|
||||||
|
Due to popular complaint, the Bees & Magic node now requires Unified Thaumic Field Theory to unlock.
|
||||||
|
Moving all kinds of string contstants out of code into Localization files.
|
||||||
|
Also fixed crazy aspects showing up on things that shouldn't have those aspects.
|
||||||
|
ACTUALLY fixed issue with untyped node mutations failing.
|
||||||
|
|
||||||
|
1.3.0d
|
||||||
|
Fixed an issue with mutations requiring a non-specific type of node to fail.
|
||||||
|
|
||||||
|
1.3.0c
|
||||||
|
Discovered a function call that will crash dedicated servers. If you are running ThuamicBees on a server, please update to this revision.
|
||||||
|
|
||||||
|
1.3.0b
|
||||||
|
Fixed a problem with capsules not being registered with the Forge Liquid Dictionary. You should be able to use them just about everywhere, now.
|
||||||
|
Fixed the issue with certain items appearing twice in Creative Mode tabs.
|
||||||
|
|
||||||
|
1.3.0a
|
||||||
|
Some bug fixes, including uncommenting some mutation-related code, research tweaking.
|
||||||
|
Added the last bee for a long while, probably. Good luck getting it.
|
||||||
|
|
||||||
|
Common TB crashes stemming from Forestry issues should now be reported a little better, especially the backpack registration & item texture file related things. Errors should appear in your log, so make sure you read the log before you report the error here. It could be something silly on your end that is causing the crash.
|
||||||
|
|
||||||
|
1.3.0
|
||||||
|
3 new species of bee: Vis, Pure, and Flux! Each requires an aura node nearby, and may have some side-effects...
|
||||||
|
New Thaumcraft research! Open up your Thaumanomicon to see it.
|
||||||
|
New Apiary Frames! They run off magic, confers bees with bonuses, and may have an impact outside of your apiary...
|
||||||
|
|
||||||
|
1.2.705B - Replaced 1.2.705
|
||||||
|
Fixed issue with bad Mutation class, allowing pure bees to turn into any bee that involves them in a mutation.
|
||||||
|
Also ACTUALLY fixed issue with Extra Bees loading after ThaumicBees on *nix-based systems.
|
||||||
|
|
||||||
|
1.2.705
|
||||||
|
*Stealth update: Fixed an issue with TB loading before Extra Bees, resulting in some Null Pointers getting passed and choked on. If you get this issue, please re-download 1.2.705. No other changes were made in this version.
|
||||||
|
|
||||||
|
*8 new species of bees, including "Praecantatio", which, like the other Elemental bees, may contain Vis shards in its propolis. Some of the new species may also have extra evil involved, so be ready for anything.
|
||||||
|
*Extra integration with Extra Bees! Mutations for some of the new bees. If Extra Bees is present, their mutations will require EB species rather than the base Forestry species.
|
||||||
|
*Changed the "Charmed" mutation to avoid conflicting with Extra Bees. (Binnie already had one there, so mine got moved.)
|
||||||
|
*New bee branch, similar to Extra Bees's mob spawning bees.
|
||||||
|
*One new bee from a new branch, the rest of which will come once Azanor releases the Thaumcraft API.
|
||||||
|
|
||||||
|
1.1.702-67 - Replaced 1.1.702-62
|
||||||
|
Additional Magic Capsules, featuring ExtraBees liquids, and RailCraft Creosote & Steam. (Yes, steam capsules. It's magic. That's how. :P)
|
||||||
|
Tagged additional Forestry items with Thaumcraft aspects.
|
||||||
|
|
||||||
|
1.1.702-62
|
||||||
|
Added Magic Capsules!
|
||||||
|
Compatible with BuildCraft and Forestry liquids, they function almost the same way as refactory capsules, except that they can store 2 buckets' worth of liquid. As such, you cannot right-click with them to scoop up water or lava, but you can use them in bottlers, carpenters, Railcraft's Iron Tanks, Thermal Expansion's liquid transposers, and other things that support the Forge Liquid Dictionary. They can be useful for storing larger amounts of liquids in chests and things. I am also able to add other liquids to them in the future, and liquids from mods that are not present will not appear in the Creative inventory or the NEI listings.
|
||||||
|
|
||||||
|
1.0.701-56
|
||||||
|
Update to Forestry 1.7.0.1/1.7.0.2
|
||||||
|
|
||||||
|
Added all kinds of backpack integration for Thaumcraft, including a new Thaumaturge's Backpack and Woven variety. These will suck up shards, Thaumcraft resources such as quicksilver, amber, zombie brains, research fragments and other goodies. Other TC items such as marker blocks, warded stone, candles, logs, leaves and plants also can fall into Forestry's default backpacks as appropriate. (I may have missed some other obvious items.)
|
||||||
|
|
||||||
|
1.0.70-53
|
||||||
|
Update to Forestry 1.7.0.0
|
||||||
|
|
||||||
|
1.0.0-50
|
||||||
|
-Added Thaumcraft aspects to some Forestry items, notably combs and bees. (Finally, something to use those extra drones for!)
|
||||||
|
-Added another Swarmer inducer item - craftable via carpenter using liquid honey, Royal Jelly, Pollen and Enchanting Drops from Arcane bees. 8 times more effective than Royal Jelly alone!
|
||||||
|
-Added carpenter recipe for candles using magic wax. Same patterns as with beeswax.
|
||||||
|
|
||||||
|
1.0.0-48
|
||||||
|
-Support for Forestry 1.6.5.5+
|
||||||
|
-Extra alles for bee mutations!
|
||||||
|
-Thaumcraft aspects associated with some Forestry items!
|
||||||
|
|
||||||
|
1.0.0-35
|
||||||
|
-Bugfix version to account for launcher jars located outside of expected folder. Replaced 1.0.0-34
|
||||||
|
|
||||||
|
1.0.0-34
|
||||||
|
-Initial Release
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
2.2.2
|
||||||
|
false
|
||||||
|
Magic Apiary, assorted bugfixes.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
version_major=2
|
||||||
|
version_minor=2
|
||||||
|
version_rev=3
|
||||||
|
|
||||||
|
version_forestry=3.4.0.7
|
||||||
|
version_bloodmagic=1.3.1-7
|
||||||
|
version_botania=r1.6-180
|
||||||
|
|
||||||
|
version_mc=1.7.10
|
||||||
|
version_forge=10.13.2.1230
|
||||||
Vendored
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#Wed Jul 02 15:54:47 CDT 2014
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >&-
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >&-
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||||
Vendored
+90
@@ -0,0 +1,90 @@
|
|||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
Binary file not shown.
Binary file not shown.
Submodule
+1
Submodule src/api/java/thaumcraft/api added at 4120e665c9.
@@ -0,0 +1,9 @@
|
|||||||
|
package magicbees.api;
|
||||||
|
|
||||||
|
import magicbees.api.bees.ITransmutationEffectController;
|
||||||
|
|
||||||
|
public class MagicBeesAPI
|
||||||
|
{
|
||||||
|
// Use this object during or after the Mod.Init phase to add your logic to the Transmutation bee effect.
|
||||||
|
public static ITransmutationEffectController transmutationEffectController;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package magicbees.api.bees;
|
||||||
|
|
||||||
|
public interface IAuraChargeType {
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package magicbees.api.bees;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows a tile entity to provide a Magic Apiary with 'aura' to boost bee production, mutation rate,
|
||||||
|
* or decrease bee lifespan.
|
||||||
|
*
|
||||||
|
* @author MysteriousAges
|
||||||
|
*/
|
||||||
|
public interface IMagicApiaryAuraProvider {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests a mutation charge from the aura provider. If true is returned, the
|
||||||
|
* aura provider should decrement its internal charge by one. If there are no
|
||||||
|
* charges remaining, it should return false.
|
||||||
|
*
|
||||||
|
* @return True if a charge is given; false otherwise.
|
||||||
|
*/
|
||||||
|
boolean getMutationCharge();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests a mutation charge from the aura provider. If true is returned, the
|
||||||
|
* aura provider should decrement its internal charge by one. If there are no
|
||||||
|
* charges remaining, it should return false.
|
||||||
|
*
|
||||||
|
* @return True if a charge is given; false otherwise.
|
||||||
|
*/
|
||||||
|
boolean getDeathRateCharge();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests a mutation charge from the aura provider. If true is returned, the
|
||||||
|
* aura provider should decrement its internal charge by one. If there are no
|
||||||
|
* charges remaining, it should return false.
|
||||||
|
*
|
||||||
|
* @return True if a charge is given; false otherwise.
|
||||||
|
*/
|
||||||
|
boolean getProductionCharge();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests a mutation charge from the aura provider. If true is returned, the
|
||||||
|
* aura provider should decrement its internal charge by one. If there are no
|
||||||
|
* charges remaining, it should return false.
|
||||||
|
*
|
||||||
|
* @return True if a charge is given; false otherwise.
|
||||||
|
*/
|
||||||
|
boolean getCharge(IAuraChargeType auraChargeType);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package magicbees.api.bees;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages adding custom ITransmutationEffectLogic instances into the bee effect
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* @author MysteriousAges
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface ITransmutationEffectController
|
||||||
|
{
|
||||||
|
public void addEffectLogic(ITransmutationEffectLogic logic);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package magicbees.api.bees;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to control plugin logic for the Transmutation bee effect. Turns blocks
|
||||||
|
* into other blocks based on biome, time of day, or whatever is deemed
|
||||||
|
* appropriate at the time.
|
||||||
|
*
|
||||||
|
* @author MysteriousAges
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface ITransmutationEffectLogic
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Allows an external mod to add transmutation logic to the Transmuting bee effect.
|
||||||
|
* Called from a list of ITransmutationEffectLogic until one returns true. You can
|
||||||
|
* implement more than one transmutation effect in a single implementation of the
|
||||||
|
* interface. Function checks for a series of conditions based on block ID/meta, or
|
||||||
|
* biome information, or world information.
|
||||||
|
*
|
||||||
|
* @param world World object
|
||||||
|
* @param biome Biome information for current coordinates
|
||||||
|
* @param sourceBlock ItemStack representing the block at current coordinates
|
||||||
|
* @param x Current X coordinate to attempt a transmute
|
||||||
|
* @param y Current Y coordinate to attempt a transmute
|
||||||
|
* @param z Current Z coordinate to attempt a transmute
|
||||||
|
* @return true if a block was changed.
|
||||||
|
*/
|
||||||
|
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z);
|
||||||
|
}
|
||||||
@@ -0,0 +1,269 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||||
|
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||||
|
import magicbees.main.utils.compat.ThermalExpansionHelper;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||||
|
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||||
|
import forestry.api.genetics.AlleleManager;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IAlleleEffect;
|
||||||
|
import forestry.api.genetics.IAlleleFlowers;
|
||||||
|
import forestry.api.genetics.IAlleleRegistry;
|
||||||
|
|
||||||
|
public class Allele implements IAllele
|
||||||
|
{
|
||||||
|
public static AlleleFloat speedBlinding;
|
||||||
|
|
||||||
|
public static IAlleleBeeEffect forestryBaseEffect;
|
||||||
|
|
||||||
|
public static IAlleleFlowers flowerBookshelf;
|
||||||
|
public static IAlleleFlowers flowerThaumcraft;
|
||||||
|
public static IAlleleFlowers flowerArsMagica;
|
||||||
|
public static IAlleleFlowers flowerAuraNode;
|
||||||
|
|
||||||
|
public static IAlleleEffect effectCleansing;
|
||||||
|
public static IAlleleEffect effectDigSpeed;
|
||||||
|
public static IAlleleEffect effectMoveSpeed;
|
||||||
|
public static IAlleleEffect effectSlowSpeed;
|
||||||
|
public static IAlleleEffect effectWithering;
|
||||||
|
public static IAlleleEffect effectTransmuting;
|
||||||
|
public static IAlleleEffect effectCrumbling;
|
||||||
|
public static IAlleleEffect effectInvisibility;
|
||||||
|
|
||||||
|
public static IAlleleEffect spawnBrainyZombie;
|
||||||
|
public static IAlleleEffect spawnWisp;
|
||||||
|
public static IAlleleEffect spawnBats;
|
||||||
|
public static IAlleleEffect spawnGhast;
|
||||||
|
public static IAlleleEffect spawnSpider;
|
||||||
|
public static IAlleleEffect spawnBlaze;
|
||||||
|
public static IAlleleEffect spawnBlizz;
|
||||||
|
public static IAlleleEffect spawnManaDrainer;
|
||||||
|
public static IAlleleEffect spawnWispOrHecate;
|
||||||
|
|
||||||
|
/*public static IAlleleEffect effectNodeAttract;
|
||||||
|
public static IAlleleEffect effectNodePurify;
|
||||||
|
public static IAlleleEffect effectNodeFlux;
|
||||||
|
public static IAlleleEffect effectNodeCharge;*/
|
||||||
|
|
||||||
|
public static void setupAdditionalAlleles()
|
||||||
|
{
|
||||||
|
forestryBaseEffect = (IAlleleBeeEffect)getBaseAllele("effectNone");
|
||||||
|
|
||||||
|
Allele.speedBlinding = new AlleleFloat("speedBlinding", 2f, false);
|
||||||
|
|
||||||
|
Allele.flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
|
||||||
|
|
||||||
|
if (ThaumcraftHelper.isActive())
|
||||||
|
{
|
||||||
|
Allele.flowerThaumcraft = new AlleleFlower("ThaumcraftPlant", new FlowerProviderThaumcraftFlower(), false);
|
||||||
|
Allele.flowerAuraNode = new AlleleFlower("AuraNode", new FlowerProviderAuraNode(), true);
|
||||||
|
|
||||||
|
Allele.spawnBrainyZombie = new AlleleEffectSpawnMob("Brainy", false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID)
|
||||||
|
.setAggrosPlayerOnSpawn().setThrottle(800).setSpawnsOnPlayerNear(null).setMaxMobsInSpawnZone(2);
|
||||||
|
|
||||||
|
Allele.spawnBats = new AlleleEffectSpawnMob("Batty", false, ThaumcraftHelper.Entity.FIREBAT.entityID)
|
||||||
|
.setThrottle(300).setSpawnsOnPlayerNear("Bat");
|
||||||
|
|
||||||
|
Allele.spawnWisp = new AlleleEffectSpawnWisp("Wispy", false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive")
|
||||||
|
.setThrottle(1800).setChanceToSpawn(79);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ArsMagicaHelper.isActive())
|
||||||
|
{
|
||||||
|
Allele.flowerArsMagica = new AlleleFlower("flowerArsMagicaPlant", new FlowerProviderArsMagicaFlower(), false);
|
||||||
|
//String id, boolean isDominant, int throttle, String[] mobs, int[] chance
|
||||||
|
Allele.spawnManaDrainer = new AlleleEffectSpawnMobWeighted("ManaDrain", true, 20,
|
||||||
|
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
|
||||||
|
new int[] { 60, 2 });
|
||||||
|
|
||||||
|
Allele.spawnWispOrHecate = new AlleleEffectSpawnMobWeighted("AMWisp", true, 20,
|
||||||
|
new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" },
|
||||||
|
new int[] { 40, 3 });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Allele.flowerArsMagica = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||||
|
Allele.spawnManaDrainer = Allele.spawnWispOrHecate = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Allele.effectNodeAttract = new AlleleEffectAuraNodeAttract("NodeAttract", false, 400);
|
||||||
|
Allele.effectNodePurify = new AlleleEffectAuraNodePurify("NodePurify", false, 600, 150);
|
||||||
|
Allele.effectNodeFlux = new AlleleEffectAuraNodeFlux("NodeFlux", true, 300, 300);
|
||||||
|
Allele.effectNodeCharge = new AlleleEffectAuraNodeCharge("NodeCharge", true, 1200);*/
|
||||||
|
|
||||||
|
if (ThermalExpansionHelper.isActive())
|
||||||
|
{
|
||||||
|
Allele.spawnBlizz = new AlleleEffectSpawnMob("TEBlizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID)
|
||||||
|
.setThrottle(100).setChanceToSpawn(80);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Allele.spawnBlizz = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||||
|
}
|
||||||
|
|
||||||
|
Allele.effectCleansing = new AlleleEffectCure("Curative", false);
|
||||||
|
Allele.effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false);
|
||||||
|
Allele.effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
|
||||||
|
Allele.effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
|
||||||
|
Allele.effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
|
||||||
|
|
||||||
|
Allele.effectTransmuting = new AlleleEffectTransmuting("Transmuting", true);
|
||||||
|
Allele.effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
|
||||||
|
|
||||||
|
Allele.effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false);
|
||||||
|
|
||||||
|
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
|
||||||
|
.setThrottle(2060).setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
|
||||||
|
|
||||||
|
Allele.spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step")
|
||||||
|
.setThrottle(400).setChanceToSpawn(70).setMaxMobsInSpawnZone(4);
|
||||||
|
|
||||||
|
Allele.spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe")
|
||||||
|
.setThrottle(800).setChanceToSpawn(60).setMaxMobsInSpawnZone(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerDeprecatedAlleleReplacements()
|
||||||
|
{
|
||||||
|
IAlleleRegistry registry = AlleleManager.alleleRegistry;
|
||||||
|
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", Allele.getBaseAllele("fertilityHigh"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.flowerflowerBookshelf", flowerBookshelf);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speedBlinding", speedBlinding);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectCurative", effectCleansing);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectDigSpeed", effectDigSpeed);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectMoveSpeed", effectMoveSpeed);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectSlowSpeed", effectSlowSpeed);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.Ghast", spawnGhast);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.Spider", spawnSpider);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEsoteric", BeeSpecies.ESOTERIC);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMysterious", BeeSpecies.MYSTERIOUS);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArcane", BeeSpecies.ARCANE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCharmed", BeeSpecies.CHARMED);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEnchanted", BeeSpecies.ENCHANTED);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSupernatural", BeeSpecies.SUPERNATURAL);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPupil", BeeSpecies.PUPIL);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesScholarly", BeeSpecies.SCHOLARLY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSavant", BeeSpecies.SAVANT);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAware", BeeSpecies.AWARE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpirit", BeeSpecies.SPIRIT);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSoul", BeeSpecies.SOUL);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSkulking", BeeSpecies.SKULKING);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGhastly", BeeSpecies.GHASTLY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpidery", BeeSpecies.SPIDERY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTimely", BeeSpecies.TIMELY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLordly", BeeSpecies.LORDLY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDoctoral", BeeSpecies.DOCTORAL);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIron", BeeSpecies.IRON);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGold", BeeSpecies.GOLD);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCopper", BeeSpecies.COPPER);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTin", BeeSpecies.TIN);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSilver", BeeSpecies.SILVER);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLead", BeeSpecies.LEAD);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDiamond", BeeSpecies.DIAMOND);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEmerald", BeeSpecies.EMERALD);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesApatite", BeeSpecies.APATITE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStark", BeeSpecies.TC_CHAOS);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAura", BeeSpecies.TC_AIR);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIgnis", BeeSpecies.TC_FIRE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAqua", BeeSpecies.TC_WATER);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSolum", BeeSpecies.TC_EARTH);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPraecantatio", BeeSpecies.TC_ORDER);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVis", BeeSpecies.TC_VIS);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPure", BeeSpecies.TC_PURE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFlux", BeeSpecies.TC_TAINT);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesNode", BeeSpecies.TC_ATTRACT);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesRejuvenating", BeeSpecies.TC_REJUVENATING);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBrainy", BeeSpecies.TC_BRAINY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGossamer", BeeSpecies.TC_WISPY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWispy", BeeSpecies.TC_WISPY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBatty", BeeSpecies.TC_BATTY);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesChicken", BeeSpecies.TC_CHICKEN);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBeef", BeeSpecies.TC_BEEF);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPork", BeeSpecies.TC_PORK);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMinium", BeeSpecies.EE_MINIUM);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEssence", BeeSpecies.AM_ESSENCE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesQuintessence", BeeSpecies.AM_QUINTESSENCE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesErde", BeeSpecies.AM_EARTH);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLuft", BeeSpecies.AM_AIR);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFeuer", BeeSpecies.AM_FIRE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWasser", BeeSpecies.AM_WATER);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", BeeSpecies.AM_LIGHTNING);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStaude", BeeSpecies.AM_PLANT);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEis", BeeSpecies.AM_ICE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("magicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArkanen", BeeSpecies.AM_ARCANE);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVortex", BeeSpecies.AM_VORTEX);
|
||||||
|
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWight", BeeSpecies.AM_WIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IAlleleBeeSpecies getBaseSpecies(String name)
|
||||||
|
{
|
||||||
|
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IAlleleBeeSpecies getExtraSpecies(String name)
|
||||||
|
{
|
||||||
|
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IAllele getBaseAllele(String name)
|
||||||
|
{
|
||||||
|
return AlleleManager.alleleRegistry.getAllele("forestry." + name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IAllele getAllele(String name)
|
||||||
|
{
|
||||||
|
return AlleleManager.alleleRegistry.getAllele(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String uid;
|
||||||
|
private boolean dominant;
|
||||||
|
|
||||||
|
public Allele(String id, boolean isDominant)
|
||||||
|
{
|
||||||
|
this.uid = "magicbees." + id;
|
||||||
|
this.dominant = isDominant;
|
||||||
|
AlleleManager.alleleRegistry.registerAllele(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUID()
|
||||||
|
{
|
||||||
|
return this.uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isDominant()
|
||||||
|
{
|
||||||
|
return this.dominant;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString(getUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName()
|
||||||
|
{
|
||||||
|
return this.uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+26
-35
@@ -1,12 +1,10 @@
|
|||||||
package thaumicbees.bees.genetics;
|
package magicbees.bees;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import thaumicbees.main.ThaumicBees;
|
|
||||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||||
import forestry.api.apiculture.IBeeGenome;
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
import forestry.api.apiculture.IBeeHousing;
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
@@ -14,12 +12,12 @@ import forestry.api.genetics.IEffectData;
|
|||||||
|
|
||||||
public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
||||||
{
|
{
|
||||||
protected String readableName;
|
protected int throttle;
|
||||||
|
|
||||||
public AlleleEffect(String id, boolean isDominant, String identifier)
|
public AlleleEffect(String id, boolean isDominant, int timeout)
|
||||||
{
|
{
|
||||||
super(id, isDominant);
|
super("effect" + id, isDominant);
|
||||||
this.readableName = identifier;
|
this.throttle = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -32,39 +30,32 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
|||||||
public abstract IEffectData validateStorage(IEffectData storedData);
|
public abstract IEffectData validateStorage(IEffectData storedData);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getIdentifier()
|
public final IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
{
|
{
|
||||||
return this.readableName;
|
int count = storedData.getInteger(0);
|
||||||
|
if (count >= this.throttle)
|
||||||
|
{
|
||||||
|
storedData = this.doEffectThrottled(genome, storedData, housing);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
storedData.setInteger(0, count + 1);
|
||||||
|
}
|
||||||
|
return storedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public abstract IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
* @param genome
|
||||||
|
* @param storedData
|
||||||
|
* @param housing
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected abstract IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
{
|
{
|
||||||
int[] area = genome.getTerritory();
|
return Allele.forestryBaseEffect.doFX(genome, storedData, housing);
|
||||||
float mod = housing.getTerritoryModifier(genome);
|
|
||||||
// Check to make sure territory is at least 1 with housing modifications
|
|
||||||
area[0] = Math.max((int)(area[0] * mod), 1);
|
|
||||||
area[1] = Math.max((int)(area[1] * mod), 1);
|
|
||||||
area[2] = Math.max((int)(area[2] * mod), 1);
|
|
||||||
|
|
||||||
ThaumicBees.proxy.drawBeeEffects(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(),
|
|
||||||
genome.getPrimaryAsBee().getPrimaryColor(), area[0], area[1], area[2]);
|
|
||||||
return storedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getIconTextureFile()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getIconIndex()
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing)
|
protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing)
|
||||||
@@ -84,7 +75,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
|||||||
min[2] = housing.getZCoord() - area[2] / 2;
|
min[2] = housing.getZCoord() - area[2] / 2;
|
||||||
max[2] = housing.getZCoord() + area[2] / 2;
|
max[2] = housing.getZCoord() + area[2] / 2;
|
||||||
|
|
||||||
AxisAlignedBB bounds = AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(min[0], min[1], min[2], max[0], max[1], max[2]);
|
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
|
||||||
return housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds);
|
return housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
|
||||||
|
public class AlleleEffectCrumbling extends AlleleEffect
|
||||||
|
{
|
||||||
|
private static HashMap<ItemStack, ItemStack> crumbleMap = new HashMap<ItemStack, ItemStack>();
|
||||||
|
|
||||||
|
public static void addPairToMap(ItemStack source, ItemStack target)
|
||||||
|
{
|
||||||
|
boolean add = true;
|
||||||
|
for (ItemStack i : crumbleMap.keySet())
|
||||||
|
{
|
||||||
|
if (OreDictionary.itemMatches(i, source, false))
|
||||||
|
{
|
||||||
|
add = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (add)
|
||||||
|
{
|
||||||
|
crumbleMap.put(source, target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlleleEffectCrumbling(String id, boolean isDominant)
|
||||||
|
{
|
||||||
|
super(id, isDominant, 600);
|
||||||
|
|
||||||
|
addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
|
||||||
|
addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone));
|
||||||
|
addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2));
|
||||||
|
addPairToMap(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stonebrick, 1, 1));
|
||||||
|
addPairToMap(new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall, 1, 1));
|
||||||
|
addPairToMap(new ItemStack(Blocks.gravel), new ItemStack(Blocks.sand));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData validateStorage(IEffectData storedData)
|
||||||
|
{
|
||||||
|
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||||
|
{
|
||||||
|
storedData = new magicbees.bees.EffectData(1, 0, 0);
|
||||||
|
}
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
World world = housing.getWorld();
|
||||||
|
// Get random coords within territory
|
||||||
|
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||||
|
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||||
|
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||||
|
|
||||||
|
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||||
|
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||||
|
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||||
|
|
||||||
|
Block block = world.getBlock(xCoord, yCoord, zCoord);
|
||||||
|
if (block != null)
|
||||||
|
{
|
||||||
|
ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord));
|
||||||
|
for (ItemStack key : crumbleMap.keySet())
|
||||||
|
{
|
||||||
|
if (OreDictionary.itemMatches(source, key, false))
|
||||||
|
{
|
||||||
|
ItemStack target = crumbleMap.get(key);
|
||||||
|
world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()),
|
||||||
|
target.getItemDamage(), 2);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
storedData.setInteger(0, 0);
|
||||||
|
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
|
||||||
|
public class AlleleEffectCure extends AlleleEffect
|
||||||
|
{
|
||||||
|
|
||||||
|
public AlleleEffectCure(String id, boolean isDominant)
|
||||||
|
{
|
||||||
|
super(id, isDominant, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData validateStorage(IEffectData storedData)
|
||||||
|
{
|
||||||
|
if (storedData == null)
|
||||||
|
{
|
||||||
|
storedData = new EffectData(1, 0, 0);
|
||||||
|
}
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
||||||
|
|
||||||
|
for (Entity e : entityList)
|
||||||
|
{
|
||||||
|
if (e instanceof EntityPlayer)
|
||||||
|
{
|
||||||
|
EntityPlayer player = (EntityPlayer)e;
|
||||||
|
player.curePotionEffects(new ItemStack(Items.milk_bucket));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storedData.setInteger(0, 0);
|
||||||
|
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import magicbees.item.ItemArmorApiarist;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
|
||||||
|
public class AlleleEffectPotion extends AlleleEffect
|
||||||
|
{
|
||||||
|
private int potionId;
|
||||||
|
private int duration;
|
||||||
|
private boolean isMalicious;
|
||||||
|
|
||||||
|
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant)
|
||||||
|
{
|
||||||
|
super(name, isDominant, 200);
|
||||||
|
this.potionId = potionApplied.id;
|
||||||
|
this.duration = 20 * effectDuration;
|
||||||
|
this.isMalicious = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlleleEffectPotion setMalicious()
|
||||||
|
{
|
||||||
|
this.isMalicious = true;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData validateStorage(IEffectData storedData)
|
||||||
|
{
|
||||||
|
if (storedData == null)
|
||||||
|
{
|
||||||
|
storedData = new EffectData(1, 0, 0);
|
||||||
|
}
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
||||||
|
|
||||||
|
for (Entity e : entityList)
|
||||||
|
{
|
||||||
|
if (e instanceof EntityPlayer)
|
||||||
|
{
|
||||||
|
EntityPlayer player = (EntityPlayer)e;
|
||||||
|
if (this.isMalicious)
|
||||||
|
{
|
||||||
|
int armorPieces = ItemArmorApiarist.getNumberPiecesWorn(player);
|
||||||
|
int finalDuration = this.duration / 4 * (4 - armorPieces);
|
||||||
|
if (finalDuration > 0)
|
||||||
|
{
|
||||||
|
player.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storedData.setInteger(0, 0);
|
||||||
|
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
}
|
||||||
+37
-38
@@ -1,16 +1,14 @@
|
|||||||
package thaumicbees.bees.genetics;
|
package magicbees.bees;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import thaumicbees.item.ItemArmorApiarist;
|
import magicbees.item.ItemArmorApiarist;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityList;
|
import net.minecraft.entity.EntityList;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
|
||||||
import forestry.api.apiculture.IBeeGenome;
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
import forestry.api.apiculture.IBeeHousing;
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
import forestry.api.genetics.IEffectData;
|
import forestry.api.genetics.IEffectData;
|
||||||
@@ -21,24 +19,29 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
|||||||
protected boolean spawnsWhilePlayerNear;
|
protected boolean spawnsWhilePlayerNear;
|
||||||
protected String alternateMob;
|
protected String alternateMob;
|
||||||
protected String mobName;
|
protected String mobName;
|
||||||
protected int throttle;
|
protected String mobSound;
|
||||||
protected int chanceToSpawn;
|
protected int chanceToSpawn;
|
||||||
protected int maxMobsInArea;
|
protected int maxMobsInArea;
|
||||||
|
|
||||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String identifier, String mobToSpawn)
|
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn)
|
||||||
{
|
{
|
||||||
super(id, isDominant, identifier);
|
this(id, isDominant, mobToSpawn, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx)
|
||||||
|
{
|
||||||
|
super(id, isDominant, 200);
|
||||||
this.aggosOnPlayer = false;
|
this.aggosOnPlayer = false;
|
||||||
this.mobName = mobToSpawn;
|
this.mobName = mobToSpawn;
|
||||||
this.throttle = 200;
|
|
||||||
this.chanceToSpawn = 100;
|
this.chanceToSpawn = 100;
|
||||||
this.maxMobsInArea = 6;
|
this.maxMobsInArea = 6;
|
||||||
|
this.mobSound = mobSoundFx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEffectData validateStorage(IEffectData storedData)
|
public IEffectData validateStorage(IEffectData storedData)
|
||||||
{
|
{
|
||||||
if (storedData == null)
|
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||||
{
|
{
|
||||||
// Throttle; Ready to spawn
|
// Throttle; Ready to spawn
|
||||||
storedData = new EffectData(1, 1, 0);
|
storedData = new EffectData(1, 1, 0);
|
||||||
@@ -47,20 +50,8 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
{
|
{
|
||||||
int count = storedData.getInteger(0);
|
|
||||||
|
|
||||||
if (count >= this.throttle && !storedData.getBoolean(0))
|
|
||||||
{
|
|
||||||
storedData.setBoolean(0, true);
|
|
||||||
storedData.setInteger(0, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
storedData.setInteger(0, count + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we're ready to spawn the mob.
|
// Check if we're ready to spawn the mob.
|
||||||
if (storedData.getBoolean(0))
|
if (storedData.getBoolean(0))
|
||||||
{
|
{
|
||||||
@@ -109,6 +100,17 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (this.mobSound != null && w.rand.nextInt(100) < 35)
|
||||||
|
{
|
||||||
|
int range = genome.getTerritory()[0];
|
||||||
|
double x = housing.getXCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||||
|
range = genome.getTerritory()[1];
|
||||||
|
double y = housing.getYCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||||
|
range = genome.getTerritory()[2];
|
||||||
|
double z = housing.getZCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||||
|
w.playSoundEffect(x, y, z, this.mobSound, 0.5f,
|
||||||
|
(w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
|
||||||
|
}
|
||||||
storedData.setBoolean(0, true);
|
storedData.setBoolean(0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,35 +126,32 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
|||||||
EntityLiving mob;
|
EntityLiving mob;
|
||||||
if (spawnAlternate && this.alternateMob != null)
|
if (spawnAlternate && this.alternateMob != null)
|
||||||
{
|
{
|
||||||
mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world);
|
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world);
|
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mob != null)
|
if (mob != null)
|
||||||
{
|
{
|
||||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||||
|
|
||||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||||
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
||||||
.expand(8.0D, 4.0D, 8.0D)).size();
|
.expand(8.0D, 4.0D, 8.0D)).size();
|
||||||
|
|
||||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||||
|
|
||||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
|
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
|
||||||
{
|
{
|
||||||
if (mob.getCanSpawnHere())
|
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||||
|
if (this.aggosOnPlayer && player != null)
|
||||||
{
|
{
|
||||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
|
||||||
if (this.aggosOnPlayer && player != null)
|
|
||||||
{
|
{
|
||||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
|
// Protect fully suited player from initial murder intent.
|
||||||
{
|
mob.setAttackTarget(player);
|
||||||
// Protect fully suited player from initial murder intent.
|
|
||||||
mob.setAttackTarget(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,9 +199,9 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
|||||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
||||||
{
|
{
|
||||||
double pos[] = new double[3];
|
double pos[] = new double[3];
|
||||||
pos[0] = housing.getXCoord() + (world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee)) - bee.getTerritory()[0] / 2);
|
pos[0] = housing.getXCoord() + (world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2);
|
||||||
pos[1] = housing.getYCoord() + world.rand.nextInt(3) - 1;
|
pos[1] = housing.getYCoord() + world.rand.nextInt(3) - 1;
|
||||||
pos[2] = housing.getZCoord() + (world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee)) - bee.getTerritory()[2] / 2);
|
pos[2] = housing.getZCoord() + (world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2);
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
|
||||||
|
public class AlleleEffectSpawnMobWeighted extends AlleleEffect
|
||||||
|
{
|
||||||
|
private String[] entityNames;
|
||||||
|
private int[] spawnChance;
|
||||||
|
|
||||||
|
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance)
|
||||||
|
{
|
||||||
|
super(id, isDominant, throttle);
|
||||||
|
if (mobs.length != chance.length)
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("Array lengths must be equal!");
|
||||||
|
}
|
||||||
|
this.entityNames = mobs;
|
||||||
|
this.spawnChance = chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData validateStorage(IEffectData storedData)
|
||||||
|
{
|
||||||
|
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||||
|
{
|
||||||
|
storedData = new EffectData(1, 0, 0);
|
||||||
|
}
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
if (this.spawnMob(genome, housing))
|
||||||
|
{
|
||||||
|
storedData.setInteger(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
|
||||||
|
World w = housing.getWorld();
|
||||||
|
int roll = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < this.spawnChance.length && !flag; ++i)
|
||||||
|
{
|
||||||
|
roll = 100 - w.rand.nextInt(100) + 1;
|
||||||
|
if (roll < this.spawnChance[i])
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
|
||||||
|
double[] coords = this.randomMobSpawnCoords(w, genome, housing);
|
||||||
|
|
||||||
|
mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f);
|
||||||
|
if (mob instanceof EntityLiving)
|
||||||
|
{
|
||||||
|
if (((EntityLiving)mob).getCanSpawnHere())
|
||||||
|
{
|
||||||
|
w.spawnEntityInWorld(mob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
w.spawnEntityInWorld(mob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
double pos[] = new double[3];
|
||||||
|
pos[0] = housing.getXCoord() + world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2;
|
||||||
|
pos[1] = housing.getYCoord() + world.rand.nextDouble() * (bee.getTerritory()[1] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2;
|
||||||
|
pos[2] = housing.getZCoord() + world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2;
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+13
-20
@@ -1,29 +1,25 @@
|
|||||||
package thaumicbees.bees.genetics;
|
package magicbees.bees;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLLog;
|
import magicbees.item.ItemArmorApiarist;
|
||||||
|
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||||
import thaumicbees.item.ItemArmorApiarist;
|
|
||||||
import thaumicbees.thaumcraft.TCEntity;
|
|
||||||
|
|
||||||
import forestry.api.apiculture.IBeeGenome;
|
|
||||||
import forestry.api.apiculture.IBeeHousing;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityList;
|
import net.minecraft.entity.EntityList;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
|
||||||
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
|
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
|
||||||
{
|
{
|
||||||
|
|
||||||
private byte[] wispTypes = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
|
private byte[] wispTypes = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
|
||||||
|
|
||||||
public AlleleEffectSpawnWisp(String id, boolean isDominant, String identifier, String mobToSpawn)
|
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay)
|
||||||
{
|
{
|
||||||
super(id, isDominant, identifier, mobToSpawn);
|
super(id, isDominant, mobToSpawn, soundToPlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -34,16 +30,16 @@ public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
|
|||||||
EntityLiving mob;
|
EntityLiving mob;
|
||||||
if (spawnAlternate && this.alternateMob != null)
|
if (spawnAlternate && this.alternateMob != null)
|
||||||
{
|
{
|
||||||
mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world);
|
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world);
|
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mob != null)
|
if (mob != null)
|
||||||
{
|
{
|
||||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||||
|
|
||||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||||
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
||||||
@@ -56,15 +52,12 @@ public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
|
|||||||
// Try some Reflection on TC code. This could be dangerous.
|
// Try some Reflection on TC code. This could be dangerous.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class wispEntity = Class.forName(TCEntity.WISP.getClassName());
|
Class wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
|
||||||
Field type = wispEntity.getDeclaredField("type");
|
Field type = wispEntity.getDeclaredField("type");
|
||||||
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
|
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{ /*Last time I had a request to post error messages, I regretted it.*/ }
|
||||||
FMLLog.info("ThaumicBees is using an invalid classname: " + TCEntity.WISP.getClassName()
|
|
||||||
+ " Please report this error in the thread if you see it.", (Object[])null);
|
|
||||||
}
|
|
||||||
|
|
||||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||||
if (this.aggosOnPlayer && player != null)
|
if (this.aggosOnPlayer && player != null)
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
|
||||||
|
public class AlleleEffectTransmuting extends AlleleEffect
|
||||||
|
{
|
||||||
|
public AlleleEffectTransmuting(String id, boolean isDominant)
|
||||||
|
{
|
||||||
|
super(id, isDominant, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IEffectData validateStorage(IEffectData storedData)
|
||||||
|
{
|
||||||
|
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||||
|
{
|
||||||
|
storedData = new magicbees.bees.EffectData(1, 0, 0);
|
||||||
|
}
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||||
|
{
|
||||||
|
World world = housing.getWorld();
|
||||||
|
// Get random coords within territory
|
||||||
|
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||||
|
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||||
|
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||||
|
|
||||||
|
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||||
|
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||||
|
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||||
|
|
||||||
|
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||||
|
TransmutationEffectController.instance.attemptTransmutations(world, biome,
|
||||||
|
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)),
|
||||||
|
xCoord, yCoord, zCoord);
|
||||||
|
|
||||||
|
storedData.setInteger(0, 0);
|
||||||
|
|
||||||
|
return storedData;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import forestry.api.genetics.IAlleleFloat;
|
||||||
|
|
||||||
|
public class AlleleFloat extends Allele implements IAlleleFloat
|
||||||
|
{
|
||||||
|
private float value;
|
||||||
|
|
||||||
|
public AlleleFloat(String id, float val, boolean isDominant)
|
||||||
|
{
|
||||||
|
super(id, isDominant);
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getValue()
|
||||||
|
{
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package thaumicbees.bees.genetics;
|
package magicbees.bees;
|
||||||
|
|
||||||
import forestry.api.apiculture.IAlleleFlowers;
|
|
||||||
import forestry.api.apiculture.IFlowerProvider;
|
|
||||||
import forestry.api.genetics.AlleleManager;
|
import forestry.api.genetics.AlleleManager;
|
||||||
|
import forestry.api.genetics.IAlleleFlowers;
|
||||||
|
import forestry.api.genetics.IFlowerProvider;
|
||||||
|
|
||||||
public class AlleleFlower extends Allele implements IAlleleFlowers
|
public class AlleleFlower extends Allele implements IAlleleFlowers
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package thaumicbees.bees.genetics;
|
package magicbees.bees;
|
||||||
|
|
||||||
import forestry.api.genetics.IAlleleInteger;
|
import forestry.api.genetics.IAlleleInteger;
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import magicbees.api.bees.IAuraChargeType;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
|
||||||
|
public enum AuraChargeType implements IAuraChargeType {
|
||||||
|
MUTATION(Aspect.WATER, 850, 11),
|
||||||
|
DEATH(Aspect.ENTROPY, 400, 5),
|
||||||
|
PRODUCTION(Aspect.AIR, 300, 3);
|
||||||
|
|
||||||
|
public final int duration;
|
||||||
|
public final Aspect aspect;
|
||||||
|
/** The number of ticks to count between draining vis from the environment **/
|
||||||
|
public final int tickRate;
|
||||||
|
public final int flag = 1 << ordinal();
|
||||||
|
|
||||||
|
AuraChargeType(Aspect aspect, int duration, int tickRate) {
|
||||||
|
this.aspect = aspect;
|
||||||
|
this.duration = duration;
|
||||||
|
this.tickRate = tickRate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import forestry.api.genetics.AlleleManager;
|
||||||
|
import forestry.api.genetics.IAlleleSpecies;
|
||||||
|
import forestry.api.genetics.IClassification;
|
||||||
|
|
||||||
|
public enum BeeClassification implements IClassification
|
||||||
|
{
|
||||||
|
VEILED("Veiled", "Velatapis"),
|
||||||
|
ARCANE("Arcane", "Arcanapis"),
|
||||||
|
SUPERNATURAL("Supernatural", "Occultapis"),
|
||||||
|
SCHOLARLY("Scholarly", "Doctapis"),
|
||||||
|
SKULKING("Skulking", "Malevolenapis"),
|
||||||
|
MAGICAL("Magic", "Magicapis"),
|
||||||
|
TIME("Time", "Tempestivapis"),
|
||||||
|
SOUL("Soul", "Animapis"),
|
||||||
|
|
||||||
|
ABOMINABLE("Abominable", "Detestabilapis"),
|
||||||
|
EXTRINSIC("Extrinsic", "Extrarapis"),
|
||||||
|
|
||||||
|
METALLIC("Metallic", "Metalliapis"),
|
||||||
|
GEM("Gem", "Lapidapis"),
|
||||||
|
TRANSMUTING("Transmuting", "Transmutapis"),
|
||||||
|
|
||||||
|
THAUMIC("Thaumic", "Thaumiapis"),
|
||||||
|
FLESHY("Fleshy", "Carnosapis"),
|
||||||
|
|
||||||
|
ALCHEMICAL("Alchemical", "Alchimiapis"),
|
||||||
|
|
||||||
|
ESSENTIAL("Essential", "Essentiapis"),
|
||||||
|
|
||||||
|
THERMAL("Thermal", "Thermametallic"),
|
||||||
|
ADORABLE("Adorable", "Amabilis"),
|
||||||
|
|
||||||
|
BLOODY("Bloody", "Sanguis"),
|
||||||
|
|
||||||
|
BOTANICAL("Botanical", "Botanica"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private String uID;
|
||||||
|
private String latin;
|
||||||
|
private ArrayList<IAlleleSpecies> species;
|
||||||
|
private IClassification parent;
|
||||||
|
private EnumClassLevel level;
|
||||||
|
|
||||||
|
private BeeClassification(String name, String scientific)
|
||||||
|
{
|
||||||
|
this.uID = "classification." + name.toLowerCase();
|
||||||
|
this.latin = scientific;
|
||||||
|
this.level = EnumClassLevel.GENUS;
|
||||||
|
this.species = new ArrayList();
|
||||||
|
this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||||
|
AlleleManager.alleleRegistry.registerClassification(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumClassLevel getLevel()
|
||||||
|
{
|
||||||
|
return this.level;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUID()
|
||||||
|
{
|
||||||
|
return this.uID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString(getUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getScientific()
|
||||||
|
{
|
||||||
|
return this.latin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString(getUID() + ".description");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IClassification[] getMemberGroups()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addMemberGroup(IClassification group)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IAlleleSpecies[] getMemberSpecies()
|
||||||
|
{
|
||||||
|
return this.species.toArray(new IAlleleSpecies[this.species.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addMemberSpecies(IAlleleSpecies species)
|
||||||
|
{
|
||||||
|
if (!this.species.contains(species))
|
||||||
|
{
|
||||||
|
this.species.add(species);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IClassification getParent()
|
||||||
|
{
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setParent(IClassification parent)
|
||||||
|
{
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,84 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import magicbees.block.types.HiveType;
|
||||||
|
import magicbees.item.types.DropType;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.Tuple;
|
||||||
|
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||||
|
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||||
|
import forestry.api.apiculture.IBeeRoot;
|
||||||
|
import forestry.api.genetics.AlleleManager;
|
||||||
|
|
||||||
|
public class BeeManager
|
||||||
|
{
|
||||||
|
public static IBeeRoot beeRoot;
|
||||||
|
|
||||||
|
private static List<Tuple<IAlleleBeeSpecies, Double>> worldgenSpeciesWeights = new ArrayList<Tuple<IAlleleBeeSpecies, Double>>();
|
||||||
|
private static double worldgenSpeciesWeightsTotal = 0;
|
||||||
|
|
||||||
|
public static void ititializeBees()
|
||||||
|
{
|
||||||
|
beeRoot = (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
|
||||||
|
|
||||||
|
Allele.setupAdditionalAlleles();
|
||||||
|
BeeSpecies.setupBeeSpecies();
|
||||||
|
Allele.registerDeprecatedAlleleReplacements();
|
||||||
|
BeeMutation.setupMutations();
|
||||||
|
|
||||||
|
HiveType.initHiveData();
|
||||||
|
|
||||||
|
beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) {
|
||||||
|
Collections.shuffle(worldgenSpeciesWeights);
|
||||||
|
double value = r.nextDouble() * worldgenSpeciesWeightsTotal;
|
||||||
|
IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest");
|
||||||
|
|
||||||
|
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
|
||||||
|
value -= t.right.doubleValue();
|
||||||
|
if (value <= 0.0) {
|
||||||
|
species = t.left;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return species;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addWorldgenSpeciesWeight(IAlleleBeeSpecies species, double d) {
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(species, d));
|
||||||
|
worldgenSpeciesWeightsTotal += d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void populateSpeciesListRarity() {
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Forest"), 20.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Meadows"), 20.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Tropical"), 10.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Modest"), 16.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Wintry"), 10.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Ended"), 0.5));
|
||||||
|
|
||||||
|
if (ExtraBeesHelper.isActive()) {
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Water"), 12.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rocky"), 16.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Embittered"), 10.0));
|
||||||
|
}
|
||||||
|
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL, 20.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL, 20.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS, 13.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED, 6.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL, 10.0));
|
||||||
|
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION, 1.0));
|
||||||
|
|
||||||
|
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
|
||||||
|
worldgenSpeciesWeightsTotal += t.right.doubleValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,600 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import magicbees.main.utils.LogHelper;
|
||||||
|
import magicbees.main.utils.MoonPhase;
|
||||||
|
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||||
|
import magicbees.main.utils.compat.EquivalentExchangeHelper;
|
||||||
|
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||||
|
import magicbees.main.utils.compat.ForestryHelper;
|
||||||
|
import magicbees.main.utils.compat.RedstoneArsenalHelper;
|
||||||
|
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||||
|
import magicbees.main.utils.compat.ThermalExpansionHelper;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.common.BiomeDictionary;
|
||||||
|
import net.minecraftforge.common.BiomeDictionary.Type;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||||
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
|
import forestry.api.apiculture.IBeeMutation;
|
||||||
|
import forestry.api.apiculture.IBeeRoot;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IGenome;
|
||||||
|
|
||||||
|
public class BeeMutation implements IBeeMutation
|
||||||
|
{
|
||||||
|
public static void setupMutations()
|
||||||
|
{
|
||||||
|
IAlleleBeeSpecies baseA, baseB;
|
||||||
|
BeeMutation mutation;
|
||||||
|
|
||||||
|
// Forestry + These -> Common
|
||||||
|
|
||||||
|
BeeSpecies[] magicMundane = new BeeSpecies[] { BeeSpecies.MYSTICAL, BeeSpecies.SORCEROUS, BeeSpecies.UNUSUAL, BeeSpecies.ATTUNED };
|
||||||
|
String[] forestryMundane = new String[] { "Forest", "Meadows", "Modest", "Wintry", "Tropical", "Marshy" };
|
||||||
|
String[] binnieMundane = new String[] { "marble", "rock", "water", "basalt" };
|
||||||
|
|
||||||
|
for (BeeSpecies species : magicMundane)
|
||||||
|
{
|
||||||
|
for (String str : forestryMundane)
|
||||||
|
{
|
||||||
|
new BeeMutation(species, Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||||
|
}
|
||||||
|
if (ExtraBeesHelper.isActive())
|
||||||
|
{
|
||||||
|
for (String str : binnieMundane)
|
||||||
|
{
|
||||||
|
LogHelper.info("Registering " + str);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
new BeeMutation(species, Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LogHelper.info("Unable to register! This mutation will not be available.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new BeeMutation(species, Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12);
|
||||||
|
new BeeMutation(species, Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, 10);
|
||||||
|
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, 8);
|
||||||
|
new BeeMutation(BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, BeeSpecies.ARCANE, 8)
|
||||||
|
.setMoonPhaseBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f);
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, 10);
|
||||||
|
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, 8);
|
||||||
|
new BeeMutation(BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, BeeSpecies.SUPERNATURAL, 8)
|
||||||
|
.setMoonPhaseBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 1.2f);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, 7);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WINDY, 14)
|
||||||
|
.setBlockRequired(Blocks.leaves);
|
||||||
|
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WATERY, 14)
|
||||||
|
.setBlockRequired(Blocks.water);
|
||||||
|
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.EARTHY, 100)//14)
|
||||||
|
.setBlockRequired(Blocks.brick_block);
|
||||||
|
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.FIREY, 14)
|
||||||
|
.setBlockRequired(Blocks.lava);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ATTUNED, BeeSpecies.AWARE, 10);
|
||||||
|
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
|
||||||
|
new BeeMutation(BeeSpecies.ATTUNED, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
|
||||||
|
new BeeMutation(BeeSpecies.AWARE, BeeSpecies.SPIRIT, BeeSpecies.SOUL, 7);
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE, BeeSpecies.PUPIL, 10);
|
||||||
|
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, 8);
|
||||||
|
new BeeMutation(BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, BeeSpecies.SAVANT, 6);
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL, BeeSpecies.TIMELY, 8);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY, BeeSpecies.LORDLY, 8);
|
||||||
|
new BeeMutation(BeeSpecies.TIMELY, BeeSpecies.LORDLY, BeeSpecies.DOCTORAL, 7);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.ELDRITCH, BeeSpecies.HATEFUL, 9)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||||
|
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.HATEFUL, BeeSpecies.SPITEFUL, 7)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Demonic"), BeeSpecies.SPITEFUL, BeeSpecies.WITHERING, 6)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH, BeeSpecies.SKULKING, 12);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Tropical"), BeeSpecies.SKULKING, BeeSpecies.SPIDERY, 10);
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, 9);
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.HATEFUL, BeeSpecies.SMOULDERING, 7)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, 10);
|
||||||
|
new BeeMutation(BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, 8);
|
||||||
|
new BeeMutation(BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, BeeSpecies.FORLORN, 6);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED, BeeSpecies.DRACONIC, 6)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.END);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.ELDRITCH, BeeSpecies.MUTABLE, 12);
|
||||||
|
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.TRANSMUTING, 9);
|
||||||
|
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.CRUMBLING, 9);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.MYSTICAL, BeeSpecies.MUTABLE, BeeSpecies.INVISIBLE, 15);
|
||||||
|
|
||||||
|
if (BeeSpecies.COPPER.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER, 12)
|
||||||
|
.setBlockRequired("blockCopper");
|
||||||
|
}
|
||||||
|
if (BeeSpecies.TIN.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN, 12)
|
||||||
|
.setBlockRequired("blockTin");
|
||||||
|
}
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON, 12)
|
||||||
|
.setBlockRequired(Blocks.iron_block);
|
||||||
|
if (BeeSpecies.LEAD.isActive())
|
||||||
|
{
|
||||||
|
baseA = (BeeSpecies.TIN.isActive()) ? BeeSpecies.TIN : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER : BeeSpecies.IRON;
|
||||||
|
mutation = new BeeMutation(baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD, 10);
|
||||||
|
if (OreDictionary.getOres("blockLead").size() > 0)
|
||||||
|
{
|
||||||
|
mutation.setBlockRequired("blockLead");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (BeeSpecies.SILVER.isActive())
|
||||||
|
{
|
||||||
|
mutation = new BeeMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER, 8);
|
||||||
|
if (OreDictionary.getOres("blockSilver").size() > 0)
|
||||||
|
{
|
||||||
|
mutation.setBlockRequired("blockSilver");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
baseA = (BeeSpecies.EE_MINIUM.isActive()) ? BeeSpecies.EE_MINIUM : Allele.getBaseSpecies("Imperial");
|
||||||
|
baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD : BeeSpecies.IRON;
|
||||||
|
new BeeMutation(baseA, baseB, BeeSpecies.GOLD, 8)
|
||||||
|
.setBlockRequired(Blocks.gold_block);
|
||||||
|
|
||||||
|
if (BeeSpecies.ALUMINUM.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM, 10)
|
||||||
|
.setBlockRequired("blockAluminum");
|
||||||
|
}
|
||||||
|
if (BeeSpecies.ARDITE.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Industrious"), BeeSpecies.INFERNAL, BeeSpecies.ARDITE, 9)
|
||||||
|
.setBlockRequired("blockArdite");
|
||||||
|
}
|
||||||
|
if (BeeSpecies.COBALT.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL, BeeSpecies.COBALT, 9)
|
||||||
|
.setBlockRequired("blockCobalt");
|
||||||
|
}
|
||||||
|
if (BeeSpecies.MANYULLYN.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(BeeSpecies.ARDITE, BeeSpecies.COBALT, BeeSpecies.MANYULLYN, 9)
|
||||||
|
.setBlockRequired("blockManyullyn");
|
||||||
|
}
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Austere"), BeeSpecies.GOLD, BeeSpecies.DIAMOND, 7)
|
||||||
|
.setBlockRequired(Blocks.diamond_block);
|
||||||
|
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER : Allele.getBaseSpecies("Imperial");
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD, 6)
|
||||||
|
.setBlockRequired(Blocks.emerald_block);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Rural"), BeeSpecies.COPPER, BeeSpecies.APATITE, 12)
|
||||||
|
.setBlockRequired("blockApatite");
|
||||||
|
|
||||||
|
if (ThaumcraftHelper.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.WINDY, BeeSpecies.TC_AIR, 8)
|
||||||
|
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.AIR.ordinal());
|
||||||
|
new BeeMutation(BeeSpecies.FIREY, BeeSpecies.FIREY, BeeSpecies.TC_FIRE, 8)
|
||||||
|
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.FIRE.ordinal());
|
||||||
|
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.WATERY, BeeSpecies.TC_WATER, 8)
|
||||||
|
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.WATER.ordinal());
|
||||||
|
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.EARTHY, BeeSpecies.TC_EARTH, 8)
|
||||||
|
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.EARTH.ordinal());
|
||||||
|
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ARCANE, BeeSpecies.TC_ORDER, 8)
|
||||||
|
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.ORDER.ordinal());
|
||||||
|
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.SUPERNATURAL, BeeSpecies.TC_CHAOS, 8)
|
||||||
|
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.CHAOS.ordinal());
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.WINDY, BeeSpecies.TC_BATTY, 9);
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.PUPIL, BeeSpecies.TC_BRAINY, 9);
|
||||||
|
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, BeeSpecies.TC_WISPY, 9)
|
||||||
|
.setMoonPhaseRestricted(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT);
|
||||||
|
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_CHICKEN, 12)
|
||||||
|
.setBiomeRequired(Type.FOREST);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_BEEF, 12)
|
||||||
|
.setBiomeRequired(Type.PLAINS);
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_PORK, 12)
|
||||||
|
.setBiomeRequired(Type.MOUNTAIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ArsMagicaHelper.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ESSENCE, 10);
|
||||||
|
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_QUINTESSENCE, 7);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WINDY, BeeSpecies.AM_AIR, 10);
|
||||||
|
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, 10);
|
||||||
|
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.FIREY, BeeSpecies.AM_FIRE, 10);
|
||||||
|
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WATERY, BeeSpecies.AM_WATER, 10);
|
||||||
|
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ARCANE, 10);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.AM_AIR, BeeSpecies.AM_LIGHTNING, 8);
|
||||||
|
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, BeeSpecies.AM_PLANT, 8);
|
||||||
|
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.AM_WATER, BeeSpecies.AM_ICE, 8);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_VORTEX, 8);
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.GHASTLY, BeeSpecies.AM_WIGHT, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EquivalentExchangeHelper.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RedstoneArsenalHelper.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(BeeSpecies.TE_ELECTRUM, BeeSpecies.TE_DESTABILIZED, BeeSpecies.RSA_FLUXED, 10)
|
||||||
|
.setBlockRequired("blockElectrumFlux");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ThermalExpansionHelper.isActive())
|
||||||
|
{
|
||||||
|
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
|
||||||
|
.setBlockRequired("blockBronze");
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.GOLD, BeeSpecies.SILVER, BeeSpecies.TE_ELECTRUM, 10)
|
||||||
|
.setBlockRequired("blockElectrum");
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.IRON, BeeSpecies.ESOTERIC, BeeSpecies.TE_NICKEL, 14)
|
||||||
|
.setBlockRequired("blockNickel");
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.IRON, BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, 14)
|
||||||
|
.setBlockRequired("blockInvar");
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, BeeSpecies.TE_PLATINUM, 10)
|
||||||
|
.setBlockRequired("blockPlatinum");
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
|
||||||
|
.setBlockRequired("blockBronze");
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SPITEFUL, BeeSpecies.TIN, BeeSpecies.TE_COAL, 12)
|
||||||
|
.setBlockRequired(Blocks.coal_ore);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SPITEFUL, Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED, 12)
|
||||||
|
.setBlockRequired(Blocks.redstone_ore);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.INFERNAL, BeeSpecies.TE_LUX, 12)
|
||||||
|
.setBlockRequired(Blocks.glowstone);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SMOULDERING, Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE, 12)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.TE_DANTE, BeeSpecies.TE_COAL, BeeSpecies.TE_PYRO, 8)
|
||||||
|
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.SKULKING, Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY, 12);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.TE_BLIZZY, Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID, 8);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.TE_PLATINUM, BeeSpecies.OBLIVION, BeeSpecies.TE_WINSOME, 12);
|
||||||
|
|
||||||
|
new BeeMutation(BeeSpecies.TE_WINSOME, BeeSpecies.TE_COAL, BeeSpecies.TE_ENDEARING, 8)
|
||||||
|
.setBlockRequired("blockEnderium");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private IAllele parent1;
|
||||||
|
private IAllele parent2;
|
||||||
|
private IAllele mutationTemplate[];
|
||||||
|
private int baseChance;
|
||||||
|
private boolean isSecret;
|
||||||
|
private boolean isMoonRestricted;
|
||||||
|
private MoonPhase moonPhaseStart;
|
||||||
|
private MoonPhase moonPhaseEnd;
|
||||||
|
private float moonPhaseMutationBonus;
|
||||||
|
private boolean requiresBlock;
|
||||||
|
private Block requiredBlock;
|
||||||
|
private int requiredBlockMeta;
|
||||||
|
private String requiredBlockOreDictEntry;
|
||||||
|
private String requiredBlockName;
|
||||||
|
private BiomeDictionary.Type requiredBiomeType;
|
||||||
|
|
||||||
|
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, BeeSpecies resultSpecies, int percentChance)
|
||||||
|
{
|
||||||
|
this(species0, species1, resultSpecies.getGenome(), percentChance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, IAllele[] resultSpeciesGenome, int percentChance)
|
||||||
|
{
|
||||||
|
this.parent1 = species0;
|
||||||
|
this.parent2 = species1;
|
||||||
|
this.mutationTemplate = resultSpeciesGenome;
|
||||||
|
this.baseChance = percentChance;
|
||||||
|
this.isSecret = false;
|
||||||
|
this.isMoonRestricted = false;
|
||||||
|
this.moonPhaseMutationBonus = -1f;
|
||||||
|
//this.nodeType = null;
|
||||||
|
this.requiresBlock = false;
|
||||||
|
this.requiredBlockMeta = OreDictionary.WILDCARD_VALUE;
|
||||||
|
this.requiredBlockOreDictEntry = null;
|
||||||
|
this.requiredBiomeType = null;
|
||||||
|
this.requiredBlockName = null;
|
||||||
|
|
||||||
|
BeeManager.beeRoot.registerMutation(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1)
|
||||||
|
{
|
||||||
|
float finalChance = 0f;
|
||||||
|
float chance = this.baseChance * 1f;
|
||||||
|
|
||||||
|
if (this.arePartners(allele0, allele1))
|
||||||
|
{
|
||||||
|
// This mutation applies. Continue calculation.
|
||||||
|
if (this.moonPhaseStart != null && this.moonPhaseEnd != null)
|
||||||
|
{
|
||||||
|
// Only occurs during the phases.
|
||||||
|
if (this.isMoonRestricted && !MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd))
|
||||||
|
{
|
||||||
|
chance = 0;
|
||||||
|
}
|
||||||
|
else if (this.moonPhaseMutationBonus != -1f)
|
||||||
|
{
|
||||||
|
// There is a bonus to this mutation during moon phases...
|
||||||
|
if (MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd))
|
||||||
|
{
|
||||||
|
chance = (int)(chance * this.moonPhaseMutationBonus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.requiresBlock)
|
||||||
|
{
|
||||||
|
Block blockBelow;
|
||||||
|
int blockMeta;
|
||||||
|
int i = 1;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
blockBelow = housing.getWorld().getBlock(housing.getXCoord(), housing.getYCoord() - i,
|
||||||
|
housing.getZCoord());
|
||||||
|
blockMeta = housing.getWorld().getBlockMetadata(housing.getXCoord(), housing.getYCoord() - i, housing.getZCoord());
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
while (blockBelow != null && (blockBelow instanceof IBeeHousing || blockBelow == Config.fAlvearyBlock));
|
||||||
|
|
||||||
|
if (this.requiredBlockOreDictEntry != null)
|
||||||
|
{
|
||||||
|
int[] dicId = OreDictionary.getOreIDs(new ItemStack(blockBelow, 1, blockMeta));
|
||||||
|
if (dicId.length != 0)
|
||||||
|
{
|
||||||
|
if (!OreDictionary.getOreName(dicId[0]).equals(this.requiredBlockOreDictEntry))
|
||||||
|
{
|
||||||
|
chance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.requiredBlock != blockBelow || (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE &&
|
||||||
|
this.requiredBlockMeta != blockMeta))
|
||||||
|
{
|
||||||
|
chance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.requiredBiomeType != null)
|
||||||
|
{
|
||||||
|
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(housing.getWorld().getBiomeGenForCoords(housing.getXCoord(), housing.getZCoord()));
|
||||||
|
boolean found = false;
|
||||||
|
for (int i = 0; i < types.length; ++i)
|
||||||
|
{
|
||||||
|
if (this.requiredBiomeType == types[i])
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
chance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
finalChance = Math.round(chance
|
||||||
|
* housing.getMutationModifier((IBeeGenome)genome0,
|
||||||
|
(IBeeGenome)genome1, chance)
|
||||||
|
* BeeManager.beeRoot.getBeekeepingMode(housing.getWorld())
|
||||||
|
.getMutationModifier((IBeeGenome)genome0,
|
||||||
|
(IBeeGenome)genome1, chance));
|
||||||
|
}
|
||||||
|
|
||||||
|
return finalChance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IAllele getAllele0()
|
||||||
|
{
|
||||||
|
return parent1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IAllele getAllele1()
|
||||||
|
{
|
||||||
|
return parent2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IAllele[] getTemplate()
|
||||||
|
{
|
||||||
|
return mutationTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBaseChance()
|
||||||
|
{
|
||||||
|
return baseChance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isPartner(IAllele allele)
|
||||||
|
{
|
||||||
|
return parent1.getUID().equals(allele.getUID()) || parent2.getUID().equals(allele.getUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IAllele getPartner(IAllele allele)
|
||||||
|
{
|
||||||
|
IAllele val = parent1;
|
||||||
|
if (val.getUID().equals(allele.getUID()))
|
||||||
|
val = parent2;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<String> getSpecialConditions()
|
||||||
|
{
|
||||||
|
ArrayList<String> conditions = new ArrayList<String>();
|
||||||
|
|
||||||
|
if (this.isMoonRestricted && moonPhaseStart != null && moonPhaseEnd != null)
|
||||||
|
{
|
||||||
|
if (moonPhaseStart != moonPhaseEnd)
|
||||||
|
{
|
||||||
|
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhase"),
|
||||||
|
moonPhaseStart.getLocalizedName(), moonPhaseEnd.getLocalizedName()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"),
|
||||||
|
moonPhaseStart.getLocalizedName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.requiresBlock)
|
||||||
|
{
|
||||||
|
if (this.requiredBlockName != null)
|
||||||
|
{
|
||||||
|
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
|
||||||
|
LocalizationManager.getLocalizedString(this.requiredBlockName)));
|
||||||
|
}
|
||||||
|
else if (this.requiredBlockOreDictEntry != null)
|
||||||
|
{
|
||||||
|
ArrayList<ItemStack> ores = OreDictionary.getOres(this.requiredBlockOreDictEntry);
|
||||||
|
if (ores.size() > 0)
|
||||||
|
{
|
||||||
|
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"), ores.get(0).getDisplayName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int meta = OreDictionary.WILDCARD_VALUE;
|
||||||
|
if (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE)
|
||||||
|
{
|
||||||
|
meta = this.requiredBlockMeta;
|
||||||
|
}
|
||||||
|
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
|
||||||
|
new ItemStack(this.requiredBlock, 1, meta).getDisplayName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.requiredBiomeType != null)
|
||||||
|
{
|
||||||
|
String biomeName = this.requiredBiomeType.name().substring(0, 1) + this.requiredBiomeType.name().substring(1).toLowerCase();
|
||||||
|
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBiome"), biomeName));
|
||||||
|
}
|
||||||
|
|
||||||
|
return conditions;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBeeRoot getRoot()
|
||||||
|
{
|
||||||
|
return BeeManager.beeRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean arePartners(IAllele alleleA, IAllele alleleB)
|
||||||
|
{
|
||||||
|
return (this.parent1.getUID().equals(alleleA.getUID())) && this.parent2.getUID().equals(alleleB.getUID()) ||
|
||||||
|
this.parent1.getUID().equals(alleleB.getUID()) && this.parent2.getUID().equals(alleleA.getUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setSecret()
|
||||||
|
{
|
||||||
|
this.isSecret = true;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSecret()
|
||||||
|
{
|
||||||
|
return isSecret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setBlockRequired(Block block)
|
||||||
|
{
|
||||||
|
this.requiresBlock = true;
|
||||||
|
this.requiredBlock = block;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setBlockAndMetaRequired(Block block, int meta)
|
||||||
|
{
|
||||||
|
this.requiresBlock = true;
|
||||||
|
this.requiredBlock = block;
|
||||||
|
this.requiredBlockMeta = meta;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setBlockRequired(String oreDictEntry)
|
||||||
|
{
|
||||||
|
this.requiresBlock = true;
|
||||||
|
this.requiredBlockOreDictEntry = oreDictEntry;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setBlockRequiredNameOverride(String blockName)
|
||||||
|
{
|
||||||
|
this.requiredBlockName = blockName;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setMoonPhaseRestricted(MoonPhase begin, MoonPhase end)
|
||||||
|
{
|
||||||
|
this.isMoonRestricted = true;
|
||||||
|
this.moonPhaseStart = begin;
|
||||||
|
this.moonPhaseEnd = end;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setMoonPhaseBonus(MoonPhase begin, MoonPhase end, float mutationBonus)
|
||||||
|
{
|
||||||
|
this.moonPhaseMutationBonus = mutationBonus;
|
||||||
|
this.moonPhaseStart = begin;
|
||||||
|
this.moonPhaseEnd = end;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeMutation setBiomeRequired(BiomeDictionary.Type biomeType)
|
||||||
|
{
|
||||||
|
this.requiredBiomeType = biomeType;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
+7
-5
@@ -1,4 +1,4 @@
|
|||||||
package thaumicbees.bees.genetics;
|
package magicbees.bees;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import forestry.api.genetics.IEffectData;
|
import forestry.api.genetics.IEffectData;
|
||||||
@@ -18,11 +18,13 @@ public class EffectData implements IEffectData
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbttagcompound)
|
public void readFromNBT(NBTTagCompound nbttagcompound)
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound nbttagcompound)
|
public void writeToNBT(NBTTagCompound nbttagcompound)
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInteger(int index, int val)
|
public void setInteger(int index, int val)
|
||||||
@@ -66,7 +68,7 @@ public class EffectData implements IEffectData
|
|||||||
public float getFloat(int index)
|
public float getFloat(int index)
|
||||||
{
|
{
|
||||||
float val = 0f;
|
float val = 0f;
|
||||||
if (index >= 0 && index < this.intData.length)
|
if (index >= 0 && index < this.floatData.length)
|
||||||
{
|
{
|
||||||
val = this.floatData[index];
|
val = this.floatData[index];
|
||||||
}
|
}
|
||||||
@@ -77,7 +79,7 @@ public class EffectData implements IEffectData
|
|||||||
public boolean getBoolean(int index)
|
public boolean getBoolean(int index)
|
||||||
{
|
{
|
||||||
boolean val = false;
|
boolean val = false;
|
||||||
if (index >= 0 && index < this.intData.length)
|
if (index >= 0 && index < this.boolData.length)
|
||||||
{
|
{
|
||||||
val = this.boolData[index];
|
val = this.boolData[index];
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import forestry.api.genetics.IFlowerProvider;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import forestry.api.genetics.IPollinatable;
|
||||||
|
|
||||||
|
public class FlowerProviderArsMagicaFlower implements IFlowerProvider
|
||||||
|
{
|
||||||
|
private ItemStack[] flowers = { new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova),
|
||||||
|
new ItemStack(Config.amAum), new ItemStack(Config.amWakebloom),
|
||||||
|
new ItemStack(Config.amTarmaRoot) };
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
if (block == Config.amBlackOrchid || block == Config.amDesertNova ||
|
||||||
|
block == Config.amAum || block == Config.amWakebloom ||
|
||||||
|
block == Config.amTarmaRoot)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
x = -222;
|
||||||
|
y = 70;
|
||||||
|
z = -51;
|
||||||
|
Block blockDown = world.getBlock(x, y - 1, z);
|
||||||
|
if (world.getBlock(x, y, z).isAir(world, x, y, z))
|
||||||
|
{
|
||||||
|
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
|
||||||
|
{
|
||||||
|
int dart = world.rand.nextInt(100);
|
||||||
|
Block block;
|
||||||
|
if (dart > 60)
|
||||||
|
{
|
||||||
|
block = Config.amBlackOrchid;
|
||||||
|
}
|
||||||
|
else if (dart > 30)
|
||||||
|
{
|
||||||
|
block = Config.amAum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
block = Config.amTarmaRoot;
|
||||||
|
}
|
||||||
|
world.setBlock(x, y, z, block);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
else if (blockDown == Blocks.sand)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Config.amDesertNova);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
else if (blockDown == Blocks.stone)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Config.amTarmaRoot);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
else if (blockDown == Blocks.water || blockDown == Blocks.water)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Config.amWakebloom);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||||
|
{
|
||||||
|
return products;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] getItemStacks()
|
||||||
|
{
|
||||||
|
return this.flowers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||||
|
{
|
||||||
|
return pollinatable.getPlantType().size() > 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+18
-30
@@ -1,13 +1,10 @@
|
|||||||
package thaumicbees.bees;
|
package magicbees.bees;
|
||||||
|
|
||||||
import thaumcraft.api.AuraNode;
|
import magicbees.main.utils.LocalizationManager;
|
||||||
import thaumcraft.api.ThaumcraftApi;
|
|
||||||
import thaumicbees.block.BlockManager;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import forestry.api.apiculture.IBeeGenome;
|
import forestry.api.genetics.IFlowerProvider;
|
||||||
import forestry.api.apiculture.IFlowerProvider;
|
import forestry.api.genetics.IIndividual;
|
||||||
import forestry.api.genetics.IPollinatable;
|
import forestry.api.genetics.IPollinatable;
|
||||||
|
|
||||||
public class FlowerProviderAuraNode implements IFlowerProvider
|
public class FlowerProviderAuraNode implements IFlowerProvider
|
||||||
@@ -15,7 +12,7 @@ public class FlowerProviderAuraNode implements IFlowerProvider
|
|||||||
protected int nodeRange = 70;
|
protected int nodeRange = 70;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAcceptedFlower(World world, IBeeGenome genome, int x, int y, int z)
|
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||||
{
|
{
|
||||||
return this.isNodeWithinRange(world, x, y, z);
|
return this.isNodeWithinRange(world, x, y, z);
|
||||||
}
|
}
|
||||||
@@ -23,32 +20,23 @@ public class FlowerProviderAuraNode implements IFlowerProvider
|
|||||||
@Override
|
@Override
|
||||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||||
{
|
{
|
||||||
return true;
|
return pollinatable.getPlantType().size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean growFlower(World world, IBeeGenome genome, int x, int y, int z)
|
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||||
{
|
{
|
||||||
boolean flag = false;
|
return true;
|
||||||
int blockDown = world.getBlockId(x, y - 1, z);
|
|
||||||
if (world.isAirBlock(x, y, z) && (blockDown == Block.dirt.blockID || blockDown == Block.grass.blockID))
|
|
||||||
{
|
|
||||||
int rand = world.rand.nextInt(10);
|
|
||||||
world.setBlockAndMetadataWithNotify(x, y, z, BlockManager.tcPlant.blockID, (rand >= 5) ? 2 : 3);
|
|
||||||
System.out.println(x + ", " + y + ", " + ", " + z + " set to flower.");
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
return flag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
{
|
{
|
||||||
return "Node";
|
return LocalizationManager.getLocalizedString("flowerProvider.node");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack[] affectProducts(World world, IBeeGenome genome, int x, int y, int z, ItemStack[] products)
|
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||||
{
|
{
|
||||||
return products;
|
return products;
|
||||||
}
|
}
|
||||||
@@ -62,14 +50,14 @@ public class FlowerProviderAuraNode implements IFlowerProvider
|
|||||||
protected boolean isNodeWithinRange(World w, int x, int y, int z)
|
protected boolean isNodeWithinRange(World w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
boolean nodeNearby = false;
|
boolean nodeNearby = false;
|
||||||
if (ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange) >= 0)
|
/*if (ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange) >= 0)
|
||||||
{
|
{
|
||||||
nodeNearby = true;
|
nodeNearby = true;
|
||||||
}
|
}*/
|
||||||
return nodeNearby;
|
return nodeNearby;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AuraNode getNodeWithinRange(World w, int x, int y, int z)
|
/*protected AuraNode getNodeWithinRange(World w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
AuraNode node = null;
|
AuraNode node = null;
|
||||||
|
|
||||||
@@ -80,22 +68,22 @@ public class FlowerProviderAuraNode implements IFlowerProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack)
|
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack)
|
||||||
{
|
{
|
||||||
for (ItemStack stack : products)
|
for (ItemStack stack : products)
|
||||||
{
|
{
|
||||||
if (stack.itemID == itemStack.itemID && stack.getItemDamage() == itemStack.getItemDamage())
|
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage())
|
||||||
{
|
{
|
||||||
if (stack.stackSize < stack.getItem().getItemStackLimit())
|
if (stack.stackSize < stack.getItem().getItemStackLimit(stack))
|
||||||
{
|
{
|
||||||
stack.stackSize += itemStack.stackSize;
|
stack.stackSize += itemStack.stackSize;
|
||||||
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(), 0);
|
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemStack.stackSize > 0)
|
if (itemStack.stackSize > 0)
|
||||||
{
|
{
|
||||||
ItemStack[] newProducts = new ItemStack[products.length + 1];
|
ItemStack[] newProducts = new ItemStack[products.length + 1];
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.EnumPlantType;
|
||||||
|
import forestry.api.genetics.IFlowerProvider;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import forestry.api.genetics.IPollinatable;
|
||||||
|
|
||||||
|
public class FlowerProviderBookshelf implements IFlowerProvider
|
||||||
|
{
|
||||||
|
|
||||||
|
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int i, int j)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (world.getBlock(x, i, j) == Blocks.bookshelf)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean growFlower(World world, IIndividual genome, int x, int i, int j)
|
||||||
|
{
|
||||||
|
// Always return true so the system thinks we grew a flower.
|
||||||
|
// Bees can't grow bookshelves! Are you crazy?!
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[])
|
||||||
|
{
|
||||||
|
return products;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack[] getItemStacks()
|
||||||
|
{
|
||||||
|
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||||
|
{
|
||||||
|
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||||
|
return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("flowerProvider.book");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import forestry.api.genetics.IFlowerProvider;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import forestry.api.genetics.IPollinatable;
|
||||||
|
|
||||||
|
public class FlowerProviderThaumcraftFlower implements IFlowerProvider
|
||||||
|
{
|
||||||
|
private ItemStack[] flowers = { new ItemStack(Config.tcPlant, 1, 2), new ItemStack(Config.tcPlant, 1, 3) };
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (world.getBlock(x, y, z) == Config.tcPlant)
|
||||||
|
{
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if (meta == 2 || meta == 3)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
Block blockDown = world.getBlock(x, y - 1, z);
|
||||||
|
if (world.getBlock(x, y, z).isAir(world, x, y, z))
|
||||||
|
{
|
||||||
|
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
else if (blockDown == Blocks.sand)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("flowerProvider.magic");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||||
|
{
|
||||||
|
return products;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] getItemStacks()
|
||||||
|
{
|
||||||
|
return this.flowers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||||
|
{
|
||||||
|
return pollinatable.getPlantType().size() > 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.BiomeDictionary;
|
||||||
|
|
||||||
|
import forestry.api.apiculture.hives.HiveManager;
|
||||||
|
import forestry.api.apiculture.hives.IHiveDescription;
|
||||||
|
import forestry.api.apiculture.hives.IHiveGen;
|
||||||
|
import forestry.api.core.EnumHumidity;
|
||||||
|
import forestry.api.core.EnumTemperature;
|
||||||
|
|
||||||
|
import magicbees.block.types.HiveType;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.BlockUtil;
|
||||||
|
import magicbees.main.utils.LogHelper;
|
||||||
|
import magicbees.world.feature.FeatureOreVein;
|
||||||
|
import magicbees.world.feature.HiveGenNether;
|
||||||
|
import magicbees.world.feature.HiveGenOblivion;
|
||||||
|
import magicbees.world.feature.HiveGenUnderground;
|
||||||
|
|
||||||
|
public enum HiveDescription implements IHiveDescription {
|
||||||
|
CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree()),
|
||||||
|
UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),
|
||||||
|
RESONANT(HiveType.RESONANT, 0.5f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone)),
|
||||||
|
DEEP(HiveType.DEEP, 2.0f, new HiveGenUnderground(10, 10, 6)) {
|
||||||
|
@Override
|
||||||
|
public void postGen(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
super.postGen(world, x, y, z);
|
||||||
|
Random random = world.rand;
|
||||||
|
FeatureOreVein.redstoneGen.generateVein(world, random, x + 1, y, z, 2);
|
||||||
|
FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 2);
|
||||||
|
FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 2);
|
||||||
|
FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 2);
|
||||||
|
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 2);
|
||||||
|
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6)) {
|
||||||
|
@Override
|
||||||
|
public void postGen(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
super.postGen(world, x, y, z);
|
||||||
|
Random random = world.rand;
|
||||||
|
FeatureOreVein.netherQuartzGen.generateVein(world, random, x + 1, y, z, 4);
|
||||||
|
FeatureOreVein.netherQuartzGen.generateVein(world, random, x - 1, y, z, 4);
|
||||||
|
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y + 1, z, 4);
|
||||||
|
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y - 1, z, 4);
|
||||||
|
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z + 1, 4);
|
||||||
|
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z - 1, 4);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
INFERNAL_OVERWORLD(HiveType.INFERNAL, 1.0f, new HiveGenUnderground(5, 13, 6)) {
|
||||||
|
@Override
|
||||||
|
public void postGen(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
super.postGen(world, x, y, z);
|
||||||
|
Random random = world.rand;
|
||||||
|
FeatureOreVein.glowstoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(4) + 1);
|
||||||
|
FeatureOreVein.glowstoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(4) + 1);
|
||||||
|
|
||||||
|
if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone))
|
||||||
|
{
|
||||||
|
world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone))
|
||||||
|
{
|
||||||
|
world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(4) + 1);
|
||||||
|
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion()) {
|
||||||
|
@Override
|
||||||
|
public void postGen(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
super.postGen(world, x, y, z);
|
||||||
|
int obsidianSpikeHeight = world.rand.nextInt(8) + 3;
|
||||||
|
|
||||||
|
for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
OBLIVION_OVERWORLD(HiveType.OBLIVION, 1.0f, new HiveGenUnderground(5, 5, 5)) {
|
||||||
|
@Override
|
||||||
|
public void postGen(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
super.postGen(world, x, y, z);
|
||||||
|
Random random = world.rand;
|
||||||
|
|
||||||
|
FeatureOreVein.endStoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(6) + 1);
|
||||||
|
FeatureOreVein.endStoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(6) + 1);
|
||||||
|
FeatureOreVein.endStoneGen.generateVein(world, random, x, y + 1, z, world.rand.nextInt(3) + 1);
|
||||||
|
FeatureOreVein.endStoneGen.generateVein(world, random, x, y - 1, z, world.rand.nextInt(3) + 1);
|
||||||
|
FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(6) + 1);
|
||||||
|
FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(6) + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private static boolean logSpawns = Config.logHiveSpawns;
|
||||||
|
|
||||||
|
private final HiveType hiveType;
|
||||||
|
private final float genChance;
|
||||||
|
private final List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
|
||||||
|
private final IHiveGen hiveGen;
|
||||||
|
|
||||||
|
private HiveDescription(HiveType hiveType, float genChance, IHiveGen hiveGen)
|
||||||
|
{
|
||||||
|
this.hiveType = hiveType;
|
||||||
|
this.genChance = genChance;
|
||||||
|
this.hiveGen = hiveGen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initHiveData()
|
||||||
|
{
|
||||||
|
CURIOUS.biomes.add(BiomeDictionary.Type.FOREST);
|
||||||
|
CURIOUS.biomes.add(BiomeDictionary.Type.JUNGLE);
|
||||||
|
CURIOUS.biomes.add(BiomeDictionary.Type.HILLS);
|
||||||
|
|
||||||
|
UNUSUAL.biomes.add(BiomeDictionary.Type.PLAINS);
|
||||||
|
UNUSUAL.biomes.add(BiomeDictionary.Type.MOUNTAIN);
|
||||||
|
UNUSUAL.biomes.add(BiomeDictionary.Type.HILLS);
|
||||||
|
|
||||||
|
RESONANT.biomes.add(BiomeDictionary.Type.SANDY);
|
||||||
|
RESONANT.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||||
|
|
||||||
|
DEEP.biomes.add(BiomeDictionary.Type.HILLS);
|
||||||
|
DEEP.biomes.add(BiomeDictionary.Type.MOUNTAIN);
|
||||||
|
DEEP.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||||
|
|
||||||
|
INFERNAL.biomes.add(BiomeDictionary.Type.NETHER);
|
||||||
|
INFERNAL_OVERWORLD.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||||
|
|
||||||
|
OBLIVION.biomes.add(BiomeDictionary.Type.END);
|
||||||
|
OBLIVION_OVERWORLD.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IHiveGen getHiveGen()
|
||||||
|
{
|
||||||
|
return hiveGen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Block getBlock()
|
||||||
|
{
|
||||||
|
return Config.hive;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMeta()
|
||||||
|
{
|
||||||
|
return hiveType.ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGoodBiome(BiomeGenBase biome)
|
||||||
|
{
|
||||||
|
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome);
|
||||||
|
for (BiomeDictionary.Type type : types)
|
||||||
|
{
|
||||||
|
if (biomes.contains(type))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGoodHumidity(EnumHumidity humidity)
|
||||||
|
{
|
||||||
|
return hiveType.getOccupant().canWorkInHumidity(humidity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGoodTemperature(EnumTemperature temperature)
|
||||||
|
{
|
||||||
|
return hiveType.getOccupant().canWorkInTemperature(temperature);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getGenChance()
|
||||||
|
{
|
||||||
|
return genChance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postGen(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
if (logSpawns)
|
||||||
|
{
|
||||||
|
LogHelper.info("Spawned " + this.toString().toLowerCase(Locale.ENGLISH) + " hive at: X " + x + ", Y: " + y + ", Z: " + z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import forestry.api.apiculture.EnumBeeType;
|
||||||
|
import forestry.api.apiculture.IBee;
|
||||||
|
import forestry.api.apiculture.IHiveDrop;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
|
||||||
|
public class HiveDrop implements IHiveDrop
|
||||||
|
{
|
||||||
|
private IAllele[] template;
|
||||||
|
private int chance;
|
||||||
|
private ItemStack[] bonus;
|
||||||
|
private float ignoblePercent = 0f;
|
||||||
|
|
||||||
|
public HiveDrop(IAllele[] beeTemplate, ItemStack[] bonusDrops, int dropChance)
|
||||||
|
{
|
||||||
|
this.template = beeTemplate;
|
||||||
|
this.bonus = bonusDrops;
|
||||||
|
this.chance = dropChance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HiveDrop setIgnoblePercentage(float f)
|
||||||
|
{
|
||||||
|
this.ignoblePercent = f;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IBee getBee(World w)
|
||||||
|
{
|
||||||
|
IBee bee = BeeManager.beeRoot.getBee(w, BeeManager.beeRoot.templateAsGenome(this.template));
|
||||||
|
if (w.rand.nextFloat() < this.ignoblePercent)
|
||||||
|
{
|
||||||
|
bee.setIsNatural(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return bee;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getPrincess(World world, int x, int y, int z, int fortune)
|
||||||
|
{
|
||||||
|
return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<ItemStack> getDrones(World world, int x, int y, int z, int fortune)
|
||||||
|
{
|
||||||
|
ArrayList<ItemStack> value = new ArrayList<ItemStack>(1);
|
||||||
|
value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal()));
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<ItemStack> getAdditional(World world, int x, int y, int z, int fortune)
|
||||||
|
{
|
||||||
|
ArrayList<ItemStack> value = new ArrayList<ItemStack>(bonus.length);
|
||||||
|
|
||||||
|
for (int i = 0; i < bonus.length; ++i)
|
||||||
|
{
|
||||||
|
value.add(bonus[i].copy());
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChance(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return this.chance;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLLog;
|
||||||
|
import magicbees.api.MagicBeesAPI;
|
||||||
|
import magicbees.api.bees.ITransmutationEffectController;
|
||||||
|
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
|
||||||
|
public class TransmutationEffectController implements ITransmutationEffectController
|
||||||
|
{
|
||||||
|
private ArrayList<ITransmutationEffectLogic> logicObjects;
|
||||||
|
static TransmutationEffectController instance;
|
||||||
|
|
||||||
|
public TransmutationEffectController()
|
||||||
|
{
|
||||||
|
logicObjects = new ArrayList<ITransmutationEffectLogic>();
|
||||||
|
logicObjects.add(new TransmutationEffectRailcraft());
|
||||||
|
logicObjects.add(new TransmutationEffectVanilla());
|
||||||
|
MagicBeesAPI.transmutationEffectController = instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean done;
|
||||||
|
ITransmutationEffectLogic logic;
|
||||||
|
for (int i = 0; i < logicObjects.size(); i++)
|
||||||
|
{
|
||||||
|
logic = logicObjects.get(i);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
done = logic.tryTransmutation(world, biome, sourceBlock, x, y, z);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
done = false;
|
||||||
|
FMLLog.warning("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", logic.getClass().getName());
|
||||||
|
FMLLog.info(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (done)
|
||||||
|
{
|
||||||
|
logicObjects.remove(i);
|
||||||
|
logicObjects.add(logic);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addEffectLogic(ITransmutationEffectLogic logic)
|
||||||
|
{
|
||||||
|
if (logic != null && !logicObjects.contains(logic))
|
||||||
|
{
|
||||||
|
logicObjects.add(logic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraftforge.common.BiomeDictionary;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false) ||
|
||||||
|
OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false))
|
||||||
|
{
|
||||||
|
flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) ||
|
||||||
|
trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
|
||||||
|
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY))
|
||||||
|
{
|
||||||
|
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) &&
|
||||||
|
!biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river"))
|
||||||
|
{
|
||||||
|
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package magicbees.bees;
|
||||||
|
|
||||||
|
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraftforge.common.BiomeDictionary;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
public class TransmutationEffectVanilla implements ITransmutationEffectLogic
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return trySpawnSandstone(world, biome, sourceBlock, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) &&
|
||||||
|
OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false))
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Blocks.sandstone);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.client.gui.UIScreens;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.MagicBees;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import magicbees.tileentity.TileEntityEffectJar;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BlockEffectJar extends BlockContainer
|
||||||
|
{
|
||||||
|
public BlockEffectJar()
|
||||||
|
{
|
||||||
|
super(Material.glass);
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setBlockName("effectJar");
|
||||||
|
this.setBlockBounds(0.25f, 0f, 0.25f, 0.75f, 0.81f, 0.74f);
|
||||||
|
this.setHardness(0.1f);
|
||||||
|
this.setResistance(1.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
|
||||||
|
{
|
||||||
|
boolean activate = false;
|
||||||
|
|
||||||
|
if (!player.isSneaking())
|
||||||
|
{
|
||||||
|
player.openGui(MagicBees.object, UIScreens.EFFECT_JAR.ordinal(), world, x, y, z);
|
||||||
|
activate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return activate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World w, int metadata)
|
||||||
|
{
|
||||||
|
return new TileEntityEffectJar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType()
|
||||||
|
{
|
||||||
|
return CommonProxy.RenderIdEffectJar;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
||||||
|
{
|
||||||
|
super.breakBlock(world, x, y, z, block, meta);
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dropInventory(World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
TileEntity e = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if (e != null && e instanceof TileEntityEffectJar)
|
||||||
|
{
|
||||||
|
TileEntityEffectJar jar = (TileEntityEffectJar)e;
|
||||||
|
|
||||||
|
// 0 is the only droppable stack.
|
||||||
|
ItemStack stack = jar.getStackInSlot(0);
|
||||||
|
|
||||||
|
if (stack != null && stack.stackSize > 0)
|
||||||
|
{
|
||||||
|
float pX = world.rand.nextFloat() * 0.8f + 0.1f;
|
||||||
|
float pY = world.rand.nextFloat() * 0.8f + 0.1f;
|
||||||
|
float pZ = world.rand.nextFloat() * 0.8f + 0.1f;
|
||||||
|
|
||||||
|
EntityItem entityItem = new EntityItem(world, x + pX, y + pY, z + pZ, stack.copy());
|
||||||
|
|
||||||
|
entityItem.motionX = world.rand.nextGaussian() * 0.05f;
|
||||||
|
entityItem.motionY = world.rand.nextGaussian() * 0.05f + 0.2f;
|
||||||
|
entityItem.motionZ = world.rand.nextGaussian() * 0.05f;
|
||||||
|
|
||||||
|
world.spawnEntityInWorld(entityItem);
|
||||||
|
stack.stackSize = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.blockIcon = Blocks.glass.getIcon(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.block.types.HiveType;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import forestry.api.core.Tabs;
|
||||||
|
|
||||||
|
public class BlockHive extends Block
|
||||||
|
{
|
||||||
|
public BlockHive()
|
||||||
|
{
|
||||||
|
super(new MaterialHive());
|
||||||
|
this.setLightLevel(0.8f);
|
||||||
|
setHardness(1f);
|
||||||
|
setCreativeTab(Tabs.tabApiculture);
|
||||||
|
setBlockName("hive");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int meta)
|
||||||
|
{
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if (meta < 0 || meta > HiveType.values().length)
|
||||||
|
{
|
||||||
|
meta = 0;
|
||||||
|
}
|
||||||
|
return HiveType.getHiveFromMeta(meta).getLightValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
|
||||||
|
{
|
||||||
|
// Java bitches about raw types & types not being checked. Sorry, but the API sucks.
|
||||||
|
for (HiveType type : HiveType.values())
|
||||||
|
{
|
||||||
|
if (type.show || Config.forestryDebugEnabled)
|
||||||
|
{
|
||||||
|
itemsList.add(new ItemStack(this, 1, type.ordinal()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||||
|
{
|
||||||
|
return HiveType.getHiveFromMeta(metadata).getDrops(world, x, y, z, fortune);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister register)
|
||||||
|
{
|
||||||
|
HiveType.registerIcons(register);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta)
|
||||||
|
{
|
||||||
|
if (meta < 0 || meta > HiveType.values().length)
|
||||||
|
{
|
||||||
|
meta = 0;
|
||||||
|
}
|
||||||
|
return HiveType.getHiveFromMeta(meta).getIconForSide(side);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
|
||||||
|
if (block.isAir(world, x, y, z))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Item item = Item.getItemFromBlock(block);
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.client.gui.UIScreens;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.MagicBees;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import magicbees.tileentity.TileEntityMagicApiary;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
public class BlockMagicApiary extends BlockContainer
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] icons;
|
||||||
|
|
||||||
|
public BlockMagicApiary()
|
||||||
|
{
|
||||||
|
super(Material.wood);
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setBlockName("magicApiary");
|
||||||
|
this.setHardness(1f);
|
||||||
|
this.setResistance(1.5f);
|
||||||
|
this.setHarvestLevel("axe", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9 )
|
||||||
|
{
|
||||||
|
boolean activate = false;
|
||||||
|
|
||||||
|
if (!player.isSneaking())
|
||||||
|
{
|
||||||
|
player.openGui(MagicBees.object, UIScreens.THAUMIC_APIARY.ordinal(), world, x, y, z);
|
||||||
|
activate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return activate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
|
||||||
|
if (side == 0){
|
||||||
|
return icons[0];
|
||||||
|
}else if (side == 1){
|
||||||
|
return icons[1];
|
||||||
|
}else if (side == 2 || side == 3){
|
||||||
|
return icons[2];
|
||||||
|
}else{
|
||||||
|
return icons[4];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister register)
|
||||||
|
{
|
||||||
|
icons = new IIcon[5];
|
||||||
|
|
||||||
|
icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.0");
|
||||||
|
icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.1");
|
||||||
|
icons[2] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.2");
|
||||||
|
icons[4] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.4");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
|
return new TileEntityMagicApiary();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int meta){
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
if (te != null && te instanceof IInventory){
|
||||||
|
IInventory inventory = (IInventory)te;
|
||||||
|
|
||||||
|
for (int i = 0; i < inventory.getSizeInventory(); i++){
|
||||||
|
ItemStack itemStack = inventory.getStackInSlotOnClosing(i);
|
||||||
|
|
||||||
|
if (itemStack != null){
|
||||||
|
float spawnX = x + world.rand.nextFloat();
|
||||||
|
float spawnY = y + world.rand.nextFloat();
|
||||||
|
float spawnZ = z + world.rand.nextFloat();
|
||||||
|
|
||||||
|
EntityItem droppedItem = new EntityItem(world, spawnX, spawnY, spawnZ, itemStack);
|
||||||
|
|
||||||
|
float mult = 0.05F;
|
||||||
|
|
||||||
|
droppedItem.motionX = (-0.5F + world.rand.nextFloat()) * mult;
|
||||||
|
droppedItem.motionY = (4 + world.rand.nextFloat()) * mult;
|
||||||
|
droppedItem.motionZ = (-0.5F + world.rand.nextFloat()) * mult;
|
||||||
|
|
||||||
|
world.spawnEntityInWorld(droppedItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.breakBlock(world, x, y, z, block, meta);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.block.types.PlankType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class BlockPlanks extends Block
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] IIcons;
|
||||||
|
|
||||||
|
public BlockPlanks()
|
||||||
|
{
|
||||||
|
super(Material.wood);
|
||||||
|
this.setHardness(2.5f);
|
||||||
|
this.setResistance(6.0f);
|
||||||
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||||
|
if (Config.areMagicPlanksFlammable)
|
||||||
|
{
|
||||||
|
Blocks.fire.setFireInfo(this, 5, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int meta)
|
||||||
|
{
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
|
||||||
|
{
|
||||||
|
for (PlankType type : PlankType.values())
|
||||||
|
{
|
||||||
|
itemsList.add(new ItemStack(this, 1, type.ordinal()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta)
|
||||||
|
{
|
||||||
|
return this.IIcons[Math.max(0, Math.min(meta & 7, IIcons.length - 1))];
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister par1IIconRegister)
|
||||||
|
{
|
||||||
|
this.IIcons = new IIcon[PlankType.values().length];
|
||||||
|
for (PlankType t : PlankType.values())
|
||||||
|
{
|
||||||
|
this.IIcons[t.ordinal()] = par1IIconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import magicbees.tileentity.TileEntityVisAuraProvider;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class BlockVisAuraProvider extends BlockContainer {
|
||||||
|
|
||||||
|
public BlockVisAuraProvider() {
|
||||||
|
super(Material.glass);
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setBlockName("visAuraProvider");
|
||||||
|
this.setHardness(0.5f);
|
||||||
|
this.setResistance(1.5f);
|
||||||
|
this.setLightLevel(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
|
return new TileEntityVisAuraProvider();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType()
|
||||||
|
{
|
||||||
|
return CommonProxy.RenderIdVisAuraProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
|
this.blockIcon = Blocks.planks.getIcon(0, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.block.types.PlankType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockSlab;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BlockWoodSlab extends BlockSlab
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] icons;
|
||||||
|
|
||||||
|
public BlockWoodSlab(boolean doubleSlab)
|
||||||
|
{
|
||||||
|
super(doubleSlab, Material.wood);
|
||||||
|
this.setHardness(2.5f);
|
||||||
|
this.setResistance(6.0f);
|
||||||
|
this.setBlockName("tb.slab.wood");
|
||||||
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||||
|
this.setLightOpacity(doubleSlab ? 255 : 0);
|
||||||
|
if (Config.areMagicPlanksFlammable)
|
||||||
|
{
|
||||||
|
Blocks.fire.setFireInfo(this, 5, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getItemDropped(int id, Random rand, int par3)
|
||||||
|
{
|
||||||
|
return Item.getItemFromBlock(Config.slabWoodHalf);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ItemStack createStackedBlock(int meta)
|
||||||
|
{
|
||||||
|
return new ItemStack(Config.planksWood, 1, meta & 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String func_150002_b(int meta)
|
||||||
|
{
|
||||||
|
return this.getUnlocalizedName() + "." + PlankType.getType(meta).name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
|
||||||
|
{
|
||||||
|
for (PlankType type : PlankType.values())
|
||||||
|
{
|
||||||
|
itemsList.add(new ItemStack(this, 1, type.ordinal()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta)
|
||||||
|
{
|
||||||
|
return this.icons[Math.max(0, Math.min(meta & 7, icons.length - 1))];
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.icons = new IIcon[PlankType.values().length];
|
||||||
|
for (PlankType t : PlankType.values())
|
||||||
|
{
|
||||||
|
this.icons[t.ordinal()] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
|
||||||
|
if (block.isAir(world, x, y, z))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Item item = Item.getItemFromBlock(block);
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package magicbees.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.MapColor;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
public class MaterialHive extends Material
|
||||||
|
{
|
||||||
|
|
||||||
|
public MaterialHive()
|
||||||
|
{
|
||||||
|
super(MapColor.stoneColor);
|
||||||
|
this.setImmovableMobility();
|
||||||
|
this.setRequiresTool();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
package magicbees.block.types;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import magicbees.bees.BeeGenomeManager;
|
||||||
|
import magicbees.bees.BeeSpecies;
|
||||||
|
import magicbees.bees.HiveDrop;
|
||||||
|
import magicbees.item.types.CombType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.compat.ForestryHelper;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import forestry.api.apiculture.IHiveDrop;
|
||||||
|
|
||||||
|
public enum HiveType
|
||||||
|
{
|
||||||
|
CURIOUS("curious", BeeSpecies.MYSTICAL, 12, true),
|
||||||
|
UNUSUAL("unusual", BeeSpecies.UNUSUAL, 12, true),
|
||||||
|
RESONANT("resonant", BeeSpecies.SORCEROUS, 12, true),
|
||||||
|
DEEP("deep", BeeSpecies.ATTUNED, 4, false),
|
||||||
|
INFERNAL("infernal", BeeSpecies.INFERNAL, 15, false),
|
||||||
|
OBLIVION("oblivion", BeeSpecies.OBLIVION, 7, false),
|
||||||
|
;
|
||||||
|
|
||||||
|
private static String[] nameList;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private BeeSpecies occupant;
|
||||||
|
public boolean show;
|
||||||
|
private int lightLevel;
|
||||||
|
private ArrayList<IHiveDrop> drops;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] icons;
|
||||||
|
|
||||||
|
public static HiveType getHiveFromMeta(int meta)
|
||||||
|
{
|
||||||
|
HiveType type = CURIOUS;
|
||||||
|
|
||||||
|
if (meta > 0 && meta < HiveType.values().length)
|
||||||
|
{
|
||||||
|
type = HiveType.values()[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initHiveData()
|
||||||
|
{
|
||||||
|
ItemStack[] combs = new ItemStack[] { Config.combs.getStackForType(CombType.MUNDANE) };
|
||||||
|
HiveDrop valiantDrop = new HiveDrop(BeeGenomeManager.addRainResist(ForestryHelper.getTemplateForestryForSpecies("Valiant")), combs, 5);
|
||||||
|
|
||||||
|
CURIOUS.drops.add(new HiveDrop(BeeSpecies.MYSTICAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
|
||||||
|
CURIOUS.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.MYSTICAL.getGenome()), combs, 15));
|
||||||
|
CURIOUS.drops.add(valiantDrop);
|
||||||
|
|
||||||
|
UNUSUAL.drops.add(new HiveDrop(BeeSpecies.UNUSUAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
|
||||||
|
UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15));
|
||||||
|
UNUSUAL.drops.add(valiantDrop);
|
||||||
|
|
||||||
|
RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
|
||||||
|
RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20));
|
||||||
|
RESONANT.drops.add(valiantDrop);
|
||||||
|
|
||||||
|
DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80).setIgnoblePercentage(0.65f));
|
||||||
|
DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20));
|
||||||
|
DEEP.drops.add(valiantDrop);
|
||||||
|
|
||||||
|
combs = new ItemStack[] { Config.combs.getStackForType(CombType.MOLTEN), new ItemStack(Items.glowstone_dust, 6) };
|
||||||
|
|
||||||
|
INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80).setIgnoblePercentage(0.5f));
|
||||||
|
INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3));
|
||||||
|
|
||||||
|
combs = new ItemStack[] { Config.combs.getStackForType(CombType.FORGOTTEN), new ItemStack(Items.ender_pearl, 1) };
|
||||||
|
|
||||||
|
OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80));
|
||||||
|
OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9));
|
||||||
|
}
|
||||||
|
|
||||||
|
private HiveType(String hiveName, BeeSpecies occupant, int light, boolean visible)
|
||||||
|
{
|
||||||
|
this.name = hiveName;
|
||||||
|
this.occupant = occupant;
|
||||||
|
this.lightLevel = light;
|
||||||
|
this.show = visible;
|
||||||
|
this.drops = new ArrayList<IHiveDrop>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public static void registerIcons(IIconRegister register)
|
||||||
|
{
|
||||||
|
for (HiveType type : HiveType.values())
|
||||||
|
{
|
||||||
|
type.icons = new IIcon[2];
|
||||||
|
|
||||||
|
type.icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".top");
|
||||||
|
type.icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".side");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconForSide(int side)
|
||||||
|
{
|
||||||
|
IIcon i = this.icons[0];
|
||||||
|
|
||||||
|
if (side != 0 && side != 1)
|
||||||
|
{
|
||||||
|
i = this.icons[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLightValue()
|
||||||
|
{
|
||||||
|
return this.lightLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int fortune)
|
||||||
|
{
|
||||||
|
ArrayList<ItemStack> hiveDrops = new ArrayList<ItemStack>();
|
||||||
|
int dart;
|
||||||
|
|
||||||
|
// Get a princess.
|
||||||
|
int throttle = 0;
|
||||||
|
while (hiveDrops.size() <= 0 && throttle < 10)
|
||||||
|
{
|
||||||
|
++throttle;
|
||||||
|
dart = world.rand.nextInt(100);
|
||||||
|
for (IHiveDrop drop : drops)
|
||||||
|
{
|
||||||
|
if (dart <= drop.getChance(world, x, y, z))
|
||||||
|
{
|
||||||
|
hiveDrops.add(drop.getPrincess(world, x, y, z, fortune));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a drone, maybe.
|
||||||
|
dart = world.rand.nextInt(100);
|
||||||
|
for (IHiveDrop drop : drops)
|
||||||
|
{
|
||||||
|
if (dart <= drop.getChance(world, x, y, z))
|
||||||
|
{
|
||||||
|
hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get additional drops.
|
||||||
|
dart = world.rand.nextInt(100);
|
||||||
|
for (IHiveDrop drop : drops)
|
||||||
|
{
|
||||||
|
if (dart <= drop.getChance(world, x, y, z))
|
||||||
|
{
|
||||||
|
hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hiveDrops;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] getAllNames()
|
||||||
|
{
|
||||||
|
return (nameList == null) ? nameList = generateNames() : nameList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BeeSpecies getOccupant() {
|
||||||
|
return this.occupant;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String[] generateNames()
|
||||||
|
{
|
||||||
|
String[] names = new String[values().length];
|
||||||
|
for (int i = 0; i < names.length; ++i)
|
||||||
|
{
|
||||||
|
names[i] = values()[i].name;
|
||||||
|
}
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package magicbees.block.types;
|
||||||
|
|
||||||
|
public enum PlankType
|
||||||
|
{
|
||||||
|
GREATWOOD("greatwood", 48),
|
||||||
|
SILVERWOOD("silverwood", 49),
|
||||||
|
;
|
||||||
|
|
||||||
|
public String name;
|
||||||
|
public int textureIdx;
|
||||||
|
private static String[] nameList;
|
||||||
|
|
||||||
|
private PlankType(String n, int idx)
|
||||||
|
{
|
||||||
|
this.name = n;
|
||||||
|
this.textureIdx = idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlankType getType(int meta)
|
||||||
|
{
|
||||||
|
PlankType type = null;
|
||||||
|
|
||||||
|
if (meta >= 0 && meta <= values().length)
|
||||||
|
{
|
||||||
|
type = values()[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] getAllNames()
|
||||||
|
{
|
||||||
|
return (nameList == null) ? nameList = generateNames() : nameList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String[] generateNames()
|
||||||
|
{
|
||||||
|
String[] names = new String[values().length];
|
||||||
|
for (int i = 0; i < names.length; ++i)
|
||||||
|
{
|
||||||
|
names[i] = values()[i].name;
|
||||||
|
}
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.tileentity.TileEntityEffectJar;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerEffectJar extends Container
|
||||||
|
{
|
||||||
|
public TileEntityEffectJar jar;
|
||||||
|
|
||||||
|
public int lastBeeHealth = 0;
|
||||||
|
public int speciesColour = 0xffffff;
|
||||||
|
|
||||||
|
public ContainerEffectJar(TileEntityEffectJar tileEntityEffectJar, EntityPlayer player)
|
||||||
|
{
|
||||||
|
this.jar = tileEntityEffectJar;
|
||||||
|
this.addSlotToContainer(new SlotCustomItems(this.jar, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < 9; ++j)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 9; ++i)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 132));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting crafting)
|
||||||
|
{
|
||||||
|
super.addCraftingToCrafters(crafting);
|
||||||
|
|
||||||
|
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
|
||||||
|
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges()
|
||||||
|
{
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
|
||||||
|
for (int i = 0; i < this.crafters.size(); ++i)
|
||||||
|
{
|
||||||
|
ICrafting crafting = (ICrafting)this.crafters.get(i);
|
||||||
|
|
||||||
|
if (this.lastBeeHealth != this.jar.currentBeeHealth)
|
||||||
|
{
|
||||||
|
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
|
||||||
|
this.lastBeeHealth = this.jar.currentBeeHealth;
|
||||||
|
}
|
||||||
|
if (this.speciesColour != this.jar.currentBeeColour)
|
||||||
|
{
|
||||||
|
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
|
||||||
|
this.speciesColour = this.jar.currentBeeColour;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int craftingId, int value)
|
||||||
|
{
|
||||||
|
if (craftingId == 0)
|
||||||
|
{
|
||||||
|
this.jar.currentBeeHealth = value;
|
||||||
|
}
|
||||||
|
else if (craftingId == 1)
|
||||||
|
{
|
||||||
|
this.jar.currentBeeColour = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||||
|
{
|
||||||
|
return this.jar.isUseableByPlayer(entityplayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot)
|
||||||
|
{
|
||||||
|
Slot itemSlot = this.getSlot(slot);
|
||||||
|
boolean clearSlot = false;
|
||||||
|
|
||||||
|
if (itemSlot != null && itemSlot.getHasStack())
|
||||||
|
{
|
||||||
|
ItemStack srcStack = itemSlot.getStack();
|
||||||
|
if (slot == 0 && srcStack != null)
|
||||||
|
{
|
||||||
|
clearSlot = this.mergeItemStack(srcStack, 1, 36 + 1, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.getSlot(0).isItemValid(srcStack))
|
||||||
|
{
|
||||||
|
clearSlot = this.mergeItemStack(srcStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clearSlot)
|
||||||
|
{
|
||||||
|
itemSlot.putStack(null);
|
||||||
|
}
|
||||||
|
itemSlot.onSlotChanged();
|
||||||
|
player.inventory.markDirty();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
|
||||||
|
public class ContainerMB extends Container
|
||||||
|
{
|
||||||
|
protected final int PLAYER_INVENTORY_ROWS = 3;
|
||||||
|
protected final int PLAYER_INVENTORY_COLUMNS = 9;
|
||||||
|
|
||||||
|
public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart)
|
||||||
|
{
|
||||||
|
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){
|
||||||
|
addSlotToContainer(new Slot(inventoryPlayer, x, xStart + 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int y = 0; y < PLAYER_INVENTORY_ROWS; y++){
|
||||||
|
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){
|
||||||
|
addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, xStart + 8 + 18 * x, yStart + y * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer entityPlayer) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import forestry.api.apiculture.IHiveFrame;
|
||||||
|
import forestry.plugins.PluginApiculture;
|
||||||
|
import magicbees.main.utils.ItemInterface;
|
||||||
|
import magicbees.tileentity.TileEntityMagicApiary;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerMagicApiary extends ContainerMB {
|
||||||
|
|
||||||
|
public TileEntityMagicApiary apiary;
|
||||||
|
public int maxSlot = 0;
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
private static final int SLOT_QUEEN = 0;
|
||||||
|
private static final int SLOT_DRONE = 1;
|
||||||
|
private static final int SLOT_FRAME_START = 2;
|
||||||
|
private static final int SLOT_INVENTORY_START = 5;
|
||||||
|
private static final int SLOT_FRAME_COUNT = 3;
|
||||||
|
private static final int SLOT_INVENTORY_COUNT = 7;
|
||||||
|
|
||||||
|
public ContainerMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary){
|
||||||
|
this.apiary = thaumicApiary;
|
||||||
|
|
||||||
|
// Queen/Princess slot
|
||||||
|
addSlotToContainer(new SlotCustomItems(this.apiary, 0, 29, 39, ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), ItemInterface.getItemStack("Forestry", "beePrincessGE", 1)));
|
||||||
|
// Drone slot
|
||||||
|
addSlotToContainer(new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64)));
|
||||||
|
|
||||||
|
int currentSlot = 1;
|
||||||
|
|
||||||
|
// Frame slots
|
||||||
|
for (int x = 0; x < 3; x++){
|
||||||
|
currentSlot++;
|
||||||
|
addSlotToContainer(new SlotFrame(thaumicApiary, currentSlot, 66, 23 + x * 29));
|
||||||
|
//LogHelper.info("[1] CURRENTSLOT: " + currentSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int x = 0; x < 3; x++){
|
||||||
|
currentSlot++;
|
||||||
|
addSlotToContainer(new Slot(thaumicApiary, currentSlot, 116, 26 + x * 26));
|
||||||
|
//LogHelper.info("[2] CURRENTSLOT: " + currentSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
int j = 0;
|
||||||
|
for (int y = 0; y < 2; y++){
|
||||||
|
for (int x = 0; x < 2; x++){
|
||||||
|
currentSlot++;
|
||||||
|
addSlotToContainer(new Slot(thaumicApiary, currentSlot, 95 + x * 42, 39 + j * 26));
|
||||||
|
//LogHelper.info("[3] CURRENTSLOT: " + currentSlot);
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
|
||||||
|
addPlayerInventory(inventoryPlayer, 0, 110);
|
||||||
|
|
||||||
|
maxSlot = currentSlot;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex){
|
||||||
|
Slot itemSlot = this.getSlot(slotIndex);
|
||||||
|
boolean clearSlot = false;
|
||||||
|
|
||||||
|
if (itemSlot != null && itemSlot.getHasStack()) {
|
||||||
|
ItemStack srcStack = itemSlot.getStack();
|
||||||
|
|
||||||
|
if (slotIndex <= maxSlot && srcStack != null){
|
||||||
|
clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false);
|
||||||
|
}else{
|
||||||
|
if (slotIndex > maxSlot && srcStack != null){
|
||||||
|
if (PluginApiculture.beeInterface.isMember(srcStack)){
|
||||||
|
if (!PluginApiculture.beeInterface.isDrone(srcStack)){
|
||||||
|
if (this.getSlot(SLOT_QUEEN).getHasStack() == false) {
|
||||||
|
clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN, false);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)){
|
||||||
|
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(srcStack.getItem() instanceof IHiveFrame){
|
||||||
|
clearSlot = this.mergeItemStack(srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clearSlot){
|
||||||
|
itemSlot.putStack(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
itemSlot.onSlotChanged();
|
||||||
|
player.inventory.markDirty();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer entityPlayer) {
|
||||||
|
return apiary.isUseableByPlayer(entityPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgressBar(int i, int j) {
|
||||||
|
apiary.getGUINetworkData(i, j);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges() {
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
|
||||||
|
for (Object crafter : crafters) {
|
||||||
|
apiary.sendGUINetworkData(this, (ICrafting) crafter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.tileentity.TileEntityEffectJar;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
|
||||||
|
public class GUIEffectJar extends GuiContainer
|
||||||
|
{
|
||||||
|
public static final String BACKGROUND_FILE = "jarScreen.png";
|
||||||
|
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "jarScreen.png");
|
||||||
|
|
||||||
|
private static final int WIDTH = 176;
|
||||||
|
private static final int HEIGHT = 156;
|
||||||
|
|
||||||
|
private static final int SLOT_JAR_X = 80;
|
||||||
|
private static final int SLOT_JAR_Y = 22;
|
||||||
|
private static final int SLOT_INVENTORY_X = 8;
|
||||||
|
private static final int SLOT_INVENTORY_Y = 74;
|
||||||
|
private static final int BAR_DEST_X = 117;
|
||||||
|
private static final int BAR_DEST_Y = 10;
|
||||||
|
|
||||||
|
private static final int BAR_SRC_X = 176;
|
||||||
|
private static final int BAR_SRC_Y = 0;
|
||||||
|
|
||||||
|
private static final int BAR_WIDTH = 10;
|
||||||
|
private static final int BAR_HEIGHT = 40;
|
||||||
|
|
||||||
|
public GUIEffectJar(TileEntityEffectJar jar, EntityPlayer player)
|
||||||
|
{
|
||||||
|
super(new ContainerEffectJar(jar, player));
|
||||||
|
this.xSize = WIDTH;
|
||||||
|
this.ySize = HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||||
|
{
|
||||||
|
fontRendererObj.drawString("Inventory", 9, 63, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||||
|
{
|
||||||
|
GL11.glColor4f(1f, 1f, 1f, 1f);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_SRC_ALPHA);
|
||||||
|
this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION);
|
||||||
|
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
|
TileEntityEffectJar jar = ((ContainerEffectJar)this.inventorySlots).jar;
|
||||||
|
float r = ((jar.currentBeeColour >> 16) & 255) / 255f;
|
||||||
|
float g = ((jar.currentBeeColour >> 8) & 255) / 255f;
|
||||||
|
float b = (jar.currentBeeColour & 255) / 255f;
|
||||||
|
|
||||||
|
GL11.glColor3f(r, g, b);
|
||||||
|
|
||||||
|
int value = BAR_HEIGHT - (jar.currentBeeHealth * BAR_HEIGHT) / 100;
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + BAR_DEST_X, this.guiTop + value + BAR_DEST_Y, BAR_SRC_X, BAR_SRC_Y, BAR_WIDTH, BAR_HEIGHT - value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import magicbees.tileentity.TileEntityEffectJar;
|
||||||
|
import magicbees.tileentity.TileEntityMagicApiary;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.common.network.IGuiHandler;
|
||||||
|
|
||||||
|
public class GUIHandler implements IGuiHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
Object value = null;
|
||||||
|
|
||||||
|
if (ID == UIScreens.EFFECT_JAR.ordinal())
|
||||||
|
{
|
||||||
|
value = new ContainerEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player);
|
||||||
|
}
|
||||||
|
else if (ID == UIScreens.THAUMIC_APIARY.ordinal())
|
||||||
|
{
|
||||||
|
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
|
||||||
|
value = new ContainerMagicApiary(player.inventory, tileEntityThaumicApiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
Object value = null;
|
||||||
|
|
||||||
|
if (ID == UIScreens.EFFECT_JAR.ordinal())
|
||||||
|
{
|
||||||
|
value = new GUIEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player);
|
||||||
|
}else if (ID == UIScreens.THAUMIC_APIARY.ordinal())
|
||||||
|
{
|
||||||
|
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
|
||||||
|
value = new GuiMagicApiary(player.inventory, tileEntityThaumicApiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.IModGuiFactory;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
||||||
|
public class GuiFactory implements IModGuiFactory
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(Minecraft minecraftInstance)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends GuiScreen> mainConfigGuiClass()
|
||||||
|
{
|
||||||
|
return ModGuiConfig.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.tileentity.TileEntityMagicApiary;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class GuiMagicApiary extends GuiContainer
|
||||||
|
{
|
||||||
|
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "apiary.png");
|
||||||
|
|
||||||
|
private static final int WIDTH = 176;
|
||||||
|
private static final int HEIGHT = 190;
|
||||||
|
|
||||||
|
private static final int LIFEBAR_WIDTH = 2;
|
||||||
|
private static final int LIFEBAR_HEIGHT = 46;
|
||||||
|
|
||||||
|
private static final int LIFEBAR_DEST_X = 21;
|
||||||
|
private static final int LIFEBAR_DEST_Y = 37;
|
||||||
|
|
||||||
|
private static final int LIFEBAR_SRC_Y = 0;
|
||||||
|
private static final int LIFEBAR_SRC_STAGE1_X = 184;
|
||||||
|
private static final int LIFEBAR_SRC_STAGE2_X = 182;
|
||||||
|
private static final int LIFEBAR_SRC_STAGE3_X = 180;
|
||||||
|
private static final int LIFEBAR_SRC_STAGE4_X = 178;
|
||||||
|
private static final int LIFEBAR_SRC_STAGE5_X = 176;
|
||||||
|
|
||||||
|
private static final int WORKBOOST_WIDTH = 16;
|
||||||
|
private static final int WORKBOOST_HEIGHT = 12;
|
||||||
|
private static final int WORKBOOST_DEST_X = 37;
|
||||||
|
private static final int WORKBOOST_DEST_Y = 18;
|
||||||
|
private static final int WORKBOOST_SRC_X = 176;
|
||||||
|
private static final int WORKBOOST_SRC_Y = 46;
|
||||||
|
|
||||||
|
private static final int DEATHBOOST_WIDTH = 11;
|
||||||
|
private static final int DEATHBOOST_HEIGHT = 13;
|
||||||
|
private static final int DEATHBOOST_DEST_X = 25;
|
||||||
|
private static final int DEATHBOOST_DEST_Y = 17;
|
||||||
|
private static final int DEATHBOOST_SRC_X = 176;
|
||||||
|
private static final int DEATHBOOST_SRC_Y = 58;
|
||||||
|
|
||||||
|
private static final int MUTATIONBOOST_WIDTH = 9;
|
||||||
|
private static final int MUTATIONBOOST_HEIGHT = 13;
|
||||||
|
private static final int MUTATIONBOOST_DEST_X = 15;
|
||||||
|
private static final int MUTATIONBOOST_DEST_Y = 17;
|
||||||
|
private static final int MUTATIONBOOST_SRC_X = 176;
|
||||||
|
private static final int MUTATIONBOOST_SRC_Y = 71;
|
||||||
|
|
||||||
|
private GuiButton mutationButton;
|
||||||
|
|
||||||
|
public GuiMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary) {
|
||||||
|
super(new ContainerMagicApiary(inventoryPlayer, thaumicApiary));
|
||||||
|
|
||||||
|
this.xSize = WIDTH;
|
||||||
|
this.ySize = HEIGHT;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||||
|
{
|
||||||
|
fontRendererObj.drawString("Inventory", 9, 99, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) {
|
||||||
|
GL11.glColor4f(1, 1, 1, 1);
|
||||||
|
this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION);
|
||||||
|
|
||||||
|
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
|
TileEntityMagicApiary apiary = ((ContainerMagicApiary)this.inventorySlots).apiary;
|
||||||
|
|
||||||
|
drawLifebar(apiary);
|
||||||
|
|
||||||
|
drawWorkBoostIcon(apiary);
|
||||||
|
drawDeathRateIcon(apiary);
|
||||||
|
drawMutationIcon(apiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawMutationIcon(TileEntityMagicApiary apiary) {
|
||||||
|
if (apiary.isMutationBoosted()) {
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + MUTATIONBOOST_DEST_X, this.guiTop + MUTATIONBOOST_DEST_Y,
|
||||||
|
MUTATIONBOOST_SRC_X, MUTATIONBOOST_SRC_Y, MUTATIONBOOST_WIDTH, MUTATIONBOOST_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawDeathRateIcon(TileEntityMagicApiary apiary) {
|
||||||
|
if (apiary.isDeathRateBoosted()) {
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + DEATHBOOST_DEST_X, this.guiTop + DEATHBOOST_DEST_Y,
|
||||||
|
DEATHBOOST_SRC_X, DEATHBOOST_SRC_Y, DEATHBOOST_WIDTH, DEATHBOOST_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawWorkBoostIcon(TileEntityMagicApiary apiary) {
|
||||||
|
if (apiary.isProductionBoosted()) {
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + WORKBOOST_DEST_X, this.guiTop + WORKBOOST_DEST_Y,
|
||||||
|
WORKBOOST_SRC_X, WORKBOOST_SRC_Y, WORKBOOST_WIDTH, WORKBOOST_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawLifebar(TileEntityMagicApiary apiary) {
|
||||||
|
int value = LIFEBAR_HEIGHT - apiary.getHealthScaled(LIFEBAR_HEIGHT);
|
||||||
|
int lifebarSrc = getLifebarSrc(apiary);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + LIFEBAR_DEST_X, this.guiTop + value + LIFEBAR_DEST_Y,
|
||||||
|
lifebarSrc, LIFEBAR_SRC_Y, LIFEBAR_WIDTH, LIFEBAR_HEIGHT - value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getLifebarSrc(TileEntityMagicApiary apiary) {
|
||||||
|
int value = apiary.getHealthScaled(5);
|
||||||
|
if (value >= 5) {
|
||||||
|
return LIFEBAR_SRC_STAGE1_X;
|
||||||
|
}
|
||||||
|
else if (value >= 4) {
|
||||||
|
return LIFEBAR_SRC_STAGE2_X;
|
||||||
|
}
|
||||||
|
else if (value >= 3) {
|
||||||
|
return LIFEBAR_SRC_STAGE3_X;
|
||||||
|
}
|
||||||
|
else if (value >= 2) {
|
||||||
|
return LIFEBAR_SRC_STAGE4_X;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return LIFEBAR_SRC_STAGE5_X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.config.GuiConfig;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.VersionInfo;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraftforge.common.config.ConfigElement;
|
||||||
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
|
||||||
|
public class ModGuiConfig extends GuiConfig
|
||||||
|
{
|
||||||
|
public ModGuiConfig(GuiScreen guiScreen)
|
||||||
|
{
|
||||||
|
super(guiScreen,
|
||||||
|
new ConfigElement(Config.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
||||||
|
VersionInfo.ModName,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
GuiConfig.getAbridgedConfigPath(Config.configuration.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author MysteriousAges
|
||||||
|
*/
|
||||||
|
public class SlotCustomItems extends Slot
|
||||||
|
{
|
||||||
|
private List<ItemStack> items;
|
||||||
|
|
||||||
|
public SlotCustomItems(IInventory inventory, int slotIndex, int xPos, int yPos, ItemStack... items)
|
||||||
|
{
|
||||||
|
super(inventory, slotIndex, xPos, yPos);
|
||||||
|
this.items = new ArrayList<ItemStack>(items.length);
|
||||||
|
|
||||||
|
Collections.addAll(this.items, items);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return List of valid ItemStacks
|
||||||
|
*/
|
||||||
|
public List<ItemStack> getValidItems()
|
||||||
|
{
|
||||||
|
return this.items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addValidItem(ItemStack newItem)
|
||||||
|
{
|
||||||
|
boolean contains = false;
|
||||||
|
for (int i = 0; i < this.items.size(); ++i)
|
||||||
|
{
|
||||||
|
ItemStack s = this.items.get(i);
|
||||||
|
if (s.getItem() == newItem.getItem())
|
||||||
|
{
|
||||||
|
if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
||||||
|
{
|
||||||
|
contains = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s.getItemDamage() == newItem.getItemDamage())
|
||||||
|
{
|
||||||
|
contains = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!contains)
|
||||||
|
{
|
||||||
|
this.items.add(newItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param removeItem ItemStack to remove.
|
||||||
|
*/
|
||||||
|
public void removeValidItem(ItemStack removeItem)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.items.size(); ++i)
|
||||||
|
{
|
||||||
|
ItemStack s = this.items.get(i);
|
||||||
|
if (s.getItem() == removeItem.getItem())
|
||||||
|
{
|
||||||
|
if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
||||||
|
{
|
||||||
|
this.items.remove(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s.getItemDamage() == removeItem.getItemDamage())
|
||||||
|
{
|
||||||
|
this.items.remove(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
for (ItemStack item : this.items)
|
||||||
|
{
|
||||||
|
if (item != null && item.getItem() == itemStack.getItem())
|
||||||
|
{
|
||||||
|
if (item.getItemDamage() == itemStack.getItemDamage() || item.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
import forestry.api.apiculture.IHiveFrame;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class SlotFrame extends SlotCustomItems {
|
||||||
|
public SlotFrame(IInventory inventory, int slotIndex, int xPos, int yPos) {
|
||||||
|
super(inventory, slotIndex, xPos, yPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack itemStack){
|
||||||
|
if (itemStack == null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean flag = false;
|
||||||
|
|
||||||
|
if(itemStack.getItem() instanceof IHiveFrame){
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package magicbees.client.gui;
|
||||||
|
|
||||||
|
public enum UIScreens
|
||||||
|
{
|
||||||
|
EFFECT_JAR,
|
||||||
|
THAUMIC_APIARY,;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package magicbees.client.model;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||||
|
import net.minecraftforge.client.model.IModelCustom;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class ModelEffectJar
|
||||||
|
{
|
||||||
|
public static final ResourceLocation objFile = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "effectJar.obj");
|
||||||
|
public static final ResourceLocation textureLocation = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "jarTexture.png");
|
||||||
|
|
||||||
|
public static final ModelEffectJar model = new ModelEffectJar();
|
||||||
|
|
||||||
|
private IModelCustom effectJarObj;
|
||||||
|
|
||||||
|
public ModelEffectJar()
|
||||||
|
{
|
||||||
|
this.effectJarObj = AdvancedModelLoader.loadModel(objFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render()
|
||||||
|
{
|
||||||
|
this.effectJarObj.renderPart("jarLid");
|
||||||
|
|
||||||
|
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||||
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
this.effectJarObj.renderPart("jarBase");
|
||||||
|
GL11.glPopAttrib();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package magicbees.client.model;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||||
|
import net.minecraftforge.client.model.IModelCustom;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class ModelVisAuraProvider {
|
||||||
|
public static final ResourceLocation objFile = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraConverter.obj");
|
||||||
|
public static final ResourceLocation textureLocation = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraProvider.png");
|
||||||
|
|
||||||
|
public static final ModelVisAuraProvider model = new ModelVisAuraProvider();
|
||||||
|
|
||||||
|
private IModelCustom visAuraProviderObj;
|
||||||
|
|
||||||
|
public ModelVisAuraProvider() {
|
||||||
|
this.visAuraProviderObj = AdvancedModelLoader.loadModel(objFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(long tick) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glRotated(Math.sin(tick * Math.PI * 2 / 80) * 0.7, 0, 1, 0);
|
||||||
|
GL11.glRotated(Math.sin((tick + 25) * Math.PI * 2 / 150) * 0.75, 0.5, 0, 0.5);
|
||||||
|
GL11.glTranslated(Math.sin(tick * Math.PI * 2 / 1000) * 0.025, 0, Math.sin((tick + 30) * Math.PI * 2 / 650) * 0.03);
|
||||||
|
float red = (float)(Math.sin(tick * Math.PI * 2 / 130) * 0.2 + 0.8);
|
||||||
|
float green = (float)(Math.cos((tick + 2) * Math.PI * 2 / 140) * 0.2 + 0.8);
|
||||||
|
float blue = (float)(Math.sin((tick + 5) * Math.PI * 2 / 99) * 0.2 + 0.8);
|
||||||
|
GL11.glColor3f(red, green, blue);
|
||||||
|
this.visAuraProviderObj.renderPart("centre");
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
GL11.glColor3f(1f, 1f, 1f);
|
||||||
|
this.visAuraProviderObj.renderPart("frame");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package magicbees.client.render;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import magicbees.client.model.ModelEffectJar;
|
||||||
|
import magicbees.tileentity.TileEntityEffectJar;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
public class RendererEffectJar extends TileEntitySpecialRenderer implements IItemRenderer
|
||||||
|
{
|
||||||
|
public static RendererEffectJar instance = new RendererEffectJar();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
|
||||||
|
{
|
||||||
|
if (tileEntity instanceof TileEntityEffectJar)
|
||||||
|
{
|
||||||
|
this.doRender(x, y, z, 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case ENTITY:
|
||||||
|
doRender(0, 0, 0, 1.8f);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EQUIPPED:
|
||||||
|
doRender(0, 0, 0, 1.5f);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EQUIPPED_FIRST_PERSON:
|
||||||
|
doRender(-.5, .5, 0.25, 1f);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVENTORY:
|
||||||
|
doRender(0.3, 0.25, 0.3, 1.5f);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doRender(double x, double y, double z, float scale)
|
||||||
|
{
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
GL11.glTranslated(x, y, z);
|
||||||
|
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelEffectJar.textureLocation);
|
||||||
|
|
||||||
|
ModelEffectJar.model.render();
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package magicbees.client.render;
|
||||||
|
|
||||||
|
import magicbees.client.model.ModelVisAuraProvider;
|
||||||
|
import magicbees.tileentity.TileEntityVisAuraProvider;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
public class RendererVisAuraProvider extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||||
|
public static RendererVisAuraProvider instance = new RendererVisAuraProvider();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float tick) {
|
||||||
|
if (entity instanceof TileEntityVisAuraProvider) {
|
||||||
|
this.doRender(x, y, z, 1f, entity.getWorldObj().getTotalWorldTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
|
doRender(0, 0, 0, 1f, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doRender(double x, double y, double z, float scale, long tick) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
GL11.glTranslated(x, y, z);
|
||||||
|
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelVisAuraProvider.textureLocation);
|
||||||
|
ModelVisAuraProvider.model.render(tick);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+17
-7
@@ -1,4 +1,4 @@
|
|||||||
package thaumicbees.item;
|
package magicbees.item;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
@@ -8,25 +8,29 @@ import forestry.api.apiculture.IArmorApiarist;
|
|||||||
public class ItemArmorApiarist extends Item implements IArmorApiarist
|
public class ItemArmorApiarist extends Item implements IArmorApiarist
|
||||||
{
|
{
|
||||||
|
|
||||||
public ItemArmorApiarist(int par1)
|
public ItemArmorApiarist()
|
||||||
{
|
{
|
||||||
super(par1);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getNumberPiecesWorn(EntityPlayer player)
|
public static int getNumberPiecesWorn(EntityPlayer player)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (wearsHelmet(player)) {
|
if (wearsHelmet(player))
|
||||||
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (wearsChest(player)) {
|
if (wearsChest(player))
|
||||||
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (wearsLegs(player)) {
|
if (wearsLegs(player))
|
||||||
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (wearsBoots(player)) {
|
if (wearsBoots(player))
|
||||||
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,4 +60,10 @@ public class ItemArmorApiarist extends Item implements IArmorApiarist
|
|||||||
ItemStack armorItem = player.inventory.armorInventory[0];
|
ItemStack armorItem = player.inventory.armorInventory[0];
|
||||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.item.types.CapsuleType;
|
||||||
|
import magicbees.item.types.FluidType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class ItemCapsule extends Item
|
||||||
|
{
|
||||||
|
private CapsuleType capsuleType;
|
||||||
|
|
||||||
|
public ItemCapsule(CapsuleType type, int maxStackSize)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.capsuleType = type;
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setMaxStackSize(maxStackSize);
|
||||||
|
this.setUnlocalizedName("capsule." + type.toString().toLowerCase());
|
||||||
|
GameRegistry.registerItem(this, "capsule." + type.toString().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public CapsuleType getType()
|
||||||
|
{
|
||||||
|
return this.capsuleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return String.format(this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getCapsuleForLiquid(FluidType l)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, 1, l.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List itemList)
|
||||||
|
{
|
||||||
|
for (FluidType l : FluidType.values())
|
||||||
|
{
|
||||||
|
if (l.available)
|
||||||
|
{
|
||||||
|
itemList.add(new ItemStack(this, 1, l.ordinal()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean requiresMultipleRenderPasses()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase()
|
||||||
|
+ this.capsuleType.getName().substring(1));
|
||||||
|
for (FluidType t : FluidType.values())
|
||||||
|
{
|
||||||
|
if (t != FluidType.EMPTY && t.liquidIcon == null)
|
||||||
|
{
|
||||||
|
t.liquidIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID.toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamageForRenderPass(int metadata, int pass)
|
||||||
|
{
|
||||||
|
IIcon i = this.itemIcon;
|
||||||
|
if (metadata != 0 && pass == 0)
|
||||||
|
{
|
||||||
|
i = FluidType.values()[Math.max(0, Math.min(metadata, FluidType.values().length - 1))].liquidIcon;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderPasses(int metadata)
|
||||||
|
{
|
||||||
|
return (metadata == 0) ? 1 : 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.item.types.CombType;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.compat.ForestryHelper;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import forestry.api.core.Tabs;
|
||||||
|
|
||||||
|
public class ItemComb extends Item
|
||||||
|
{
|
||||||
|
public ItemComb()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setCreativeTab(Tabs.tabApiculture);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("comb");
|
||||||
|
GameRegistry.registerItem(this, "comb");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStackForType(CombType type)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, 1, type.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStackForType(CombType type, int count)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, count, type.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
|
{
|
||||||
|
for (CombType type : CombType.values())
|
||||||
|
{
|
||||||
|
if (type.showInList || Config.forestryDebugEnabled)
|
||||||
|
{
|
||||||
|
list.add(this.getStackForType(type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean requiresMultipleRenderPasses()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderPasses(int meta)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon secondIcon;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.0");
|
||||||
|
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(ItemStack stack, int pass)
|
||||||
|
{
|
||||||
|
return (pass == 0) ? itemIcon : secondIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
|
{
|
||||||
|
int meta = Math.max(0, Math.min(CombType.values().length - 1, stack.getItemDamage()));
|
||||||
|
int colour = CombType.values()[meta].getColours()[0];
|
||||||
|
|
||||||
|
if (pass >= 1)
|
||||||
|
{
|
||||||
|
colour = CombType.values()[meta].getColours()[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
|
{
|
||||||
|
return CombType.values()[stack.getItemDamage()].getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemCrystalAspect extends Item
|
||||||
|
{
|
||||||
|
public ItemCrystalAspect()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("crystalAspect");
|
||||||
|
GameRegistry.registerItem(this, "crystalAspect");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||||
|
{
|
||||||
|
/*for (EnumTag tag : EnumTag.values())
|
||||||
|
{
|
||||||
|
if (tag == EnumTag.UNKNOWN)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
list.add(new ItemStack(this.itemID, 1, tag.id));
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":crystalAspect");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
//return EnumTag.get(stack.getItemDamage()).color;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("resource.crystalAspect");
|
||||||
|
//return String.format(LocalizationManager.getLocalizedString("resource.crystalAspect"), EnumTag.get(stack.getItemDamage()).name);
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
-26
@@ -1,31 +1,34 @@
|
|||||||
package thaumicbees.item;
|
package magicbees.item;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import thaumicbees.item.types.DropType;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import thaumicbees.main.CommonProxy;
|
|
||||||
import thaumicbees.main.ThaumicBees;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import forestry.api.core.Tabs;
|
import magicbees.item.types.DropType;
|
||||||
|
import magicbees.main.utils.compat.ForestryHelper;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import forestry.api.core.Tabs;
|
||||||
|
|
||||||
public class ItemDrop extends Item
|
public class ItemDrop extends Item
|
||||||
{
|
{
|
||||||
public ItemDrop(int itemID)
|
public ItemDrop()
|
||||||
{
|
{
|
||||||
super(itemID);
|
super();
|
||||||
this.setTextureFile(CommonProxy.FORESTRY_GFX_ITEMS);
|
|
||||||
this.setCreativeTab(Tabs.tabApiculture);
|
this.setCreativeTab(Tabs.tabApiculture);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("drop");
|
||||||
|
GameRegistry.registerItem(this, "drop");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(DropType type)
|
public ItemStack getStackForType(DropType type)
|
||||||
{
|
{
|
||||||
return new ItemStack(this, 1, type.ordinal());
|
return new ItemStack(this, 1, type.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(DropType type, int count)
|
public ItemStack getStackForType(DropType type, int count)
|
||||||
{
|
{
|
||||||
@@ -34,7 +37,7 @@ public class ItemDrop extends Item
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(int id, CreativeTabs tabs, List list)
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
{
|
{
|
||||||
for (DropType type : DropType.values())
|
for (DropType type : DropType.values())
|
||||||
{
|
{
|
||||||
@@ -54,17 +57,21 @@ public class ItemDrop extends Item
|
|||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon secondIcon;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.0");
|
||||||
|
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.1");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconIndex(ItemStack stack, int pass)
|
public IIcon getIcon(ItemStack stack, int pass)
|
||||||
{
|
{
|
||||||
int idx = 109;
|
return (pass == 0) ? this.itemIcon : this.secondIcon;
|
||||||
// 109, 110 are the base forestry drop textures.
|
|
||||||
if (pass >= 1)
|
|
||||||
{
|
|
||||||
idx = 110;
|
|
||||||
}
|
|
||||||
return idx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -83,15 +90,9 @@ public class ItemDrop extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemDisplayName(ItemStack stack)
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
{
|
{
|
||||||
String result = "";
|
return DropType.values()[stack.getItemDamage()].getName();
|
||||||
int meta = stack.getItemDamage();
|
|
||||||
if (meta >= 0 && meta < DropType.values().length)
|
|
||||||
{
|
|
||||||
result = DropType.values()[meta].name;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import magicbees.block.types.HiveType;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import forestry.core.items.ItemForestryBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Allen on 7/29/2014.
|
||||||
|
*/
|
||||||
|
public class ItemMagicHive extends ItemForestryBlock
|
||||||
|
{
|
||||||
|
public ItemMagicHive(Block block)
|
||||||
|
{
|
||||||
|
super(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack)
|
||||||
|
{
|
||||||
|
return getBlock().getUnlocalizedName() + "." + HiveType.getHiveFromMeta(itemstack.getItemDamage()).name().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack p_77653_1_)
|
||||||
|
{
|
||||||
|
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
+37
-47
@@ -1,15 +1,12 @@
|
|||||||
package thaumicbees.item;
|
package magicbees.item;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import thaumcraft.api.AuraNode;
|
|
||||||
import thaumcraft.api.EnumTag;
|
|
||||||
import thaumcraft.api.ObjectTags;
|
|
||||||
import thaumcraft.api.ThaumcraftApi;
|
|
||||||
import thaumicbees.item.types.HiveFrameType;
|
|
||||||
import thaumicbees.item.types.LiquidType;
|
|
||||||
import thaumicbees.main.CommonProxy;
|
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.item.types.HiveFrameType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -22,20 +19,21 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
|
|||||||
{
|
{
|
||||||
private HiveFrameType type;
|
private HiveFrameType type;
|
||||||
|
|
||||||
public ItemMagicHiveFrame(int itemID, HiveFrameType frameType)
|
public ItemMagicHiveFrame(HiveFrameType frameType)
|
||||||
{
|
{
|
||||||
super(itemID);
|
super();
|
||||||
this.type = frameType;
|
this.type = frameType;
|
||||||
this.setMaxDamage(this.type.maxDamage);
|
this.setMaxDamage(this.type.maxDamage);
|
||||||
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
|
|
||||||
this.setIconIndex(this.type.iconIdx);
|
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setUnlocalizedName("frame" + frameType.getName());
|
||||||
|
GameRegistry.registerItem(this, "frame" + frameType.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@SideOnly(Side.CLIENT)
|
||||||
public String getItemDisplayName(ItemStack itemStack)
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
return this.type.frameName;
|
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":frame" + type.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------- IHiveFrame functions -----------------------------------------
|
// --------- IHiveFrame functions -----------------------------------------
|
||||||
@@ -43,39 +41,18 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
|
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
|
||||||
{
|
{
|
||||||
this.doFluxEffect(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord());
|
return this.doWear(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), frame, wear);
|
||||||
frame = this.doWear(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), frame, wear);
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doFluxEffect(World w, int x, int y, int z)
|
|
||||||
{
|
|
||||||
if (this.type.flux != null && w.rand.nextInt(5) <= 1)
|
|
||||||
{
|
|
||||||
ThaumcraftApi.addFluxToClosest(w, x, y, z, this.type.flux);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack doWear(World w, int x, int y, int z, ItemStack frame, int wear)
|
private ItemStack doWear(World w, int x, int y, int z, ItemStack frame, int wear)
|
||||||
{
|
{
|
||||||
int damage = wear;
|
int damage = wear;
|
||||||
|
|
||||||
if (this.type.auraPerUse > 0)
|
|
||||||
{
|
|
||||||
// Attempt to use aura for the frame.
|
|
||||||
if (!ThaumcraftApi.decreaseClosestAura(w, x, y, z, this.type.auraPerUse, true))
|
|
||||||
{
|
|
||||||
// Insufficient aura, or no nearby node.
|
|
||||||
damage = wear + this.type.auraPerUse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
frame.setItemDamage(frame.getItemDamage() + damage);
|
frame.setItemDamage(frame.getItemDamage() + damage);
|
||||||
|
|
||||||
if (frame.getItemDamage() >= frame.getMaxDamage())
|
if (frame.getItemDamage() >= frame.getMaxDamage())
|
||||||
{
|
{
|
||||||
// Break!
|
// Break the frame.
|
||||||
frame = null;
|
frame = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,31 +60,31 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getTerritoryModifier(IBeeGenome genome)
|
public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
|
||||||
{
|
{
|
||||||
return this.type.territoryMod;
|
return this.type.territoryMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate)
|
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||||
{
|
{
|
||||||
return this.type.mutationMod;
|
return this.type.mutationMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate)
|
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||||
{
|
{
|
||||||
return this.type.lifespanMod;
|
return this.type.lifespanMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getProductionModifier(IBeeGenome genome)
|
public float getProductionModifier(IBeeGenome genome, float currentModifier)
|
||||||
{
|
{
|
||||||
return this.type.productionMod;
|
return this.type.productionMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getFloweringModifier(IBeeGenome genome)
|
public float getFloweringModifier(IBeeGenome genome, float currentModifier)
|
||||||
{
|
{
|
||||||
return this.type.floweringMod;
|
return this.type.floweringMod;
|
||||||
}
|
}
|
||||||
@@ -136,4 +113,17 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
|
|||||||
return this.type.isHellish;
|
return this.type.isHellish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getGeneticDecay(IBeeGenome genome, float currentModifier)
|
||||||
|
{
|
||||||
|
return this.type.geneticDecayMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.item.types.ResourceType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class ItemMiscResources extends Item
|
||||||
|
{
|
||||||
|
private IIcon[] icons = new IIcon[ResourceType.values().length];
|
||||||
|
|
||||||
|
public ItemMiscResources()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("miscResources");
|
||||||
|
GameRegistry.registerItem(this, "miscResources");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStackForType(ResourceType type)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, 1, type.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStackForType(ResourceType type, int count)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, count, type.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
|
{
|
||||||
|
for (ResourceType type : ResourceType.values())
|
||||||
|
{
|
||||||
|
if (type.showInList)
|
||||||
|
{
|
||||||
|
list.add(this.getStackForType(type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ResourceType.values().length; i++)
|
||||||
|
{
|
||||||
|
this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + ResourceType.values()[i].getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int meta)
|
||||||
|
{
|
||||||
|
return icons[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
|
{
|
||||||
|
return ResourceType.values()[stack.getItemDamage()].getLocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.MoonPhase;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class ItemMoonDial extends Item
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] icons;
|
||||||
|
|
||||||
|
public ItemMoonDial()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
this.setUnlocalizedName("moonDial");
|
||||||
|
GameRegistry.registerItem(this, "moonDial");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.icons = new IIcon[MoonPhase.values().length];
|
||||||
|
for (int i = 0; i < MoonPhase.values().length; ++i)
|
||||||
|
{
|
||||||
|
this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":moonDial." + i);
|
||||||
|
}
|
||||||
|
this.itemIcon = this.icons[4];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||||
|
{
|
||||||
|
return this.icons[MoonPhase.getMoonPhaseFromTime(player.worldObj.getWorldTime()).ordinal()];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List infoList, boolean par4)
|
||||||
|
{
|
||||||
|
if (Config.moonDialShowsPhaseInText &&
|
||||||
|
entityPlayer.getCurrentEquippedItem() != null &&
|
||||||
|
entityPlayer.getCurrentEquippedItem().getItem() == this)
|
||||||
|
{
|
||||||
|
infoList.add("\u00A77" + MoonPhase.getMoonPhaseFromTime(entityPlayer.worldObj.getWorldTime()).getLocalizedName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import magicbees.main.utils.TabMagicBees;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.projectile.EntityArrow;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemMysteriousMagnet extends Item
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon activeIcon;
|
||||||
|
|
||||||
|
private float rangeBase;
|
||||||
|
private float multiplier;
|
||||||
|
private int maxLevel;
|
||||||
|
private final float fudgeFactor = 0.2f;
|
||||||
|
|
||||||
|
public ItemMysteriousMagnet()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setNoRepair();
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.rangeBase = 3f;
|
||||||
|
this.multiplier = 0.75f;
|
||||||
|
this.maxLevel = 8;
|
||||||
|
this.setUnlocalizedName(CommonProxy.DOMAIN + ":mysteriousMagnet");
|
||||||
|
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaseRange(float value)
|
||||||
|
{
|
||||||
|
this.rangeBase = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevelMultiplier(float value)
|
||||||
|
{
|
||||||
|
this.multiplier = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaximumLevel(int value)
|
||||||
|
{
|
||||||
|
this.maxLevel = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaximumLevel()
|
||||||
|
{
|
||||||
|
return this.maxLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4)
|
||||||
|
{
|
||||||
|
String s = LocalizationManager.getLocalizedString("misc.level", itemStack.getItemDamage() >> 1);
|
||||||
|
if (isMagnetActive(itemStack))
|
||||||
|
{
|
||||||
|
list.add(LocalizationManager.getLocalizedString("misc.magnetActive", s));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list.add(LocalizationManager.getLocalizedString("misc.magnetInactive", s));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
|
{
|
||||||
|
for (int i = 0; i <= this.maxLevel; i++)
|
||||||
|
{
|
||||||
|
list.add(new ItemStack(this, 1, i * 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister iconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetInactive");
|
||||||
|
this.activeIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetActive");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int damage)
|
||||||
|
{
|
||||||
|
return isMagnetActive(damage) ? this.activeIcon : this.itemIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean hasEffect(ItemStack itemStack, int pass)
|
||||||
|
{
|
||||||
|
return isMagnetActive(itemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
if (player.isSneaking())
|
||||||
|
{
|
||||||
|
itemStack.setItemDamage(itemStack.getItemDamage() ^ 1);
|
||||||
|
}
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
|
||||||
|
{
|
||||||
|
if (isMagnetActive(itemStack) && entity instanceof EntityPlayer)
|
||||||
|
{
|
||||||
|
EntityPlayer player = (EntityPlayer)entity;
|
||||||
|
int dragCount = player.getCommandSenderName().hashCode();
|
||||||
|
float radius = getRadius(itemStack.getItemDamage()) - fudgeFactor;
|
||||||
|
AxisAlignedBB bounds = player.boundingBox.expand(radius, radius, radius);
|
||||||
|
|
||||||
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
|
||||||
|
{
|
||||||
|
bounds.expand(fudgeFactor, fudgeFactor, fudgeFactor);
|
||||||
|
|
||||||
|
if ((itemStack.getItemDamage() >> 1) >= 7)
|
||||||
|
{
|
||||||
|
List<EntityArrow> arrows = world.getEntitiesWithinAABB(EntityArrow.class, bounds);
|
||||||
|
|
||||||
|
for (EntityArrow arrow : arrows)
|
||||||
|
{
|
||||||
|
if (arrow.canBePickedUp == 1 && world.rand.nextInt(6) == 0)
|
||||||
|
{
|
||||||
|
EntityItem replacement = new EntityItem(world, arrow.posX, arrow.posY, arrow.posZ,
|
||||||
|
new ItemStack(Items.arrow));
|
||||||
|
world.spawnEntityInWorld(replacement);
|
||||||
|
}
|
||||||
|
world.removeEntity(arrow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<EntityItem> list = world.getEntitiesWithinAABB(EntityItem.class, bounds);
|
||||||
|
|
||||||
|
for (EntityItem e : list)
|
||||||
|
{
|
||||||
|
if (e.age >= 10)
|
||||||
|
{
|
||||||
|
double x = player.posX - e.posX;
|
||||||
|
double y = player.posY - e.posY;
|
||||||
|
double z = player.posZ - e.posZ;
|
||||||
|
|
||||||
|
double length = Math.sqrt(x * x + y * y + z * z) * 2;
|
||||||
|
|
||||||
|
x = x / length + player.motionX / 2;
|
||||||
|
y = y / length + player.motionY / 2;
|
||||||
|
z = z / length + player.motionZ / 2;
|
||||||
|
|
||||||
|
e.motionX = x;
|
||||||
|
e.motionY = y;
|
||||||
|
e.motionZ = z;
|
||||||
|
e.isAirBorne = true;
|
||||||
|
|
||||||
|
if (e.isCollidedHorizontally)
|
||||||
|
{
|
||||||
|
e.motionY += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (world.rand.nextInt(20) == 0)
|
||||||
|
{
|
||||||
|
float pitch = 0.85f - world.rand.nextFloat() * 3f / 10f;
|
||||||
|
world.playSoundEffect(e.posX, e.posY, e.posZ, "mob.endermen.portal", 0.6f, pitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isMagnetActive(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return isMagnetActive(itemStack.getItemDamage());
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isMagnetActive(int damage)
|
||||||
|
{
|
||||||
|
return (damage & 0x01) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getRadius(int damageValue)
|
||||||
|
{
|
||||||
|
return this.rangeBase + (multiplier * (damageValue >> 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import magicbees.item.types.NuggetType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class ItemNugget extends Item
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] icons;
|
||||||
|
|
||||||
|
public ItemNugget()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setCreativeTab(CreativeTabs.tabMaterials);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("beeNugget");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStackForType(NuggetType type)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, 1, type.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStackForType(NuggetType type, int count)
|
||||||
|
{
|
||||||
|
return new ItemStack(this, count, type.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||||
|
{
|
||||||
|
for (NuggetType type : NuggetType.values())
|
||||||
|
{
|
||||||
|
if (type.isActive())
|
||||||
|
{
|
||||||
|
list.add(new ItemStack(item, 1, type.ordinal()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.icons = new IIcon[NuggetType.values().length];
|
||||||
|
for (int i = 0; i < NuggetType.values().length; i++)
|
||||||
|
{
|
||||||
|
this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":nugget"
|
||||||
|
+ NuggetType.values()[i].name().substring(0, 1)
|
||||||
|
+ NuggetType.values()[i].name().substring(1).toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int meta)
|
||||||
|
{
|
||||||
|
return icons[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
|
{
|
||||||
|
return NuggetType.values()[stack.getItemDamage()].getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
-29
@@ -1,30 +1,34 @@
|
|||||||
package thaumicbees.item;
|
package magicbees.item;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import thaumicbees.item.types.PollenType;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import thaumicbees.main.CommonProxy;
|
|
||||||
import thaumicbees.main.ThaumicBees;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import forestry.api.core.Tabs;
|
import magicbees.item.types.PollenType;
|
||||||
|
import magicbees.main.utils.compat.ForestryHelper;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import forestry.api.core.Tabs;
|
||||||
|
|
||||||
public class ItemPollen extends Item
|
public class ItemPollen extends Item
|
||||||
{
|
{
|
||||||
public ItemPollen(int itemID)
|
public ItemPollen()
|
||||||
{
|
{
|
||||||
super(itemID);
|
super();
|
||||||
this.setTextureFile(CommonProxy.FORESTRY_GFX_ITEMS);
|
|
||||||
this.setCreativeTab(Tabs.tabApiculture);
|
this.setCreativeTab(Tabs.tabApiculture);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("pollen");
|
||||||
|
GameRegistry.registerItem(this, "pollen");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(PollenType type)
|
public ItemStack getStackForType(PollenType type)
|
||||||
{
|
{
|
||||||
return new ItemStack(this, 1, type.ordinal());
|
return new ItemStack(this, 1, type.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(PollenType type, int count)
|
public ItemStack getStackForType(PollenType type, int count)
|
||||||
{
|
{
|
||||||
@@ -33,7 +37,7 @@ public class ItemPollen extends Item
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(int id, CreativeTabs tabs, List list)
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
{
|
{
|
||||||
for (PollenType type : PollenType.values())
|
for (PollenType type : PollenType.values())
|
||||||
{
|
{
|
||||||
@@ -53,17 +57,21 @@ public class ItemPollen extends Item
|
|||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon secondIcon;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.0");
|
||||||
|
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.1");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconIndex(ItemStack stack, int pass)
|
public IIcon getIcon(ItemStack stack, int pass)
|
||||||
{
|
{
|
||||||
int idx = 45;
|
return (pass == 0) ? this.itemIcon : this.secondIcon;
|
||||||
// 45, 46 are the base forestry pollen textures.
|
|
||||||
if (pass >= 1)
|
|
||||||
{
|
|
||||||
idx = 46;
|
|
||||||
}
|
|
||||||
return idx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,26 +79,20 @@ public class ItemPollen extends Item
|
|||||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
{
|
{
|
||||||
int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage()));
|
int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage()));
|
||||||
int colour = PollenType.values()[meta].combColour[0];
|
int colour = PollenType.values()[meta].colour[0];
|
||||||
|
|
||||||
if (pass >= 1)
|
if (pass >= 1)
|
||||||
{
|
{
|
||||||
colour = PollenType.values()[meta].combColour[1];
|
colour = PollenType.values()[meta].colour[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return colour;
|
return colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemDisplayName(ItemStack stack)
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
{
|
{
|
||||||
String result = "";
|
return PollenType.values()[stack.getItemDamage()].getName();
|
||||||
int meta = stack.getItemDamage();
|
|
||||||
if (meta >= 0 && meta < PollenType.values().length)
|
|
||||||
{
|
|
||||||
result = PollenType.values()[meta].name;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+20
-18
@@ -1,31 +1,33 @@
|
|||||||
package thaumicbees.item;
|
package magicbees.item;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import thaumicbees.item.types.PropolisType;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import thaumicbees.main.CommonProxy;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import forestry.api.core.Tabs;
|
import magicbees.item.types.PropolisType;
|
||||||
|
import magicbees.main.utils.compat.ForestryHelper;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import forestry.api.core.Tabs;
|
||||||
|
|
||||||
public class ItemPropolis extends Item
|
public class ItemPropolis extends Item
|
||||||
{
|
{
|
||||||
public ItemPropolis(int id)
|
public ItemPropolis()
|
||||||
{
|
{
|
||||||
super(id);
|
super();
|
||||||
this.setTextureFile(CommonProxy.FORESTRY_GFX_ITEMS);
|
|
||||||
this.setCreativeTab(Tabs.tabApiculture);
|
this.setCreativeTab(Tabs.tabApiculture);
|
||||||
this.setIconIndex(98);
|
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("propolis");
|
||||||
|
GameRegistry.registerItem(this, "propolis");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(PropolisType type)
|
public ItemStack getStackForType(PropolisType type)
|
||||||
{
|
{
|
||||||
return new ItemStack(this, 1, type.ordinal());
|
return new ItemStack(this, 1, type.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(PropolisType type, int count)
|
public ItemStack getStackForType(PropolisType type, int count)
|
||||||
{
|
{
|
||||||
@@ -34,7 +36,7 @@ public class ItemPropolis extends Item
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(int id, CreativeTabs tabs, List list)
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
{
|
{
|
||||||
for (PropolisType type : PropolisType.values())
|
for (PropolisType type : PropolisType.values())
|
||||||
{
|
{
|
||||||
@@ -42,6 +44,12 @@ public class ItemPropolis extends Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":propolis.0");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
{
|
{
|
||||||
@@ -55,15 +63,9 @@ public class ItemPropolis extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemDisplayName(ItemStack stack)
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
{
|
{
|
||||||
String result = "";
|
return PropolisType.values()[stack.getItemDamage()].getName();
|
||||||
int meta = stack.getItemDamage();
|
|
||||||
if (meta >= 0 && meta < PropolisType.values().length)
|
|
||||||
{
|
|
||||||
result = PropolisType.values()[meta].name;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.Config;
|
||||||
|
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
import thaumcraft.api.IRepairableExtended;
|
||||||
|
import thaumcraft.api.ThaumcraftApi;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import forestry.api.arboriculture.IToolGrafter;
|
||||||
|
|
||||||
|
@Optional.InterfaceList(
|
||||||
|
{
|
||||||
|
@Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IToolGrafter
|
||||||
|
{
|
||||||
|
public ItemThaumiumGrafter()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setMaxDamage(15);
|
||||||
|
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
|
||||||
|
this.setUnlocalizedName("thaumiumGrafter");
|
||||||
|
this.setHarvestLevel("grafter", 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return 100f;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float func_150893_a(ItemStack itemStack, Block block)
|
||||||
|
{
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getDigSpeed(ItemStack itemStack, Block block, int metadata)
|
||||||
|
{
|
||||||
|
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int x, int y, int z,
|
||||||
|
EntityLivingBase entityLiving)
|
||||||
|
{
|
||||||
|
int damage = 1;
|
||||||
|
if (block == Config.tcLeaf)
|
||||||
|
{
|
||||||
|
int meta = world.getBlockMetadata(x, y, z) & 1;
|
||||||
|
if (meta == 0 || meta == 1)
|
||||||
|
{
|
||||||
|
double chance = Math.random();
|
||||||
|
if (chance <= Config.thaumcraftSaplingDroprate)
|
||||||
|
{
|
||||||
|
this.dropItem(world, x, y, z, new ItemStack(Config.tcPlant, 1, meta));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemstack.damageItem(damage, entityLiving);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dropItem(World world, int x, int y, int z, ItemStack item)
|
||||||
|
{
|
||||||
|
if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops"))
|
||||||
|
{
|
||||||
|
float f = 0.7F;
|
||||||
|
double d0 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||||
|
double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||||
|
double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||||
|
EntityItem entityitem = new EntityItem(world, (double)x + d0, (double)y + d1, (double)z + d2, item);
|
||||||
|
entityitem.delayBeforeCanPickup = 10;
|
||||||
|
world.spawnEntityInWorld(entityitem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the enchantability factor of the item, most of the time is based on material.
|
||||||
|
*/
|
||||||
|
@Optional.Method(modid = ThaumcraftHelper.Name)
|
||||||
|
public int getItemEnchantability()
|
||||||
|
{
|
||||||
|
return ThaumcraftApi.toolMatThaumium.getEnchantability();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the name for this tool's material.
|
||||||
|
*/
|
||||||
|
@Optional.Method(modid = ThaumcraftHelper.Name)
|
||||||
|
public String getToolMaterialName()
|
||||||
|
{
|
||||||
|
return ThaumcraftApi.toolMatThaumium.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether this item is repairable in an anvil.
|
||||||
|
*/
|
||||||
|
@Optional.Method(modid = ThaumcraftHelper.Name)
|
||||||
|
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
|
||||||
|
{
|
||||||
|
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() || super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if (stack.getItemDamage() > 0)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
player.addExhaustion(0.6f * (enchantLevel * enchantLevel));
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister iconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumGrafter");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package magicbees.item;
|
||||||
|
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
import thaumcraft.api.IRepairable;
|
||||||
|
import thaumcraft.api.ThaumcraftApi;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import forestry.api.core.IToolScoop;
|
||||||
|
|
||||||
|
@Optional.InterfaceList(
|
||||||
|
{
|
||||||
|
@Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
|
||||||
|
{
|
||||||
|
public ItemThaumiumScoop()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setMaxDamage(30);
|
||||||
|
this.setCreativeTab(forestry.api.core.Tabs.tabApiculture);
|
||||||
|
this.setUnlocalizedName("thaumiumScoop");
|
||||||
|
this.setHarvestLevel("scoop", 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float func_150893_a(ItemStack itemStack, Block block)
|
||||||
|
{
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getDigSpeed(ItemStack itemStack, Block block, int metadata)
|
||||||
|
{
|
||||||
|
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l,
|
||||||
|
EntityLivingBase entityliving)
|
||||||
|
{
|
||||||
|
itemstack.damageItem(1, entityliving);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the enchantability factor of the item, most of the time is based on material.
|
||||||
|
*/
|
||||||
|
@Optional.Method(modid = ThaumcraftHelper.Name)
|
||||||
|
public int getItemEnchantability()
|
||||||
|
{
|
||||||
|
return ThaumcraftApi.toolMatThaumium.getEnchantability();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the name for this tool's material.
|
||||||
|
*/
|
||||||
|
@Optional.Method(modid = ThaumcraftHelper.Name)
|
||||||
|
public String getToolMaterialName()
|
||||||
|
{
|
||||||
|
return ThaumcraftApi.toolMatThaumium.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether this item is repairable in an anvil.
|
||||||
|
*/
|
||||||
|
@Optional.Method(modid = ThaumcraftHelper.Name)
|
||||||
|
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
|
||||||
|
{
|
||||||
|
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() || super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister iconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumScoop");
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
-26
@@ -1,25 +1,31 @@
|
|||||||
package thaumicbees.item;
|
package magicbees.item;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import thaumicbees.item.types.WaxType;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import thaumicbees.main.CommonProxy;
|
|
||||||
import thaumicbees.main.ThaumicBees;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import forestry.api.core.Tabs;
|
import magicbees.item.types.WaxType;
|
||||||
|
import magicbees.main.CommonProxy;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import forestry.api.core.Tabs;
|
||||||
|
|
||||||
public class ItemWax extends Item
|
public class ItemWax extends Item
|
||||||
{
|
{
|
||||||
public ItemWax(int itemID)
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon secondaryIcon;
|
||||||
|
|
||||||
|
public ItemWax()
|
||||||
{
|
{
|
||||||
super(itemID);
|
super();
|
||||||
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
|
|
||||||
this.setCreativeTab(Tabs.tabApiculture);
|
this.setCreativeTab(Tabs.tabApiculture);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName("wax");
|
||||||
|
GameRegistry.registerItem(this, "wax");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackForType(WaxType type)
|
public ItemStack getStackForType(WaxType type)
|
||||||
@@ -32,21 +38,23 @@ public class ItemWax extends Item
|
|||||||
return new ItemStack(this, count, type.ordinal());
|
return new ItemStack(this, count, type.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@SideOnly(Side.CLIENT)
|
||||||
public int getIconIndex(ItemStack stack, int pass)
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
int idx = 1;
|
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.0");
|
||||||
int meta = stack.getItemDamage();
|
this.secondaryIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.1");
|
||||||
if (meta >= 0 && meta < WaxType.values().length)
|
}
|
||||||
{
|
|
||||||
idx = (WaxType.values()[meta].sparkly) ? 0 : 1;
|
@Override
|
||||||
}
|
@SideOnly(Side.CLIENT)
|
||||||
return idx;
|
public IIcon getIconFromDamage(int meta)
|
||||||
|
{
|
||||||
|
return (WaxType.values()[meta].sparkly) ? this.itemIcon : this.secondaryIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(int id, CreativeTabs tabs, List list)
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
{
|
{
|
||||||
for (WaxType type : WaxType.values())
|
for (WaxType type : WaxType.values())
|
||||||
{
|
{
|
||||||
@@ -68,14 +76,8 @@ public class ItemWax extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemDisplayName(ItemStack stack)
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
{
|
{
|
||||||
String result = "";
|
return WaxType.values()[stack.getItemDamage()].getName();
|
||||||
int meta = stack.getItemDamage();
|
|
||||||
if (meta >= 0 && meta < WaxType.values().length)
|
|
||||||
{
|
|
||||||
result = WaxType.values()[meta].name;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
|
||||||
|
public enum CapsuleType
|
||||||
|
{
|
||||||
|
MAGIC("magic", 2000, 0),
|
||||||
|
VOID("void", 8000, 1),
|
||||||
|
;
|
||||||
|
private String name;
|
||||||
|
public int capacity;
|
||||||
|
public int iconIdx;
|
||||||
|
|
||||||
|
private CapsuleType(String n, int c, int idx)
|
||||||
|
{
|
||||||
|
this.name = n;
|
||||||
|
this.capacity = c;
|
||||||
|
this.iconIdx = idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocalizedName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("capsule." + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
|
||||||
|
public enum CombType
|
||||||
|
{
|
||||||
|
MUNDANE("mundane", true),
|
||||||
|
MOLTEN("molten", true),
|
||||||
|
OCCULT("occult", true),
|
||||||
|
OTHERWORLDLY("otherworldly", true),
|
||||||
|
TRANSMUTED("transmuted", true),
|
||||||
|
|
||||||
|
PAPERY("paper", true),
|
||||||
|
SOUL("soul", true),
|
||||||
|
FURTIVE("furtive", false),
|
||||||
|
INTELLECT("aware", false),
|
||||||
|
TEMPORAL("time", false),
|
||||||
|
FORGOTTEN("forgotten", false),
|
||||||
|
|
||||||
|
AIRY("air", false),
|
||||||
|
FIREY("fire", false),
|
||||||
|
WATERY("water", false),
|
||||||
|
EARTHY("earth", false),
|
||||||
|
|
||||||
|
TC_AIR("TCair", false),
|
||||||
|
TC_FIRE("TCfire", false),
|
||||||
|
TC_WATER("TCwater", false),
|
||||||
|
TC_EARTH("TCearth", false),
|
||||||
|
TC_ORDER("TCorder", false),
|
||||||
|
TC_CHAOS("TCchaos", false),
|
||||||
|
|
||||||
|
AM_ESSENCE("essence", false),
|
||||||
|
AM_POTENT("potent", false),
|
||||||
|
|
||||||
|
TE_DESTABILIZED("TEelectric", false),
|
||||||
|
TE_CARBON("TEcarbon", false),
|
||||||
|
TE_LUX("TElux", false),
|
||||||
|
TE_ENDEARING("TEendearing", false),
|
||||||
|
;
|
||||||
|
|
||||||
|
private static int[][] colours = new int[][] {
|
||||||
|
{ 0xFF9859, 0xFFC58E },
|
||||||
|
{ 0xcc3333, 0x1E160E },
|
||||||
|
{ 0x9872FF, 0x2D2D2D },
|
||||||
|
{ 0x3EE0D8, 0x3A3820 },
|
||||||
|
{ 0xE5425D, 0x323291 },
|
||||||
|
|
||||||
|
{ 0xBCA664, 0x35332E },
|
||||||
|
{ 0x7F7171, 0x876D53 },
|
||||||
|
{ 0xB7ACB7, 0x636363 },
|
||||||
|
{ 0x0092e9, 0x618fff },
|
||||||
|
{ 0x2F9381, 0x773C31 },
|
||||||
|
{ 0xB191D8, 0x35443B },
|
||||||
|
|
||||||
|
{ 0xffff7e, 0x606308 },
|
||||||
|
{ 0xff3C01, 0x5B0D10 },
|
||||||
|
{ 0x0090ff, 0x102F6B },
|
||||||
|
{ 0x00a000, 0x043004 },
|
||||||
|
|
||||||
|
{ 0xFFDF14, 0x707019 },
|
||||||
|
{ 0xE21802, 0x3F0E12 },
|
||||||
|
{ 0x00B6FF, 0x0F373D },
|
||||||
|
{ 0x28D328, 0x333004 },
|
||||||
|
{ 0xDDDDFF, 0x9D9DB5 },
|
||||||
|
{ 0x555577, 0x2D2D56 },
|
||||||
|
|
||||||
|
{ 0xCC8604, 0x41046F },
|
||||||
|
{ 0xCCCC04, 0x41046F },
|
||||||
|
|
||||||
|
{ 0xCC002C, 0x6B0118 },
|
||||||
|
{ 0x454545, 0x0F0F0F },
|
||||||
|
{ 0xF5F3A4, 0xC9C87D },
|
||||||
|
{ 0x12E3D9, 0x069E97 },
|
||||||
|
};
|
||||||
|
|
||||||
|
private CombType(String pName, boolean show)
|
||||||
|
{
|
||||||
|
this.name = pName;
|
||||||
|
|
||||||
|
this.showInList = show;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHidden()
|
||||||
|
{
|
||||||
|
this.showInList = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
public boolean showInList;
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("comb." + this.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getColours()
|
||||||
|
{
|
||||||
|
return colours[this.ordinal()];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
|
||||||
|
public enum DropType
|
||||||
|
{
|
||||||
|
ENCHANTED("enchanting", 0x6e1c6d, 0xff8fff),
|
||||||
|
INTELLECT("intellect", 0x25914D, 0x18E072),
|
||||||
|
DESTABILIZED("destabilized", 0xCC002C, 0x6B0118),
|
||||||
|
CARBON("carbon", 0x454545, 0x0F0F0F),
|
||||||
|
LUX("lux", 0xF5F3A4, 0xC9C87D),
|
||||||
|
ENDEARING("endearing", 0x12E3D9, 0x069E97),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private DropType(String pName, int colourA, int colourB)
|
||||||
|
{
|
||||||
|
this.name = pName;
|
||||||
|
this.combColour[0] = colourA;
|
||||||
|
this.combColour[1] = colourB;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
public int[] combColour = new int[2];
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("drop." + this.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public enum FluidType
|
||||||
|
{
|
||||||
|
// Incidentally, Item meta is the liquid ID.
|
||||||
|
|
||||||
|
// Args are: forgeLiquidID, Display Name, Icon idx
|
||||||
|
EMPTY(""),
|
||||||
|
|
||||||
|
// Vanilla
|
||||||
|
WATER("water"),
|
||||||
|
LAVA("lava"),
|
||||||
|
|
||||||
|
// Forestry
|
||||||
|
BIOMASS("biomass"),
|
||||||
|
ETHANOL("bioethanol"),
|
||||||
|
|
||||||
|
// Buildcraft
|
||||||
|
OIL("oil"),
|
||||||
|
FUEL("fuel"),
|
||||||
|
|
||||||
|
// More Forestry
|
||||||
|
SEEDOIL("seedoil"),
|
||||||
|
HONEY("honey"),
|
||||||
|
JUICE("juice"),
|
||||||
|
CRUSHEDICE("ice"),
|
||||||
|
MILK("milk"),
|
||||||
|
|
||||||
|
// ExtraBees liquids
|
||||||
|
ACID("acid"),
|
||||||
|
POISON("poison"),
|
||||||
|
LIQUIDNITROGEN("liquidnitrogen"),
|
||||||
|
DNA("liquiddna"),
|
||||||
|
|
||||||
|
// Railcraft
|
||||||
|
CREOSOTEOIL("creosote"),
|
||||||
|
STEAM("steam"),
|
||||||
|
;
|
||||||
|
public String liquidID;
|
||||||
|
public int iconIdx;
|
||||||
|
public boolean available = false;
|
||||||
|
public IIcon liquidIcon;
|
||||||
|
|
||||||
|
private FluidType(String l)
|
||||||
|
{
|
||||||
|
this.liquidID = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("liquid." + liquidID);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
|
||||||
|
public enum HiveFrameType
|
||||||
|
{
|
||||||
|
MAGIC("Magic", 240, 1f, 1f, 1f, 2f, 0.6f),
|
||||||
|
RESILIENT("Resilient", 800, 1f, 1f, 1f, 2f, 0.5f),
|
||||||
|
GENTLE("Gentle", 200, 1f, 0.7f, 1.5f, 1.4f, 0.01f),
|
||||||
|
METABOLIC("Metabolic", 130, 1f, 1.8f, 1f, 1.2f, 1f),
|
||||||
|
NECROTIC("Necrotic", 280, 1f, 1f, 0.3f, 0.75f, 1.2f),
|
||||||
|
TEMPORAL("Temporal", 300, 1f, 1f, 2.5f, 1f, 0.8f),
|
||||||
|
OBLIVION("Oblivion", 50, 1f, 1f, 0.0001f, 0f, 1f),
|
||||||
|
;
|
||||||
|
|
||||||
|
private HiveFrameType(String name, int damage,
|
||||||
|
float territory, float mutation, float lifespan, float production, float geneticDecay)
|
||||||
|
{
|
||||||
|
this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private HiveFrameType(String name, int damage,
|
||||||
|
float territory, float mutation, float lifespan, float production, float flowering, float geneticDecay,
|
||||||
|
boolean sealed, boolean lit, boolean sunlit, boolean hellish)
|
||||||
|
{
|
||||||
|
this.frameName = name;
|
||||||
|
this.maxDamage = damage;
|
||||||
|
|
||||||
|
this.territoryMod = territory;
|
||||||
|
this.mutationMod = mutation;
|
||||||
|
this.lifespanMod = lifespan;
|
||||||
|
this.productionMod = production;
|
||||||
|
this.floweringMod = flowering;
|
||||||
|
this.geneticDecayMod = geneticDecay;
|
||||||
|
this.isSealed = sealed;
|
||||||
|
this.isLit = lit;
|
||||||
|
this.isSunlit = sunlit;
|
||||||
|
this.isHellish = hellish;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String frameName;
|
||||||
|
public int maxDamage;
|
||||||
|
|
||||||
|
public float territoryMod;
|
||||||
|
public float mutationMod;
|
||||||
|
public float lifespanMod;
|
||||||
|
public float productionMod;
|
||||||
|
public float floweringMod;
|
||||||
|
public float geneticDecayMod;
|
||||||
|
public boolean isSealed;
|
||||||
|
public boolean isLit;
|
||||||
|
public boolean isSunlit;
|
||||||
|
public boolean isHellish;
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return this.frameName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocalizedName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("frame." + this.frameName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
|
public enum NuggetType
|
||||||
|
{
|
||||||
|
IRON,
|
||||||
|
COPPER,
|
||||||
|
TIN,
|
||||||
|
SILVER,
|
||||||
|
LEAD,
|
||||||
|
DIAMOND,
|
||||||
|
EMERALD,
|
||||||
|
APATITE,
|
||||||
|
;
|
||||||
|
|
||||||
|
private Item targetIngot;
|
||||||
|
private boolean active;
|
||||||
|
|
||||||
|
private NuggetType()
|
||||||
|
{
|
||||||
|
this.active = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIngotItem(Item target)
|
||||||
|
{
|
||||||
|
this.targetIngot = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item getIngotItem()
|
||||||
|
{
|
||||||
|
return this.targetIngot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInactive()
|
||||||
|
{
|
||||||
|
this.active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActive()
|
||||||
|
{
|
||||||
|
return this.active;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("nugget." + this.toString().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
|
||||||
|
public enum PollenType
|
||||||
|
{
|
||||||
|
UNUSUAL("unusual", 0xD8417B, 0xA03059),
|
||||||
|
PHASED("phased", 0x4974B4, 0x456BA5),
|
||||||
|
;
|
||||||
|
|
||||||
|
private PollenType(String pName, int colourA, int colourB)
|
||||||
|
{
|
||||||
|
this.name = pName;
|
||||||
|
this.colour[0] = colourA;
|
||||||
|
this.colour[1] = colourB;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
public int[] colour = new int[2];
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("pollen." + this.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package magicbees.item.types;
|
||||||
|
|
||||||
|
import magicbees.main.utils.LocalizationManager;
|
||||||
|
|
||||||
|
public enum PropolisType
|
||||||
|
{
|
||||||
|
UNSTABLE("unstable", 0xEFB492),
|
||||||
|
|
||||||
|
AIR("air", 0xA19E10),
|
||||||
|
FIRE("fire", 0x95132F),
|
||||||
|
WATER("water", 0x1054A1),
|
||||||
|
EARTH("earth", 0x00a000),
|
||||||
|
ORDER("dull", 0xDDDDFF),
|
||||||
|
CHAOS("magic", 0x555577),
|
||||||
|
;
|
||||||
|
|
||||||
|
private PropolisType(String pName, int overlayColour)
|
||||||
|
{
|
||||||
|
this.name = pName;
|
||||||
|
this.colour = overlayColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
public int colour;
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return LocalizationManager.getLocalizedString("propolis." + this.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loaded 100 of 337 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user