mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-24 22:14:45 +00:00
Fixed Pokefenn's commit.
This commit is contained in:
1 parent
5d3dda366d
commit
5433b583c3
10 files changed
+84
-96
No files matched your search
@@ -11,7 +11,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -38,8 +43,7 @@ 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 java.util.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvider, ISpecialFlower, IWandable, ILexiconable, IWandHUD {
|
||||
|
||||
@@ -51,7 +55,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
// Generating
|
||||
LibBlockNames.SUBTILE_DAYBLOOM,
|
||||
LibBlockNames.SUBTILE_ENDOFLAME,
|
||||
LibBlockNames.SUBTILE_HYDROANGEAS,
|
||||
LibBlockNames.SUBTILE_HYDROANGEAS,
|
||||
|
||||
// Functional
|
||||
LibBlockNames.SUBTILE_JADED_AMARANTHUS,
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
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;
|
||||
@@ -36,8 +38,6 @@ 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,6 @@ 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);
|
||||
|
||||
switch(orientation) {
|
||||
case 0:
|
||||
|
||||
@@ -91,7 +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_HYDROANGEAS, SubTileHydroangeas.class);
|
||||
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_BELLETHORN, SubTileBellethorn.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HEISEI_DREAM, SubTileHeiseiDream.class);
|
||||
|
||||
@@ -13,6 +13,8 @@ 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 {
|
||||
|
||||
|
||||
@@ -10,103 +10,86 @@ 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;
|
||||
private static final String TAG_BURN_TIME = "burnTime";
|
||||
int burnTime = 0;
|
||||
int currentTime = 0;
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
|
||||
int range = 1;
|
||||
int range = 1;
|
||||
|
||||
boolean didSomething = false;
|
||||
boolean didSomething = false;
|
||||
|
||||
if (burnTime == 0) {
|
||||
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 += 10;
|
||||
|
||||
if (supertile.worldObj.getWorldTime() % 40L == 0) {
|
||||
break;
|
||||
|
||||
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--;
|
||||
}
|
||||
|
||||
}
|
||||
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.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
burnTime--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 150;
|
||||
}
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 150;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValueForPassiveGeneration(){
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getValueForPassiveGeneration(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor(){
|
||||
if (burnTime > 0)
|
||||
return 0x532FE0;
|
||||
else
|
||||
return 0xA62997;
|
||||
@Override
|
||||
public int getColor(){
|
||||
return 0x532FE0;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.hydroangeas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry()
|
||||
{
|
||||
return LexiconData.hydroangeas;
|
||||
}
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp){
|
||||
super.writeToPacketNBT(cmp);
|
||||
cmp.setInteger(TAG_BURN_TIME, burnTime);
|
||||
}
|
||||
|
||||
cmp.setInteger(TAG_BURN_TIME, burnTime);
|
||||
}
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp){
|
||||
super.readFromPacketNBT(cmp);
|
||||
burnTime = cmp.getInteger(TAG_BURN_TIME);
|
||||
}
|
||||
|
||||
burnTime = cmp.getInteger(TAG_BURN_TIME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGeneratePassively(){
|
||||
return burnTime > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDelayBetweenPassiveGeneration(){
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public boolean canGeneratePassively() {
|
||||
return burnTime > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDelayBetweenPassiveGeneration() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,14 +32,14 @@ public final class ModPetalRecipes {
|
||||
public static RecipePetals bellethorneRecipe;
|
||||
public static RecipePetals heiseiDreamRecipe;
|
||||
public static RecipePetals tigerseyeRecipe;
|
||||
public static RecipePetals hydroangeasRecipe;
|
||||
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);
|
||||
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);
|
||||
|
||||
@@ -66,7 +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 hydroangeas;
|
||||
|
||||
public static LexiconEntry pistonRelay;
|
||||
public static LexiconEntry pylon;
|
||||
@@ -167,8 +167,8 @@ 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));
|
||||
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);
|
||||
|
||||
@@ -35,7 +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_HYDROANGEAS = "hydroangeas";
|
||||
|
||||
public static final String SUBTILE_BELLETHORN = "bellethorn";
|
||||
public static final String SUBTILE_HEISEI_DREAM = "heiseiDream";
|
||||
|
||||
@@ -52,7 +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 GFLOWER_HYDROANGEAS = "hydroangeas";
|
||||
|
||||
public static final String DEVICE_PISTON_RELAY = "pistonRelay";
|
||||
public static final String DEVICE_PYLON = "pylon";
|
||||
|
||||
@@ -385,7 +385,7 @@ 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
|
||||
# -- 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.
|
||||
|
||||
Reference in new issue
Block a user