Updated for 1.7.2
This commit is contained in:
parent
cc178e1a3b
commit
29228e18fe
105 changed files with 1939 additions and 2690 deletions
|
|
@ -1,114 +0,0 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.items.ItemHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.ColorizerGrass;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBush extends BlockFlower {
|
||||
Icon[] textures;
|
||||
|
||||
public BlockBush(int id) {
|
||||
super(id, Material.leaves);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setHardness(0.3F);
|
||||
setResistance(0.1F);
|
||||
setStepSound(Block.soundGrassFootstep);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
|
||||
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
||||
return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j) {
|
||||
return j;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor() {
|
||||
double d0 = 0.5D;
|
||||
double d1 = 1.0D;
|
||||
return ColorizerGrass.getGrassColor(d0, d1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, par2 + this.maxX, par3 + this.maxY, par4 + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlantType getPlantType(World world, int x, int y, int z) {
|
||||
return EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int par1) {
|
||||
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||
for (int j = 0; j < 12; j++) {
|
||||
list.add(new ItemStack(i, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return ItemHandler.bushFruit.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int par1, Random par2Random) {
|
||||
return 1 + par2Random.nextInt(par1 * 2 + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[16];
|
||||
for (int i = 0; i < 12; i++) {
|
||||
textures[i] = iconRegister.registerIcon("mysticworld:" + ItemBush.BUSH_TYPES[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int par1) {
|
||||
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +1,26 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import mysticworld.lib.BlockIds;
|
||||
import mysticworld.lib.Strings;
|
||||
import mysticworld.util.Reference;
|
||||
import net.minecraft.block.Block;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class BlockHandler {
|
||||
public static Block oreImbuedStone;
|
||||
public static Block bush;
|
||||
public static Block lightCube;
|
||||
public static Block pillarPlatform;
|
||||
public static Block pillar;
|
||||
public static Block pillarInsert;
|
||||
public static final ArrayList<String> IMBUED_STONE_TYPE = new ArrayList<String>(Arrays.asList(Strings.IMBUED_STONE_NAME+"Fire", Strings.IMBUED_STONE_NAME+"Water", Strings.IMBUED_STONE_NAME+"Earth", Strings.IMBUED_STONE_NAME+"Air", Strings.IMBUED_STONE_NAME+"Energy"));
|
||||
public static final ArrayList<String> BUSH_TYPES = new ArrayList<String>(Arrays.asList(Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME,
|
||||
Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME,
|
||||
Strings.INVISIBILITY_BUSH_NAME));
|
||||
public static Block oreImbuedStone, bush, lightCube, pillarPlatform, pillar, pillarInsert;
|
||||
|
||||
public static void init() {
|
||||
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
||||
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
|
||||
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME).setTextureName("mysticworld:lightCube");
|
||||
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME).setTextureName("mysticworld:Platform");
|
||||
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME).setTextureName("mysticworld:Pillar");
|
||||
pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME);
|
||||
registerBlocks();
|
||||
setBlockHarvestLevels();
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
GameRegistry.registerBlock(oreImbuedStone, ItemImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
||||
GameRegistry.registerBlock(bush, ItemBush.class, Strings.BUSH_NAME);
|
||||
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
|
||||
GameRegistry.registerBlock(pillarPlatform, Strings.PLATFORM_NAME);
|
||||
GameRegistry.registerBlock(pillar, Strings.PILLAR_NAME);
|
||||
GameRegistry.registerBlock(pillarInsert, Strings.PILLAR_INSERT_NAME);
|
||||
}
|
||||
|
||||
private static void setBlockHarvestLevels() {
|
||||
oreImbuedStone = GameRegistry.registerBlock(new BlockImbuedStone().setBlockName(Strings.IMBUED_STONE_NAME), ItemBlockMulti.class, Strings.IMBUED_STONE_NAME, Reference.MOD_ID, IMBUED_STONE_TYPE);
|
||||
bush = GameRegistry.registerBlock(new BlockBushes().setBlockName(Strings.BUSH_NAME), ItemBlockMulti.class, Strings.BUSH_NAME, Reference.MOD_ID, BUSH_TYPES);
|
||||
lightCube = GameRegistry.registerBlock(new BlockLightCube().setBlockName(Strings.LIGHT_CUBE_NAME).setBlockTextureName("mysticworld:lightCube"), Strings.LIGHT_CUBE_NAME);
|
||||
pillarPlatform = GameRegistry.registerBlock(new BlockPlatform().setBlockName(Strings.PLATFORM_NAME).setBlockTextureName("mysticworld:Platform"), Strings.PLATFORM_NAME);
|
||||
pillar = GameRegistry.registerBlock(new BlockPillar().setBlockName(Strings.PILLAR_NAME).setBlockTextureName("mysticworld:Pillar"), Strings.PILLAR_NAME);
|
||||
pillarInsert = GameRegistry.registerBlock(new BlockPillarInsert().setBlockName(Strings.PILLAR_INSERT_NAME), Strings.PILLAR_INSERT_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,29 +8,30 @@ import mysticworld.items.ItemHandler;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockImbuedStone extends Block {
|
||||
Icon[] textures;
|
||||
IIcon[] textures;
|
||||
|
||||
public BlockImbuedStone(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(0.5F);
|
||||
setResistance(5F);
|
||||
public BlockImbuedStone() {
|
||||
super(Material.rock);
|
||||
setHardness(0.5F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||
setLightValue(0.625f);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||
setLightLevel(0.625f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -44,25 +45,20 @@ public class BlockImbuedStone extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta) {
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||
public void getSubBlocks(Item i, CreativeTabs tab, List list) {
|
||||
for (int j = 0; j < 5; j++) {
|
||||
list.add(new ItemStack(i, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return ItemHandler.imbuedShard.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
||||
return ItemHandler.imbuedShard;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -71,9 +67,9 @@ public class BlockImbuedStone extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
||||
boolean flag = false;
|
||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) {
|
||||
if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && !BlockFence.func_149825_a(par1World.getBlock(par2, par3 - 1, par4))) {
|
||||
flag = true;
|
||||
}
|
||||
if (flag) {
|
||||
|
|
@ -84,24 +80,24 @@ public class BlockImbuedStone extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[16];
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
textures = new IIcon[16];
|
||||
for (int i = 0; i < 5; i++) {
|
||||
textures[i] = iconRegister.registerIcon("mysticworld:" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
|
||||
textures[i] = iconRegister.registerIcon("mysticworld:" + BlockHandler.IMBUED_STONE_TYPE.get(i).substring(11) + " Imbued Stone");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public int xpDropAmount(int j) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,24 +5,20 @@ import java.util.Random;
|
|||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockLightCube extends Block {
|
||||
public BlockLightCube(int id) {
|
||||
super(id, Material.circuits);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setLightValue(1.0F);
|
||||
this.setTickRandomly(true);
|
||||
public BlockLightCube() {
|
||||
super(Material.circuits);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setLightLevel(1.0F);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -31,13 +27,13 @@ public class BlockLightCube extends Block {
|
|||
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,23 +3,24 @@ package mysticworld.blocks;
|
|||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockPillar extends Block {
|
||||
public BlockPillar(int id) {
|
||||
super(id, Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
public BlockPillar() {
|
||||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,28 +4,33 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.tiles.TileEntityPillarInsert;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPillarInsert extends BlockContainer {
|
||||
public class BlockPillarInsert extends Block {
|
||||
public static int RENDER_PILLAR_INSERT;
|
||||
|
||||
public BlockPillarInsert(int id) {
|
||||
super(id, Material.rock);
|
||||
public BlockPillarInsert() {
|
||||
super(Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000000.0F);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
|
||||
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int i){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createTileEntity(World world, int i) {
|
||||
return new TileEntityPillarInsert();
|
||||
}
|
||||
|
||||
|
|
@ -39,16 +44,11 @@ public class BlockPillarInsert extends BlockContainer {
|
|||
return RENDER_PILLAR_INSERT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
|
||||
if (!world.isRemote) {
|
||||
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) {
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
if (Items.ender_pearl == entityPlayer.inventory.getCurrentItem().getItem()) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -56,15 +56,21 @@ public class BlockPillarInsert extends BlockContainer {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,18 +9,13 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPillarPlatform extends Block {
|
||||
public BlockPillarPlatform(int id) {
|
||||
super(id, Material.rock);
|
||||
public BlockPillarPlatform() {
|
||||
super(Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000000.0F);
|
||||
this.setTickRandomly(true);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -40,10 +35,15 @@ public class BlockPillarPlatform extends Block {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
|
|
@ -57,11 +57,11 @@ public class BlockPillarPlatform extends Block {
|
|||
}
|
||||
|
||||
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||
int block = BlockHandler.pillar.blockID;
|
||||
if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block
|
||||
&& world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block
|
||||
&& world.getBlockId(x + 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block
|
||||
&& world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block) {
|
||||
Block block = BlockHandler.pillar;
|
||||
if (world.getBlock(x - 2, y, z - 2) == block && world.getBlock(x - 2, y, z + 2) == block && world.getBlock(x + 2, y, z + 2) == block && world.getBlock(x + 2, y, z - 2) == block
|
||||
&& world.getBlock(x - 2, y + 1, z - 2) == block && world.getBlock(x - 2, y + 1, z + 2) == block && world.getBlock(x + 2, y + 1, z + 2) == block
|
||||
&& world.getBlock(x + 2, y + 1, z - 2) == block && world.getBlock(x - 2, y + 2, z - 2) == block && world.getBlock(x - 2, y + 2, z + 2) == block
|
||||
&& world.getBlock(x + 2, y + 2, z + 2) == block && world.getBlock(x + 2, y + 2, z - 2) == block) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -5,21 +5,21 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockPillarTower extends Block {
|
||||
public BlockPillarTower(int id) {
|
||||
super(id, Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
public BlockPillarTower() {
|
||||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,23 +8,27 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPlatform extends Block {
|
||||
public BlockPlatform(int id) {
|
||||
super(id, Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000000.0F);
|
||||
this.setTickRandomly(true);
|
||||
public BlockPlatform() {
|
||||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setTickRandomly(true);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
int block = BlockHandler.pillar.blockID;
|
||||
double posX = x;
|
||||
double posY = y;
|
||||
double posZ = z;
|
||||
|
|
@ -39,11 +43,6 @@ public class BlockPlatform extends Block {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
return 30;
|
||||
|
|
@ -54,12 +53,12 @@ public class BlockPlatform extends Block {
|
|||
}
|
||||
|
||||
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||
int pillar = BlockHandler.pillar.blockID;
|
||||
int insert = BlockHandler.pillarInsert.blockID;
|
||||
if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar
|
||||
&& world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert
|
||||
&& world.getBlockId(x + 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar
|
||||
&& world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar) {
|
||||
Block pillar = BlockHandler.pillar;
|
||||
Block insert = BlockHandler.pillarInsert;
|
||||
if (world.getBlock(x - 2, y, z - 2) == pillar && world.getBlock(x - 2, y, z + 2) == pillar && world.getBlock(x + 2, y, z + 2) == pillar && world.getBlock(x + 2, y, z - 2) == pillar
|
||||
&& world.getBlock(x - 2, y + 1, z - 2) == insert && world.getBlock(x - 2, y + 1, z + 2) == insert && world.getBlock(x + 2, y + 1, z + 2) == insert
|
||||
&& world.getBlock(x + 2, y + 1, z - 2) == insert && world.getBlock(x - 2, y + 2, z - 2) == pillar && world.getBlock(x - 2, y + 2, z + 2) == pillar
|
||||
&& world.getBlock(x + 2, y + 2, z + 2) == pillar && world.getBlock(x + 2, y + 2, z - 2) == pillar) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import mysticworld.lib.Strings;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBush extends ItemBlock {
|
||||
public static String[] BUSH_TYPES = new String[] { Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME,
|
||||
Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME,
|
||||
Strings.INVISIBILITY_BUSH_NAME };
|
||||
|
||||
public ItemBush(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
return BlockHandler.bush.getIcon(2, par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
|
||||
return BUSH_TYPES[meta];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemImbuedStone extends ItemBlock {
|
||||
|
||||
public static String[] IMBUED_STONE_TYPE = new String[] {"Fire", "Water", "Earth", "Air", "Energy"};
|
||||
|
||||
public ItemImbuedStone(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, IMBUED_STONE_TYPE.length);
|
||||
return super.getUnlocalizedName() + IMBUED_STONE_TYPE[meta];
|
||||
}
|
||||
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return BlockHandler.oreImbuedStone.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue