mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-12 16:27:34 +00:00
Finishing up Worldgen, added new initial mutations (still several left to go)
This commit is contained in:
1 parent
b7714a1435
commit
37e8965a3c
19 files changed
+464
-423
No files matched your search
+21
-23
@@ -1,11 +1,11 @@
|
||||
<project name="ThaumicBees" basedir="../../../" default="main">
|
||||
<project name="MagicBees" basedir="../../../" default="main">
|
||||
<property name="build.dir" value="build" />
|
||||
<property name="classes.dir" value="${build.dir}/classes" />
|
||||
<property name="resource.dir" value="${build.dir}/mc.dev" />
|
||||
<property name="jar.dir" value="${build.dir}/jar" />
|
||||
|
||||
<property name="src.dir" value="Sources/ThaumicBees" />
|
||||
<property name="lang.dir" value="Sources/ThaumicBees/thaumicbees_res/lang" />
|
||||
<property name="src.dir" value="Sources/MagicBees" />
|
||||
<property name="lang.dir" value="Sources/MagicBees/magicbees_res/lang" />
|
||||
|
||||
<property name="forge.dir" value="${build.dir}/forge" />
|
||||
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
||||
@@ -16,20 +16,20 @@
|
||||
|
||||
<property name="mc.version" value="1.5.2"/>
|
||||
<property name="forge.version" value="7.8.0.700"/>
|
||||
<property name="thaumicbees.version" value="1.4.7a"/>
|
||||
<property name="magicbees.version" value="1.9.9"/>
|
||||
|
||||
<!-- for local deployment only, not used by main -->
|
||||
<property name="deploy.type" value="previews" />
|
||||
<property name="deploy.root" value="C:\Users\Marc\Dropbox\Public\ThaumicBees" />
|
||||
<property name="deploy.root" value="C:\Users\Marc\Dropbox\Public\magicBees" />
|
||||
<property name="deploy.dir" value="${deploy.root}\${deploy.type}" />
|
||||
<property name="share.dir" value="C:\Users\Marc\Dropbox\Shared\ThaumicBees" />
|
||||
<property name="share.dir" value="C:\Users\Marc\Dropbox\Shared\magicBees" />
|
||||
<property name="local.dir" value="D:\Games\Minecraft\MultiMC\instances\1.4.6 pure\minecraft\mods" />
|
||||
|
||||
<!-- TARGETS -->
|
||||
<target name="clean">
|
||||
<delete dir="${clientsrc.dir}/forestry" />
|
||||
<delete dir="${clientsrc.dir}/thaumcraft" />
|
||||
<delete dir="${clientsrc.dir}/thaumicbees" />
|
||||
<delete dir="${clientsrc.dir}/magicbees" />
|
||||
<delete dir="${classes.dir}" />
|
||||
</target>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
<target name="setup">
|
||||
<!-- Set build number -->
|
||||
<buildnumber file="${src.dir}/thaumicbees_res/build.number"/>
|
||||
<buildnumber file="${src.dir}/magicbees_res/build.number"/>
|
||||
|
||||
<!-- Copy source -->
|
||||
<echo message="Copying Source" />
|
||||
@@ -68,20 +68,19 @@
|
||||
<fileset dir="${thaumcraft.dir}/">
|
||||
<include name="thaumcraft/api/**" />
|
||||
</fileset>
|
||||
<fileset dir="${src.dir}/thaumicbees_src">
|
||||
<include name="**/net/mysteriousages/**" />
|
||||
<include name="**/thaumicbees/**" />
|
||||
<fileset dir="${src.dir}/magicbees_src">
|
||||
<include name="**/magicbees/**" />
|
||||
<include name="**/forestry/**" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${clientsrc.dir}" overwrite="true" failonerror="true">
|
||||
<fileset dir="${src.dir}/thaumicbees_src">
|
||||
<fileset dir="${src.dir}/magicbees_src">
|
||||
<include name="**/VersionInfo.java" />
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="MCVERSION" value="${mc.version}" />
|
||||
<filter token="VERSION" value="${thaumicbees.version}" />
|
||||
<filter token="VERSION" value="${magicbees.version}" />
|
||||
<filter token="BUILD_NUMBER" value="${build.number}" />
|
||||
<filter token="FINGERPRINT" value="${key.fingerprint}" />
|
||||
</filterset>
|
||||
@@ -115,25 +114,24 @@
|
||||
<fileset dir="${mcp.dir}/reobf/minecraft">
|
||||
<exclude name="forestry/api/**" />
|
||||
|
||||
<include name="**/thaumicbees/**" />
|
||||
<include name="**/net/mysteriousages/**" />
|
||||
<include name="**/magicbees/**" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- Copy ThaumicBees resources -->
|
||||
<!-- Copy magicBees resources -->
|
||||
<copy todir="${classes.dir}/client">
|
||||
<fileset dir="${src.dir}/thaumicbees_res">
|
||||
<fileset dir="${src.dir}/magicbees_res">
|
||||
<exclude name="build.xml"/>
|
||||
<exclude name="build.number"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${classes.dir}/client" overwrite="true" failonerror="true">
|
||||
<fileset dir="${src.dir}/thaumicbees_res">
|
||||
<fileset dir="${src.dir}/magicbees_res">
|
||||
<include name="**/mcmod.info" />
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="MODVERSION" value="${thaumicbees.version}" />
|
||||
<filter token="MODVERSION" value="${magicbees.version}" />
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
@@ -141,19 +139,19 @@
|
||||
<!-- Package the jars -->
|
||||
<target name="package" depends="setup,compile">
|
||||
<echo message="Packaging basic jar..." />
|
||||
<jar destfile="${jar.dir}/thaumicbees-${thaumicbees.version}-${build.number}.jar" basedir="${classes.dir}/client"/>
|
||||
<jar destfile="${jar.dir}/magicbees-${magicbees.version}-${build.number}.jar" basedir="${classes.dir}/client"/>
|
||||
</target>
|
||||
|
||||
<!-- Deploy to private share -->
|
||||
<target name="deploy.private" depends="clean,package">
|
||||
<copy todir="${local.dir}">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="thaumicbees-*.jar" />
|
||||
<include name="magicbees-*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${share.dir}/">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="thaumicbees-*.jar" />
|
||||
<include name="magicbees-*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
@@ -162,7 +160,7 @@
|
||||
<target name="deploy.public" depends="deploy.private">
|
||||
<copy todir="${deploy.dir}">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="thaumicbees-*.jar" />
|
||||
<include name="magicbees-*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[
|
||||
{
|
||||
"modid": "ThaumicBees",
|
||||
"modid": "MagicBees",
|
||||
"version": "@MODVERSION@",
|
||||
"name": "ThaumicBees",
|
||||
"name": "Magic Bees",
|
||||
"url": "http://bit.ly/XFDvLY",
|
||||
"description": "Magic bees & more. Supports Thaumcraft, Equivalent Exchange 3",
|
||||
"description": "Magic themed bee expansion for Forestry. TC3, EE3, AM compatible!",
|
||||
"authors": [ "MysteriousAges" ],
|
||||
"credits": "SirSengir, Azanor, Binnie & the Forestry Dev peeps",
|
||||
"logoFile": "/mods/thaumicbees/textures/logo.png"
|
||||
"logoFile": "/mods/magicbees/textures/logo.png"
|
||||
}
|
||||
]
|
||||
@@ -16,7 +16,6 @@ public class Allele implements IAllele
|
||||
{
|
||||
public static IBeeRoot beeRoot;
|
||||
|
||||
public static AlleleInteger fertilityHighDominant;
|
||||
public static AlleleFloat speedBlinding;
|
||||
|
||||
public static IAlleleFlowers flowerBookshelf;
|
||||
@@ -46,7 +45,6 @@ public class Allele implements IAllele
|
||||
{
|
||||
beeRoot = (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
|
||||
|
||||
Allele.fertilityHighDominant = new AlleleInteger("fertilityHighDominant", 3, true);
|
||||
Allele.speedBlinding = new AlleleFloat("speedBlinding", 2f, false);
|
||||
|
||||
Allele.flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
|
||||
@@ -110,7 +108,7 @@ public class Allele implements IAllele
|
||||
{
|
||||
IAlleleRegistry registry = AlleleManager.alleleRegistry;
|
||||
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", fertilityHighDominant);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", Allele.getBaseAllele("fertilityHigh"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.flowerflowerBookshelf", flowerBookshelf);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speedBlinding", speedBlinding);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeAttract", effectNodeAttract);
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package magicbees.bees;
|
||||
|
||||
|
||||
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.core.ItemInterface;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.apiculture.genetics.BeeTemplates;
|
||||
|
||||
/**
|
||||
* Simply a class to hold all the functions to manage species' default genomes.
|
||||
@@ -63,6 +61,8 @@ public class BeeGenomeManager
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SORCEROUS;
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh");
|
||||
genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2");
|
||||
genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1");
|
||||
|
||||
return genome;
|
||||
}
|
||||
@@ -87,6 +87,30 @@ public class BeeGenomeManager
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateInfernal()
|
||||
{
|
||||
IAllele[] genome = getTemplateModBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INFERNAL;
|
||||
genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2");
|
||||
genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersNether");
|
||||
genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectAggressive");
|
||||
genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShort");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateOblivion()
|
||||
{
|
||||
IAllele[] genome = getTemplateModBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.OBLIVION;
|
||||
genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2");
|
||||
genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectAggressive");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateEldritch()
|
||||
{
|
||||
IAllele[] genome = getTemplateModBase();
|
||||
@@ -285,7 +309,7 @@ public class BeeGenomeManager
|
||||
genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast");
|
||||
genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster");
|
||||
genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue");
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.fertilityHighDominant;
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal");
|
||||
|
||||
return genome;
|
||||
}
|
||||
@@ -296,7 +320,6 @@ public class BeeGenomeManager
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SKULKING;
|
||||
genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue");
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal");
|
||||
|
||||
return genome;
|
||||
}
|
||||
@@ -938,26 +961,4 @@ public class BeeGenomeManager
|
||||
selectedGene.setString("UID0", allele.getUID());
|
||||
selectedGene.setString("UID1", allele.getUID());
|
||||
}
|
||||
|
||||
// ---------- Forestry templates -----------------------
|
||||
|
||||
public static IAllele[] getTemplateForestryValiant()
|
||||
{
|
||||
return BeeTemplates.getValiantTemplate();
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateForestrySinister()
|
||||
{
|
||||
return BeeTemplates.getSinisterTemplate();
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateForestrySteadfast()
|
||||
{
|
||||
return BeeTemplates.getSteadfastTemplate();
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateForestryEnder()
|
||||
{
|
||||
return BeeTemplates.getEnderTemplate();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ public class BeeManager
|
||||
BeeSpecies.setupBeeSpecies();
|
||||
Allele.registerDeprecatedAlleleReplacements();
|
||||
BeeMutation.setupMutations();
|
||||
HiveType.initHiveDrops();
|
||||
|
||||
HiveType.initHiveData();
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,54 @@ public class BeeMutation implements IBeeMutation
|
||||
{
|
||||
public static void setupMutations()
|
||||
{
|
||||
IAlleleBeeSpecies baseA, baseB;
|
||||
|
||||
// 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", "rocky", "water", "embittered" };
|
||||
|
||||
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)
|
||||
{
|
||||
new BeeMutation(species, Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, 7);
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
private IAllele parent1;
|
||||
@@ -47,12 +95,17 @@ public class BeeMutation implements IBeeMutation
|
||||
private int requiredBlockId;
|
||||
private int requiredBlockMeta;
|
||||
private String requiredBlockOreDictEntry;
|
||||
|
||||
|
||||
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 = resultSpecies.getGenome();
|
||||
this.mutationTemplate = resultSpeciesGenome;
|
||||
this.baseChance = percentChance;
|
||||
this.isSecret = false;
|
||||
this.isMoonRestricted = false;
|
||||
|
||||
@@ -45,28 +45,32 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
MYSTICAL("Mystical", "mysticum",
|
||||
BeeClassification.VEILED, 0xAFFFB7, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true),
|
||||
SORCEROUS("Sorcerous", "fascinatio",
|
||||
BeeClassification.VEILED, 0xFF444E, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true),
|
||||
BeeClassification.VEILED, 0xEA9A9A, EnumTemperature.HOT, EnumHumidity.ARID, false, false, true),
|
||||
UNUSUAL("Unusual", "inusitatus",
|
||||
BeeClassification.VEILED, 0x72D361, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true),
|
||||
ATTUNED("Attuned", "similis",
|
||||
BeeClassification.VEILED, 0x0086A8, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true),
|
||||
INFERNAL("Infernal", "infernales",
|
||||
BeeClassification.VEILED, 0xFF1C1C, 0x960F00, EnumTemperature.HELLISH, EnumHumidity.ARID, false, false, true),
|
||||
OBLIVION("Oblivion", "lethe",
|
||||
BeeClassification.VEILED, 0xD5C3E5, 0xF696FF, EnumTemperature.COLD, EnumHumidity.NORMAL, false, false, false),
|
||||
|
||||
ELDRITCH("Eldritch", "prodigiosus",
|
||||
BeeClassification.VEILED, 0x8D75A0, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
|
||||
ESOTERIC("Esoteric", "secretiore",
|
||||
BeeClassification.ARCANE, 0x001099, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BeeClassification.ARCANE, 0x001099, 0xFF9D60, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
MYSTERIOUS("Mysterious", "mysticus",
|
||||
BeeClassification.ARCANE, 0x762bc2, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BeeClassification.ARCANE, 0x762bc2, 0xFF9D60, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
ARCANE("Arcane", "arcanus",
|
||||
BeeClassification.ARCANE, 0xd242df, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
|
||||
BeeClassification.ARCANE, 0xd242df, 0xFF9D60, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
|
||||
|
||||
CHARMED("Charmed", "larvatus",
|
||||
BeeClassification.SUPERNATURAL, 0x48EEEC, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BeeClassification.SUPERNATURAL, 0x48EEEC, 0xFF9D60, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
ENCHANTED("Enchanted", "cantatus",
|
||||
BeeClassification.SUPERNATURAL, 0x18e726, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BeeClassification.SUPERNATURAL, 0x18e726, 0xFF9D60, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
SUPERNATURAL("Supernatural", "coeleste",
|
||||
BeeClassification.SUPERNATURAL, 0x005614, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
|
||||
BeeClassification.SUPERNATURAL, 0x005614, 0xFF9D60, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
|
||||
|
||||
ETHEREAL("Ethereal", "diaphanum",
|
||||
BeeClassification.MAGICAL, 0xBA3B3B, 0xEFF8FF, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
@@ -314,6 +318,12 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
ELDRITCH.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 15)
|
||||
.setGenome(BeeGenomeManager.getTemplateEldritch())
|
||||
.register();
|
||||
INFERNAL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 12)
|
||||
.setGenome(BeeGenomeManager.getTemplateInfernal())
|
||||
.register();
|
||||
OBLIVION.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 14)
|
||||
.setGenome(BeeGenomeManager.getTemplateOblivion())
|
||||
.register();
|
||||
|
||||
ESOTERIC.addProduct(Config.combs.getStackForType(CombType.OCCULT), 20)
|
||||
.setGenome(BeeGenomeManager.getTemplateEsoteric())
|
||||
@@ -559,7 +569,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
private Icon[][] icons;
|
||||
|
||||
private final static boolean defaultSecretSetting = true;
|
||||
private final static int defaultBodyColour = 0xFF6E0D;
|
||||
private final static int defaultBodyColour = 0xFF7C26;
|
||||
|
||||
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant)
|
||||
{
|
||||
|
||||
@@ -3,9 +3,7 @@ package magicbees.block;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import magicbees.block.types.HiveType;
|
||||
import magicbees.block.types.PlankType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -15,11 +13,9 @@ import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
|
||||
public class BlockHive extends Block
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package magicbees.block.types;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import magicbees.bees.BeeGenomeManager;
|
||||
@@ -25,24 +26,12 @@ import forestry.api.apiculture.IHiveDrop;
|
||||
|
||||
public enum HiveType
|
||||
{
|
||||
CURIOUS("curious", 12, true,
|
||||
new BiomeDictionary.Type[] {Type.FOREST, Type.HILLS, Type.MOUNTAIN},
|
||||
new int[] {60, 30, 15}),
|
||||
UNUSUAL("unusual", 12, true,
|
||||
new BiomeDictionary.Type[] {Type.PLAINS, Type.JUNGLE, Type.HILLS},
|
||||
new int[] {20, 35, 20}),
|
||||
RESONANT("resonant", 12, true,
|
||||
new BiomeDictionary.Type[] {Type.MAGICAL, Type.HILLS, Type.PLAINS},
|
||||
new int[] {60, 30, 10}),
|
||||
DEEP("deep", 4, true,
|
||||
new BiomeDictionary.Type[] {Type.HILLS, Type.MOUNTAIN, Type.MUSHROOM},
|
||||
new int[] {20, 40, 50}),
|
||||
INFERNAL("infernal", 15, true,
|
||||
new BiomeDictionary.Type[] {Type.NETHER, Type.MAGICAL},
|
||||
new int[] {30, 5}),
|
||||
OBLIVION("oblivion", 7, true,
|
||||
new BiomeDictionary.Type[] {Type.END, Type.MAGICAL},
|
||||
new int[] {60, 3}),
|
||||
CURIOUS("curious", 12, true),
|
||||
UNUSUAL("unusual", 12, true),
|
||||
RESONANT("resonant", 12, true),
|
||||
DEEP("deep", 4, true),
|
||||
INFERNAL("infernal", 15, true),
|
||||
OBLIVION("oblivion", 7, true),
|
||||
;
|
||||
|
||||
private static String[] nameList;
|
||||
@@ -51,8 +40,7 @@ public enum HiveType
|
||||
public boolean show;
|
||||
private int lightLevel;
|
||||
private ArrayList<IHiveDrop> drops;
|
||||
private BiomeDictionary.Type[] validBiomes;
|
||||
private int[] rarity;
|
||||
private ArrayList<BiomeDictionary.Type> validBiomes;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private Icon[] icons;
|
||||
|
||||
@@ -68,49 +56,60 @@ public enum HiveType
|
||||
return type;
|
||||
}
|
||||
|
||||
public static void initHiveDrops()
|
||||
public static void initHiveData()
|
||||
{
|
||||
ItemStack[] combs = new ItemStack[] {Config.combs.getStackForType(CombType.MUNDANE)};
|
||||
HiveDrop valiantDrop = new HiveDrop(BeeGenomeManager.addRainResist(BeeGenomeManager.getTemplateForestryValiant()), combs, 5);
|
||||
|
||||
HiveDrop valiantDrop = new HiveDrop(BeeGenomeManager.addRainResist(ForestryHelper.getTemplateForestryForSpecies("Valiant")), combs, 5);
|
||||
|
||||
CURIOUS.validBiomes.add(Type.FOREST);
|
||||
CURIOUS.validBiomes.add(Type.JUNGLE);
|
||||
CURIOUS.validBiomes.add(Type.HILLS);
|
||||
CURIOUS.drops.add(new HiveDrop(BeeSpecies.MYSTICAL.getGenome(), combs, 80));
|
||||
CURIOUS.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.MYSTICAL.getGenome()), combs, 15));
|
||||
CURIOUS.drops.add(valiantDrop);
|
||||
|
||||
UNUSUAL.validBiomes.add(Type.PLAINS);
|
||||
UNUSUAL.validBiomes.add(Type.MOUNTAIN);
|
||||
UNUSUAL.validBiomes.add(Type.HILLS);
|
||||
UNUSUAL.drops.add(new HiveDrop(BeeSpecies.UNUSUAL.getGenome(), combs, 80));
|
||||
UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15));
|
||||
UNUSUAL.drops.add(valiantDrop);
|
||||
|
||||
RESONANT.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80));
|
||||
RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20));
|
||||
|
||||
RESONANT.validBiomes.add(Type.DESERT);
|
||||
RESONANT.validBiomes.add(Type.MAGICAL);
|
||||
RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80));
|
||||
RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20));
|
||||
RESONANT.drops.add(valiantDrop);
|
||||
|
||||
DEEP.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80));
|
||||
DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20));
|
||||
DEEP.validBiomes.add(Type.HILLS);
|
||||
DEEP.validBiomes.add(Type.MOUNTAIN);
|
||||
DEEP.validBiomes.add(Type.MAGICAL);
|
||||
DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80));
|
||||
DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20));
|
||||
DEEP.drops.add(valiantDrop);
|
||||
|
||||
combs = new ItemStack[] {new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), new ItemStack(Item.lightStoneDust, 6)};
|
||||
combs = new ItemStack[] {Config.combs.getStackForType(CombType.MOLTEN), new ItemStack(Item.lightStoneDust, 6)};
|
||||
|
||||
INFERNAL.drops.add(new HiveDrop(BeeGenomeManager.getTemplateForestrySinister(), combs, 80));
|
||||
INFERNAL.drops.add(new HiveDrop(BeeSpecies.ELDRITCH.getGenome(), combs, 10));
|
||||
INFERNAL.drops.add(new HiveDrop(BeeGenomeManager.getTemplateForestrySteadfast(), combs, 3));
|
||||
INFERNAL.validBiomes.add(Type.NETHER);
|
||||
INFERNAL.validBiomes.add(Type.MAGICAL);
|
||||
INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80));
|
||||
INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3));
|
||||
|
||||
combs = new ItemStack[] {new ItemStack(Config.fBeeComb, 3, ForestryHelper.Comb.MYSTERIOUS.ordinal()), new ItemStack(Item.enderPearl, 2)};
|
||||
combs = new ItemStack[] {Config.combs.getStackForType(CombType.FORGOTTEN), new ItemStack(Item.enderPearl, 1)};
|
||||
|
||||
OBLIVION.drops.add(new HiveDrop(BeeGenomeManager.getTemplateForestryEnder(), combs, 80));
|
||||
OBLIVION.drops.add(new HiveDrop(BeeGenomeManager.getTemplateForestrySteadfast(), combs, 9));
|
||||
OBLIVION.validBiomes.add(Type.END);
|
||||
OBLIVION.validBiomes.add(Type.MAGICAL);
|
||||
OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80));
|
||||
OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9));
|
||||
}
|
||||
|
||||
private HiveType(String hiveName, int light, boolean visible, BiomeDictionary.Type[] biomes, int[] rarity)
|
||||
private HiveType(String hiveName, int light, boolean visible)
|
||||
{
|
||||
this.name = hiveName;
|
||||
this.lightLevel = light;
|
||||
this.show = visible;
|
||||
this.drops = new ArrayList<IHiveDrop>();
|
||||
this.validBiomes = biomes;
|
||||
this.rarity = rarity;
|
||||
|
||||
assert this.validBiomes.length == this.rarity.length;
|
||||
this.validBiomes = new ArrayList<BiomeDictionary.Type>();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -206,56 +205,93 @@ public enum HiveType
|
||||
|
||||
public void generateHive(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
{
|
||||
BiomeDictionary.Type[] biomeType = BiomeDictionary.getTypesForBiome(world.getBiomeGenForCoordsBody(chunkX, chunkZ));
|
||||
|
||||
int maxRarity = 0;
|
||||
for (int i = 0; i < biomeType.length; ++i)
|
||||
{
|
||||
int rarity = this.getRarityForBiome(biomeType[i]);
|
||||
if (rarity > maxRarity)
|
||||
{
|
||||
maxRarity = rarity;
|
||||
}
|
||||
}
|
||||
|
||||
if (world.rand.nextInt(100) < maxRarity)
|
||||
if (spawnsInBiome(world.getBiomeGenForCoordsBody(chunkX * 16, chunkZ * 16)))
|
||||
{
|
||||
switch (this)
|
||||
{
|
||||
default:
|
||||
case CURIOUS:
|
||||
FeatureHive.generateHiveCurious(world, random, chunkX, chunkZ, initialGen);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
int coordX = chunkX * 16 + random.nextInt(16);
|
||||
int coordZ = chunkZ * 16 + random.nextInt(16);
|
||||
if (FeatureHive.generateHiveCurious(world, random, coordX, coordZ, initialGen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case UNUSUAL:
|
||||
FeatureHive.generateHiveUnusual(world, random, chunkX, chunkZ, initialGen);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
int coordX = chunkX * 16 + random.nextInt(16);
|
||||
int coordZ = chunkZ * 16 + random.nextInt(16);
|
||||
if (FeatureHive.generateHiveUnusual(world, random, coordX, coordZ, initialGen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RESONANT:
|
||||
FeatureHive.generateHiveResonant(world, random, chunkX, chunkZ, initialGen);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
int coordX = chunkX * 16 + random.nextInt(16);
|
||||
int coordZ = chunkZ * 16 + random.nextInt(16);
|
||||
if (FeatureHive.generateHiveResonant(world, random, coordX, coordZ, initialGen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DEEP:
|
||||
FeatureHive.generateHiveDeep(world, random, chunkX, chunkZ, initialGen);
|
||||
for (int i = 0; i < 1; ++i)
|
||||
{
|
||||
int coordX = chunkX * 16 + random.nextInt(16);
|
||||
int coordZ = chunkZ * 16 + random.nextInt(16);
|
||||
if (FeatureHive.generateHiveDeep(world, random, coordX, coordZ, initialGen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case INFERNAL:
|
||||
FeatureHive.generateHiveInfernal(world, random, chunkX, chunkZ, initialGen);
|
||||
for (int i = 0; i < 1; ++i)
|
||||
{
|
||||
int coordX = chunkX * 16 + random.nextInt(16);
|
||||
int coordZ = chunkZ * 16 + random.nextInt(16);
|
||||
if (FeatureHive.generateHiveInfernal(world, random, coordX, coordZ, initialGen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OBLIVION:
|
||||
FeatureHive.generateHiveOblivion(world, random, chunkX, chunkZ, initialGen);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
int coordX = chunkX * 16 + random.nextInt(16);
|
||||
int coordZ = chunkZ * 16 + random.nextInt(16);
|
||||
if (FeatureHive.generateHiveOblivion(world, random, coordX, coordZ, initialGen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getRarityForBiome(BiomeDictionary.Type biomeType)
|
||||
public boolean spawnsInBiome(BiomeGenBase biomeGen)
|
||||
{
|
||||
int rarity = 0;
|
||||
for (int i = 0; i < this.validBiomes.length; ++i)
|
||||
boolean found = false;
|
||||
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biomeGen);
|
||||
for (int i = 0; i < types.length; ++i)
|
||||
{
|
||||
if (this.validBiomes[i].equals(biomeType))
|
||||
if (this.validBiomes.contains(types[i]))
|
||||
{
|
||||
rarity = this.rarity[i];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rarity;
|
||||
|
||||
return found;
|
||||
}
|
||||
}
|
||||
@@ -85,11 +85,11 @@ public class ItemComb extends Item
|
||||
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].combColour[0];
|
||||
int colour = CombType.values()[meta].getColours()[0];
|
||||
|
||||
if (pass >= 1)
|
||||
{
|
||||
colour = CombType.values()[meta].combColour[1];
|
||||
colour = CombType.values()[meta].getColours()[1];
|
||||
}
|
||||
|
||||
return colour;
|
||||
|
||||
@@ -5,40 +5,68 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public enum CombType
|
||||
{
|
||||
MUNDANE("mundane", new int[] {0xFFA060, 0xE5BE99}, true),
|
||||
OCCULT("occult", new int[] {0xff8fff, 0x6e1c6d}, true),
|
||||
OTHERWORLDLY("otherworldly", new int[] {0x765cc1, 0x3B3B7A}, true),
|
||||
PAPERY("paper", new int[] {0xbd9a30, 0x503900}, true),
|
||||
SOUL("soul", new int[] {0x8A4500, 0x3C1E00}, true),
|
||||
SKULKING("furtive", new int[] {0xcda6cd, 0x545454}, true),
|
||||
INTELLECT("aware", new int[] {0xb0092e9, 0x618fff}, false),
|
||||
MUNDANE("mundane", true),
|
||||
MOLTEN("molten", true),
|
||||
FORGOTTEN("forgotten", true),
|
||||
OCCULT("occult", true),
|
||||
OTHERWORLDLY("otherworldly", true),
|
||||
PAPERY("paper", true),
|
||||
SOUL("soul", true),
|
||||
SKULKING("furtive", true),
|
||||
|
||||
TC_STARK("stark", new int[] {0x6e6e79, 0xB0B0BC}, false),
|
||||
TC_AIRY("air", new int[] {0x717600, 0xffff7e}, false),
|
||||
TC_FIREY("fire", new int[] {0x740002, 0xff3C01}, false),
|
||||
TC_WATERY("water", new int[] {0x00308c, 0x0090ff}, false),
|
||||
TC_EARTHY("earth", new int[] {0x005100, 0x00a000}, false),
|
||||
TC_INFUSED("magic", new int[] {0x7A489E, 0xaa32fc}, false),
|
||||
INTELLECT("aware", false),
|
||||
|
||||
AM_ESSENCE("essence", new int[] {0x03E1DE, 0x015352}, false),
|
||||
AM_POTENT("potent", new int[] {0xBFA330, 0x41046F}, false),
|
||||
TC_STARK("stark", false),
|
||||
TC_AIRY("air", false),
|
||||
TC_FIREY("fire", false),
|
||||
TC_WATERY("water", false),
|
||||
TC_EARTHY("earth", false),
|
||||
TC_INFUSED("magic", false),
|
||||
|
||||
AM_ESSENCE("essence", false),
|
||||
AM_POTENT("potent", false),
|
||||
;
|
||||
|
||||
private CombType(String pName, int[] colour, boolean show)
|
||||
private static int[][] colours =
|
||||
new int[][] { {0xFF9859, 0xFFC58E},
|
||||
{0xcc3333, 0x1E160E},
|
||||
{0x9872FF, 0x2D2D2D},
|
||||
{0x3EE0D8, 0x3A3820},
|
||||
{0xE5425D, 0x323291},
|
||||
{0xBCA664, 0x35332E},
|
||||
{0x7F7171, 0x876D53},
|
||||
{0xcda6cd, 0x545454},
|
||||
|
||||
{0x0092e9, 0x618fff},
|
||||
|
||||
{0xB0B0BC, 0x414144},
|
||||
{0xffff7e, 0x606308},
|
||||
{0xff3C01, 0x5B0D10},
|
||||
{0x0090ff, 0x102F6B},
|
||||
{0x00a000, 0x043004},
|
||||
{0xAB12E2, 0x502868},
|
||||
|
||||
{0xCC8604, 0x41046F},
|
||||
{0xCCCC04, 0x41046F},
|
||||
};
|
||||
|
||||
private CombType(String pName, boolean show)
|
||||
{
|
||||
this.name = pName;
|
||||
this.combColour = new int[2];
|
||||
this.combColour = colour;
|
||||
|
||||
this.showInList = show;
|
||||
}
|
||||
|
||||
private String name;
|
||||
public int[] combColour;
|
||||
public boolean showInList;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return LocalizationManager.getLocalizedString("comb." + this.name);
|
||||
}
|
||||
|
||||
public int[] getColours()
|
||||
{
|
||||
return colours[this.ordinal()];
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
public enum WaxType
|
||||
{
|
||||
MAGIC("magic", false, 0xd242df),
|
||||
SOUL("soul", true, 0x8A4500),
|
||||
SOUL("soul", true, 0x967C63),
|
||||
;
|
||||
|
||||
private WaxType(String n, boolean sp, int c)
|
||||
|
||||
@@ -8,10 +8,11 @@ import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
public static final String TEXTURE_PATH = "/mods/magicbees/textures/";
|
||||
public static final String MODEL_PATH = "/mods/magicbees/model/";
|
||||
public static final String TCBEES_RESEARCH = "/research/magicbees/";
|
||||
public static final String TCBEES_LOCDIR = "/lang/magicbees/";
|
||||
public static final String RESOURCE_PATH = "/mods/magicbees/";
|
||||
public static final String TEXTURE_PATH = RESOURCE_PATH + "textures/";
|
||||
public static final String MODEL_PATH = RESOURCE_PATH + "model/";
|
||||
public static final String TCBEES_RESEARCH = RESOURCE_PATH + "research/";
|
||||
public static final String TCBEES_LOCDIR = RESOURCE_PATH + "lang/";
|
||||
|
||||
public static String FORESTRY_GFX_ITEMS;
|
||||
public static String FORESTRY_GFX_BEEEFFECTS;
|
||||
|
||||
@@ -10,7 +10,7 @@ import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.EquivalentExchangeHelper;
|
||||
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import magicbees.world.WorldHandler;
|
||||
import magicbees.world.WorldGeneratorHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -25,7 +25,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
name="Magic Bees",
|
||||
useMetadata=true,
|
||||
acceptedMinecraftVersions=VersionInfo.MCVersion,
|
||||
version=VersionInfo.Version + " - " + VersionInfo.Build,
|
||||
version=VersionInfo.Version + " (build " + VersionInfo.Build + ")",
|
||||
dependencies=VersionInfo.Depends
|
||||
)
|
||||
@NetworkMod(serverSideRequired=false, clientSideRequired=true)
|
||||
@@ -41,7 +41,7 @@ public class MagicBees
|
||||
public GUIHandler guiHandler;
|
||||
private String configsPath;
|
||||
private Config modConfig;
|
||||
private WorldHandler worldHandler;
|
||||
private WorldGeneratorHandler worldHandler;
|
||||
|
||||
@Mod.PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
@@ -66,7 +66,7 @@ public class MagicBees
|
||||
|
||||
CompatabilityManager.setupBackpacks();
|
||||
|
||||
GameRegistry.registerWorldGenerator(worldHandler = new WorldHandler());
|
||||
GameRegistry.registerWorldGenerator(worldHandler = new WorldGeneratorHandler());
|
||||
}
|
||||
|
||||
@Mod.PostInit
|
||||
|
||||
@@ -8,7 +8,10 @@ public class LocalizationManager
|
||||
{
|
||||
private enum Locale
|
||||
{
|
||||
de_DE("de_DE"),
|
||||
en_US("en_US"),
|
||||
//ru_RU("ru_RU"),
|
||||
zh_CN("zh_CN"),
|
||||
;
|
||||
public String locale;
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package magicbees.main.utils.compat;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import magicbees.main.Config;
|
||||
import net.minecraft.item.Item;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.ItemInterface;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
public class ForestryHelper
|
||||
{
|
||||
@@ -104,6 +108,24 @@ public class ForestryHelper
|
||||
Config.fPollen = Item.itemsList[ItemInterface.getItem("pollen").itemID];
|
||||
Config.fCraftingResource = Item.itemsList[ItemInterface.getItem("craftingMaterial").itemID];
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateForestryForSpecies(String speciesName)
|
||||
{
|
||||
IAllele[] template = null;
|
||||
try
|
||||
{
|
||||
//BeeTemplates.getValiantTemplate()
|
||||
Class c = Class.forName("forestry.apiculture.genetics.BeeTemplates");
|
||||
Method m = c.getMethod("getCommonTemplate");
|
||||
template = (IAllele[])(m.invoke(null));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.severe("Could not get Forestry templates. Are you SURE this version of Magic Bees compatible with your version of Forestry?");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
||||
public static EnumTemperature getEnumTemperatureFromValue(float rawTemp)
|
||||
{
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@ import cpw.mods.fml.common.IWorldGenerator;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class WorldHandler implements IWorldGenerator
|
||||
public class WorldGeneratorHandler implements IWorldGenerator
|
||||
{
|
||||
public WorldTicker ticker;
|
||||
|
||||
public WorldHandler()
|
||||
public WorldGeneratorHandler()
|
||||
{
|
||||
this.ticker = new WorldTicker(this);
|
||||
TickRegistry.registerTickHandler(this.ticker, Side.SERVER);
|
||||
@@ -14,10 +14,10 @@ import cpw.mods.fml.common.TickType;
|
||||
|
||||
public class WorldTicker implements ITickHandler
|
||||
{
|
||||
private WorldHandler parent;
|
||||
private WorldGeneratorHandler parent;
|
||||
private HashMap<Integer, LinkedList<ChunkCoords>> chunkRegenList;
|
||||
|
||||
public WorldTicker(WorldHandler p)
|
||||
public WorldTicker(WorldGeneratorHandler p)
|
||||
{
|
||||
this.parent = p;
|
||||
this.chunkRegenList = new HashMap<Integer, LinkedList<ChunkCoords>>();
|
||||
|
||||
@@ -6,8 +6,8 @@ import magicbees.block.types.HiveType;
|
||||
import magicbees.main.Config;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import forestry.api.core.GlobalManager;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class FeatureHive
|
||||
private static FeatureOreVein glowstoneGen;
|
||||
private static FeatureOreVein endStoneGen;
|
||||
|
||||
private static boolean logSpawns = true;
|
||||
private static boolean logSpawns = false;
|
||||
|
||||
public static void initialize()
|
||||
{
|
||||
@@ -36,249 +36,146 @@ public class FeatureHive
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateHiveCurious(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
public static boolean generateHiveCurious(World world, Random random, int coordX, int coordZ, boolean initialGen)
|
||||
{
|
||||
// 1 per gen
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = world.getHeight() - 1;
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(coordX, coordZ);
|
||||
int min = (int)(biome.minHeight * 64 + 64);
|
||||
int max = (int)(biome.maxHeight * 64);
|
||||
// sanity
|
||||
max = (max > 1) ? max : 1;
|
||||
int coordY = min + random.nextInt(max + 5);
|
||||
boolean doSpawn = false;
|
||||
|
||||
do
|
||||
{
|
||||
--coordY;
|
||||
if (world.isAirBlock(coordX, coordY - 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) &&
|
||||
GlobalManager.leafBlockIds.contains(world.getBlockId(coordX, coordY + 1, coordZ)) )
|
||||
{
|
||||
doSpawn = true;
|
||||
}
|
||||
}
|
||||
while (!doSpawn && coordY > 20);
|
||||
|
||||
if (doSpawn)
|
||||
if (world.isAirBlock(coordX, coordY - 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) &&
|
||||
GlobalManager.leafBlockIds.contains(world.getBlockId(coordX, coordY + 1, coordZ)) )
|
||||
{
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.CURIOUS.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Curious", coordX, coordZ, coordY);
|
||||
doSpawn = true;
|
||||
}
|
||||
|
||||
return doSpawn;
|
||||
}
|
||||
|
||||
public static void generateHiveUnusual(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
public static boolean generateHiveUnusual(World world, Random random, int coordX, int coordZ, boolean initialGen)
|
||||
{
|
||||
// 1 per gen
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = world.provider.getAverageGroundLevel() - 10;
|
||||
|
||||
// For sanity
|
||||
if (coordY <= 0)
|
||||
{
|
||||
coordY = 0;
|
||||
}
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(coordX, coordZ);
|
||||
int min = (int)(biome.minHeight * 64 + 64);
|
||||
int max = (int)(biome.maxHeight * 64);
|
||||
// sanity
|
||||
max = (max > 1) ? max : 1;
|
||||
int coordY = min + random.nextInt(max);
|
||||
|
||||
boolean doSpawn = false;
|
||||
do
|
||||
if (world.isAirBlock(coordX, coordY + 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) &&
|
||||
GlobalManager.dirtBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ)) )
|
||||
{
|
||||
++coordY;
|
||||
|
||||
if (world.isAirBlock(coordX, coordY + 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) &&
|
||||
GlobalManager.dirtBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ)) )
|
||||
{
|
||||
doSpawn = true;
|
||||
}
|
||||
doSpawn = true;
|
||||
}
|
||||
while (!doSpawn && coordY < world.getHeight());
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.UNUSUAL.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Unusual", coordX, coordZ, coordY);
|
||||
}
|
||||
|
||||
return doSpawn;
|
||||
}
|
||||
|
||||
public static void generateHiveResonant(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
public static boolean generateHiveResonant(World world, Random random, int coordX, int coordZ, boolean initialGen)
|
||||
{
|
||||
// 1 per gen
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = world.provider.getAverageGroundLevel() - 10;
|
||||
|
||||
// For sanity
|
||||
if (coordY <= 0)
|
||||
{
|
||||
coordY = 0;
|
||||
}
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(coordX, coordZ);
|
||||
int min = (int)(biome.minHeight * 64 + 62);
|
||||
int max = (int)(biome.maxHeight * 64);
|
||||
// sanity
|
||||
max = (max > 1) ? max : 1;
|
||||
int coordY = min + random.nextInt(max);
|
||||
|
||||
boolean doSpawn = false;
|
||||
do
|
||||
if (world.isAirBlock(coordX, coordY + 1, coordZ) &&
|
||||
(world.isAirBlock(coordX, coordY, coordZ) || world.getBlockId(coordX, coordY, coordZ) == Block.tallGrass.blockID) &&
|
||||
(GlobalManager.dirtBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ)) ||
|
||||
GlobalManager.sandBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ))) )
|
||||
{
|
||||
++coordY;
|
||||
|
||||
if (world.isAirBlock(coordX, coordY + 1, coordZ) &&
|
||||
(world.isAirBlock(coordX, coordY, coordZ) || world.getBlockId(coordX, coordY, coordZ) == Block.grass.blockID ||
|
||||
world.getBlockId(coordX, coordY, coordZ) == Block.snow.blockID) &&
|
||||
(GlobalManager.dirtBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ)) ||
|
||||
GlobalManager.sandBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ))) )
|
||||
{
|
||||
doSpawn = true;
|
||||
}
|
||||
doSpawn = true;
|
||||
}
|
||||
while (!doSpawn && coordY < world.getHeight());
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.RESONANT.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Resonant", coordX, coordZ, coordY);
|
||||
}
|
||||
|
||||
return doSpawn;
|
||||
}
|
||||
|
||||
public static void generateHiveDeep(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
public static boolean generateHiveDeep(World world, Random random, int coordX, int coordZ, boolean initialGen)
|
||||
{
|
||||
// 1 or 2 per gen
|
||||
int count = random.nextInt(1) + 1;
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(coordX, coordZ);
|
||||
int coordY = 10 + random.nextInt(10);
|
||||
|
||||
boolean doSpawn = false;
|
||||
|
||||
if (random.nextInt(100) < 40 &&
|
||||
!world.isAirBlock(coordX, coordY, coordZ) &&
|
||||
world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.stone) >= 6;
|
||||
}
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = random.nextInt(16) + 17;
|
||||
boolean doSpawn = false;
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.DEEP.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Deep", coordX, coordZ, coordY);
|
||||
|
||||
do
|
||||
{
|
||||
--coordY;
|
||||
int blockId = world.getBlockId(coordX, coordY, coordZ);
|
||||
if (blockId == Block.stone.blockID)
|
||||
{
|
||||
doSpawn = true;
|
||||
}
|
||||
|
||||
redstoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY + 1, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY - 1, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY, coordZ + 1, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, 2);
|
||||
}
|
||||
|
||||
return doSpawn;
|
||||
}
|
||||
|
||||
public static boolean generateHiveInfernal(World world, Random random, int coordX, int coordZ, boolean initialGen)
|
||||
{
|
||||
boolean doSpawn = false;
|
||||
if (!world.provider.isSurfaceWorld())
|
||||
{
|
||||
int chop = random.nextInt(2) + 1;
|
||||
int coordY = random.nextInt(60 / chop) + random.nextInt(chop) * (120 / chop) - 5;
|
||||
|
||||
if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.netherrack) >= 5;
|
||||
}
|
||||
while (!doSpawn && coordY > 4);
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.DEEP.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Deep", coordX, coordZ, coordY);
|
||||
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.INFERNAL.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Infernal", coordX, coordZ, coordY);
|
||||
|
||||
redstoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY + 1, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY - 1, coordZ, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY, coordZ + 1, 2);
|
||||
redstoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateHiveInfernal(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
{
|
||||
if (world.provider.dimensionId == -1)
|
||||
{
|
||||
// 2 or 3 per gen
|
||||
int count = random.nextInt(3) + 1;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = random.nextInt(60 / count) + i * (120 / count) - 5;
|
||||
boolean doSpawn = false;
|
||||
|
||||
do
|
||||
{
|
||||
++coordY;
|
||||
|
||||
if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
int surroundCount = 0;
|
||||
if (world.getBlockId(coordX+1, coordY, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX-1, coordY, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY+1, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY-1, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY, coordZ+1) == Block.netherrack.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY, coordZ-1) == Block.netherrack.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
|
||||
doSpawn = surroundCount >= 5;
|
||||
}
|
||||
}
|
||||
while (!doSpawn && coordY > 4 && coordY < 126);
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.INFERNAL.ordinal(), 3);
|
||||
if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Infernal", coordX, coordZ, coordY);
|
||||
|
||||
netherQuartzGen.generateVein(world, random, coordX + 1, coordY, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX - 1, coordY, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY + 1, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY - 1, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY, coordZ + 1, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY, coordZ - 1, 4);
|
||||
}
|
||||
netherQuartzGen.generateVein(world, random, coordX + 1, coordY, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX - 1, coordY, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY + 1, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY - 1, coordZ, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY, coordZ + 1, 4);
|
||||
netherQuartzGen.generateVein(world, random, coordX, coordY, coordZ - 1, 4);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 1 per gen
|
||||
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = random.nextInt(16) + 17;
|
||||
boolean doSpawn = false;
|
||||
int coordY = random.nextInt(13) + 5;
|
||||
|
||||
do
|
||||
if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
--coordY;
|
||||
|
||||
if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
int surroundCount = 0;
|
||||
if (world.getBlockId(coordX+1, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX-1, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY+1, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY-1, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY, coordZ+1) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY, coordZ-1) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
|
||||
doSpawn = surroundCount >= 5;
|
||||
}
|
||||
doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.stone) >= 6;
|
||||
}
|
||||
while (!doSpawn && coordY > 4);
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
@@ -287,11 +184,13 @@ public class FeatureHive
|
||||
|
||||
glowstoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, 2);
|
||||
glowstoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, 2);
|
||||
if (world.getBlockId(coordX, coordY + 1, coordZ) == Block.stone.blockID)
|
||||
if (world.getBlockId(coordX, coordY + 1, coordZ) == Block.stone.blockID ||
|
||||
world.getBlockId(coordX, coordY + 1, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
world.setBlock(coordX, coordY + 1, coordZ, Block.glowStone.blockID, 0, 3);
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY - 1, coordZ) == Block.stone.blockID)
|
||||
if (world.getBlockId(coordX, coordY - 1, coordZ) == Block.stone.blockID ||
|
||||
world.getBlockId(coordX, coordY + 1, coordZ) == Block.netherrack.blockID)
|
||||
{
|
||||
world.setBlock(coordX, coordY - 1, coordZ, Block.glowStone.blockID, 0, 3);
|
||||
}
|
||||
@@ -299,34 +198,24 @@ public class FeatureHive
|
||||
glowstoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
return doSpawn;
|
||||
}
|
||||
|
||||
public static void generateHiveOblivion(World world, Random random, int chunkX, int chunkZ, boolean initialGen)
|
||||
public static boolean generateHiveOblivion(World world, Random random, int coordX, int coordZ, boolean initialGen)
|
||||
{
|
||||
if (world.provider.dimensionId == 1)
|
||||
boolean doSpawn = false;
|
||||
if (!world.provider.isSurfaceWorld())
|
||||
{
|
||||
// 1 per gen
|
||||
boolean doSpawn = false;
|
||||
int coordX = 0;
|
||||
int coordZ = 0;
|
||||
int coordY = 0;
|
||||
int coordY = 10 + random.nextInt(25);
|
||||
|
||||
coordX = random.nextInt(16) + chunkX * 16;
|
||||
coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
coordY = 8;
|
||||
|
||||
do
|
||||
if (world.isAirBlock(coordX, coordY - 2, coordZ) &&
|
||||
world.getBlockId(coordX, coordY - 1, coordZ) == Block.whiteStone.blockID &&
|
||||
world.getBlockId(coordX, coordY, coordZ) == Block.whiteStone.blockID)
|
||||
{
|
||||
++coordY;
|
||||
|
||||
if (world.isAirBlock(coordX, coordY - 2, coordZ) &&
|
||||
world.getBlockId(coordX, coordY - 1, coordZ) == Block.whiteStone.blockID &&
|
||||
world.getBlockId(coordX, coordY, coordZ) == Block.whiteStone.blockID)
|
||||
{
|
||||
doSpawn = true;
|
||||
}
|
||||
doSpawn = true;
|
||||
}
|
||||
while (!doSpawn && coordY < 90);
|
||||
|
||||
if (doSpawn)
|
||||
{
|
||||
@@ -344,45 +233,17 @@ public class FeatureHive
|
||||
else
|
||||
{
|
||||
// 1 per gen
|
||||
|
||||
int coordX = random.nextInt(16) + chunkX * 16;
|
||||
int coordZ = random.nextInt(16) + chunkZ * 16;
|
||||
int coordY = random.nextInt(16) + 9;
|
||||
boolean doSpawn = false;
|
||||
int coordY = random.nextInt(5) + 5;
|
||||
|
||||
do
|
||||
{
|
||||
--coordY;
|
||||
|
||||
if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
int surroundCount = 0;
|
||||
if (world.getBlockId(coordX+1, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX-1, coordY, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY+1, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY-1, coordZ) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY, coordZ+1) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(coordX, coordY, coordZ-1) == Block.stone.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
|
||||
doSpawn = surroundCount >= 5;
|
||||
if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID ||
|
||||
world.getBlockId(coordX, coordY + 1, coordZ) == Block.whiteStone.blockID)
|
||||
{
|
||||
doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.whiteStone) >= 5 ||
|
||||
getSurroundCount(world, coordX, coordY, coordZ, Block.stone) >= 5;
|
||||
}
|
||||
}
|
||||
while (!doSpawn && coordY > 5);
|
||||
@@ -400,5 +261,38 @@ public class FeatureHive
|
||||
endStoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, 3);
|
||||
}
|
||||
}
|
||||
return doSpawn;
|
||||
}
|
||||
|
||||
private static int getSurroundCount(World world, int x, int y, int z, Block blockType)
|
||||
{
|
||||
int surroundCount = 0;
|
||||
|
||||
if (world.getBlockId(x+1, y, z) == blockType.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(x-1, y, z) == blockType.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(x, y+1, z) == blockType.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(x, y-1, z) == blockType.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(x, y, z+1) == blockType.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
if (world.getBlockId(x, y, z-1) == blockType.blockID)
|
||||
{
|
||||
++surroundCount;
|
||||
}
|
||||
|
||||
return surroundCount;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user