mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-12 16:27:34 +00:00
Pulling forward some changes to 1.5
This commit is contained in:
commit
e23ebd1011
15 files changed
+385
-163
No files matched your search
@@ -266,6 +266,13 @@
|
||||
<entry key="magicbees.speciesEmerald.description">It is said they have been to a land ruled by a Great Wizard, and have taken the aspect of his city.|Apinomicon</entry>
|
||||
<entry key="magicbees.speciesApatite">Apatine</entry>
|
||||
<entry key="magicbees.speciesApatite.description">Day and night the whining droned on. I barricaded the windows and hid in the cellar, but everywhere the high-pitched noise of the apatine bees penetrated the walls and drove me to distraction.|Beekeeping 101</entry>
|
||||
|
||||
<entry key="magicbees.speciesMutable">Mutable</entry>
|
||||
<entry key="magicbees.speciesMutable.description">Changeable in nature, mercurial in personality.|Apinomicon</entry>
|
||||
<entry key="magicbees.speciesTransmuting">Transmuting</entry>
|
||||
<entry key="magicbees.speciesTransmuting.description">"I could've sworn this was made out of stone yesterday!"|Sengir, Mad Apiarist</entry>
|
||||
<entry key="magicbees.speciesCrumbling">Crumbling</entry>
|
||||
<entry key="magicbees.speciesCrumbling.description">They have a corrosive effect on their surroundings, rapidly aging them.|Apinomicon</entry>
|
||||
|
||||
<entry key="magicbees.speciesTCStark">Stark</entry>
|
||||
<entry key="magicbees.speciesTCStark.description">"These are unusually attracted to shards. This warrents further investigation."|Azanor, Master Thaumaturge</entry>
|
||||
@@ -350,6 +357,8 @@
|
||||
<entry key="magicbees.effectMoveSpeed">Swiftness</entry>
|
||||
<entry key="magicbees.effectSlowSpeed">Time Warp</entry>
|
||||
<entry key="magicbees.effectWithering">Withering</entry>
|
||||
<entry key="magicbees.effectTransmuting">Transmuting</entry>
|
||||
<entry key="magicbees.effectCrumbling">Crumbling</entry>
|
||||
<entry key="magicbees.effectNodeAttract">Aura Attract</entry>
|
||||
<entry key="magicbees.effectNodePurify">Purify Aura</entry>
|
||||
<entry key="magicbees.effectNodeFlux">Aura Flux</entry>
|
||||
@@ -392,6 +401,8 @@
|
||||
<entry key="classification.metallic.description">They collect fragments of metal and combine them into larger portions.|Apinomicon</entry>
|
||||
<entry key="classification.gem">Gem</entry>
|
||||
<entry key="classification.gem.description">They collect fragments of precious gems in their combs.|Apinomicon</entry>
|
||||
<entry key="classification.transmuting">Polymorphic</entry>
|
||||
<entry key="classification.transmuting.description">Reality seems to be somewhat volatile around bees of this family.|Apinomicon</entry>
|
||||
<entry key="classification.thaumic">Thaumic</entry>
|
||||
<entry key="classification.thaumic.description">These bees have an increased affinity to magic and aura.|Apinomicon</entry>
|
||||
<entry key="classification.fleshy">Fleshy</entry>
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
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)
|
||||
|
||||
@@ -4,8 +4,8 @@ import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.potion.Potion;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
@@ -16,6 +16,8 @@ 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;
|
||||
@@ -26,6 +28,8 @@ public class Allele implements IAllele
|
||||
public static IAlleleEffect effectMoveSpeed;
|
||||
public static IAlleleEffect effectSlowSpeed;
|
||||
public static IAlleleEffect effectWithering;
|
||||
public static IAlleleEffect effectTransmuting;
|
||||
public static IAlleleEffect effectCrumbling;
|
||||
|
||||
public static IAlleleEffect spawnBrainyZombie;
|
||||
public static IAlleleEffect spawnWisp;
|
||||
@@ -42,7 +46,9 @@ public class Allele implements IAllele
|
||||
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);
|
||||
@@ -64,7 +70,6 @@ public class Allele implements IAllele
|
||||
else
|
||||
{
|
||||
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||
Allele.spawnBrainyZombie = Allele.spawnBats = Allele.spawnWisp = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||
}
|
||||
|
||||
if (ArsMagicaHelper.isActive())
|
||||
@@ -95,6 +100,9 @@ public class Allele implements IAllele
|
||||
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.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
|
||||
.setThrottle(2060).setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
|
||||
|
||||
@@ -61,16 +61,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
||||
@Override
|
||||
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
int[] area = genome.getTerritory();
|
||||
float mod = housing.getTerritoryModifier(genome, 1f);
|
||||
// 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);
|
||||
|
||||
MagicBees.proxy.drawBeeEffects(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(),
|
||||
genome.getPrimary().getIconColour(0), area[0], area[1], area[2]);
|
||||
return storedData;
|
||||
return Allele.forestryBaseEffect.doFX(genome, storedData, housing);
|
||||
}
|
||||
|
||||
protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing)
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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(Block.stone), new ItemStack(Block.cobblestone));
|
||||
addPairToMap(new ItemStack(Block.cobblestone), new ItemStack(Block.cobblestoneMossy));
|
||||
addPairToMap(new ItemStack(Block.stoneBrick, 1, 0), new ItemStack(Block.stoneBrick, 1, 2));
|
||||
addPairToMap(new ItemStack(Block.stoneBrick, 1, 2), new ItemStack(Block.stoneBrick, 1, 1));
|
||||
addPairToMap(new ItemStack(Block.cobblestoneWall), new ItemStack(Block.cobblestoneWall, 1, 1));
|
||||
addPairToMap(new ItemStack(Block.gravel), new ItemStack(Block.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 xCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
xCoord = housing.getXCoord() + world.rand.nextInt(xCoord) - xCoord / 2;
|
||||
int yCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
yCoord = housing.getYCoord() + world.rand.nextInt(yCoord) - yCoord / 2;
|
||||
int zCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
zCoord = housing.getZCoord() + world.rand.nextInt(zCoord) - zCoord / 2;
|
||||
|
||||
boolean success = false;
|
||||
Block block = Block.blocksList[world.getBlockId(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, target.itemID, target.getItemDamage(), 2);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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;
|
||||
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, 900);
|
||||
}
|
||||
|
||||
@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 xCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
xCoord = housing.getXCoord() + world.rand.nextInt(xCoord) - xCoord / 2;
|
||||
int yCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
yCoord = housing.getYCoord() + world.rand.nextInt(yCoord) - yCoord / 2;
|
||||
int zCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
zCoord = housing.getZCoord() + world.rand.nextInt(zCoord) - zCoord / 2;
|
||||
|
||||
// Check if == stone
|
||||
boolean doTransmute = false;
|
||||
Block block = Block.blocksList[world.getBlockId(xCoord, yCoord, zCoord)];
|
||||
if (block == null || block == Block.stone || block == Block.cobblestone)
|
||||
{
|
||||
doTransmute = true;
|
||||
}
|
||||
else if (block != null)
|
||||
{
|
||||
ItemStack cobbleItem = new ItemStack(Block.cobblestone);
|
||||
ItemStack stoneItem = new ItemStack(Block.stone);
|
||||
ItemStack testItem = new ItemStack(block);
|
||||
doTransmute = OreDictionary.itemMatches(cobbleItem, testItem, false) || OreDictionary.itemMatches(stoneItem, cobbleItem, false);
|
||||
}
|
||||
|
||||
// Transmute to something.
|
||||
if (doTransmute)
|
||||
{
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
// Gogo shortcutting logic operators!
|
||||
boolean tryThis = trySpawnAbyssalStone(world, biome, xCoord, yCoord, zCoord) ||
|
||||
trySpawnQuarriedStone(world, biome, xCoord, yCoord, zCoord) ||
|
||||
trySpawnSandstone(world, biome, xCoord, yCoord, zCoord);
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, int x, int y, int z)
|
||||
{
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
|
||||
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FROZEN))
|
||||
{
|
||||
ItemStack item = GameRegistry.findItemStack("Railcraft", "stone.abyssal", 1);
|
||||
if (item != null)
|
||||
{
|
||||
world.setBlock(x, y, z, item.itemID, item.getItemDamage(), 2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, 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", "stone.quarried", 1);
|
||||
if (item != null)
|
||||
{
|
||||
world.setBlock(x, y, z, item.itemID, item.getItemDamage(), 2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean trySpawnSandstone(World world, BiomeGenBase biome, int x, int y, int z)
|
||||
{
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.DESERT))
|
||||
{
|
||||
world.setBlock(x, y, z, Block.sandStone.blockID);
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,6 +27,7 @@ public enum BeeClassification implements IClassification
|
||||
|
||||
METALLIC("Metallic", "Metalliapis"),
|
||||
GEM("Gem", "Lapidapis"),
|
||||
TRANSMUTING("Transmuting", "Transmutapis"),
|
||||
|
||||
THAUMIC("Thaumic", "Thaumiapis"),
|
||||
FLESHY("Fleshy", "Carnosapis"),
|
||||
|
||||
@@ -62,7 +62,7 @@ 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");
|
||||
genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1");
|
||||
|
||||
return genome;
|
||||
}
|
||||
@@ -718,6 +718,46 @@ public class BeeGenomeManager
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateMutableBase()
|
||||
{
|
||||
IAllele[] genome = getTemplateModBase();
|
||||
|
||||
genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortest");
|
||||
genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1");
|
||||
genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateMutable()
|
||||
{
|
||||
IAllele[] genome = getTemplateMutableBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MUTABLE;
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateTransmuting()
|
||||
{
|
||||
IAllele[] genome = getTemplateMutableBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TRANSMUTING;
|
||||
genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectTransmuting;
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateCrumbling()
|
||||
{
|
||||
IAllele[] genome = getTemplateMutableBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CRUMBLING;
|
||||
genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectCrumbling;
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
private static IAllele[] getTemplateTCBase()
|
||||
{
|
||||
IAllele[] genome = getTemplateModBase();
|
||||
|
||||
@@ -113,6 +113,10 @@ public class BeeMutation implements IBeeMutation
|
||||
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);
|
||||
|
||||
if (BeeSpecies.COPPER.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER, 12)
|
||||
@@ -123,7 +127,7 @@ public class BeeMutation implements IBeeMutation
|
||||
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN, 12)
|
||||
.setBlockRequired("blockTin");
|
||||
}
|
||||
new BeeMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON, 100)
|
||||
new BeeMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON, 12)
|
||||
.setBlockRequired(Block.blockIron);
|
||||
if (BeeSpecies.LEAD.isActive())
|
||||
{
|
||||
@@ -249,7 +253,7 @@ public class BeeMutation implements IBeeMutation
|
||||
|
||||
if (EquivalentExchangeHelper.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.ELDRITCH, BeeSpecies.EE_MINIUM, 8);
|
||||
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,6 +159,13 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
BeeClassification.GEM, 0x005300, 0x17DD62, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
|
||||
APATITE("Apatite", "apatite",
|
||||
BeeClassification.GEM, 0x2EA7EC, 0x001D51, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
|
||||
MUTABLE("Mutable", "mutable",
|
||||
BeeClassification.TRANSMUTING, 0xDBB24C, 0xE0D5A6, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
TRANSMUTING("Transmuting", "transmuting",
|
||||
BeeClassification.TRANSMUTING, 0xDBB24C, 0xA2D2D8, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
CRUMBLING("Crumbling", "crumbling",
|
||||
BeeClassification.TRANSMUTING, 0xDBB24C, 0xDBA4A4, EnumTemperature.HOT, EnumHumidity.ARID, false, false),
|
||||
|
||||
// --------- Thaumcraft Bees ---------------------------------------------------------------------------------------
|
||||
TC_STARK("TCStark", "torridae", // Stark
|
||||
@@ -578,6 +585,19 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
.setGenome(BeeGenomeManager.getTemplateApatite())
|
||||
.register();
|
||||
|
||||
MUTABLE.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 30)
|
||||
.setGenome(BeeGenomeManager.getTemplateMutable())
|
||||
.register();
|
||||
TRANSMUTING.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 10)
|
||||
.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 10)
|
||||
.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 10)
|
||||
.setGenome(BeeGenomeManager.getTemplateTransmuting())
|
||||
;//.register();
|
||||
CRUMBLING.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 20)
|
||||
.addProduct(new ItemStack(Config.fBeeComb, 1 , ForestryHelper.Comb.COCOA.ordinal()), 20)
|
||||
.setGenome(BeeGenomeManager.getTemplateCrumbling())
|
||||
.register();
|
||||
|
||||
|
||||
TC_STARK.addProduct(Config.combs.getStackForType(CombType.HARMONIZING), 10)
|
||||
.setGenome(BeeGenomeManager.getTemplateTCStark())
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
package magicbees.client.render;
|
||||
|
||||
import magicbees.main.MagicBees;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
/**
|
||||
* Borrowed from Forestry with some modifications.
|
||||
*/
|
||||
public class BeeRenderEffect extends EntityFX
|
||||
{
|
||||
public int blendmode = 1;
|
||||
private static ResourceLocation texture = new ResourceLocation("Forestry", "textures/items/particles/swarm_bee.png");
|
||||
|
||||
public BeeRenderEffect(World world, double x, double y, double z, float motionScaleX, float motionScaleY, float motionScaleZ, int color)
|
||||
{
|
||||
|
||||
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
|
||||
// Colour is stored in 4-byte int: XXRRGGBB
|
||||
particleRed = (color >> 16 & 255) / 255.0F;
|
||||
particleGreen = (color >> 8 & 255) / 255.0F;
|
||||
particleBlue = (color & 255) / 255.0F;
|
||||
|
||||
this.setParticleTextureIndex(0);
|
||||
this.setSize(0.1F, 0.1F);
|
||||
this.particleScale *= 0.2F;
|
||||
this.particleMaxAge = (int) (20.0D / (Math.random() * 0.8D + 0.2D));
|
||||
this.noClip = true;
|
||||
|
||||
this.motionX *= 0.119999999552965164D;
|
||||
this.motionY *= 0.119999999552965164D;
|
||||
this.motionZ *= 0.119999999552965164D;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
public void onUpdate()
|
||||
{
|
||||
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 1.08D;
|
||||
this.motionY *= 1.08D;
|
||||
this.motionZ *= 1.08D;
|
||||
|
||||
if (this.particleMaxAge-- <= 0)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
|
||||
/*tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, blendmode);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(texture);
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
float f10 = 0.1F * particleScale;
|
||||
float f11 = (float) ((prevPosX + (posX - prevPosX) * f) - interpPosX);
|
||||
float f12 = (float) ((prevPosY + (posY - prevPosY) * f) - interpPosY);
|
||||
float f13 = (float) ((prevPosZ + (posZ - prevPosZ) * f) - interpPosZ);
|
||||
|
||||
// GL11.glRotatef(this.rand.nextFloat(), 0.0F, 1.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(0x0000f0);
|
||||
|
||||
tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 1.0F);
|
||||
tessellator.addVertexWithUV(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10, 0, 1);
|
||||
tessellator.addVertexWithUV((f11 - f1 * f10) + f4 * f10, f12 + f2 * f10, (f13 - f3 * f10) + f5 * f10, 1, 1);
|
||||
tessellator.addVertexWithUV(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10, 1, 0);
|
||||
tessellator.addVertexWithUV((f11 + f1 * f10) - f4 * f10, f12 - f2 * f10, (f13 + f3 * f10) - f5 * f10, 0, 0);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glBindTexture(3553, MagicBees.proxy.getClientInstance().renderEngine.func_110577_a(texture));
|
||||
tessellator.startDrawingQuads();*/
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,20 @@
|
||||
package magicbees.main;
|
||||
|
||||
import magicbees.client.render.BeeRenderEffect;
|
||||
import magicbees.client.render.EffectJarRenderer;
|
||||
import magicbees.tileentity.TileEntityEffectJar;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.core.render.TextureManager;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
|
||||
public ClientProxy() { }
|
||||
|
||||
@Override
|
||||
{ @Override
|
||||
public void registerRenderers()
|
||||
{
|
||||
super.registerRenderers();
|
||||
@@ -25,31 +23,4 @@ public class ClientProxy extends CommonProxy
|
||||
MinecraftForgeClient.registerItemRenderer(Config.effectJar.blockID, EffectJarRenderer.instance);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEffectJar.class, EffectJarRenderer.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBeeEffects(World world, double xPos, double yPos, double zPos, int colour, int rangeX, int rangeY, int rangeZ)
|
||||
{
|
||||
// drawParticleEffects flag pulled from Forestry after configs
|
||||
if (MagicBees.getConfig().DrawParticleEffects)
|
||||
{
|
||||
double spawnX;
|
||||
double spawnY;
|
||||
double spawnZ;
|
||||
|
||||
if (world.rand.nextBoolean())
|
||||
{
|
||||
spawnX = xPos + 0.5;
|
||||
spawnY = yPos + 0.75;
|
||||
spawnZ = zPos + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnX = xPos + world.rand.nextInt(rangeX * 2) - rangeX;
|
||||
spawnY = yPos + world.rand.nextInt(rangeY);
|
||||
spawnZ = zPos + world.rand.nextInt(rangeZ * 2) - rangeZ;
|
||||
}
|
||||
|
||||
this.getClientInstance().effectRenderer.addEffect(new BeeRenderEffect(world, spawnX, spawnY, spawnZ, 0f, 0f, 0f, colour));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,18 +31,6 @@ public class CommonProxy
|
||||
public static final String GUI_PATH = TEXTURE_PATH + "gui/";
|
||||
|
||||
public static int RenderIdEffectJar;
|
||||
|
||||
public CommonProxy() { }
|
||||
|
||||
public void drawBeeEffects(World world, double xPos, double yPos, double zPos, int colour, int rangeX, int rangeY, int rangeZ)
|
||||
{
|
||||
// Does nothing in common.
|
||||
}
|
||||
|
||||
public Minecraft getClientInstance()
|
||||
{
|
||||
return FMLClientHandler.instance().getClient();
|
||||
}
|
||||
|
||||
public void registerRenderers() { }
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import magicbees.bees.BeeManager;
|
||||
import magicbees.client.gui.GUIHandler;
|
||||
import magicbees.main.utils.CompatabilityManager;
|
||||
import magicbees.main.utils.CraftingManager;
|
||||
import magicbees.main.utils.IMCManager;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.VersionInfo;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
@@ -14,6 +15,7 @@ import magicbees.world.WorldGeneratorHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
@@ -91,6 +93,12 @@ public class MagicBees
|
||||
VersionInfo.doVersionCheck();
|
||||
}
|
||||
|
||||
@Mod.IMCCallback
|
||||
public void handleIMCMessage(IMCEvent event)
|
||||
{
|
||||
IMCManager.handle(event);
|
||||
}
|
||||
|
||||
public static Config getConfig()
|
||||
{
|
||||
return object.modConfig;
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package magicbees.main.utils;
|
||||
|
||||
import magicbees.bees.AlleleEffectCrumbling;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
public class IMCManager
|
||||
{
|
||||
public static void handle(IMCEvent event)
|
||||
{
|
||||
for (IMCMessage message : event.getMessages())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (message.key.equals("addCrumblePair"))
|
||||
{
|
||||
handleCrumbleBlock(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.warning("Magic Bees recieved an IMC Message from a mod %s " +
|
||||
"but does not support messages keyed with %s.",
|
||||
message.getSender(), message.key);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.warning("Magic Bees recieved an invalid IMC Message from a mod %s! Please inform " +
|
||||
"the author of %s that they may not be correctly implementing message for key '%s'. Error details follow.",
|
||||
message.getSender(), message.key);
|
||||
FMLLog.info(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void handleCrumbleBlock(IMCMessage message) throws Exception
|
||||
{
|
||||
NBTTagCompound root = message.getNBTValue();
|
||||
NBTBase source = root.getTag("source");
|
||||
NBTBase target = root.getTag("target");
|
||||
|
||||
if (source != null && source instanceof NBTTagCompound)
|
||||
{
|
||||
ItemStack sourceItem = ItemStack.loadItemStackFromNBT((NBTTagCompound)source);
|
||||
if (target instanceof NBTTagCompound)
|
||||
{
|
||||
ItemStack targetItem = ItemStack.loadItemStackFromNBT((NBTTagCompound)target);
|
||||
AlleleEffectCrumbling.addPairToMap(sourceItem, targetItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Required tag 'target' was either empty, or not a valid ItemStack.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Required tag 'source' was either empty, or not a valid ItemStack.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user