Updated for 1.7.2

This commit is contained in:
GotoLink 2014-02-22 22:25:26 +01:00
commit 29228e18fe
105 changed files with 1939 additions and 2690 deletions

View file

@ -1,12 +1,13 @@
package mysticworld.biome;
import net.minecraft.block.Block;
import net.minecraft.world.biome.BiomeGenBase;
public class BiomeGenBasic extends BiomeGenBase {
public BiomeGenBasic(int id, int blockTop, int blockFiller) {
public BiomeGenBasic(int id, Block blockTop, Block blockFiller) {
super(id);
this.topBlock = (byte) blockTop;
this.fillerBlock = (byte) blockFiller;
this.topBlock = blockTop;
this.fillerBlock = blockFiller;
}
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk) {
@ -17,9 +18,9 @@ public class BiomeGenBasic extends BiomeGenBase {
this.theBiomeDecorator.reedsPerChunk = reedsChunk;
}
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
this(id, treesChunk, grassChunk, flowerChunk, reedsChunk);
this.topBlock = (byte) blockTop;
this.fillerBlock = (byte) blockFiller;
this.topBlock = blockTop;
this.fillerBlock = blockFiller;
}
}

View file

@ -1,7 +1,9 @@
package mysticworld.biome;
import net.minecraft.block.Block;
public class BiomeGenGlacier extends BiomeGenTundra {
public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller);
this.waterColorMultiplier = 15397370;
}

View file

@ -1,18 +1,20 @@
package mysticworld.biome;
import java.util.Random;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenHugeTrees;
import net.minecraft.world.gen.feature.WorldGenMegaJungle;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenJungle extends net.minecraft.world.biome.BiomeGenJungle {
public BiomeGenJungle(int par1) {
super(par1);
super(par1, false);
}
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) {
return par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenHugeTrees(false, 10 + par1Random.nextInt(20), 3, 3) : new WorldGenTrees(false,
public WorldGenAbstractTree func_150567_a(Random par1Random) {
return par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenMegaJungle(false, 10, 20, 3, 3) : new WorldGenTrees(false,
4 + par1Random.nextInt(7), 3, 3, true));
}
}

View file

@ -1,9 +1,9 @@
package mysticworld.biome;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.block.Block;
public class BiomeGenTundra extends BiomeGenBasic {
public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller);
this.spawnableCreatureList.clear();
this.spawnableMonsterList.clear();

View file

@ -1,10 +1,9 @@
package mysticworld.biome;
import mysticworld.lib.Booleans;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
import cpw.mods.fml.common.registry.GameRegistry;
public class BiomeHandler {
public static BiomeGenBase Mountain;
@ -13,48 +12,33 @@ public class BiomeHandler {
public static BiomeGenBase Glacier;
public static BiomeGenBase Jungle;
public static void init() {
initializeBiomes();
registerBiomes();
}
public static void initializeBiomes() {
Mountain = new BiomeGenBasic(23, Block.stone.blockID, Block.stone.blockID).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
.setMinMaxHeight(0.5F, 1.0F);
Tundra = new BiomeGenTundra(24, 0, 0, 0, 0, Block.blockSnow.blockID, Block.blockSnow.blockID).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
.setMinMaxHeight(0.8F, 0.4F);
Steppe = new BiomeGenBasic(25, 0, 2, 2, 3, Block.grass.blockID, Block.dirt.blockID).setColor(5470985).setBiomeName("Steppe").setMinMaxHeight(0.1F, 0.1F);
Glacier = new BiomeGenGlacier(26, 0, 0, 0, 0, Block.ice.blockID, Block.ice.blockID).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
.setMinMaxHeight(0.5F, 0.7F);
Jungle = new BiomeGenJungle(27).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F);
}
public static void registerBiomes() {
public static void init(){
if (Booleans.ENABLE_JUNGLE_REWRITE) {
GameRegistry.removeBiome(BiomeGenBase.jungle);
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
GameRegistry.addBiome(Jungle);
Jungle = new BiomeGenJungle(21).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setHeight(new BiomeGenBase.Height(0.2F, 0.4F));
BiomeManager.addSpawnBiome(Jungle);
BiomeManager.addStrongholdBiome(Jungle);
}
if (Booleans.ENABLE_GLACIER_GEN) {
GameRegistry.addBiome(Glacier);
BiomeManager.addStrongholdBiome(Glacier);
}
if (Booleans.ENABLE_MOUNTAIN_GEN) {
GameRegistry.addBiome(Mountain);
Mountain = new BiomeGenBasic(53, Blocks.stone, Blocks.stone).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
.setHeight(new BiomeGenBase.Height(0.5F, 1.0F));
BiomeManager.addSpawnBiome(Mountain);
BiomeManager.addStrongholdBiome(Mountain);
}
if (Booleans.ENABLE_TUNDRA_GEN) {
GameRegistry.addBiome(Tundra);
Tundra = new BiomeGenTundra(54, 0, 0, 0, 0, Blocks.snow, Blocks.snow).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
.setHeight(new BiomeGenBase.Height(0.8F, 0.4F));
BiomeManager.addStrongholdBiome(Tundra);
}
if (Booleans.ENABLE_STEPPE_GEN) {
GameRegistry.addBiome(Steppe);
Steppe = new BiomeGenBasic(55, 0, 2, 2, 3, Blocks.grass, Blocks.dirt).setColor(5470985).setBiomeName("Steppe").setHeight(new BiomeGenBase.Height(0.1F, 0.1F));
BiomeManager.addSpawnBiome(Steppe);
BiomeManager.addVillageBiome(Steppe, true);
BiomeManager.addStrongholdBiome(Steppe);
}
if (Booleans.ENABLE_GLACIER_GEN) {
Glacier = new BiomeGenGlacier(56, 0, 0, 0, 0, Blocks.ice, Blocks.ice).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
.setHeight(new BiomeGenBase.Height(0.5F, 0.7F));
BiomeManager.addStrongholdBiome(Glacier);
}
}
}

View file

@ -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;
}
}

View file

@ -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);
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;

View file

@ -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];
}
}

View file

@ -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);
}
}

View file

