Added Primus Loci.

This commit is contained in:
Vasco Lavos committed 2015-10-24 01:07:47 +01:00
1 parent 78609232de
commit 31c42e9703
12 files changed
+135 -5

No files matched your search

@@ -464,10 +464,12 @@ public final class ModBlocks {
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class);
registerSubTileWithDecor(LibBlockNames.SUBTILE_DAYBLOOM, SubTileDaybloom.class, SubTileDecor.Daybloom.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DAYBLOOM_PRIME, SubTileDaybloom.Prime.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ENDOFLAME, SubTileEndoflame.class);
registerSubTileWithDecor(LibBlockNames.SUBTILE_HYDROANGEAS, SubTileHydroangeas.class, SubTileDecor.Hydroangeas.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_THERMALILY, SubTileThermalily.class);
registerSubTileWithDecor(LibBlockNames.SUBTILE_NIGHTSHADE, SubTileNightshade.class, SubTileDecor.Nightshade.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_NIGHTSHADE_PRIME, SubTileNightshade.Prime.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ARCANE_ROSE, SubTileArcaneRose.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MUNCHDEW, SubTileMunchdew.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ENTROPINNYUM, SubTileEntropinnyum.class);
@@ -11,22 +11,58 @@
package vazkii.botania.common.block.subtile.generating;
import java.awt.Color;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.ISubTileContainer;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibMisc;
public class SubTileDaybloom extends SubTilePassiveGenerating {
private static final String TAG_PRIME_POSITION_X = "primePositionX";
private static final String TAG_PRIME_POSITION_Y = "primePositionY";
private static final String TAG_PRIME_POSITION_Z = "primePositionZ";
private static final String TAG_SAVED_POSITION = "savedPosition";
int primePositionX, primePositionY, primePositionZ;
boolean savedPosition;
@Override
public int getColor() {
return 0xFFFF00;
}
@Override
public void onUpdate() {
super.onUpdate();
if(isPrime() && (!savedPosition || primePositionX != supertile.xCoord || primePositionY != supertile.yCoord || primePositionZ != supertile.zCoord))
supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord);
}
public void setPrimusPosition() {
primePositionX = supertile.xCoord;
primePositionY = supertile.yCoord;
primePositionZ = supertile.zCoord;
savedPosition = true;
}
@Override
public ArrayList<ItemStack> getDrops(ArrayList<ItemStack> list) {
if(isPrime())
list.clear();
return super.getDrops(list);
}
@Override
public boolean canGeneratePassively() {
boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering());
@@ -35,7 +71,7 @@ public class SubTileDaybloom extends SubTilePassiveGenerating {
@Override
public int getDelayBetweenPassiveGeneration() {
return 25 + (int) (getSurroundingFlowers() * 7.5);
return isPrime() ? 22 : (25 + (int) (getSurroundingFlowers() * 7.5));
}
public int getSurroundingFlowers() {
@@ -61,15 +97,62 @@ public class SubTileDaybloom extends SubTilePassiveGenerating {
return flowers;
}
@Override
public void writeToPacketNBT(NBTTagCompound cmp) {
super.writeToPacketNBT(cmp);
if(isPrime()) {
cmp.setInteger(TAG_PRIME_POSITION_X, primePositionX);
cmp.setInteger(TAG_PRIME_POSITION_Y, primePositionY);
cmp.setInteger(TAG_PRIME_POSITION_Z, primePositionZ);
cmp.setBoolean(TAG_SAVED_POSITION, savedPosition);
}
}
@Override
public void readFromPacketNBT(NBTTagCompound cmp) {
super.readFromPacketNBT(cmp);
if(isPrime()) {
primePositionX = cmp.getInteger(TAG_PRIME_POSITION_X);
primePositionY = cmp.getInteger(TAG_PRIME_POSITION_Y);
primePositionZ = cmp.getInteger(TAG_PRIME_POSITION_Z);
savedPosition = cmp.getBoolean(TAG_SAVED_POSITION);
}
}
@Override
public boolean shouldSyncPassiveGeneration() {
return true;
}
@Override
public boolean isPassiveFlower() {
return !isPrime();
}
@Override
public LexiconEntry getEntry() {
return LexiconData.daybloom;
}
public boolean isPrime() {
return false;
}
public static class Prime extends SubTileDaybloom {
@Override
public boolean isPrime() {
return true;
}
@Override
public LexiconEntry getEntry() {
return LexiconData.primusLoci;
}
}
}
@@ -34,5 +34,19 @@ public class SubTileNightshade extends SubTileDaybloom {
public LexiconEntry getEntry() {
return LexiconData.nightshade;
}
public static class Prime extends SubTileNightshade {
@Override
public boolean isPrime() {
return true;
}
@Override
public LexiconEntry getEntry() {
return LexiconData.primusLoci;
}
}
}
@@ -16,6 +16,9 @@ import vazkii.botania.api.item.IFlowerlessBiome;
import vazkii.botania.api.item.IFlowerlessWorld;
import vazkii.botania.common.block.BlockModFlower;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.subtile.generating.SubTileDaybloom;
import vazkii.botania.common.block.tile.TileSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@@ -42,15 +45,25 @@ public class BiomeDecorationHandler {
int y = event.world.getTopSolidOrLiquidBlock(x, z);
int color = event.rand.nextInt(16);
boolean primus = event.rand.nextInt(500) == 0;
for(int j = 0; j < ConfigHandler.flowerDensity * ConfigHandler.flowerPatchChance; j++) {
int x1 = x + event.rand.nextInt(dist * 2) - dist;
int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4);
int z1 = z + event.rand.nextInt(dist * 2) - dist;
if(event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1)) {
event.world.setBlock(x1, y1, z1, ModBlocks.flower, color, 2);
if(event.rand.nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).func_149851_a(event.world, x1, y1, z1, false))
BlockModFlower.placeDoubleFlower(event.world, x1, y1, z1, color, 0);
if(primus) {
event.world.setBlock(x1, y1, z1, ModBlocks.specialFlower, 0, 2);
TileSpecialFlower flower = (TileSpecialFlower) event.world.getTileEntity(x1, y1, z1);
flower.setSubTile(event.rand.nextBoolean() ? LibBlockNames.SUBTILE_NIGHTSHADE_PRIME : LibBlockNames.SUBTILE_DAYBLOOM_PRIME);
SubTileDaybloom subtile = (SubTileDaybloom) flower.getSubTile();
subtile.setPrimusPosition();
} else {
event.world.setBlock(x1, y1, z1, ModBlocks.flower, color, 2);
if(event.rand.nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).func_149851_a(event.world, x1, y1, z1, false))
BlockModFlower.placeDoubleFlower(event.world, x1, y1, z1, color, 0);
}
}
}
}
@@ -123,6 +123,7 @@ public final class LexiconData {
public static LexiconEntry generatingIntro;
public static LexiconEntry passiveGen;
public static LexiconEntry primusLoci;
public static LexiconEntry daybloom;
public static LexiconEntry nightshade;
public static LexiconEntry endoflame;
@@ -531,6 +532,10 @@ public final class LexiconData {
passiveGen = new BLexiconEntry(LibLexicon.GFLOWER_PASSIVE_GENERATION, categoryGenerationFlowers);
passiveGen.setPriority().setLexiconPages(new PageText("0"), new PageText("1")).setIcon(new ItemStack(Blocks.deadbush));
primusLoci = new BLexiconEntry(LibLexicon.GFLOWER_PRIMUS_LOCI, categoryGenerationFlowers);
primusLoci.setPriority().setLexiconPages(new PageText("0"), new PageText("1"));
primusLoci.setIcon(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM_PRIME));
daybloom = new BLexiconEntry(LibLexicon.GFLOWER_DAYBLOOM, categoryGenerationFlowers);
daybloom.setPriority().setLexiconPages(new PageText("0"), new PageText(ConfigHandler.hardcorePassiveGeneration > 0 ? "1a" : "1"), new PageImage("3", LibResources.ENTRY_DIMINISHING_RETURNS), new PagePetalRecipe("2", ModPetalRecipes.daybloomRecipe), new PageText("4"), new PageText("5"));
@@ -109,10 +109,12 @@ public final class LibBlockNames {
public static final String SUBTILE_MANASTAR = "manastar";
public static final String SUBTILE_DAYBLOOM = "daybloom";
public static final String SUBTILE_DAYBLOOM_PRIME = "daybloomPrime";
public static final String SUBTILE_ENDOFLAME = "endoflame";
public static final String SUBTILE_HYDROANGEAS = "hydroangeas";
public static final String SUBTILE_THERMALILY = "thermalily";
public static final String SUBTILE_NIGHTSHADE = "nightshade";
public static final String SUBTILE_NIGHTSHADE_PRIME = "nightshadePrime";
public static final String SUBTILE_ARCANE_ROSE = "arcanerose";
public static final String SUBTILE_MUNCHDEW = "munchdew";
public static final String SUBTILE_ENTROPINNYUM = "entropinnyum";
@@ -93,6 +93,7 @@ public final class LibLexicon {
public static final String GFLOWER_INTRO = "gIntro";
public static final String GFLOWER_PASSIVE_GENERATION = "passiveGen";
public static final String GFLOWER_PRIMUS_LOCI = "primusLoci";
public static final String GFLOWER_DAYBLOOM = "daybloom";
public static final String GFLOWER_NIGHTSHADE = "nightshade";
public static final String GFLOWER_ENDOFLAME = "endoflame";
@@ -1167,6 +1167,8 @@ tile.botania:flower.daybloom.name=Daybloom
tile.botania:flower.daybloom.reference=A Sting of light
tile.botania:flower.daybloomDecor.name=Daybloom Motif
tile.botania:flower.daybloomDecor.reference=A Sting of light
tile.botania:flower.daybloomPrime.name=Daybloom Primus
tile.botania:flower.daybloomPrime.reference=You should not have this on you
tile.botania:flower.endoflame.name=Endoflame
tile.botania:flower.endoflame.reference=Squirting Lag
tile.botania:flower.hydroangeas.name=Hydroangeas
@@ -1177,6 +1179,8 @@ tile.botania:flower.thermalily.name=Thermalily
tile.botania:flower.thermalily.reference=A Scarlet Rose indeed
tile.botania:flower.nightshade.name=Nightshade
tile.botania:flower.nightshade.reference=Ghastly signature
tile.botania:flower.nightshadePrime.name=Nightshade Primus
tile.botania:flower.nightshadePrime.reference=You should not have this on you
tile.botania:flower.nightshadeDecor.name=Nightshade Motif
tile.botania:flower.nightshadeDecor.reference=Ghastly signature
tile.botania:flower.arcanerose.name=Rosa Arcana
@@ -2430,6 +2434,12 @@ botania.tagline.passiveGen=It's free or it's good, pick one
botania.page.passiveGen0=The spectrum of &4Generating Flowers&0 can be arranged in two groups, &4Passive&0 and &4Active&0.<br>&4Passive Flowers&0 are those that simply create &4Mana&0 using a completely free resource, such as the sun, or water. &4Active Flowers&0 require some sort of resource to transform into &4Mana&0, be it renewable or not.
botania.page.passiveGen1=At the start of a botanist's career, only very basic and rudimentary &4Passive Flowers&0 are available, such as the &1Daybloom&0 or &1Nightshade&0.<br>These flowers are required to advance on to more potent and effective &4Active Flowers&0, but they should not be relied upon aside from being a stepping stone, as all &4Passive Flowers&0 will decay into a &1Dead Bush&0 after three days of work.
# -- PRIMUS LOCI
botania.entry.primusLoci=Primus Loci
botania.tagline.primusLoci=Rare flower patches with non-decaying flowers
botania.page.primusLoci0=Among one's travels, one might come across an unusual flower patch, with flowers resembling &1Dayblooms&0 and &1Nightshades&0.<br>This is called a &4Primus Locus&0, a rare occurence in the world, where two special generating flora, the &1Daybloom Primus&0 and &1Nightshade Primus&0 can appear.
botania.page.primusLoci1=These flowers act as normal &1Dayblooms&0 or &1Nightshades&0, however, they produce mana a little bit faster and do not decay, making them a great find for a fledgling botanist to set up camp around.<br>Primus flowers are incredibly fickle, and as such, attempting to move them off their natural resting place will kill them.
# -- DAYBLOOM
botania.entry.daybloom=Daybloom
botania.tagline.daybloom=Mana from the sky
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB