mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 06:52:58 +00:00
Added the Clayconia.
This commit is contained in:
1 parent
62532fc8d0
commit
39b5a61b6a
6 files changed
+85
-2
No files matched your search
@@ -49,7 +49,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
|
||||
public static Map<String, IIcon> icons = new HashMap();
|
||||
|
||||
private static String[] subtypes = {
|
||||
private static String[] subtypes = new String[] {
|
||||
// Misc
|
||||
LibBlockNames.SUBTILE_PUREDAISY,
|
||||
|
||||
@@ -77,7 +77,8 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
LibBlockNames.SUBTILE_TANGLEBERRIE,
|
||||
LibBlockNames.SUBTILE_JIYUULIA,
|
||||
LibBlockNames.SUBTILE_HYACIDUS,
|
||||
LibBlockNames.SUBTILE_POLLIDISIAC
|
||||
LibBlockNames.SUBTILE_POLLIDISIAC,
|
||||
LibBlockNames.SUBTILE_CLAYCONIA
|
||||
};
|
||||
|
||||
protected BlockSpecialFlower() {
|
||||
|
||||
@@ -22,6 +22,7 @@ import vazkii.botania.common.block.dispenser.BehaviourWand;
|
||||
import vazkii.botania.common.block.subtile.SubTilePureDaisy;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileAgricarnation;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileBellethorn;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileClayconia;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileDreadthorn;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileExoflame;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileFallenKanade;
|
||||
@@ -170,6 +171,7 @@ public final class ModBlocks {
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_RANNUNCARPUS, SubTileRannuncarpus.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HYACIDUS, SubTileHyacidus.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_POLLIDISIAC, SubTilePollidisiac.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_CLAYCONIA, SubTileClayconia.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [May 17, 2014, 12:05:37 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
|
||||
public class SubTileClayconia extends SubTileFunctional {
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!supertile.getWorldObj().isRemote && supertile.getWorldObj().getTotalWorldTime() % 5 == 0) {
|
||||
int manaCost = 80;
|
||||
if(mana >= manaCost) {
|
||||
ChunkCoordinates coords = getCoordsToPut();
|
||||
if(coords != null) {
|
||||
supertile.getWorldObj().setBlockToAir(coords.posX, coords.posY, coords.posZ);
|
||||
supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(Blocks.sand));
|
||||
EntityItem item = new EntityItem(supertile.getWorldObj(), coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, new ItemStack(Items.clay_ball));
|
||||
supertile.getWorldObj().spawnEntityInWorld(item);
|
||||
mana -= manaCost;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ChunkCoordinates getCoordsToPut() {
|
||||
List<ChunkCoordinates> possibleCoords = new ArrayList();
|
||||
int range = 5;
|
||||
int rangeY = 3;
|
||||
|
||||
for(int i = -range; i < range; i++)
|
||||
for(int j = -rangeY; j < rangeY; j++)
|
||||
for(int k = -range; k < range; k++) {
|
||||
int x = supertile.xCoord + i;
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
Block block = supertile.getWorldObj().getBlock(x, y, z);
|
||||
if(block == Blocks.sand)
|
||||
possibleCoords.add(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
|
||||
if(possibleCoords.isEmpty())
|
||||
return null;
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x7B8792;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 640;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,4 +66,5 @@ public final class LibBlockNames {
|
||||
public static final String SUBTILE_RANNUNCARPUS = "rannuncarpus";
|
||||
public static final String SUBTILE_HYACIDUS = "hyacidus";
|
||||
public static final String SUBTILE_POLLIDISIAC = "pollidisiac";
|
||||
public static final String SUBTILE_CLAYCONIA = "clayconia";
|
||||
}
|
||||
@@ -185,6 +185,8 @@ tile.botania:flower.hyacidus.name=Hyacidus
|
||||
tile.botania:flower.hyacidus.reference=If you don't walk, it doesn't hurt
|
||||
tile.botania:flower.pollidisiac.name=Pollidisiac
|
||||
tile.botania:flower.pollidisiac.reference=Birds and bees
|
||||
tile.botania:flower.clayconia.name=Clayconia
|
||||
tile.botania:flower.clayconia.reference=Rupees not included
|
||||
|
||||
# ITEM NAMES
|
||||
item.botania:lexicon.name=Lexica Botania
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Reference in new issue
Block a user