mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-12 16:27:37 +00:00
commit
5d3dda366d
11 files changed
+138
-12
No files matched your search
@@ -11,12 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -43,7 +38,8 @@ import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvider, ISpecialFlower, IWandable, ILexiconable, IWandHUD {
|
||||
|
||||
@@ -55,12 +51,14 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
// Generating
|
||||
LibBlockNames.SUBTILE_DAYBLOOM,
|
||||
LibBlockNames.SUBTILE_ENDOFLAME,
|
||||
LibBlockNames.SUBTILE_HYDROANGEAS,
|
||||
|
||||
// Functional
|
||||
LibBlockNames.SUBTILE_JADED_AMARANTHUS,
|
||||
LibBlockNames.SUBTILE_BELLETHORN,
|
||||
LibBlockNames.SUBTILE_HEISEI_DREAM,
|
||||
LibBlockNames.SUBTILE_TIGERSEYE,
|
||||
|
||||
};
|
||||
|
||||
protected BlockSpecialFlower() {
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -38,6 +36,8 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockSpreader extends BlockModContainer implements IWandable, IWandHUD, ILexiconable {
|
||||
|
||||
Random random;
|
||||
@@ -55,7 +55,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
||||
TileSpreader spreader = (TileSpreader) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
System.out.println(orientation);
|
||||
//System.out.println(orientation);
|
||||
|
||||
switch(orientation) {
|
||||
case 0:
|
||||
|
||||
@@ -22,6 +22,7 @@ import vazkii.botania.common.block.subtile.functional.SubTileJadedAmaranthus;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileTigerseye;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileDaybloom;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileEndoflame;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileHydroangeas;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
import vazkii.botania.common.block.tile.TileDistributor;
|
||||
import vazkii.botania.common.block.tile.TileManaBeacon;
|
||||
@@ -90,6 +91,7 @@ public final class ModBlocks {
|
||||
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DAYBLOOM, SubTileDaybloom.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ENDOFLAME, SubTileEndoflame.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HYDROANGEAS, SubTileHydroangeas.class);
|
||||
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_BELLETHORN, SubTileBellethorn.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HEISEI_DREAM, SubTileHeiseiDream.class);
|
||||
|
||||
@@ -13,8 +13,6 @@ package vazkii.botania.common.block.multipart;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.microblock.MicroMaterialRegistry;
|
||||
|
||||
public final class MultipartHandler {
|
||||
|
||||
@@ -30,6 +28,7 @@ public final class MultipartHandler {
|
||||
|
||||
private static void registerMultipart(Block block, int meta) {
|
||||
MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileHydroangeas extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_BURN_TIME = "burnTime";
|
||||
int burnTime = 0;
|
||||
int currentTime = 0;
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
|
||||
int range = 1;
|
||||
|
||||
boolean didSomething = false;
|
||||
|
||||
if (burnTime == 0) {
|
||||
|
||||
if (supertile.worldObj.getWorldTime() % 40L == 0) {
|
||||
|
||||
if (mana < getMaxMana() && !supertile.worldObj.isRemote) {
|
||||
|
||||
for (int i = -range; i <= range; i++) {
|
||||
|
||||
for (int j = -range; j <= range; j++) {
|
||||
|
||||
if (supertile.worldObj.getBlockId(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == Block.waterStill.blockID && supertile.worldObj.getBlockMetadata(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == 0) {
|
||||
|
||||
supertile.worldObj.setBlockToAir(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j);
|
||||
didSomething = true;
|
||||
burnTime++;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (didSomething)
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (supertile.worldObj.rand.nextInt(8) == 0)
|
||||
Botania.proxy.wispFX(supertile.worldObj, supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
burnTime--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 150;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValueForPassiveGeneration(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor(){
|
||||
if (burnTime > 0)
|
||||
return 0x532FE0;
|
||||
else
|
||||
return 0xA62997;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry()
|
||||
{
|
||||
return LexiconData.hydroangeas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp){
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
cmp.setInteger(TAG_BURN_TIME, burnTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp){
|
||||
super.readFromPacketNBT(cmp);
|
||||
|
||||
burnTime = cmp.getInteger(TAG_BURN_TIME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGeneratePassively(){
|
||||
return burnTime > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDelayBetweenPassiveGeneration(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -32,16 +32,19 @@ public final class ModPetalRecipes {
|
||||
public static RecipePetals bellethorneRecipe;
|
||||
public static RecipePetals heiseiDreamRecipe;
|
||||
public static RecipePetals tigerseyeRecipe;
|
||||
public static RecipePetals hydroangeasRecipe;
|
||||
|
||||
public static void init() {
|
||||
pureDaisyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), white, white, white, white);
|
||||
|
||||
daybloomRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM), yellow, yellow, orange, lightBlue);
|
||||
endoflameRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENDOFLAME), brown, red, redMana, brownMana, lightGray);
|
||||
hydroangeasRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HYDROANGEAS), blue, blue, pink, blue);
|
||||
|
||||
jadedAmaranthusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_JADED_AMARANTHUS), purpleMana, purpleMana, lime, purple, green);
|
||||
bellethorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN), redMana, redMana, cyan, cyan, red);
|
||||
heiseiDreamRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HEISEI_DREAM), purpleMana, pinkMana, magentaMana, purple, pink, magenta, runeWrath);
|
||||
tigerseyeRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_TIGERSEYE), yellow, brownMana, orangeMana, lime, runeAutumn);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry generatingIntro;
|
||||
public static LexiconEntry daybloom;
|
||||
public static LexiconEntry endoflame;
|
||||
public static LexiconEntry hydroangeas;
|
||||
|
||||
public static LexiconEntry pistonRelay;
|
||||
public static LexiconEntry pylon;
|
||||
@@ -166,6 +167,9 @@ public final class LexiconData {
|
||||
endoflame = new BLexiconEntry(LibLexicon.GFLOWER_ENDOFLAME, categoryGenerationFlowers);
|
||||
endoflame.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.endoflameRecipe));
|
||||
|
||||
hydroangeas = new BLexiconEntry(LibLexicon.GFLOWER_HYDROANGEAS, categoryGenerationFlowers);
|
||||
hydroangeas.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.hydroangeasRecipe));
|
||||
|
||||
// DEVICES ENTRIES
|
||||
pistonRelay = new BLexiconEntry(LibLexicon.DEVICE_PISTON_RELAY, categoryDevices);
|
||||
pistonRelay.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe));
|
||||
|
||||
@@ -35,6 +35,7 @@ public final class LibBlockNames {
|
||||
|
||||
public static final String SUBTILE_DAYBLOOM = "daybloom";
|
||||
public static final String SUBTILE_ENDOFLAME = "endoflame";
|
||||
public static final String SUBTILE_HYDROANGEAS = "hydroangeas";
|
||||
|
||||
public static final String SUBTILE_BELLETHORN = "bellethorn";
|
||||
public static final String SUBTILE_HEISEI_DREAM = "heiseiDream";
|
||||
|
||||
@@ -52,6 +52,7 @@ public final class LibLexicon {
|
||||
public static final String GFLOWER_INTRO = "gIntro";
|
||||
public static final String GFLOWER_DAYBLOOM = "daybloom";
|
||||
public static final String GFLOWER_ENDOFLAME = "endoflame";
|
||||
public static final String GFLOWER_HYDROANGEAS = "hydroangeas";
|
||||
|
||||
public static final String DEVICE_PISTON_RELAY = "pistonRelay";
|
||||
public static final String DEVICE_PYLON = "pylon";
|
||||
|
||||
@@ -105,6 +105,7 @@ tile.botania:flower.puredaisy.name=Pure Daisy
|
||||
# - GENERATING
|
||||
tile.botania:flower.daybloom.name=Daybloom
|
||||
tile.botania:flower.endoflame.name=Endoflame
|
||||
tile.botania:flower.hydroangeas.name=Hydroangeas
|
||||
|
||||
# - FUNCTIONAL
|
||||
tile.botania:flower.bellethorn.name=Bellethorne
|
||||
@@ -384,6 +385,11 @@ botania.entry.endoflame=Endoflame
|
||||
botania.page.endoflame0=While the &1Daybloom&0 is all well and good, a botanist requires more effective means of generating &4Mana&0.<br>The &1Endoflame&0 does that exactly, it will absorb any combustible items or blocks dropped on the nearby vacinity (albeit only one at a time) and burn through them to passively generate mana while the fuel lasts.
|
||||
botania.page.endoflame1=&oNot nitor&r.
|
||||
|
||||
# -- Hydroangeas
|
||||
botania.entry.hydroangeas=Hydroangeas
|
||||
botania.page.hydroangeas0=While you can generate easy &4Mana&0 with the &1Daybloom&0, sometimes you need to create more energy without using any fuels...<br>The &1Hydroangeas&0 will devour adjacent water sources to create mana, it does have a cooldown timer though, so power can not be generated instantly.
|
||||
botania.page.hydroangeas1=&oAquatic Power&r.
|
||||
|
||||
# - MAGICAL APPARATUS
|
||||
# -- FORCE RELAY
|
||||
botania.entry.pistonRelay=Force Relay
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 558 B |
Reference in new issue
Block a user