@ -15,6 +15,7 @@ import mysticworld.items.ItemHandler;
import mysticworld.renderer.*;
import mysticworld.tiles.TileEntityPillarInsert;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
@ -25,11 +26,6 @@ public class ClientProxy extends CommonProxy {
public final Minecraft mc = Minecraft.getMinecraft();
public static final ResourceLocation particle = new ResourceLocation("textures/particle/particles.png");
@Override
public int addArmor(String armor) {
return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
//particles
@Override
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
@ -64,17 +60,17 @@ public class ClientProxy extends CommonProxy {
@Override
public void registerRenders() {
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new StaffItemRenderer("Fire"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new StaffItemRenderer("Earth"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new StaffItemRenderer("Air"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new StaffItemRenderer("Energy"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new StaffItemRenderer("Water"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new OrbItemRenderer("Fire"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new OrbItemRenderer("Earth"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new OrbItemRenderer("Air"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new OrbItemRenderer("Energy"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new OrbItemRenderer("Water"));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockHandler.pillarInsert), new BlockPillarInsertRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff, new StaffItemRenderer("Fire"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff, new StaffItemRenderer("Earth"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff, new StaffItemRenderer("Air"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff, new StaffItemRenderer("Energy"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff, new StaffItemRenderer("Water"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb, new OrbItemRenderer("Fire"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb, new OrbItemRenderer("Earth"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb, new OrbItemRenderer("Air"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb, new OrbItemRenderer("Energy"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb, new OrbItemRenderer("Water"));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));

View file

@ -72,7 +72,7 @@ public class EntityChargeAir extends Entity {
super.onUpdate();
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {

View file

@ -10,6 +10,8 @@ import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -79,7 +81,7 @@ public class EntityChargeEarth extends Entity {
super.onUpdate();
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {
@ -143,15 +145,15 @@ public class EntityChargeEarth extends Entity {
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
}
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.seeds, rand.nextInt(4))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.mushroomBrown, rand.nextInt(2))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.appleRed, rand.nextInt(2))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 0)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.pumpkinSeeds, rand.nextInt(2))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 1)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 2)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 3)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.melonSeeds, rand.nextInt(3))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.wheat_seeds, rand.nextInt(4))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.brown_mushroom, rand.nextInt(2))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.apple, rand.nextInt(2))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 0)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.pumpkin_seeds, rand.nextInt(2))));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 1)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 2)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 3)));
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.melon_seeds, rand.nextInt(3))));
} else {
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;

View file

@ -69,7 +69,7 @@ public class EntityChargeEnergy extends Entity {
super.onUpdate();
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {

View file

@ -6,6 +6,7 @@ import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
@ -70,7 +71,7 @@ public class EntityChargeFire extends Entity {
super.onUpdate();
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {
@ -160,7 +161,7 @@ public class EntityChargeFire extends Entity {
++i;
}
if (this.worldObj.isAirBlock(i, j, k)) {
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
this.worldObj.setBlock(i, j, k, Blocks.fire);
}
}
this.setDead();

View file

@ -69,7 +69,7 @@ public class EntityChargeWater extends Entity {
super.onUpdate();
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {

View file

@ -1,20 +1,21 @@
package mysticworld.entity;
import mysticworld.MysticWorld;
import mysticworld.lib.EntityIds;
import mysticworld.lib.Strings;
import cpw.mods.fml.common.registry.EntityRegistry;
public class EntityHandler {
//Entity IDs
public static int ENTITY_AIR_CHARGE = 1;
public static int ENTITY_FIREBALL = 2;
public static int ENTITY_EARTH_CHARGE = 3;
public static int ENTITY_ENERGY_CHARGE = 4;
public static int ENTITY_WATER_CHARGE = 5;
public static void init() {
registerEntities();
}
public static void registerEntities() {
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, EntityIds.ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, EntityIds.ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, EntityIds.ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, EntityIds.ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, EntityIds.ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false);
}
}

View file

@ -1,12 +1,12 @@
package mysticworld.items;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraftforge.common.EnumHelper;
import net.minecraft.item.ItemArmor;
import net.minecraftforge.common.util.EnumHelper;
public class EnumArmor
{
static EnumArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5);
static EnumArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9);
static EnumArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13);
static EnumArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15);
static ItemArmor.ArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5);
static ItemArmor.ArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9);
static ItemArmor.ArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13);
static ItemArmor.ArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15);
}

View file

@ -1,30 +1,29 @@
package mysticworld.items;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemArmorAdamantine extends ItemArmor {
int ArmorType;
public ItemArmorAdamantine(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial, par3, par4);
public ItemArmorAdamantine(ArmorMaterial par2EnumArmorMaterial, int par4) {
super(par2EnumArmorMaterial, 0, par4);
this.ArmorType = par4;
this.setMaxDamage(3000);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticworld:textures/models/armor/Adamantine_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticworld:AdamantineArmor_" + ArmorType);
}
}

View file

@ -1,10 +1,9 @@
package mysticworld.items;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
@ -14,44 +13,44 @@ import net.minecraft.world.World;
public class ItemArmorIridium extends ItemArmor {
int ArmorType;
public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial, par3, par4);
public ItemArmorIridium(ArmorMaterial par2EnumArmorMaterial, int par4) {
super(par2EnumArmorMaterial, 0, par4);
this.ArmorType = par4;
this.setMaxDamage(4000);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticworld:textures/models/armor/Iridium_layer_" + suffix + ".png";
}
@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
ItemStack helmet = player.getCurrentItemOrArmor(4);
ItemStack plate = player.getCurrentItemOrArmor(3);
ItemStack legs = player.getCurrentItemOrArmor(2);
ItemStack boots = player.getCurrentItemOrArmor(1);
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
ItemStack helmet = player.getEquipmentInSlot(4);
ItemStack plate = player.getEquipmentInSlot(3);
ItemStack legs = player.getEquipmentInSlot(2);
ItemStack boots = player.getEquipmentInSlot(1);
if (helmet != null) {
if (helmet.itemID == ItemHandler.iridiumHelmet.itemID) {
if (helmet.getItem() == ItemHandler.iridiumHelmet) {
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
}
}
if (plate != null) {
if (plate.itemID == ItemHandler.iridiumChestplate.itemID) {
if (plate.getItem() == ItemHandler.iridiumChestplate) {
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
}
}
if (legs != null) {
if (legs.itemID == ItemHandler.iridiumLeggings.itemID) {
if (legs.getItem() == ItemHandler.iridiumLeggings) {
player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2)));
player.addVelocity(0.0005, 0, 0.0005);
player.stepHeight = 1.001F;
}
}
if (boots != null) {
if (boots.itemID == ItemHandler.iridiumBoots.itemID) {
if (boots.getItem() == ItemHandler.iridiumBoots) {
player.fallDistance = 0.0F;
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
}
@ -59,7 +58,7 @@ public class ItemArmorIridium extends ItemArmor {
}
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticworld:IridiumArmor_" + ArmorType);
}
}

View file

@ -1,30 +1,29 @@
package mysticworld.items;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemArmorMithril extends ItemArmor {
int ArmorType;
public ItemArmorMithril(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial, par3, par4);
public ItemArmorMithril(ArmorMaterial par2EnumArmorMaterial, int par4) {
super(par2EnumArmorMaterial, 0, par4);
this.ArmorType = par4;
this.setMaxDamage(500);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticworld:textures/models/armor/Mithril_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticworld:MithrilArmor_" + ArmorType);
}
}

View file

@ -1,30 +1,29 @@
package mysticworld.items;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemArmorVerdite extends ItemArmor {
int ArmorType;
public ItemArmorVerdite(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial, par3, par4);
public ItemArmorVerdite(ArmorMaterial par2EnumArmorMaterial, int par4) {
super(par2EnumArmorMaterial, 0, par4);
this.ArmorType = par4;
this.setMaxDamage(262);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticworld:textures/models/armor/Verdite_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticworld:VerditeArmor_" + ArmorType);
}
}

View file

@ -3,26 +3,27 @@ package mysticworld.items;
import java.util.List;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBushFruit extends ItemFood {
private Icon[] icons;
private IIcon[] icons;
private static final String[] FRUIT_TYPES = new String[] { "Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision",
"Invisibility" };
public ItemBushFruit(int id, int health) {
super(id, health, 0.6F, false);
public ItemBushFruit(int health) {
super(health, 0.6F, false);
this.setHasSubtypes(true);
this.setCreativeTab(MysticWorld.MysticWorldTab);
maxStackSize = 64;
@ -32,7 +33,7 @@ public class ItemBushFruit extends ItemFood {
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
public IIcon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
return icons[j];
}
@ -44,7 +45,7 @@ public class ItemBushFruit extends ItemFood {
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) {
par3List.add(new ItemStack(par1, 1, var4));
}
@ -60,8 +61,8 @@ public class ItemBushFruit extends ItemFood {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[FRUIT_TYPES.length];
public void registerIcons(IIconRegister iconRegister) {
icons = new IIcon[FRUIT_TYPES.length];
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticworld:Fruit" + FRUIT_TYPES[i]);
}
@ -76,77 +77,77 @@ public class ItemBushFruit extends ItemFood {
case 1:
potion = player.getActivePotionEffect(Potion.poison);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
break;
case 2:
potion = player.getActivePotionEffect(Potion.weakness);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
break;
case 3:
potion = player.getActivePotionEffect(Potion.moveSlowdown);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
break;
case 4:
potion = player.getActivePotionEffect(Potion.harm);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
break;
case 5:
potion = player.getActivePotionEffect(Potion.wither);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
break;
case 6:
potion = player.getActivePotionEffect(Potion.heal);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
break;
case 7:
potion = player.getActivePotionEffect(Potion.moveSpeed);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
break;
case 8:
potion = player.getActivePotionEffect(Potion.fireResistance);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
break;
case 9:
potion = player.getActivePotionEffect(Potion.regeneration);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
break;
case 10:
potion = player.getActivePotionEffect(Potion.nightVision);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
break;
case 11:
potion = player.getActivePotionEffect(Potion.invisibility);
if (potion != null) {
duration = potion.duration;
duration = potion.getDuration();
}
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
break;

View file

@ -4,21 +4,21 @@ import java.util.List;
import mysticworld.MysticWorld;
import mysticworld.lib.Strings;
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.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemImbuedShard extends Item {
private Icon[] icons;
private IIcon[] icons;
private static final String[] SHARD_TYPES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
public ItemImbuedShard(int id) {
super(id);
public ItemImbuedShard() {
super();
this.setHasSubtypes(true);
this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
this.setCreativeTab(MysticWorld.MysticWorldTab);
@ -26,14 +26,14 @@ public class ItemImbuedShard extends Item {
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
public IIcon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, 5);
return icons[j];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int var4 = 0; var4 < SHARD_TYPES.length; var4++) {
par3List.add(new ItemStack(par1, 1, var4));
}
@ -47,8 +47,8 @@ public class ItemImbuedShard extends Item {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[SHARD_TYPES.length];
public void registerIcons(IIconRegister iconRegister) {
icons = new IIcon[SHARD_TYPES.length];
for (int i = 0; i < SHARD_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticworld:Shard" + SHARD_TYPES[i]);
}

View file

@ -6,14 +6,14 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
public class ItemOrb extends Item {
Random rand = new Random();
public ItemOrb(int id) {
super(id);
public ItemOrb() {
super();
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
@ -21,6 +21,6 @@ public class ItemOrb extends Item {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
public void registerIcons(IIconRegister par1IconRegister) {
}
}

View file

@ -11,8 +11,8 @@ import net.minecraft.world.World;
import org.lwjgl.input.Mouse;
public class ItemOrbAir extends ItemOrb {
public ItemOrbAir(int id) {
super(id);
public ItemOrbAir() {
super();
}
@Override

View file

@ -1,26 +1,15 @@
package mysticworld.items;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCocoa;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.BlockDirectional;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.BlockStem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.BonemealEvent;
public class ItemOrbEarth extends ItemOrb {
public ItemOrbEarth(int id) {
super(id);
public ItemOrbEarth() {
super();
}
@Override
@ -47,113 +36,6 @@ public class ItemOrbEarth extends ItemOrb {
}
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) {
int l = par1World.getBlockId(par2, par3, par4);
BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
if (MinecraftForge.EVENT_BUS.post(event)) {
return false;
}
if (event.getResult() == Result.ALLOW) {
itemStack.damageItem(1, player);
return true;
}
if (l == Block.sapling.blockID) {
if (!par1World.isRemote) {
if (par1World.rand.nextFloat() < 0.45D) {
((BlockSapling) Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand);
}
itemStack.damageItem(1, player);
}
return true;
} else if (l == Block.cobblestone.blockID) {
if (!par1World.isRemote) {
par1World.setBlock(par2, par3, par4, Block.cobblestoneMossy.blockID);
}
itemStack.damageItem(1, player);
} else if (l == Block.deadBush.blockID) {
if (!par1World.isRemote) {
par1World.setBlock(par2, par3, par4, 0);
par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(Block.sapling, 1)));
}
itemStack.damageItem(1, player);
} else if (l != Block.mushroomBrown.blockID && l != Block.mushroomRed.blockID) {
if (l != Block.melonStem.blockID && l != Block.pumpkinStem.blockID) {
if (l > 0 && Block.blocksList[l] instanceof BlockCrops) {
if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
return false;
} else {
if (!par1World.isRemote) {
((BlockCrops) Block.blocksList[l]).fertilize(par1World, par2, par3, par4);
itemStack.damageItem(1, player);
}
return true;
}
} else {
int i1;
int j1;
int k1;
if (l == Block.cocoaPlant.blockID) {
i1 = par1World.getBlockMetadata(par2, par3, par4);
j1 = BlockDirectional.getDirection(i1);
k1 = BlockCocoa.func_72219_c(i1);
if (k1 >= 2) {
return false;
} else {
if (!par1World.isRemote) {
++k1;
par1World.setBlockMetadataWithNotify(par2, par3, par4, k1 << 2 | j1, 2);
itemStack.damageItem(1, player);
}
return true;
}
} else if (l != Block.grass.blockID) {
return false;
} else {
if (!par1World.isRemote) {
itemStack.damageItem(1, player);
label102: for (i1 = 0; i1 < 128; ++i1) {
j1 = par2;
k1 = par3 + 1;
int l1 = par4;
for (int i2 = 0; i2 < i1 / 16; ++i2) {
j1 += itemRand.nextInt(3) - 1;
k1 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2;
l1 += itemRand.nextInt(3) - 1;
if (par1World.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || par1World.isBlockNormalCube(j1, k1, l1)) {
continue label102;
}
}
if (par1World.getBlockId(j1, k1, l1) == 0) {
if (itemRand.nextInt(10) != 0) {
if (Block.tallGrass.canBlockStay(par1World, j1, k1, l1)) {
par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3);
}
} else {
ForgeHooks.plantGrass(par1World, j1, k1, l1);
}
}
}
}
return true;
}
}
} else if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
return false;
} else {
if (!par1World.isRemote) {
((BlockStem) Block.blocksList[l]).fertilizeStem(par1World, par2, par3, par4);
itemStack.damageItem(1, player);
}
return true;
}
} else {
if (!par1World.isRemote) {
if (par1World.rand.nextFloat() < 0.4D) {
((BlockMushroom) Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand);
}
itemStack.damageItem(1, player);
}
return true;
}
return true;
return ItemDye.applyBonemeal(itemStack, par1World, par2, par3, par4, player);
}
}

View file

@ -2,16 +2,18 @@ package mysticworld.items;
import mysticworld.MysticWorld;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class ItemOrbEnergy extends ItemOrb {
public ItemOrbEnergy(int id) {
super(id);
public ItemOrbEnergy() {
super();
}
@Override
@ -37,10 +39,10 @@ public class ItemOrbEnergy extends ItemOrb {
if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack)) {
return false;
} else {
int i1 = world.getBlockId(par4, par5, par6);
if (i1 == 0) {
Block i1 = world.getBlock(par4, par5, par6);
if (i1 == Blocks.air) {
world.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(par4, par5, par6, BlockHandler.lightCube.blockID);
world.setBlock(par4, par5, par6, BlockHandler.lightCube);
}
itemStack.damageItem(1, entityPlayer);
return true;

View file

@ -5,6 +5,7 @@ import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -12,8 +13,8 @@ import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class ItemOrbFire extends ItemOrb {
public ItemOrbFire(int id) {
super(id);
public ItemOrbFire() {
super();
}
@Override
@ -49,7 +50,7 @@ public class ItemOrbFire extends ItemOrb {
} else {
if (par3World.isAirBlock(par4, par5, par6)) {
par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
par3World.setBlock(par4, par5, par6, Block.fire.blockID);
par3World.setBlock(par4, par5, par6, Blocks.fire);
}
par1ItemStack.damageItem(1, par2EntityPlayer);
return true;

View file

@ -5,14 +5,14 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class ItemOrbWater extends ItemOrb {
public ItemOrbWater(int id) {
super(id);
public ItemOrbWater() {
super();
}
@Override
@ -21,7 +21,7 @@ public class ItemOrbWater extends ItemOrb {
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
@ -31,7 +31,7 @@ public class ItemOrbWater extends ItemOrb {
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
}
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) {
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlockToAir(i, j, k);
itemStack.damageItem(1, entityPlayer);
@ -58,10 +58,10 @@ public class ItemOrbWater extends ItemOrb {
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
int i1 = world.getBlockId(i, j, k);
if (i1 == 0) {
Block i1 = world.getBlock(i, j, k);
if (i1 == Blocks.air) {
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, Block.waterMoving.blockID);
world.setBlock(i, j, k, Blocks.flowing_water);
itemStack.damageItem(1, entityPlayer);
}
return itemStack;

View file

@ -3,7 +3,7 @@ package mysticworld.items;
import java.util.Random;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -11,8 +11,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemStaff extends Item {
Random rand = new Random();
public ItemStaff(int id) {
super(id);
public ItemStaff() {
super();
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
@ -26,6 +26,6 @@ public class ItemStaff extends Item {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
public void registerIcons(IIconRegister par1IconRegister) {
}
}

View file

@ -11,8 +11,8 @@ import net.minecraft.world.World;
import org.lwjgl.input.Mouse;
public class ItemStaffAir extends ItemStaff {
public ItemStaffAir(int id) {
super(id);
public ItemStaffAir() {
super();
}
@Override
@ -33,13 +33,13 @@ public class ItemStaffAir extends ItemStaff {
ItemStack currentItem = player.inventory.getCurrentItem();
itemStack.stackTagCompound.setInteger("maxChargeTime", 3 * 20);
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
if (currentItem.getItem() == itemStack.getItem()) {
player.fallDistance = 0.0F;
chargeEffect(itemStack, world, player);
if (!Mouse.isButtonDown(1)) {
if (itemStack.stackTagCompound.getInteger("chargeTime") > 0) {
if (!world.isRemote) {
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0);
world.playAuxSFXAtEntity(null, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0);
world.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound
.getInteger("maxChargeTime")))), (itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / itemStack.stackTagCompound.getInteger("maxChargeTime")))));
itemStack.damageItem(1, player);

View file

@ -2,40 +2,26 @@ package mysticworld.items;
import mysticworld.MysticWorld;
import mysticworld.entity.EntityChargeEarth;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCocoa;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.BlockDirectional;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.BlockStem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.BonemealEvent;
import org.lwjgl.input.Keyboard;
public class ItemStaffEarth extends ItemStaff {
public ItemStaffEarth(int id) {
super(id);
public ItemStaffEarth() {
super();
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
if (entityPlayer.isSneaking()) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
@ -55,7 +41,7 @@ public class ItemStaffEarth extends ItemStaff {
}
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
if (!world.isRemote) {
world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer));
itemStack.damageItem(1, entityPlayer);
@ -74,113 +60,6 @@ public class ItemStaffEarth extends ItemStaff {
}
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) {
int l = par1World.getBlockId(par2, par3, par4);
BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
if (MinecraftForge.EVENT_BUS.post(event)) {
return false;
}
if (event.getResult() == Result.ALLOW) {
itemStack.damageItem(1, player);
return true;
}
if (l == Block.sapling.blockID) {
if (!par1World.isRemote) {
if (par1World.rand.nextFloat() < 0.45D) {
((BlockSapling) Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand);
}
itemStack.damageItem(1, player);
}
return true;
} else if (l == Block.cobblestone.blockID) {
if (!par1World.isRemote) {
par1World.setBlock(par2, par3, par4, Block.cobblestoneMossy.blockID);
}
itemStack.damageItem(1, player);
} else if (l == Block.deadBush.blockID) {
if (!par1World.isRemote) {
par1World.setBlock(par2, par3, par4, 0);
par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(Block.sapling, 1)));
}
itemStack.damageItem(1, player);
} else if (l != Block.mushroomBrown.blockID && l != Block.mushroomRed.blockID) {
if (l != Block.melonStem.blockID && l != Block.pumpkinStem.blockID) {
if (l > 0 && Block.blocksList[l] instanceof BlockCrops) {
if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
return false;
} else {
if (!par1World.isRemote) {
((BlockCrops) Block.blocksList[l]).fertilize(par1World, par2, par3, par4);
itemStack.damageItem(1, player);
}
return true;
}
} else {
int i1;
int j1;
int k1;
if (l == Block.cocoaPlant.blockID) {
i1 = par1World.getBlockMetadata(par2, par3, par4);
j1 = BlockDirectional.getDirection(i1);
k1 = BlockCocoa.func_72219_c(i1);
if (k1 >= 2) {
return false;
} else {
if (!par1World.isRemote) {
++k1;
par1World.setBlockMetadataWithNotify(par2, par3, par4, k1 << 2 | j1, 2);
itemStack.damageItem(1, player);
}
return true;
}
} else if (l != Block.grass.blockID) {
return false;
} else {
if (!par1World.isRemote) {
itemStack.damageItem(1, player);
label102: for (i1 = 0; i1 < 128; ++i1) {
j1 = par2;
k1 = par3 + 1;
int l1 = par4;
for (int i2 = 0; i2 < i1 / 16; ++i2) {
j1 += itemRand.nextInt(3) - 1;
k1 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2;
l1 += itemRand.nextInt(3) - 1;
if (par1World.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || par1World.isBlockNormalCube(j1, k1, l1)) {
continue label102;
}
}
if (par1World.getBlockId(j1, k1, l1) == 0) {
if (itemRand.nextInt(10) != 0) {
if (Block.tallGrass.canBlockStay(par1World, j1, k1, l1)) {
par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3);
}
} else {
ForgeHooks.plantGrass(par1World, j1, k1, l1);
}
}
}
}
return true;
}
}
} else if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
return false;
} else {
if (!par1World.isRemote) {
((BlockStem) Block.blocksList[l]).fertilizeStem(par1World, par2, par3, par4);
itemStack.damageItem(1, player);
}
return true;
}
} else {
if (!par1World.isRemote) {
if (par1World.rand.nextFloat() < 0.4D) {
((BlockMushroom) Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand);
}
itemStack.damageItem(1, player);
}
return true;
}
return true;
return ItemDye.applyBonemeal(itemStack, par1World, par2, par3, par4, player);
}
}

View file

@ -8,25 +8,22 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
public class ItemStaffEnegy extends ItemStaff {
public ItemStaffEnegy(int id) {
super(id);
public ItemStaffEnegy() {
super();
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
if (entityPlayer.isSneaking()) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
@ -59,7 +56,7 @@ public class ItemStaffEnegy extends ItemStaff {
} else {
if (world.isAirBlock(i, j, k)) {
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, BlockHandler.lightCube.blockID);
world.setBlock(i, j, k, BlockHandler.lightCube);
}
itemStack.damageItem(1, entityPlayer);
return itemStack;
@ -68,7 +65,7 @@ public class ItemStaffEnegy extends ItemStaff {
}
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
if (!world.isRemote) {
world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer));
itemStack.damageItem(1, entityPlayer);

View file

@ -6,25 +6,23 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
public class ItemStaffFire extends ItemStaff {
public ItemStaffFire(int id) {
super(id);
public ItemStaffFire() {
super();
}
@Override
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entityLiving) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
if (entityPlayer.isSneaking()) {
entityLiving.setFire(5);
entityLiving.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityLiving);
@ -35,12 +33,12 @@ public class ItemStaffFire extends ItemStaff {
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
if (entityPlayer.isSneaking()) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
@ -50,12 +48,12 @@ public class ItemStaffFire extends ItemStaff {
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlockId(i, j, k), 1, world.getBlockMetadata(i, j, k)));
if (!world.isRemote && !(result == null)) {
int id = result.itemID;
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlock(i, j, k), 1, world.getBlockMetadata(i, j, k)));
if (!world.isRemote && result != null) {
Item id = result.getItem();
int meta = result.getItemDamage();
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, 0);
world.setBlockToAir(i, j, k);
world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
itemStack.damageItem(1, entityPlayer);
}
@ -63,7 +61,7 @@ public class ItemStaffFire extends ItemStaff {
}
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
if (!world.isRemote) {
world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer));
itemStack.damageItem(1, entityPlayer);

View file

@ -3,35 +3,35 @@ package mysticworld.items;
import java.util.List;
import mysticworld.MysticWorld;
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.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemStaffParts extends Item {
private Icon[] icons;
private IIcon[] icons;
private static final String[] STAFF_PARTS = new String[] { "Staff", "Hilt", "Handle", "Head" };
public ItemStaffParts(int id) {
super(id);
public ItemStaffParts() {
super();
this.setHasSubtypes(true);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
public IIcon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, STAFF_PARTS.length);
return icons[j];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int var4 = 0; var4 < STAFF_PARTS.length; var4++) {
par3List.add(new ItemStack(par1, 1, var4));
}
@ -51,8 +51,8 @@ public class ItemStaffParts extends Item {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[STAFF_PARTS.length];
public void registerIcons(IIconRegister iconRegister) {
icons = new IIcon[STAFF_PARTS.length];
for (int i = 0; i < STAFF_PARTS.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticworld:StaffPart_" + STAFF_PARTS[i]);
}

View file

@ -1,19 +1,19 @@
package mysticworld.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemStaffPower extends Item {
private Icon[] icons;
private IIcon[] icons;
private static final String[] CHARGE_NAMES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
public ItemStaffPower(int id) {
super(id);
public ItemStaffPower() {
super();
this.setHasSubtypes(true);
this.setCreativeTab(null);
maxStackSize = 64;
@ -21,7 +21,7 @@ public class ItemStaffPower extends Item {
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
public IIcon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, 5);
return icons[j];
}
@ -34,8 +34,8 @@ public class ItemStaffPower extends Item {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[CHARGE_NAMES.length];
public void registerIcons(IIconRegister iconRegister) {
icons = new IIcon[CHARGE_NAMES.length];
for (int i = 0; i < CHARGE_NAMES.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticworld:Charge" + CHARGE_NAMES[i]);
}

View file

@ -6,16 +6,14 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
public class ItemStaffWater extends ItemStaff {
public ItemStaffWater(int id) {
super(id);
public ItemStaffWater() {
super();
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
@ -23,12 +21,12 @@ public class ItemStaffWater extends ItemStaff {
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
if (entityPlayer.isSneaking()) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
@ -38,7 +36,7 @@ public class ItemStaffWater extends ItemStaff {
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
}
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) {
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlockToAir(i, j, k);
itemStack.damageItem(1, entityPlayer);
@ -65,10 +63,10 @@ public class ItemStaffWater extends ItemStaff {
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
int i1 = world.getBlockId(i, j, k);
if (i1 == 0) {
Block i1 = world.getBlock(i, j, k);
if (i1 == Blocks.air) {
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, Block.waterMoving.blockID);
world.setBlock(i, j, k, Blocks.flowing_water);
itemStack.damageItem(1, entityPlayer);
}
return itemStack;
@ -78,7 +76,7 @@ public class ItemStaffWater extends ItemStaff {
return itemStack;
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
if (!world.isRemote) {
world.spawnEntityInWorld(new EntityChargeWater(world, entityPlayer));
itemStack.damageItem(1, entityPlayer);

View file

@ -12,8 +12,8 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemVoidShard extends Item {
public ItemVoidShard(int id) {
super(id);
public ItemVoidShard() {
super();
this.setMaxStackSize(1);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.setMaxDamage(1);
@ -28,7 +28,7 @@ public class ItemVoidShard extends Item {
}
@Override
public boolean hasEffect(ItemStack itemStack) {
public boolean hasEffect(ItemStack itemStack, int i) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.hasKey("filled")) {
@ -44,7 +44,7 @@ public class ItemVoidShard extends Item {
itemStack.setTagCompound(new NBTTagCompound());
int experience = entityPlayer.experienceLevel;
int experienceSubtract = entityPlayer.experienceLevel - 30;
if (itemStack.stackTagCompound.getBoolean("filled") == false) {
if (!itemStack.stackTagCompound.getBoolean("filled")) {
if (experience > 0 && experience <= 30) {
entityPlayer.experienceLevel = 0;
itemStack.stackTagCompound.setInteger("xpStored", experience);

View file

@ -1,21 +0,0 @@
package mysticworld.lib;
public class BlockIds {
public static int ORE_STONE_1 = 600;
public static int BUSH = 601;
public static int POISON_BUSH = 602;
public static int WEAKNESS_BUSH = 603;
public static int SLOWNESS_BUSH = 604;
public static int HARMING_BUSH = 605;
public static int WITHER_BUSH = 606;
public static int HEALTH_BUSH = 607;
public static int SPEED_BUSH = 608;
public static int FIRE_RESISTANCE_BUSH = 609;
public static int REGEN_BUSH = 610;
public static int NIGHT_VISION_BUSH = 611;
public static int INVISIBILITY_BUSH = 612;
public static int LIGHT_CUBE = 613;
public static int PLATFORM = 614;
public static int PILLAR = 615;
public static int PILLAR_INSERT = 616;
}

View file

@ -1,14 +0,0 @@
package mysticworld.lib;
public class EntityIds {
//Entity IDs
public static int ENTITY_AIR_CHARGE = 1;
public static int ENTITY_FIREBALL = 2;
public static int ENTITY_EARTH_CHARGE = 3;
public static int ENTITY_ENERGY_CHARGE = 4;
public static int ENTITY_WATER_CHARGE = 5;
public static int ENTITY_PIGMAN = 6;
}

View file

@ -1,35 +0,0 @@
package mysticworld.lib;
public class ItemIds {
public static int STAFF_PARTS = 5503;
public static int IMBUED_SHARD = 5504;
public static int FIRE_STAFF = 5505;
public static int WATER_STAFF = 5506;
public static int EARTH_STAFF = 5507;
public static int AIR_STAFF = 5508;
public static int ENERGY_STAFF = 5509;
public static int STAFF_POWER = 5510;
public static int BUSH_FRUIT = 5511;
public static int VERDITE_HELMET = 5512;
public static int VERDITE_CHESTPLATE = 5513;
public static int VERDITE_LEGGINGS = 5514;
public static int VERDITE_BOOTS = 5515;
public static int MITHRIL_HELMET = 5516;
public static int MITHRIL_CHESTPLATE = 5517;
public static int MITHRIL_LEGGINGS = 5518;
public static int MITHRIL_BOOTS = 5519;
public static int ADAMANTINE_HELMET = 5520;
public static int ADAMANTINE_CHESTPLATE = 5521;
public static int ADAMANTINE_LEGGINGS = 5522;
public static int ADAMANTINE_BOOTS = 5523;
public static int IRIDIUM_HELMET = 5524;
public static int IRIDIUM_CHESTPLATE = 5525;
public static int IRIDIUM_LEGGINGS = 5526;
public static int IRIDIUM_BOOTS = 5527;
public static int FIRE_ORB = 5528;
public static int WATER_ORB = 5529;
public static int EARTH_ORB = 5530;
public static int AIR_ORB = 5531;
public static int ENERGY_ORB = 5532;
public static int VOID_SHARD = 5533;
}

View file

@ -80,7 +80,4 @@ public class Strings {
//Tile Entity Names
public static final String PILLAR_INSERT_TE_NAME = "pillarInsert";
//Config Category Names
public static final String ENTITY_CATEGORY = "entity";
}

View file

@ -1,14 +1,16 @@
package mysticworld.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
public class ModelOrb extends ModelBase {
private static final ResourceLocation orb = new ResourceLocation("mysticworld", "models/orb.obj");
private IModelCustom modelOrb;
public ModelOrb() {
modelOrb = AdvancedModelLoader.loadModel("/assets/mysticworld/models/orb.obj");
modelOrb = AdvancedModelLoader.loadModel(orb);
}
public void render() {

View file

@ -70,10 +70,5 @@ public class ModelPillarInsert extends ModelBase
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View file

@ -142,9 +142,4 @@ public class ModelStaff extends ModelBase
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View file

@ -1,61 +1,60 @@
package mysticworld;
import cpw.mods.fml.common.FMLCommonHandler;
import mysticworld.biome.BiomeHandler;
import mysticworld.blocks.BlockHandler;
import mysticworld.entity.EntityHandler;
import mysticworld.items.ItemHandler;
import mysticworld.lib.Booleans;
import mysticworld.tiles.TileEntityHandler;
import mysticworld.util.Config;
import mysticworld.util.RecipeHandler;
import mysticworld.util.Reference;
import mysticworld.util.TickHandler;
import mysticworld.worldgen.WorldGenBushes;
import mysticworld.worldgen.WorldGenStones;
import mysticworld.worldgen.WorldGenerators;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION_NUMBER)
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MysticWorld {
@Instance(Reference.MOD_ID)
public static MysticWorld instance;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
public static final CreativeTabs MysticWorldTab = new CreativeTabs("MysticWorldTab") {
@Override
public ItemStack getIconItemStack() {
return new ItemStack(ItemHandler.earthStaff, 1);
}
};
@Override
public Item getTabIconItem() {
return ItemHandler.earthStaff;
}
};
public boolean ENABLE = true;
@EventHandler
public void load(FMLInitializationEvent event) {
TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER);
BlockHandler.init();
ItemHandler.init();
TileEntityHandler.init();
if (Booleans.ENABLE_BUSH_GEN)
GameRegistry.registerWorldGenerator(new WorldGenBushes());
GameRegistry.registerWorldGenerator(new WorldGenStones());
EntityHandler.init();
RecipeHandler.init();
proxy.registerRenders();
if(ENABLE){
FMLCommonHandler.instance().bus().register(new TickHandler());
GameRegistry.registerWorldGenerator(new WorldGenerators(), 100);
EntityHandler.init();
proxy.registerRenders();
}
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Config.initialize(event.getSuggestedConfigurationFile());
BiomeHandler.init();
if(ENABLE){
BiomeHandler.init();
BlockHandler.init();
ItemHandler.init();
TileEntityHandler.init();
RecipeHandler.init();
}
}
}

View file

@ -5,7 +5,7 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@ -28,7 +28,7 @@ public class RenderStaffPower extends Render {
this.bindEntityTexture(entity);
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
Icon icon = ItemHandler.staffPower.getIconFromDamage(this.meta);
IIcon icon = ItemHandler.staffPower.getIconFromDamage(this.meta);
Tessellator tessellator = Tessellator.instance;
float f3 = icon.getMinU();
float f4 = icon.getMaxU();

View file

@ -2,17 +2,16 @@ package mysticworld.util;
import java.io.File;
import mysticworld.lib.BlockIds;
import mysticworld.MysticWorld;
import mysticworld.lib.Booleans;
import mysticworld.lib.ItemIds;
import mysticworld.lib.Strings;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.config.Configuration;
public class Config {
public static Configuration config;
public static void initialize(File file) {
config = new Configuration(file);
MysticWorld.instance.ENABLE = config.get("General", "Enable", true).getBoolean(true);
//Boolean Configurations
Booleans.ENABLE_BUSH_GEN = config.get("World Generation", "Enable Bush Generation", true).getBoolean(true);
Booleans.ENABLE_GLACIER_GEN = config.get("World Generation", "Enable Glacier Biome", true).getBoolean(true);
@ -20,45 +19,6 @@ public class Config {
Booleans.ENABLE_MOUNTAIN_GEN = config.get("World Generation", "Enable Mountain Biome", true).getBoolean(true);
Booleans.ENABLE_STEPPE_GEN = config.get("World Generation", "Enable Steppe Biome", true).getBoolean(true);
Booleans.ENABLE_TUNDRA_GEN = config.get("World Generation", "Enable Tundra Biome", true).getBoolean(true);
//Block Configuration
BlockIds.ORE_STONE_1 = config.getBlock(Strings.IMBUED_STONE_NAME, BlockIds.ORE_STONE_1).getInt(BlockIds.ORE_STONE_1);
BlockIds.BUSH = config.getBlock(Strings.BUSH_NAME, BlockIds.BUSH).getInt(BlockIds.BUSH);
BlockIds.LIGHT_CUBE = config.getBlock(Strings.LIGHT_CUBE_NAME, BlockIds.LIGHT_CUBE).getInt(BlockIds.LIGHT_CUBE);
BlockIds.PLATFORM = config.getBlock(Strings.PLATFORM_NAME, BlockIds.PLATFORM).getInt(BlockIds.PLATFORM);
BlockIds.PILLAR = config.getBlock(Strings.PILLAR_NAME, BlockIds.PILLAR).getInt(BlockIds.PILLAR);
BlockIds.PILLAR_INSERT = config.getBlock(Strings.PILLAR_INSERT_NAME, BlockIds.PILLAR_INSERT).getInt(BlockIds.PILLAR_INSERT);
//Item Configuration
ItemIds.IMBUED_SHARD = config.getItem(Strings.IMBUED_SHARD_NAME, ItemIds.IMBUED_SHARD).getInt(ItemIds.IMBUED_SHARD);
ItemIds.STAFF_PARTS = config.getItem(Strings.STAFF_NAME, ItemIds.STAFF_PARTS).getInt(ItemIds.STAFF_PARTS);
ItemIds.FIRE_STAFF = config.getItem(Strings.FIRE_STAFF_NAME, ItemIds.FIRE_STAFF).getInt(ItemIds.FIRE_STAFF);
ItemIds.WATER_STAFF = config.getItem(Strings.WATER_STAFF_NAME, ItemIds.WATER_STAFF).getInt(ItemIds.WATER_STAFF);
ItemIds.EARTH_STAFF = config.getItem(Strings.EARTH_STAFF_NAME, ItemIds.EARTH_STAFF).getInt(ItemIds.EARTH_STAFF);
ItemIds.AIR_STAFF = config.getItem(Strings.AIR_STAFF_NAME, ItemIds.AIR_STAFF).getInt(ItemIds.AIR_STAFF);
ItemIds.ENERGY_STAFF = config.getItem(Strings.ENERGY_STAFF_NAME, ItemIds.ENERGY_STAFF).getInt(ItemIds.ENERGY_STAFF);
ItemIds.STAFF_POWER = config.getItem(Strings.POWER_STAFF_NAME, ItemIds.STAFF_POWER).getInt(ItemIds.STAFF_POWER);
ItemIds.BUSH_FRUIT = config.getItem(Strings.BUSH_FRUIT_NAME, ItemIds.BUSH_FRUIT).getInt(ItemIds.BUSH_FRUIT);
ItemIds.VERDITE_HELMET = config.getItem(Strings.VERDITE_HELMET_NAME, ItemIds.VERDITE_HELMET).getInt(ItemIds.VERDITE_HELMET);
ItemIds.VERDITE_CHESTPLATE = config.getItem(Strings.VERDITE_CHESTPLATE_NAME, ItemIds.VERDITE_CHESTPLATE).getInt(ItemIds.VERDITE_CHESTPLATE);
ItemIds.VERDITE_LEGGINGS = config.getItem(Strings.VERDITE_LEGGINGS_NAME, ItemIds.VERDITE_LEGGINGS).getInt(ItemIds.VERDITE_LEGGINGS);
ItemIds.VERDITE_BOOTS = config.getItem(Strings.VERDITE_BOOTS_NAME, ItemIds.VERDITE_BOOTS).getInt(ItemIds.VERDITE_BOOTS);
ItemIds.MITHRIL_HELMET = config.getItem(Strings.MITHRIL_HELMET_NAME, ItemIds.MITHRIL_HELMET).getInt(ItemIds.MITHRIL_HELMET);
ItemIds.MITHRIL_CHESTPLATE = config.getItem(Strings.MITHRIL_CHESTPLATE_NAME, ItemIds.MITHRIL_CHESTPLATE).getInt(ItemIds.MITHRIL_CHESTPLATE);
ItemIds.MITHRIL_LEGGINGS = config.getItem(Strings.MITHRIL_LEGGINGS_NAME, ItemIds.MITHRIL_LEGGINGS).getInt(ItemIds.MITHRIL_LEGGINGS);
ItemIds.MITHRIL_BOOTS = config.getItem(Strings.MITHRIL_BOOTS_NAME, ItemIds.MITHRIL_BOOTS).getInt(ItemIds.MITHRIL_BOOTS);
ItemIds.ADAMANTINE_HELMET = config.getItem(Strings.ADAMANTINE_HELMET_NAME, ItemIds.ADAMANTINE_HELMET).getInt(ItemIds.ADAMANTINE_HELMET);
ItemIds.ADAMANTINE_CHESTPLATE = config.getItem(Strings.ADAMANTINE_CHESTPLATE_NAME, ItemIds.ADAMANTINE_CHESTPLATE).getInt(ItemIds.ADAMANTINE_CHESTPLATE);
ItemIds.ADAMANTINE_LEGGINGS = config.getItem(Strings.ADAMANTINE_LEGGINGS_NAME, ItemIds.ADAMANTINE_LEGGINGS).getInt(ItemIds.ADAMANTINE_LEGGINGS);
ItemIds.ADAMANTINE_BOOTS = config.getItem(Strings.ADAMANTINE_BOOTS_NAME, ItemIds.ADAMANTINE_BOOTS).getInt(ItemIds.ADAMANTINE_BOOTS);
ItemIds.IRIDIUM_HELMET = config.getItem(Strings.IRIDIUM_HELMET_NAME, ItemIds.IRIDIUM_HELMET).getInt(ItemIds.IRIDIUM_HELMET);
ItemIds.IRIDIUM_CHESTPLATE = config.getItem(Strings.IRIDIUM_CHESTPLATE_NAME, ItemIds.IRIDIUM_CHESTPLATE).getInt(ItemIds.IRIDIUM_CHESTPLATE);
ItemIds.IRIDIUM_LEGGINGS = config.getItem(Strings.IRIDIUM_LEGGINGS_NAME, ItemIds.IRIDIUM_LEGGINGS).getInt(ItemIds.IRIDIUM_LEGGINGS);
ItemIds.IRIDIUM_BOOTS = config.getItem(Strings.IRIDIUM_BOOTS_NAME, ItemIds.IRIDIUM_BOOTS).getInt(ItemIds.IRIDIUM_BOOTS);
ItemIds.FIRE_ORB = config.getItem(Strings.FIRE_ORB_NAME, ItemIds.FIRE_ORB).getInt(ItemIds.FIRE_ORB);
ItemIds.WATER_ORB = config.getItem(Strings.WATER_ORB_NAME, ItemIds.WATER_ORB).getInt(ItemIds.WATER_ORB);
ItemIds.EARTH_ORB = config.getItem(Strings.EARTH_ORB_NAME, ItemIds.EARTH_ORB).getInt(ItemIds.EARTH_ORB);
ItemIds.AIR_ORB = config.getItem(Strings.AIR_ORB_NAME, ItemIds.AIR_ORB).getInt(ItemIds.AIR_ORB);
ItemIds.ENERGY_ORB = config.getItem(Strings.ENERGY_ORB_NAME, ItemIds.ENERGY_ORB).getInt(ItemIds.ENERGY_ORB);
ItemIds.VOID_SHARD = config.getItem(Strings.VOID_SHARD_NAME, ItemIds.VOID_SHARD).getInt(ItemIds.VOID_SHARD);
config.save();
}
}

View file

@ -13,27 +13,27 @@ public class RecipeHandler {
}
private static void bootsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "# #", "# #", '#', input);
}
private static void chestplateRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "###", "###", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "# #", "###", "###", '#', input);
}
private static void helmetRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "###", "# #", '#', input);
}
private static void itemRecipes() {
//Staff Hilt Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), " # ", "#$#", " # ", '#', net.minecraft.init.Items.gold_ingot, '$', net.minecraft.init.Items.diamond);
//Staff Handle Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), new Object[] { "#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), "#", "$", "S", '#', net.minecraft.init.Items.gold_nugget, '$', net.minecraft.init.Items.stick, 'S', net.minecraft.init.Items.dye);
//Staff Topper Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), " # ", "#$#", " # ", '#', net.minecraft.init.Items.gold_ingot, '$', net.minecraft.init.Items.nether_star);
//Staff Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 0), new Object[] { " #", " X ", "Y ", '#', new ItemStack(ItemHandler.staffParts, 1, 3), 'X',
new ItemStack(ItemHandler.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler.staffParts, 1, 1) });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 0), " #", " X ", "Y ", '#', new ItemStack(ItemHandler.staffParts, 1, 3), 'X',
new ItemStack(ItemHandler.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler.staffParts, 1, 1));
//Orb Recipes
orbRecipe(ItemHandler.fireOrb, new ItemStack(ItemHandler.imbuedShard, 1, 0));
orbRecipe(ItemHandler.waterOrb, new ItemStack(ItemHandler.imbuedShard, 1, 1));
@ -69,15 +69,15 @@ public class RecipeHandler {
}
private static void itemSmelting() {
GameRegistry.addSmelting(ItemHandler.imbuedShard.itemID, new ItemStack(ItemHandler.voidShard), 0.5f);
GameRegistry.addSmelting(ItemHandler.imbuedShard, new ItemStack(ItemHandler.voidShard), 0.5f);
}
private static void leggingsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "###", "# #", "# #", '#', input);
}
private static void orbRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "##", "##", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "##", "##", '#', input);
}
private static void staffRecipe(Item output, ItemStack input) {

View file

@ -1,56 +1,36 @@
package mysticworld.util;
import java.util.EnumSet;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import cpw.mods.fml.common.IScheduledTickHandler;
import cpw.mods.fml.common.TickType;
public class TickHandler implements IScheduledTickHandler {
public class TickHandler {
public static final Enchantment[] enchantmentsPick = { Enchantment.efficiency, Enchantment.fortune, Enchantment.silkTouch, Enchantment.unbreaking };
@Override
public String getLabel() {
return "mystic world tick";
@SubscribeEvent
public void tickStart(TickEvent.PlayerTickEvent event) {
if(event.phase== TickEvent.Phase.START && event.side.isServer() && event.player.worldObj.getWorldTime()%20==0)
pillarTick(event.player, event.player.worldObj, new Random());
}
@Override
public int nextTickSpacing() {
return 20;
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
}
@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.PLAYER);
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
EntityPlayer player = (EntityPlayer) tickData[0];
pillarTick(player, player.worldObj, player.inventory, new Random());
}
private static void pillarTick(EntityPlayer player, World world, InventoryPlayer inventory, Random rand) {
ItemStack itemStack = inventory.getCurrentItem();
private static void pillarTick(EntityPlayer player, World world, Random rand) {
ItemStack itemStack = player.inventory.getCurrentItem();
int blockX = (int) player.posX - 1;
int blockY = (int) (player.posY - 0.15D);
int blockZ = (int) player.posZ - 1;
int blockId = world.getBlockId(blockX, blockY, blockZ);
Block blockId = world.getBlock(blockX, blockY, blockZ);
int blockMeta = world.getBlockMetadata(blockX, blockY, blockZ);
if (blockId == BlockHandler.pillarPlatform.blockID) {
if (blockId == BlockHandler.pillarPlatform) {
switch (blockMeta) {
//food
case 0:
@ -85,8 +65,8 @@ public class TickHandler implements IScheduledTickHandler {
//enchanter
case 7:
if (itemStack != null
&& (itemStack.itemID == Item.pickaxeWood.itemID || itemStack.itemID == Item.pickaxeStone.itemID || itemStack.itemID == Item.pickaxeIron.itemID
|| itemStack.itemID == Item.pickaxeGold.itemID || itemStack.itemID == Item.pickaxeDiamond.itemID)) {
&& (itemStack.getItem() == Items.wooden_pickaxe || itemStack.getItem() == Items.stone_pickaxe || itemStack.getItem() == Items.iron_pickaxe
|| itemStack.getItem() == Items.golden_pickaxe || itemStack.getItem() == Items.diamond_pickaxe)) {
if (itemStack.isItemEnchanted() != true && player.experienceLevel >= 10) {
player.experienceLevel -= 10;
itemStack.addEnchantment(enchantmentsPick[rand.nextInt(3)], rand.nextInt(4) + 1);

View file

@ -3,7 +3,7 @@ package mysticworld.worldgen;
import java.util.Random;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -15,8 +15,8 @@ public class BushesGen extends WorldGenerator {
int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlockId(i1, j1 - 1, k1) == Block.grass.blockID && BlockHandler.bush.canPlaceBlockAt(par1World, i1, j1, k1)) {
par1World.setBlock(i1, j1, k1, BlockHandler.bush.blockID, bushType, 2);
if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlock(i1, j1 - 1, k1) == Blocks.grass && BlockHandler.bush.canPlaceBlockAt(par1World, i1, j1, k1)) {
par1World.setBlock(i1, j1, k1, BlockHandler.bush, bushType, 2);
}
}
return true;

View file

@ -3,7 +3,7 @@ package mysticworld.worldgen;
import java.util.Random;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -14,8 +14,8 @@ public class StonesGen extends WorldGenerator {
int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlockId(i1, j1 - 1, k1) == Block.grass.blockID && BlockHandler.oreImbuedStone.canPlaceBlockAt(par1World, i1, j1, k1)) {
par1World.setBlock(i1, j1, k1, BlockHandler.oreImbuedStone.blockID, par2Random.nextInt(5), 2);
if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlock(i1, j1 - 1, k1) == Blocks.grass && BlockHandler.oreImbuedStone.canPlaceBlockAt(par1World, i1, j1, k1)) {
par1World.setBlock(i1, j1, k1, BlockHandler.oreImbuedStone, par2Random.nextInt(5), 2);
}
}
return true;

View file

@ -1,30 +0,0 @@
package mysticworld.worldgen;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenBushes implements IWorldGenerator {
public static final WorldGenerator bushes = new BushesGen();
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < 1; i++) {
int Xcoord1 = blockX + random.nextInt(16) + 8;
int Ycoord1 = random.nextInt(11) + 60;
int Zcoord1 = blockZ + random.nextInt(16) + 8;
bushes.generate(world, random, Xcoord1, Ycoord1, Zcoord1);
}
}
}

View file

@ -1,30 +0,0 @@
package mysticworld.worldgen;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenStones implements IWorldGenerator {
public static final WorldGenerator stones = new StonesGen();
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < 1; i++) {
int Xcoord1 = blockX + random.nextInt(16) + 8;
int Ycoord1 = random.nextInt(11) + 60;
int Zcoord1 = blockZ + random.nextInt(16) + 8;
stones.generate(world, random, Xcoord1, Ycoord1, Zcoord1);
}
}
}