Reorganized github - Renamed packages lowercase
This commit is contained in:
parent
5a3a6d4a8e
commit
579ddee7f0
362 changed files with 5163 additions and 8935 deletions
|
|
@ -1,27 +1,17 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import MysticWorld.Lib.BlockIds;
|
||||
import MysticWorld.Lib.Strings;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.items.ItemHandler$1;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.ColorizerGrass;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
|
@ -29,12 +19,12 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBush extends Block implements IPlantable{
|
||||
|
||||
public class BlockBush extends Block implements IPlantable {
|
||||
Icon[] textures;
|
||||
|
||||
|
||||
public BlockBush(int id) {
|
||||
super(id, Material.leaves);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
|
|
@ -43,154 +33,138 @@ public class BlockBush extends Block implements IPlantable{
|
|||
setStepSound(Block.soundGrassFootstep);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World par1World, int par2, int par3, int par4) {
|
||||
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4))
|
||||
&& (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||
}
|
||||
|
||||
//Plant Specific Stuff
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
//Plant Specific Stuff
|
||||
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int par1)
|
||||
{
|
||||
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
|
||||
this.checkBushChange(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
this.checkBushChange(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
protected final void checkBushChange(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if (!this.canBlockStay(par1World, par2, par3, par4))
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) &&
|
||||
(soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||
}
|
||||
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlantType getPlantType(World world, int x, int y, int z)
|
||||
{
|
||||
@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 int getDamageValue(World par1World, int par2, int par3, int par4) {
|
||||
return par1World.getBlockMetadata(par2, par3, par4);
|
||||
}
|
||||
|
||||
//Sprite Inits
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantID(World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantMetadata(World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlantType getPlantType(World world, int x, int y, int z) {
|
||||
return EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantID(World world, int x, int y, int z)
|
||||
{
|
||||
return 0;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int par1) {
|
||||
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantMetadata(World world, int x, int y, int z)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Sprite Inits
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor()
|
||||
{
|
||||
double d0 = 0.5D;
|
||||
double d1 = 1.0D;
|
||||
return ColorizerGrass.getGrassColor(d0, d1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int par1)
|
||||
{
|
||||
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
//Meta Inits
|
||||
|
||||
public int quantityDroppedWithBonus(int par1, Random par2Random)
|
||||
{
|
||||
return 1 + par2Random.nextInt(par1 * 2 + 1);
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return ItemHandler$1.bushFruit.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j)
|
||||
{
|
||||
return j;
|
||||
}
|
||||
|
||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return blockID;
|
||||
}
|
||||
|
||||
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.getBlockMetadata(par2, par3, par4);
|
||||
}
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
for(int j=0;j<12;j++)
|
||||
{
|
||||
list.add(new ItemStack(i,1,j));
|
||||
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 void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return ItemHandler$1.bushFruit.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||
return blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
|
||||
this.checkBushChange(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
//Meta Inits
|
||||
@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("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
this.checkBushChange(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int par1) {
|
||||
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
|
||||
}
|
||||
|
||||
protected final void checkBushChange(World par1World, int par2, int par3, int par4) {
|
||||
if (!this.canBlockStay(par1World, par2, par3, par4)) {
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +1,33 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import MysticWorld.Lib.BlockIds;
|
||||
import MysticWorld.Lib.Booleans;
|
||||
import MysticWorld.Lib.Strings;
|
||||
import MysticWorld.WorldGen.StonesGen;
|
||||
import MysticWorld.WorldGen.WorldGenBushes;
|
||||
import MysticWorld.WorldGen.WorldGenStones;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import mysticworld.lib.BlockIds;
|
||||
import mysticworld.lib.Strings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
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 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);
|
||||
|
||||
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
|
||||
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -1,34 +1,24 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.items.ItemHandler$1;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBreakable;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
|
||||
public class BlockImbuedStone extends Block {
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
|
||||
public BlockImbuedStone(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(0.5F);
|
||||
|
|
@ -37,97 +27,86 @@ public class BlockImbuedStone extends Block {
|
|||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||
setLightValue(0.625f);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j) {
|
||||
return j;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World par1World, int par2, int par3, int par4) {
|
||||
return par1World.getBlockMetadata(par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int 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$1.imbuedShard.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||
return blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) {
|
||||
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||
boolean flag = false;
|
||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) {
|
||||
flag = true;
|
||||
}
|
||||
if (flag) {
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
for (int i = 0; i < 5; i++) {
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
boolean flag = false;
|
||||
|
||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return ItemHandler$1.imbuedShard.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j)
|
||||
{
|
||||
return j;
|
||||
}
|
||||
|
||||
public int xpDropAmount(int j)
|
||||
{
|
||||
public int xpDropAmount(int j) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
|
||||
{
|
||||
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
|
||||
}
|
||||
|
||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return blockID;
|
||||
}
|
||||
|
||||
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.getBlockMetadata(par2, par3, par4);
|
||||
}
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
for(int j=0;j<5;j++)
|
||||
{
|
||||
list.add(new ItemStack(i,1,j));
|
||||
}
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,62 +1,52 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "lightCube");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import MysticWorld.MysticWorld;
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPillar extends Block {
|
||||
|
||||
public BlockPillar(int id) {
|
||||
super(id, Material.rock);
|
||||
setBlockUnbreakable();
|
||||
|
|
@ -16,22 +15,20 @@ public class BlockPillar extends Block {
|
|||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Pillar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +1,62 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Lib.RenderIds;
|
||||
import MysticWorld.TileEntity.TileEntityPillarInsert;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.lib.RenderIds;
|
||||
import mysticworld.tiles.TileEntityPillarInsert;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPillarInsert extends BlockContainer {
|
||||
|
||||
public BlockPillarInsert(int id)
|
||||
{
|
||||
public BlockPillarInsert(int id) {
|
||||
super(id, 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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return RenderIds.RENDER_PILLAR_INSERT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return new TileEntityPillarInsert();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return RenderIds.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);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPillarPlatform extends Block {
|
||||
|
||||
public BlockPillarPlatform(int id) {
|
||||
super(id, Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
|
|
@ -21,64 +17,53 @@ public class BlockPillarPlatform extends Block {
|
|||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int tickRate(World par1World)
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
double posX = (double)x;
|
||||
double posY = (double)y;
|
||||
double posZ = (double)z;
|
||||
|
||||
if (this.isTowersNearby(world, x, y, z))
|
||||
{
|
||||
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if (this.isTowersNearby(world, x, y, z))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if (this.isTowersNearby(world, x, y, z))
|
||||
{
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
super.onEntityWalking(world, x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||
if (this.isTowersNearby(world, x, y, z)) {
|
||||
super.onEntityWalking(world, x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
double posX = x;
|
||||
double posY = y;
|
||||
double posZ = z;
|
||||
if (this.isTowersNearby(world, x, y, z)) {
|
||||
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
if (this.isTowersNearby(world, x, y, z)) {
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import mysticworld.MysticWorld;
|
||||
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();
|
||||
|
|
@ -13,15 +12,14 @@ public class BlockPillarTower extends Block {
|
|||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,17 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPlatform extends Block {
|
||||
|
||||
public BlockPlatform(int id) {
|
||||
super(id, Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
|
|
@ -26,79 +20,63 @@ public class BlockPlatform extends Block {
|
|||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
int block = BlockHandler.pillar.blockID;
|
||||
|
||||
double posX = (double)x;
|
||||
double posY = (double)y;
|
||||
double posZ = (double)z;
|
||||
|
||||
if (this.isTowersNearby(world, x, y, z))
|
||||
{
|
||||
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
||||
|
||||
if (rand.nextInt(3) == 0)
|
||||
{
|
||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x - 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z - 2 - z) + rand.nextFloat()) - 0.5D);
|
||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x - 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z + 2 - z) + rand.nextFloat()) - 0.5D);
|
||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x + 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z + 2 - z) + rand.nextFloat()) - 0.5D);
|
||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x + 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z - 2 - z) + rand.nextFloat()) - 0.5D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World)
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
super.onEntityWalking(world, x, y, z, entity);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||
super.onEntityWalking(world, x, y, z, entity);
|
||||
}
|
||||
|
||||
@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;
|
||||
if (this.isTowersNearby(world, x, y, z)) {
|
||||
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
||||
if (rand.nextInt(3) == 0) {
|
||||
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x - 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z - 2 - z + rand.nextFloat() - 0.5D);
|
||||
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x - 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z + 2 - z + rand.nextFloat() - 0.5D);
|
||||
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x + 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z + 2 - z + rand.nextFloat() - 0.5D);
|
||||
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x + 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z - 2 - z + rand.nextFloat() - 0.5D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Platform");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
}
|
||||
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +1,38 @@
|
|||
package MysticWorld.Blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import MysticWorld.Lib.Strings;
|
||||
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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 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);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
|
||||
return BUSH_TYPES[meta];
|
||||
}
|
||||
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return BlockHandler.bush.getIcon(2, par1);
|
||||
}
|
||||
|
||||
@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,4 +1,4 @@
|
|||
package MysticWorld.Blocks;
|
||||
package mysticworld.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue