Reorganized github - Renamed packages lowercase

This commit is contained in:
GotoLink 2013-10-20 23:40:12 +02:00
commit 579ddee7f0
362 changed files with 5163 additions and 8935 deletions

View file

@ -1,4 +1,4 @@
package MysticWorld.Biome;
package mysticworld.biome;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticWorld.Biome;
package mysticworld.biome;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticWorld.Biome;
package mysticworld.biome;
import java.util.Random;
import net.minecraft.block.Block;

View file

@ -1,4 +1,4 @@
package MysticWorld.Biome;
package mysticworld.biome;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticWorld.Biome;
package mysticworld.biome;
import java.util.Random;

View file

@ -1,68 +1,61 @@
package MysticWorld.Biome;
package mysticworld.biome;
import cpw.mods.fml.common.registry.GameRegistry;
import MysticWorld.Lib.*;
import MysticOres.Blocks.BlockHandler;
import mysticworld.lib.Booleans;
import net.minecraft.block.Block;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
import cpw.mods.fml.common.registry.GameRegistry;
public class BiomeHandler
{
public class BiomeHandler {
public static BiomeGenBase Mountain;
public static BiomeGenBase Tundra;
public static BiomeGenBase Steppe;
public static BiomeGenBase Glacier;
public static BiomeGenBase Jungle;
public static void init()
{
public static void init() {
initializeBiomes();
registerBiomes();
}
public static void initializeBiomes()
{
Mountain = new BiomeGenMountain(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);
public static void initializeBiomes() {
Mountain = new BiomeGenMountain(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);;
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()
{
if(Booleans.ENABLE_JUNGLE_REWRITE)
{
public static void registerBiomes() {
if (Booleans.ENABLE_JUNGLE_REWRITE) {
GameRegistry.removeBiome(BiomeGenBase.jungle);
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
GameRegistry.addBiome(Jungle);
BiomeManager.addSpawnBiome(Jungle);
GameRegistry.addBiome(Jungle);
BiomeManager.addSpawnBiome(Jungle);
BiomeManager.addStrongholdBiome(Jungle);
}
if(Booleans.ENABLE_GLACIER_GEN)
{
GameRegistry.addBiome(Glacier);
BiomeManager.addStrongholdBiome(Glacier);
if (Booleans.ENABLE_GLACIER_GEN) {
GameRegistry.addBiome(Glacier);
BiomeManager.addStrongholdBiome(Glacier);
}
if(Booleans.ENABLE_MOUNTAIN_GEN)
{
if (Booleans.ENABLE_MOUNTAIN_GEN) {
GameRegistry.addBiome(Mountain);
BiomeManager.addSpawnBiome(Mountain);
BiomeManager.addStrongholdBiome(Mountain);
}
if(Booleans.ENABLE_TUNDRA_GEN)
{
GameRegistry.addBiome(Tundra);
BiomeManager.addStrongholdBiome(Tundra);
}
if(Booleans.ENABLE_STEPPE_GEN)
{
GameRegistry.addBiome(Steppe);
BiomeManager.addSpawnBiome(Steppe);
if (Booleans.ENABLE_TUNDRA_GEN) {
GameRegistry.addBiome(Tundra);
BiomeManager.addStrongholdBiome(Tundra);
}
if (Booleans.ENABLE_STEPPE_GEN) {
GameRegistry.addBiome(Steppe);
BiomeManager.addSpawnBiome(Steppe);
BiomeManager.addVillageBiome(Steppe, true);
BiomeManager.addStrongholdBiome(Steppe);
}
}
}
}

View file

@ -1,27 +1,17 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import MysticWorld.Items.ItemHandler$1;
import MysticWorld.Lib.BlockIds;
import MysticWorld.Lib.Strings;
import mysticworld.MysticWorld;
import mysticworld.items.ItemHandler$1;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
@ -29,12 +19,12 @@ import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.IShearable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBush extends Block implements IPlantable{
public class BlockBush extends Block implements IPlantable {
Icon[] textures;
public BlockBush(int id) {
super(id, Material.leaves);
setCreativeTab(MysticWorld.MysticWorldTab);
@ -43,154 +33,138 @@ public class BlockBush extends Block implements IPlantable{
setStepSound(Block.soundGrassFootstep);
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
}
@Override
public boolean canBlockStay(World par1World, int par2, int par3, int par4) {
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4))
&& (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
}
//Plant Specific Stuff
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[16];
for (int i = 0; i < 12; i++)
{
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
}
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
}
//Plant Specific Stuff
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4);
}
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
}
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
this.checkBushChange(par1World, par2, par3, par4);
}
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
this.checkBushChange(par1World, par2, par3, par4);
}
protected final void checkBushChange(World par1World, int par2, int par3, int par4)
{
if (!this.canBlockStay(par1World, par2, par3, par4))
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
}
}
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) &&
(soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
}
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
}
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public EnumPlantType getPlantType(World world, int x, int y, int z)
{
@Override
public int damageDropped(int j) {
return j;
}
@Override
@SideOnly(Side.CLIENT)
public int getBlockColor() {
double d0 = 0.5D;
double d1 = 1.0D;
return ColorizerGrass.getGrassColor(d0, d1);
}
@Override
public int getDamageValue(World par1World, int par2, int par3, int par4) {
return par1World.getBlockMetadata(par2, par3, par4);
}
//Sprite Inits
@Override
public Icon getIcon(int side, int meta) {
return textures[meta];
}
@Override
public int getPlantID(World world, int x, int y, int z) {
return 0;
}
@Override
public int getPlantMetadata(World world, int x, int y, int z) {
return 0;
}
@Override
public EnumPlantType getPlantType(World world, int x, int y, int z) {
return EnumPlantType.Plains;
}
@Override
public int getPlantID(World world, int x, int y, int z)
{
return 0;
@SideOnly(Side.CLIENT)
public int getRenderColor(int par1) {
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
}
@Override
public int getPlantMetadata(World world, int x, int y, int z)
{
return 0;
}
//Sprite Inits
@Override
public Icon getIcon(int side, int meta)
{
return textures[meta];
}
public boolean isOpaqueCube()
{
return false;
}
@SideOnly(Side.CLIENT)
public int getBlockColor()
{
double d0 = 0.5D;
double d1 = 1.0D;
return ColorizerGrass.getGrassColor(d0, d1);
}
@SideOnly(Side.CLIENT)
public int getRenderColor(int par1)
{
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
}
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
}
//Meta Inits
public int quantityDroppedWithBonus(int par1, Random par2Random)
{
return 1 + par2Random.nextInt(par1 * 2 + 1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return ItemHandler$1.bushFruit.itemID;
}
@Override
public int damageDropped(int j)
{
return j;
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return blockID;
}
public int getDamageValue(World par1World, int par2, int par3, int par4)
{
return par1World.getBlockMetadata(par2, par3, par4);
}
public void getSubBlocks(int i,CreativeTabs tab, List list)
{
for(int j=0;j<12;j++)
{
list.add(new ItemStack(i,1,j));
public void getSubBlocks(int i, CreativeTabs tab, List list) {
for (int j = 0; j < 12; j++) {
list.add(new ItemStack(i, 1, j));
}
}
@Override
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
}
@Override
public int idDropped(int par1, Random par2Random, int par3) {
return ItemHandler$1.bushFruit.itemID;
}
@Override
public int idPicked(World par1World, int par2, int par3, int par4) {
return blockID;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
this.checkBushChange(par1World, par2, par3, par4);
}
//Meta Inits
@Override
public int quantityDroppedWithBonus(int par1, Random par2Random) {
return 1 + par2Random.nextInt(par1 * 2 + 1);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 12; i++) {
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
}
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
this.checkBushChange(par1World, par2, par3, par4);
}
protected boolean canThisPlantGrowOnThisBlockID(int par1) {
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
}
protected final void checkBushChange(World par1World, int par2, int par3, int par4) {
if (!this.canBlockStay(par1World, par2, par3, par4)) {
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
}
}
}

View file

@ -1,47 +1,33 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import MysticWorld.Lib.BlockIds;
import MysticWorld.Lib.Booleans;
import MysticWorld.Lib.Strings;
import MysticWorld.WorldGen.StonesGen;
import MysticWorld.WorldGen.WorldGenBushes;
import MysticWorld.WorldGen.WorldGenStones;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import mysticworld.lib.BlockIds;
import mysticworld.lib.Strings;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockHandler {
public static Block oreImbuedStone;
public static Block bush;
public static Block lightCube;
public static Block pillarPlatform;
public static Block pillar;
public static Block pillarInsert;
public static void init() {
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME);
pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME);
registerBlocks();
setBlockHarvestLevels();
}
private static void registerBlocks() {
GameRegistry.registerBlock(oreImbuedStone, ItemImbuedStone.class, Strings.IMBUED_STONE_NAME);
GameRegistry.registerBlock(bush, ItemBush.class, Strings.BUSH_NAME);
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
GameRegistry.registerBlock(pillarPlatform, Strings.PLATFORM_NAME);
GameRegistry.registerBlock(pillar, Strings.PILLAR_NAME);
GameRegistry.registerBlock(pillarInsert, Strings.PILLAR_INSERT_NAME);

View file

@ -1,34 +1,24 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import java.util.List;
import java.util.Random;
import mysticworld.MysticWorld;
import mysticworld.items.ItemHandler$1;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import MysticWorld.Items.ItemHandler$1;
public class BlockImbuedStone extends Block {
Icon[] textures;
public BlockImbuedStone(int ID) {
super(ID, Material.rock);
setHardness(0.5F);
@ -37,97 +27,86 @@ public class BlockImbuedStone extends Block {
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
setLightValue(0.625f);
}
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
}
@Override
public int damageDropped(int j) {
return j;
}
@Override
public int getDamageValue(World par1World, int par2, int par3, int par4) {
return par1World.getBlockMetadata(par2, par3, par4);
}
@Override
public Icon getIcon(int side, int meta) {
return textures[meta];
}
@Override
public void getSubBlocks(int i, CreativeTabs tab, List list) {
for (int j = 0; j < 5; j++) {
list.add(new ItemStack(i, 1, j));
}
}
@Override
public int idDropped(int par1, Random par2Random, int par3) {
return ItemHandler$1.imbuedShard.itemID;
}
@Override
public int idPicked(World par1World, int par2, int par3, int par4) {
return blockID;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) {
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
}
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
boolean flag = false;
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) {
flag = true;
}
if (flag) {
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 5; i++)
{
for (int i = 0; i < 5; i++) {
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
}
}
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
}
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
boolean flag = false;
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)))
{
flag = true;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
if (flag)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
}
}
@Override
public Icon getIcon(int side, int meta)
{
return textures[meta];
}
public int idDropped(int par1, Random par2Random, int par3)
{
return ItemHandler$1.imbuedShard.itemID;
}
@Override
public int damageDropped(int j)
{
return j;
}
public int xpDropAmount(int j)
{
public int xpDropAmount(int j) {
return 5;
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean isOpaqueCube()
{
return false;
}
protected boolean canSilkHarvest()
{
return true;
}
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
{
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return blockID;
}
public int getDamageValue(World par1World, int par2, int par3, int par4)
{
return par1World.getBlockMetadata(par2, par3, par4);
}
public void getSubBlocks(int i,CreativeTabs tab, List list)
{
for(int j=0;j<5;j++)
{
list.add(new ItemStack(i,1,j));
}
@Override
protected boolean canSilkHarvest() {
return true;
}
}

View file

@ -1,62 +1,52 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import MysticWorld.Items.ItemHandler$1;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockLightCube extends Block {
public BlockLightCube(int id) {
super(id, Material.circuits);
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
setLightValue(1.0F);
this.setTickRandomly(true);
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
protected boolean canSilkHarvest()
{
return true;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
public int idDropped(int par1, Random par2Random, int par3) {
return 0;
}
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random)
{
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
}
public boolean isOpaqueCube() {
return false;
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "lightCube");
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
protected boolean canSilkHarvest() {
return true;
}
}

View file

@ -1,14 +1,13 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPillar extends Block {
public BlockPillar(int id) {
super(id, Material.rock);
setBlockUnbreakable();
@ -16,22 +15,20 @@ public class BlockPillar extends Block {
setCreativeTab(MysticWorld.MysticWorldTab);
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Pillar");
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
}

View file

@ -1,75 +1,62 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import MysticWorld.MysticWorld;
import MysticWorld.Lib.RenderIds;
import MysticWorld.TileEntity.TileEntityPillarInsert;
import mysticworld.MysticWorld;
import mysticworld.lib.RenderIds;
import mysticworld.tiles.TileEntityPillarInsert;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockPillarInsert extends BlockContainer {
public BlockPillarInsert(int id)
{
public BlockPillarInsert(int id) {
super(id, Material.rock);
this.setBlockUnbreakable();
this.setResistance(6000000.0F);
this.setCreativeTab(MysticWorld.MysticWorldTab);
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
{
if (world.isRemote)
{
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID)
{
TileEntity te = world.getBlockTileEntity(x, y, z);
}
}
return false;
}
@Override
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i)
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public int getRenderType()
{
return RenderIds.RENDER_PILLAR_INSERT;
}
@Override
public int getRenderBlockPass(){
return 1;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public TileEntity createNewTileEntity(World world) {
return new TileEntityPillarInsert();
}
}
@Override
public int getRenderBlockPass() {
return 1;
}
@Override
public int getRenderType() {
return RenderIds.RENDER_PILLAR_INSERT;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
if (world.isRemote) {
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) {
TileEntity te = world.getBlockTileEntity(x, y, z);
}
}
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) {
return false;
}
}

View file

@ -1,18 +1,14 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import java.util.Random;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockPillarPlatform extends Block {
public BlockPillarPlatform(int id) {
super(id, Material.rock);
this.setBlockUnbreakable();
@ -21,64 +17,53 @@ public class BlockPillarPlatform extends Block {
setCreativeTab(MysticWorld.MysticWorldTab);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean isOpaqueCube()
{
return false;
}
public int tickRate(World par1World)
{
return 30;
}
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
{
double posX = (double)x;
double posY = (double)y;
double posZ = (double)z;
if (this.isTowersNearby(world, x, y, z))
{
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
}
}
public void updateTick(World world, int x, int y, int z, Random random)
{
if (this.isTowersNearby(world, x, y, z))
{
}
}
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
{
if (this.isTowersNearby(world, x, y, z))
{
@Override
public boolean isOpaqueCube() {
return false;
}
super.onEntityWalking(world, x, y, z, entity);
}
}
private boolean isTowersNearby(World world, int x, int y, int z)
{
int block = BlockHandler.pillar.blockID;
if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block
&& world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z - 2) == block
&& world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block)
{
return true;
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
if (this.isTowersNearby(world, x, y, z)) {
super.onEntityWalking(world, x, y, z, entity);
}
}
return false;
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
double posX = x;
double posY = y;
double posZ = z;
if (this.isTowersNearby(world, x, y, z)) {
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
}
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int tickRate(World par1World) {
return 30;
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
if (this.isTowersNearby(world, x, y, z)) {
}
}
private boolean isTowersNearby(World world, int x, int y, int z) {
int block = BlockHandler.pillar.blockID;
if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block
&& world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block
&& world.getBlockId(x + 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block
&& world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block) {
return true;
}
return false;
}
}

View file

@ -1,11 +1,10 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockPillarTower extends Block {
public BlockPillarTower(int id) {
super(id, Material.rock);
setBlockUnbreakable();
@ -13,15 +12,14 @@ public class BlockPillarTower extends Block {
setCreativeTab(MysticWorld.MysticWorldTab);
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
}

View file

@ -1,23 +1,17 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlatform extends Block {
public BlockPlatform(int id) {
super(id, Material.rock);
this.setBlockUnbreakable();
@ -26,79 +20,63 @@ public class BlockPlatform extends Block {
setCreativeTab(MysticWorld.MysticWorldTab);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
{
int block = BlockHandler.pillar.blockID;
double posX = (double)x;
double posY = (double)y;
double posZ = (double)z;
if (this.isTowersNearby(world, x, y, z))
{
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
if (rand.nextInt(3) == 0)
{
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x - 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z - 2 - z) + rand.nextFloat()) - 0.5D);
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x - 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z + 2 - z) + rand.nextFloat()) - 0.5D);
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x + 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z + 2 - z) + rand.nextFloat()) - 0.5D);
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x + 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z - 2 - z) + rand.nextFloat()) - 0.5D);
}
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random random)
{
}
@Override
public int tickRate(World par1World)
{
return 30;
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
{
super.onEntityWalking(world, x, y, z, entity);
}
private boolean isTowersNearby(World world, int x, int y, int z)
{
int pillar = BlockHandler.pillar.blockID;
int insert = BlockHandler.pillarInsert.blockID;
if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar
&& world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z - 2) == insert
&& world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar)
{
return true;
}
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
super.onEntityWalking(world, x, y, z, entity);
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
int block = BlockHandler.pillar.blockID;
double posX = x;
double posY = y;
double posZ = z;
if (this.isTowersNearby(world, x, y, z)) {
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
if (rand.nextInt(3) == 0) {
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x - 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z - 2 - z + rand.nextFloat() - 0.5D);
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x - 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z + 2 - z + rand.nextFloat() - 0.5D);
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x + 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z + 2 - z + rand.nextFloat() - 0.5D);
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x + 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z - 2 - z + rand.nextFloat() - 0.5D);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Platform");
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int tickRate(World par1World) {
return 30;
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
}
private boolean isTowersNearby(World world, int x, int y, int z) {
int pillar = BlockHandler.pillar.blockID;
int insert = BlockHandler.pillarInsert.blockID;
if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar
&& world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert
&& world.getBlockId(x + 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar
&& world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar) {
return true;
}
return false;
}
}

View file

@ -1,46 +1,38 @@
package MysticWorld.Blocks;
import java.util.List;
import MysticWorld.Lib.Strings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
package mysticworld.blocks;
import mysticworld.lib.Strings;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBush extends ItemBlock {
public static String[] BUSH_TYPES = new String[] { Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME,
Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME,
Strings.INVISIBILITY_BUSH_NAME };
public static String[] BUSH_TYPES = new String[] {Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME,
Strings.HARMING_BUSH_NAME, Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME,
Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME, Strings.INVISIBILITY_BUSH_NAME};
public ItemBush(int par1) {
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
return BUSH_TYPES[meta];
}
public int getMetadata(int par1)
{
return par1;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return BlockHandler.bush.getIcon(2, par1);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return BlockHandler.bush.getIcon(2, par1);
}
@Override
public int getMetadata(int par1) {
return par1;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
return BUSH_TYPES[meta];
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.Blocks;
package mysticworld.blocks;
import java.util.List;

View file

@ -1,121 +1,106 @@
package MysticWorld.Client;
package mysticworld.client;
import mysticworld.blocks.BlockHandler;
import mysticworld.client.fx.LightCubeFX;
import mysticworld.client.fx.PowerAirFX;
import mysticworld.client.fx.PowerEarthFX;
import mysticworld.client.fx.PowerEnergyFX;
import mysticworld.client.fx.PowerFireFX;
import mysticworld.client.fx.PowerWaterFX;
import mysticworld.entity.EntityChargeAir;
import mysticworld.entity.EntityChargeEarth;
import mysticworld.entity.EntityChargeEnergy;
import mysticworld.entity.EntityChargeFire;
import mysticworld.entity.EntityChargeWater;
import mysticworld.items.ItemHandler$1;
import mysticworld.lib.RenderIds;
import mysticworld.renderer.BlockPillarInsertRenderer;
import mysticworld.renderer.ItemOrbAirRenderer;
import mysticworld.renderer.ItemOrbEarthRenderer;
import mysticworld.renderer.ItemOrbEnergyRenderer;
import mysticworld.renderer.ItemOrbFireRenderer;
import mysticworld.renderer.ItemOrbWaterRenderer;
import mysticworld.renderer.ItemStaffAirRenderer;
import mysticworld.renderer.ItemStaffEarthRenderer;
import mysticworld.renderer.ItemStaffEnergyRenderer;
import mysticworld.renderer.ItemStaffFireRenderer;
import mysticworld.renderer.ItemStaffWaterRenderer;
import mysticworld.renderer.RenderStaffPower;
import mysticworld.renderer.TileEntityPillarInsertRenderer;
import mysticworld.tiles.TileEntityPillarInsert;
import mysticworld.util.CommonProxy;
import net.minecraft.src.ModLoader;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Client.FX.LightCubeFX;
import MysticWorld.Client.FX.PowerAirFX;
import MysticWorld.Client.FX.PowerEarthFX;
import MysticWorld.Client.FX.PowerEnergyFX;
import MysticWorld.Client.FX.PowerFireFX;
import MysticWorld.Client.FX.PowerWaterFX;
import MysticWorld.Entity.EntityChargeAir;
import MysticWorld.Entity.EntityChargeEarth;
import MysticWorld.Entity.EntityChargeEnergy;
import MysticWorld.Entity.EntityChargeFire;
import MysticWorld.Entity.EntityChargeWater;
import MysticWorld.Items.ItemHandler$1;
import MysticWorld.Lib.RenderIds;
import MysticWorld.Renderer.BlockPillarInsertRenderer;
import MysticWorld.Renderer.ItemOrbAirRenderer;
import MysticWorld.Renderer.ItemOrbEarthRenderer;
import MysticWorld.Renderer.ItemOrbEnergyRenderer;
import MysticWorld.Renderer.ItemOrbFireRenderer;
import MysticWorld.Renderer.ItemOrbWaterRenderer;
import MysticWorld.Renderer.ItemStaffAirRenderer;
import MysticWorld.Renderer.ItemStaffEarthRenderer;
import MysticWorld.Renderer.ItemStaffEnergyRenderer;
import MysticWorld.Renderer.ItemStaffFireRenderer;
import MysticWorld.Renderer.ItemStaffWaterRenderer;
import MysticWorld.Renderer.RenderStaffPower;
import MysticWorld.Renderer.TileEntityPillarInsertRenderer;
import MysticWorld.TileEntity.TileEntityPillarInsert;
import MysticWorld.Util.CommonProxy;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderIDs()
{
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) {
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
}
@Override
public void earthFX(World worldObj, double x, double y, double z, float scale) {
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(earthFX);
}
@Override
public void energyFX(World worldObj, double x, double y, double z, float scale) {
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(energyFX);
}
@Override
public void fireFX(World worldObj, double x, double y, double z, float scale) {
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(fireFX);
}
@Override
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
LightCubeFX lightCubeFX = new LightCubeFX(worldObj, x, y, z, motionX, motionY, motionZ, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(lightCubeFX);
}
@Override
public void registerRenderIDs() {
RenderIds.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
}
@Override
public void registerRenders()
{
public void registerRenders() {
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireStaff.itemID, new ItemStaffFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthStaff.itemID, new ItemStaffEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airStaff.itemID, new ItemStaffAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyStaff.itemID, new ItemStaffEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterStaff.itemID, new ItemStaffWaterRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireOrb.itemID, new ItemOrbFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthOrb.itemID, new ItemOrbEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airOrb.itemID, new ItemOrbAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyOrb.itemID, new ItemOrbEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterOrb.itemID, new ItemOrbWaterRenderer());
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower(3));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower(4));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillarInsert.class, new TileEntityPillarInsertRenderer());
}
@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)
{
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
}
@Override
public void earthFX(World worldObj, double x, double y, double z, float scale)
{
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(earthFX);
}
@Override
public void energyFX(World worldObj, double x, double y, double z, float scale)
{
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(energyFX);
}
@Override
public void fireFX(World worldObj, double x, double y, double z, float scale)
{
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(fireFX);
}
@Override
public void waterFX(World worldObj, double x, double y, double z, float scale)
{
public void waterFX(World worldObj, double x, double y, double z, float scale) {
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(waterFX);
}
@Override
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale)
{
LightCubeFX lightCubeFX = new LightCubeFX(worldObj, x, y, z, motionX, motionY, motionZ, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(lightCubeFX);
}
}

View file

@ -1,102 +1,83 @@
package MysticWorld.Client.FX;
package mysticworld.client.fx;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class LightCubeFX extends EntityFX {
public LightCubeFX(World world, double x, double y, double z)
{
super(world, x, y, z);
}
public LightCubeFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public LightCubeFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float scale){
super(world, x, y, z);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = rand.nextInt(25);
}
public LightCubeFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
super(world, x, y, z);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = rand.nextInt(25);
}
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/lightCubeFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/lightCubeFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
}

View file

@ -1,126 +1,103 @@
package MysticWorld.Client.FX;
package mysticworld.client.fx;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.src.ModLoader;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class PowerAirFX extends EntityFX {
public PowerAirFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public class PowerAirFX extends EntityFX
{
public PowerAirFX(World world, double x, double y, double z)
{
super(world, x, y, z);
}
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw) {
super(world, x, y, z);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = 1.0F;
this.noClip = true;
this.particleMaxAge = 120;
this.rotationPitch = rotPitch;
this.rotationYaw = rotYaw;
}
public PowerAirFX(World world, double x, double y, double z, float scale, int age){
super(world, x, y, z);
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = age;
}
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw){
super(world, x, y, z);
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = 1.0F;
this.noClip = true;
this.particleMaxAge = 120;
this.rotationPitch = rotPitch;
this.rotationYaw = rotYaw;
}
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
super(world, x, y, z);
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = age;
}
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.setPosition(this.posX, this.posY, this.posZ);
}
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.setPosition(this.posX, this.posY, this.posZ);
}
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/airFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/airFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
}

View file

@ -1,104 +1,83 @@
package MysticWorld.Client.FX;
package mysticworld.client.fx;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.src.ModLoader;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class PowerEarthFX extends EntityFX {
public PowerEarthFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public class PowerEarthFX extends EntityFX
{
public PowerEarthFX(World world, double x, double y, double z)
{
super(world, x, y, z);
}
public PowerEarthFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
public PowerEarthFX(World world, double x, double y, double z, float scale){
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/earthFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/earthFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
}

View file

@ -1,104 +1,83 @@
package MysticWorld.Client.FX;
package mysticworld.client.fx;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.src.ModLoader;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class PowerEnergyFX extends EntityFX {
public PowerEnergyFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public class PowerEnergyFX extends EntityFX
{
public PowerEnergyFX(World world, double x, double y, double z)
{
super(world, x, y, z);
}
public PowerEnergyFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
public PowerEnergyFX(World world, double x, double y, double z, float scale){
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/energyFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/energyFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
}

View file

@ -1,105 +1,83 @@
package MysticWorld.Client.FX;
package mysticworld.client.fx;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.src.ModLoader;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class PowerFireFX extends EntityFX {
public PowerFireFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public class PowerFireFX extends EntityFX
{
public PowerFireFX(World world, double x, double y, double z)
{
super(world, x, y, z);
}
public PowerFireFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
public PowerFireFX(World world, double x, double y, double z, float scale){
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/fireFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/fireFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
}

View file

@ -1,104 +1,83 @@
package MysticWorld.Client.FX;
package mysticworld.client.fx;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.src.ModLoader;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class PowerWaterFX extends EntityFX {
public PowerWaterFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public class PowerWaterFX extends EntityFX
{
public PowerWaterFX(World world, double x, double y, double z)
{
super(world, x, y, z);
}
public PowerWaterFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
public PowerWaterFX(World world, double x, double y, double z, float scale){
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/waterFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/waterFX.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
tessellator.startDrawingQuads();
}
}

View file

@ -1,214 +1,176 @@
package MysticWorld.Entity;
package mysticworld.entity;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import mysticworld.MysticWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.FakePlayerFactory;
import net.minecraftforge.common.ForgeHooks;
import MysticWorld.MysticWorld;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityChargeAir extends Entity {
public EntityPlayer shootingEntity;
private boolean inGround = false;
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile = 0;
private int ticksAlive;
private int ticksInAir = 0;
private float particleScale = 1.0f;
private double powerHeight = 0.75D;
public EntityChargeAir(World par1World)
{
private int ticksInAir = 0;
private float particleScale = 1.0f;
private double powerHeight = 0.75D;
public EntityChargeAir(World par1World) {
super(par1World);
}
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight)
{
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.shootingEntity = par2EntityPlayer;
this.particleScale = pScale;
this.powerHeight = pHeight;
}
public void onUpdate()
{
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
{
this.setDead();
}
else
{
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);
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);
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight) {
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.shootingEntity = par2EntityPlayer;
this.particleScale = pScale;
this.powerHeight = pHeight;
}
if (movingobjectposition != null)
{
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
@Override
public boolean canBeCollidedWith() {
return true;
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
@Override
public float getBrightness(float par1) {
return 1.0F;
}
for (int j = 0; j < list.size(); ++j)
{
Entity entity1 = (Entity)list.get(j);
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1) {
return 15728880;
}
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
{
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
@Override
public float getCollisionBorderSize() {
return 1.0F;
}
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize() {
return 0.0F;
}
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
@Override
public void onUpdate() {
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
this.setDead();
} else {
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);
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) {
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null) {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null) {
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater()) {
for (int k = 0; k < 4; ++k) {
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null)
{
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater())
{
for (int k = 0; k < 4; ++k)
{
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), particleScale, 15);
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), particleScale, 15);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
protected float getMotionFactor()
{
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
Random rand = new Random();
if (!this.worldObj.isRemote)
{
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null)
{
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F)
{
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * (double)2 * 0.6000000238418579D / (double)f3, 1.0D + powerHeight, this.motionZ * (double)2 * 0.6000000238418579D / (double)f3);
}
}
else
{
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit)
{
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void entityInit() {
}
protected float getMotionFactor() {
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
Random rand = new Random();
if (!this.worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null) {
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F) {
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 2 * 0.6000000238418579D / f3, 1.0D + powerHeight, this.motionZ * 2 * 0.6000000238418579D / f3);
}
} else {
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit) {
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
}
@ -216,31 +178,4 @@ public class EntityChargeAir extends Entity {
@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
}
public boolean canBeCollidedWith()
{
return true;
}
public float getCollisionBorderSize()
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public float getBrightness(float par1)
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1)
{
return 15728880;
}
}

View file

@ -1,27 +1,16 @@
package MysticWorld.Entity;
package mysticworld.entity;
import java.util.List;
import java.util.Random;
import MysticWorld.MysticWorld;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
@ -30,190 +19,173 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.FakePlayerFactory;
import net.minecraftforge.common.ForgeHooks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityChargeEarth extends Entity {
public EntityPlayer shootingEntity;
public EntityPlayer entityPlayer;
public EntityDragon entityDragon;
public EntityWither entityWither;
private boolean inGround = false;
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile = 0;
private int ticksAlive;
private int ticksInAir = 0;
public EntityChargeEarth(World par1World)
{
private int ticksInAir = 0;
public EntityChargeEarth(World par1World) {
super(par1World);
}
public EntityChargeEarth(World par1World, EntityPlayer par2EntityPlayer)
{
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.shootingEntity = par2EntityPlayer;
}
public void onUpdate()
{
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
{
this.setDead();
}
else
{
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);
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);
public EntityChargeEarth(World par1World, EntityPlayer par2EntityPlayer) {
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.shootingEntity = par2EntityPlayer;
}
if (movingobjectposition != null)
{
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
@Override
public boolean canBeCollidedWith() {
return true;
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
@Override
public float getBrightness(float par1) {
return 1.0F;
}
for (int j = 0; j < list.size(); ++j)
{
Entity entity1 = (Entity)list.get(j);
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1) {
return 15728880;
}
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
{
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
@Override
public float getCollisionBorderSize() {
return 1.0F;
}
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize() {
return 0.0F;
}
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
@Override
public void onUpdate() {
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
this.setDead();
} else {
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);
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) {
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null) {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null) {
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater()) {
for (int k = 0; k < 4; ++k) {
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null)
{
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater())
{
for (int k = 0; k < 4; ++k)
{
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
protected float getMotionFactor()
{
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
Random rand = new Random();
if (!this.worldObj.isRemote)
{
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null)
{
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F)
{
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * (double)1 * 0.6000000238418579D / (double)f3, 0.1D, this.motionZ * (double)1 * 0.6000000238418579D / (double)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))));
}
else
{
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit)
{
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void entityInit() {
}
protected float getMotionFactor() {
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
Random rand = new Random();
if (!this.worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null) {
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F) {
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))));
} else {
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit) {
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
}
@ -221,31 +193,4 @@ public class EntityChargeEarth extends Entity {
@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
}
public boolean canBeCollidedWith()
{
return true;
}
public float getCollisionBorderSize()
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public float getBrightness(float par1)
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1)
{
return 15728880;
}
}

View file

@ -1,197 +1,171 @@
package MysticWorld.Entity;
package mysticworld.entity;
import java.util.List;
import MysticWorld.MysticWorld;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import mysticworld.MysticWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityChargeEnergy extends Entity {
public EntityPlayer shootingEntity;
private boolean inGround = false;
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile = 0;
private int ticksAlive;
private int ticksInAir = 0;
public EntityChargeEnergy(World par1World)
{
private int ticksInAir = 0;
public EntityChargeEnergy(World par1World) {
super(par1World);
}
public EntityChargeEnergy(World par1World, EntityPlayer par2EntityPlayer)
{
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.shootingEntity = par2EntityPlayer;
}
public void onUpdate()
{
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
{
this.setDead();
}
else
{
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);
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);
public EntityChargeEnergy(World par1World, EntityPlayer par2EntityPlayer) {
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.shootingEntity = par2EntityPlayer;
}
if (movingobjectposition != null)
{
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
@Override
public boolean canBeCollidedWith() {
return true;
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
@Override
public float getBrightness(float par1) {
return 1.0F;
}
for (int j = 0; j < list.size(); ++j)
{
Entity entity1 = (Entity)list.get(j);
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1) {
return 15728880;
}
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
{
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
@Override
public float getCollisionBorderSize() {
return 1.0F;
}
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize() {
return 0.0F;
}
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
@Override
public void onUpdate() {
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
this.setDead();
} else {
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);
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) {
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null) {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null) {
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater()) {
for (int k = 0; k < 4; ++k) {
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null)
{
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater())
{
for (int k = 0; k < 4; ++k)
{
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
protected float getMotionFactor()
{
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
if (!this.worldObj.isRemote)
{
if (par1MovingObjectPosition.entityHit != null)
{
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F)
{
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * (double)1 * 0.6000000238418579D / (double)f3, 0.1D, this.motionZ * (double)1 * 0.6000000238418579D / (double)f3);
}
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ));
}
else
{
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
switch (par1MovingObjectPosition.sideHit)
{
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void entityInit() {
}
protected float getMotionFactor() {
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
if (!this.worldObj.isRemote) {
if (par1MovingObjectPosition.entityHit != null) {
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F) {
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
}
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ));
} else {
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
switch (par1MovingObjectPosition.sideHit) {
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
}
@ -199,32 +173,4 @@ public class EntityChargeEnergy extends Entity {
@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
}
public boolean canBeCollidedWith()
{
return true;
}
public float getCollisionBorderSize()
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public float getBrightness(float par1)
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1)
{
return 15728880;
}
}

View file

@ -1,22 +1,11 @@
package MysticWorld.Entity;
package mysticworld.entity;
import java.util.List;
import MysticWorld.MysticWorld;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
@ -24,183 +13,166 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityChargeFire extends Entity {
public EntityPlayer shootingEntity;
private boolean inGround = false;
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile = 0;
private int ticksAlive;
private int ticksInAir = 0;
public EntityChargeFire(World par1World)
{
private int ticksInAir = 0;
public EntityChargeFire(World par1World) {
super(par1World);
}
public EntityChargeFire(World par1World, EntityPlayer par2EntityPlayer)
{
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.shootingEntity = par2EntityPlayer;
}
public void onUpdate()
{
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
{
this.setDead();
}
else
{
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);
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);
public EntityChargeFire(World par1World, EntityPlayer par2EntityPlayer) {
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.shootingEntity = par2EntityPlayer;
}
if (movingobjectposition != null)
{
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
@Override
public boolean canBeCollidedWith() {
return true;
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
@Override
public float getBrightness(float par1) {
return 1.0F;
}
for (int j = 0; j < list.size(); ++j)
{
Entity entity1 = (Entity)list.get(j);
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1) {
return 15728880;
}
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
{
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
@Override
public float getCollisionBorderSize() {
return 1.0F;
}
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize() {
return 0.0F;
}
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
@Override
public void onUpdate() {
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
this.setDead();
} else {
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);
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) {
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null) {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null) {
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater()) {
for (int k = 0; k < 4; ++k) {
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null)
{
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater())
{
for (int k = 0; k < 4; ++k)
{
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
protected float getMotionFactor()
{
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (!this.worldObj.isRemote)
{
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null)
{
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F)
{
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * (double)1 * 0.6000000238418579D / (double)f3, 0.1D, this.motionZ * (double)1 * 0.6000000238418579D / (double)f3);
}
if (!par1MovingObjectPosition.entityHit.isImmuneToFire())
{
par1MovingObjectPosition.entityHit.setFire(5);
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 7);
}
}
else
{
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit)
{
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
if (this.worldObj.isAirBlock(i, j, k))
{
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
}
}
this.setDead();
}
}
@Override
protected void entityInit() {
}
protected float getMotionFactor() {
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
if (!this.worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null) {
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F) {
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
}
if (!par1MovingObjectPosition.entityHit.isImmuneToFire()) {
par1MovingObjectPosition.entityHit.setFire(5);
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 7);
}
} else {
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit) {
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
if (this.worldObj.isAirBlock(i, j, k)) {
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
}
}
this.setDead();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
}
@ -208,32 +180,4 @@ public class EntityChargeFire extends Entity {
@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
}
public boolean canBeCollidedWith()
{
return true;
}
public float getCollisionBorderSize()
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public float getBrightness(float par1)
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1)
{
return 15728880;
}
}

View file

@ -1,22 +1,10 @@
package MysticWorld.Entity;
package mysticworld.entity;
import java.util.List;
import MysticWorld.MysticWorld;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import mysticworld.MysticWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
@ -24,181 +12,165 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityChargeWater extends Entity {
public EntityPlayer shootingEntity;
private boolean inGround = false;
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile = 0;
private int ticksAlive;
private int ticksInAir = 0;
public EntityChargeWater(World par1World)
{
private int ticksInAir = 0;
public EntityChargeWater(World par1World) {
super(par1World);
}
public EntityChargeWater(World par1World, EntityPlayer par2EntityPlayer)
{
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.shootingEntity = par2EntityPlayer;
}
public void onUpdate()
{
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
{
this.setDead();
}
else
{
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);
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);
public EntityChargeWater(World par1World, EntityPlayer par2EntityPlayer) {
super(par1World);
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.shootingEntity = par2EntityPlayer;
}
if (movingobjectposition != null)
{
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
@Override
public boolean canBeCollidedWith() {
return true;
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
@Override
public float getBrightness(float par1) {
return 1.0F;
}
for (int j = 0; j < list.size(); ++j)
{
Entity entity1 = (Entity)list.get(j);
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1) {
return 15728880;
}
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
{
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
@Override
public float getCollisionBorderSize() {
return 1.0F;
}
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize() {
return 0.0F;
}
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
@Override
public void onUpdate() {
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
this.setDead();
} else {
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);
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) {
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null) {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null) {
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater()) {
for (int k = 0; k < 4; ++k) {
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null)
{
this.onImpact(movingobjectposition);
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f2 = this.getMotionFactor();
if (this.isInWater())
{
for (int k = 0; k < 4; ++k)
{
float f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), 1.0F);
this.setPosition(this.posX, this.posY, this.posZ);
}
}
protected float getMotionFactor()
{
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (!this.worldObj.isRemote)
{
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null)
{
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F)
{
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * (double)1 * 0.6000000238418579D / (double)f3, 0.1D, this.motionZ * (double)1 * 0.6000000238418579D / (double)f3);
}
if (par1MovingObjectPosition.entityHit.isImmuneToFire())
{
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
}
if (par1MovingObjectPosition.entityHit.isBurning())
{
par1MovingObjectPosition.entityHit.extinguish();
}
}
else
{
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit)
{
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void entityInit() {
}
protected float getMotionFactor() {
return 0.95F;
}
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
if (!this.worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
if (par1MovingObjectPosition.entityHit != null) {
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f3 > 0.0F) {
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
}
if (par1MovingObjectPosition.entityHit.isImmuneToFire()) {
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
}
if (par1MovingObjectPosition.entityHit.isBurning()) {
par1MovingObjectPosition.entityHit.extinguish();
}
} else {
int i = par1MovingObjectPosition.blockX;
int j = par1MovingObjectPosition.blockY;
int k = par1MovingObjectPosition.blockZ;
switch (par1MovingObjectPosition.sideHit) {
case 0:
--j;
break;
case 1:
++j;
break;
case 2:
--k;
break;
case 3:
++k;
break;
case 4:
--i;
break;
case 5:
++i;
}
}
this.setDead();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
}
@ -206,33 +178,4 @@ public class EntityChargeWater extends Entity {
@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
}
public boolean canBeCollidedWith()
{
return true;
}
public float getCollisionBorderSize()
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public float getBrightness(float par1)
{
return 1.0F;
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1)
{
return 15728880;
}
}

View file

@ -1,20 +1,16 @@
package MysticWorld.Entity;
package mysticworld.entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import mysticworld.MysticWorld;
import mysticworld.lib.EntityIds;
import mysticworld.lib.Strings;
import cpw.mods.fml.common.registry.EntityRegistry;
import MysticWorld.MysticWorld;
import MysticWorld.Lib.EntityIds;
import MysticWorld.Lib.Strings;
public class EntityHandler {
public static void init(){
public static void init() {
registerEntities();
}
public static void 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);

View file

@ -1,4 +1,4 @@
package MysticWorld.Items;
package mysticworld.items;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraftforge.common.EnumHelper;

View file

@ -1,52 +1,47 @@
package MysticWorld.Items;
package mysticworld.items;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
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
{
public class ItemArmorAdamantine extends ItemArmor {
int ArmorType;
String ArmorFile_1;
String ArmorFile_2;
public ItemArmorAdamantine(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial,par3,par4);
this.ArmorType=par4;
this.setMaxDamage(3000);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/MysticMods/textures/armor/adamantine_1.png";
this.ArmorFile_2 = "/MysticMods/textures/armor/adamantine_2.png";
}
super(par1, par2EnumArmorMaterial, par3, par4);
this.ArmorType = par4;
this.setMaxDamage(3000);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/MysticMods/textures/armor/adamantine_1.png";
this.ArmorFile_2 = "/MysticMods/textures/armor/adamantine_2.png";
}
@Override
public void registerIcons(IconRegister iconRegister)
{
switch (ArmorType){
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_3");
break;
}
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
int suffix = this.armorType == 2 ? 2 : 1;
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "MysticMods:textures" + "/models/armor/Adamantine_layer_" + suffix + ".png";
}
return "MysticMods:textures" + "/models/armor/Adamantine_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
switch (ArmorType) {
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_3");
break;
}
}
}

View file

@ -1,8 +1,7 @@
package MysticWorld.Items;
package mysticworld.items;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
@ -12,89 +11,72 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class ItemArmorIridium extends ItemArmor
{
public class ItemArmorIridium extends ItemArmor {
int ArmorType;
String ArmorFile_1;
String ArmorFile_2;
public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial,par3,par4);
this.ArmorType=par4;
this.setMaxDamage(4000);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/iridium_1.png";
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/iridium_2.png";
}
super(par1, par2EnumArmorMaterial, par3, par4);
this.ArmorType = par4;
this.setMaxDamage(4000);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/iridium_1.png";
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/iridium_2.png";
}
@Override
public void registerIcons(IconRegister iconRegister)
{
switch (ArmorType){
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_3");
break;
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "MysticMods: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);
if (helmet != null) {
if (helmet.itemID == ItemHandler$1.iridiumHelmet.itemID) {
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
}
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
int suffix = this.armorType == 2 ? 2 : 1;
return "MysticMods: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);
if (helmet != null)
{
if(helmet.itemID == ItemHandler$1.iridiumHelmet.itemID)
{
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
}
}
if (plate != null)
{
if(plate.itemID == ItemHandler$1.iridiumChestplate.itemID)
{
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
}
}
if (legs != null)
{
if(legs.itemID == ItemHandler$1.iridiumLeggings.itemID)
{
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$1.iridiumBoots.itemID)
{
player.fallDistance = 0.0F;
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
}
if (plate != null) {
if (plate.itemID == ItemHandler$1.iridiumChestplate.itemID) {
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
}
}
if (legs != null) {
if (legs.itemID == ItemHandler$1.iridiumLeggings.itemID) {
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$1.iridiumBoots.itemID) {
player.fallDistance = 0.0F;
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
}
}
}
@Override
public void registerIcons(IconRegister iconRegister) {
switch (ArmorType) {
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_3");
break;
}
}
}

View file

@ -1,53 +1,47 @@
package MysticWorld.Items;
package mysticworld.items;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
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
{
public class ItemArmorMithril extends ItemArmor {
int ArmorType;
String ArmorFile_1;
String ArmorFile_2;
public ItemArmorMithril(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial,par3,par4);
this.ArmorType=par4;
this.setMaxDamage(500);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/mithril_1.png";
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/mithril_2.png";
}
super(par1, par2EnumArmorMaterial, par3, par4);
this.ArmorType = par4;
this.setMaxDamage(500);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/mithril_1.png";
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/mithril_2.png";
}
@Override
public void registerIcons(IconRegister iconRegister)
{
switch (ArmorType){
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_3");
break;
}
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
int suffix = this.armorType == 2 ? 2 : 1;
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "MysticMods:textures" + "/models/armor/Mithril_layer_" + suffix + ".png";
}
return "MysticMods:textures" + "/models/armor/Mithril_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
switch (ArmorType) {
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_3");
break;
}
}
}

View file

@ -1,53 +1,47 @@
package MysticWorld.Items;
package mysticworld.items;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
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
{
public class ItemArmorVerdite extends ItemArmor {
int ArmorType;
String ArmorFile_1;
String ArmorFile_2;
public ItemArmorVerdite(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
super(par1, par2EnumArmorMaterial,par3,par4);
this.ArmorType=par4;
this.setMaxDamage(262);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/verdite_1.png";
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/verdite_2.png";
}
super(par1, par2EnumArmorMaterial, par3, par4);
this.ArmorType = par4;
this.setMaxDamage(262);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/verdite_1.png";
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/verdite_2.png";
}
@Override
public void registerIcons(IconRegister iconRegister)
{
switch (ArmorType){
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_3");
break;
}
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
int suffix = this.armorType == 2 ? 2 : 1;
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "MysticMods:textures" + "/models/armor/Verdite_layer_" + suffix + ".png";
}
return "MysticMods:textures" + "/models/armor/Verdite_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
switch (ArmorType) {
case 0:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_0");
break;
case 1:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_1");
break;
case 2:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_2");
break;
case 3:
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_3");
break;
}
}
}

View file

@ -1,16 +1,11 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.List;
import MysticWorld.MysticWorld;
import MysticWorld.Lib.Strings;
import MysticWorld.Util.Reference;
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.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;
@ -18,154 +13,144 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Icon;
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 static final String[] FRUIT_TYPES = new String[] {"Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision", "Invisibility"};
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)
{
public ItemBushFruit(int id, int health) {
super(id, health, 0.6F, false);
this.setHasSubtypes(true);
this.setCreativeTab(MysticWorld.MysticWorldTab);
maxStackSize = 64;
setAlwaysEdible();
setUnlocalizedName("bushFruit");
this.setHasSubtypes(true);
this.setCreativeTab(MysticWorld.MysticWorldTab);
maxStackSize = 64;
setAlwaysEdible();
setUnlocalizedName("bushFruit");
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player)
{
if ((player.canEat(true)) && (player.getFoodStats().getSaturationLevel() < 20.0F))
{
player.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer player)
{
if (!world.isRemote)
{
int duration = 0;
PotionEffect potion;
switch(itemstack.getItemDamage())
{
case 1:potion = player.getActivePotionEffect(Potion.poison);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
break;
case 2:potion = player.getActivePotionEffect(Potion.weakness);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
break;
case 3:potion = player.getActivePotionEffect(Potion.moveSlowdown);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
break;
case 4:potion = player.getActivePotionEffect(Potion.harm);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
break;
case 5:potion = player.getActivePotionEffect(Potion.wither);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
break;
case 6:potion = player.getActivePotionEffect(Potion.heal);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
break;
case 7:potion = player.getActivePotionEffect(Potion.moveSpeed);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
break;
case 8:potion = player.getActivePotionEffect(Potion.fireResistance);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
break;
case 9:potion = player.getActivePotionEffect(Potion.regeneration);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
break;
case 10:potion = player.getActivePotionEffect(Potion.nightVision);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
break;
case 11:potion = player.getActivePotionEffect(Potion.invisibility);
if(potion != null)
{
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
break;
}
}
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
return icons[j];
}
public int getMaxItemUseDuration(ItemStack itemstack)
{
return 24;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
icons = new Icon[FRUIT_TYPES.length];
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:Fruit" + FRUIT_TYPES[i]);
}
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
@Override
public int getMaxItemUseDuration(ItemStack itemstack) {
return 24;
}
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
return icons[j];
}
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++)
{
par3List.add(new ItemStack(par1, 1, var4));
}
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) {
par3List.add(new ItemStack(par1, 1, var4));
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player) {
if ((player.canEat(true)) && (player.getFoodStats().getSaturationLevel() < 20.0F)) {
player.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[FRUIT_TYPES.length];
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:Fruit" + FRUIT_TYPES[i]);
}
}
@Override
protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer player) {
if (!world.isRemote) {
int duration = 0;
PotionEffect potion;
switch (itemstack.getItemDamage()) {
case 1:
potion = player.getActivePotionEffect(Potion.poison);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
break;
case 2:
potion = player.getActivePotionEffect(Potion.weakness);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
break;
case 3:
potion = player.getActivePotionEffect(Potion.moveSlowdown);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
break;
case 4:
potion = player.getActivePotionEffect(Potion.harm);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
break;
case 5:
potion = player.getActivePotionEffect(Potion.wither);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
break;
case 6:
potion = player.getActivePotionEffect(Potion.heal);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
break;
case 7:
potion = player.getActivePotionEffect(Potion.moveSpeed);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
break;
case 8:
potion = player.getActivePotionEffect(Potion.fireResistance);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
break;
case 9:
potion = player.getActivePotionEffect(Potion.regeneration);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
break;
case 10:
potion = player.getActivePotionEffect(Potion.nightVision);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
break;
case 11:
potion = player.getActivePotionEffect(Potion.invisibility);
if (potion != null) {
duration = potion.duration;
}
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
break;
}
}
}
}

View file

@ -1,108 +1,86 @@
package MysticWorld.Items;
package mysticworld.items;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import MysticWorld.MysticWorld;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Lib.ItemIds;
import MysticWorld.Lib.Strings;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumArmorMaterial;
import mysticworld.MysticWorld;
import mysticworld.lib.ItemIds;
import mysticworld.lib.Strings;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
public class ItemHandler$1 {
public static Item staffParts;
public static Item imbuedShard;
public static Item fireStaff;
public static Item waterStaff;
public static Item earthStaff;
public static Item airStaff;
public static Item energyStaff;
public static Item fireStaffPower;
public static Item waterStaffPower;
public static Item earthStaffPower;
public static Item airStaffPower;
public static Item energyStaffPower;
public static Item staffPower;
public static Item fireOrb;
public static Item waterOrb;
public static Item earthOrb;
public static Item airOrb;
public static Item energyOrb;
public static Item bushFruit;
public static Item verditeHelmet;
public static Item verditeChestplate;
public static Item verditeLeggings;
public static Item verditeBoots;
public static Item adamantineHelmet;
public static Item adamantineChestplate;
public static Item adamantineLeggings;
public static Item adamantineBoots;
public static Item mithrilHelmet;
public static Item mithrilChestplate;
public static Item mithrilLeggings;
public static Item mithrilBoots;
public static Item iridiumHelmet;
public static Item iridiumChestplate;
public static Item iridiumLeggings;
public static Item iridiumBoots;
public static Item voidShard;
public static void init(){
public static void init() {
staffParts = new ItemStaffParts(ItemIds.STAFF_PARTS);
imbuedShard = new ItemImbuedShard(ItemIds.IMBUED_SHARD);
bushFruit = new ItemBushFruit(ItemIds.BUSH_FRUIT, 2);
fireStaff = new ItemStaffFire(ItemIds.FIRE_STAFF).setUnlocalizedName(Strings.FIRE_STAFF_NAME);
waterStaff = new ItemStaffWater(ItemIds.WATER_STAFF).setUnlocalizedName(Strings.WATER_STAFF_NAME);
earthStaff = new ItemStaffEarth(ItemIds.EARTH_STAFF).setUnlocalizedName(Strings.EARTH_STAFF_NAME);
airStaff = new ItemStaffAir(ItemIds.AIR_STAFF).setUnlocalizedName(Strings.AIR_STAFF_NAME);
energyStaff = new ItemStaffEnegy(ItemIds.ENERGY_STAFF).setUnlocalizedName(Strings.ENERGY_STAFF_NAME);
staffPower = new ItemStaffPower(ItemIds.STAFF_POWER);
fireOrb = new ItemOrbFire(ItemIds.FIRE_ORB).setUnlocalizedName(Strings.FIRE_ORB_NAME);
waterOrb = new ItemOrbWater(ItemIds.WATER_ORB).setUnlocalizedName(Strings.WATER_ORB_NAME);
earthOrb = new ItemOrbEarth(ItemIds.EARTH_ORB).setUnlocalizedName(Strings.EARTH_ORB_NAME);
airOrb = new ItemOrbAir(ItemIds.AIR_ORB).setUnlocalizedName(Strings.AIR_ORB_NAME);
energyOrb = new ItemOrbEnergy(ItemIds.ENERGY_ORB).setUnlocalizedName(Strings.ENERGY_ORB_NAME);
verditeHelmet = new ItemArmorVerdite(ItemIds.VERDITE_HELMET, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 0).setUnlocalizedName(Strings.VERDITE_HELMET_NAME);
verditeChestplate = new ItemArmorVerdite(ItemIds.VERDITE_CHESTPLATE, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 1).setUnlocalizedName(Strings.VERDITE_CHESTPLATE_NAME);
verditeChestplate = new ItemArmorVerdite(ItemIds.VERDITE_CHESTPLATE, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 1)
.setUnlocalizedName(Strings.VERDITE_CHESTPLATE_NAME);
verditeLeggings = new ItemArmorVerdite(ItemIds.VERDITE_LEGGINGS, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 2).setUnlocalizedName(Strings.VERDITE_LEGGINGS_NAME);
verditeBoots = new ItemArmorVerdite(ItemIds.VERDITE_BOOTS, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 3).setUnlocalizedName(Strings.VERDITE_BOOTS_NAME);
mithrilHelmet = new ItemArmorMithril(ItemIds.MITHRIL_HELMET, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 0).setUnlocalizedName(Strings.MITHRIL_HELMET_NAME);
mithrilChestplate = new ItemArmorMithril(ItemIds.MITHRIL_CHESTPLATE, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 1).setUnlocalizedName(Strings.MITHRIL_CHESTPLATE_NAME);
mithrilChestplate = new ItemArmorMithril(ItemIds.MITHRIL_CHESTPLATE, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 1)
.setUnlocalizedName(Strings.MITHRIL_CHESTPLATE_NAME);
mithrilLeggings = new ItemArmorMithril(ItemIds.MITHRIL_LEGGINGS, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 2).setUnlocalizedName(Strings.MITHRIL_LEGGINGS_NAME);
mithrilBoots = new ItemArmorMithril(ItemIds.MITHRIL_BOOTS, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 3).setUnlocalizedName(Strings.MITHRIL_BOOTS_NAME);
adamantineHelmet = new ItemArmorAdamantine(ItemIds.ADAMANTINE_HELMET, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 0).setUnlocalizedName(Strings.ADAMANTINE_HELMET_NAME);
adamantineChestplate = new ItemArmorAdamantine(ItemIds.ADAMANTINE_CHESTPLATE, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 1).setUnlocalizedName(Strings.ADAMANTINE_CHESTPLATE_NAME);
adamantineLeggings = new ItemArmorAdamantine(ItemIds.ADAMANTINE_LEGGINGS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 2).setUnlocalizedName(Strings.ADAMANTINE_LEGGINGS_NAME);
adamantineBoots = new ItemArmorAdamantine(ItemIds.ADAMANTINE_BOOTS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 3).setUnlocalizedName(Strings.ADAMANTINE_BOOTS_NAME);
adamantineHelmet = new ItemArmorAdamantine(ItemIds.ADAMANTINE_HELMET, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 0)
.setUnlocalizedName(Strings.ADAMANTINE_HELMET_NAME);
adamantineChestplate = new ItemArmorAdamantine(ItemIds.ADAMANTINE_CHESTPLATE, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 1)
.setUnlocalizedName(Strings.ADAMANTINE_CHESTPLATE_NAME);
adamantineLeggings = new ItemArmorAdamantine(ItemIds.ADAMANTINE_LEGGINGS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 2)
.setUnlocalizedName(Strings.ADAMANTINE_LEGGINGS_NAME);
adamantineBoots = new ItemArmorAdamantine(ItemIds.ADAMANTINE_BOOTS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 3)
.setUnlocalizedName(Strings.ADAMANTINE_BOOTS_NAME);
iridiumHelmet = new ItemArmorIridium(ItemIds.IRIDIUM_HELMET, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 0).setUnlocalizedName(Strings.IRIDIUM_HELMET_NAME);
iridiumChestplate = new ItemArmorIridium(ItemIds.IRIDIUM_CHESTPLATE, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 1).setUnlocalizedName(Strings.IRIDIUM_CHESTPLATE_NAME);
iridiumChestplate = new ItemArmorIridium(ItemIds.IRIDIUM_CHESTPLATE, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 1)
.setUnlocalizedName(Strings.IRIDIUM_CHESTPLATE_NAME);
iridiumLeggings = new ItemArmorIridium(ItemIds.IRIDIUM_LEGGINGS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 2).setUnlocalizedName(Strings.IRIDIUM_LEGGINGS_NAME);
iridiumBoots = new ItemArmorIridium(ItemIds.IRIDIUM_BOOTS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 3).setUnlocalizedName(Strings.IRIDIUM_BOOTS_NAME);
voidShard = new ItemVoidShard(ItemIds.VOID_SHARD).setUnlocalizedName(Strings.VOID_SHARD_NAME);
}
}

View file

@ -1,63 +1,56 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.List;
import mysticworld.MysticWorld;
import mysticworld.lib.Strings;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import MysticWorld.MysticWorld;
import MysticWorld.Lib.Strings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemImbuedShard extends Item {
private Icon[] icons;
private static final String[] SHARD_TYPES = new String[] {"Fire", "Water", "Earth", "Air", "Energy"};
private static final String[] SHARD_TYPES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
public ItemImbuedShard(int id) {
super(id);
this.setHasSubtypes(true);
this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.setHasSubtypes(true);
this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
@SideOnly(Side.CLIENT)
public Icon 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) {
for (int var4 = 0; var4 < SHARD_TYPES.length; var4++) {
par3List.add(new ItemStack(par1, 1, var4));
}
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
return super.getUnlocalizedName() + SHARD_TYPES[meta];
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[SHARD_TYPES.length];
for (int i = 0; i < SHARD_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:Shard" + SHARD_TYPES[i]);
}
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
return super.getUnlocalizedName() + SHARD_TYPES[meta];
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[SHARD_TYPES.length];
for (int i = 0; i < SHARD_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:Shard" + SHARD_TYPES[i]);
}
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, 5);
return icons[j];
}
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int var4 = 0; var4 < SHARD_TYPES.length; var4++){
par3List.add(new ItemStack(par1, 1, var4));
}
}
}

View file

@ -1,20 +1,17 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.Random;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import net.minecraft.item.Item;
public class ItemOrb extends Item {
Random rand = new Random();
public ItemOrb(int id)
{
public ItemOrb(int id) {
super(id);
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
}

View file

@ -1,142 +1,99 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.Random;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeAir;
import net.minecraft.client.renderer.texture.IconRegister;
import mysticworld.MysticWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class ItemOrbAir extends ItemOrb
{
public ItemOrbAir(int id)
{
import org.lwjgl.input.Mouse;
public class ItemOrbAir extends ItemOrb {
public ItemOrbAir(int id) {
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.getBoolean("charging") == false) {
itemStack.stackTagCompound.setBoolean("charging", true);
}
return itemStack;
}
EntityPlayer player = (EntityPlayer)entity;
ItemStack currentItem = player.inventory.getCurrentItem();
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
itemStack.stackTagCompound.setInteger("maxChargeTime", 5 * 20);
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
player.fallDistance = 0.0F;
chargeEffect(itemStack, world, player);
if (!Mouse.isButtonDown(1))
{
if (itemStack.stackTagCompound.getInteger("chargeTime") > 0)
{
if (player.onGround)
{
world.playSoundEffect(player.posX, player.posY, player.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
player.setVelocity(0.0D, 1.0D + (float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / (double)itemStack.stackTagCompound.getInteger("maxChargeTime"))), 0.0D);
itemStack.damageItem(1, player);
if (!Mouse.isButtonDown(1)) {
if (itemStack.stackTagCompound.getInteger("chargeTime") > 0) {
if (player.onGround) {
world.playSoundEffect(player.posX, player.posY, player.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
player.setVelocity(0.0D, 1.0D + (itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / itemStack.stackTagCompound.getInteger("maxChargeTime"))), 0.0D);
itemStack.damageItem(1, player);
}
}
resetData(itemStack);
}
else
{
if (itemStack.stackTagCompound.getBoolean("charging") == true)
{
} else {
if (itemStack.stackTagCompound.getBoolean("charging") == true) {
incrementData(itemStack);
}
spiralEffect(itemStack, world, player);
}
}
}
else
{
}
} else {
resetData(itemStack);
itemStack.stackTagCompound.setFloat("angle", 0);
itemStack.stackTagCompound.setDouble("radius", 0);
}
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime"))
{
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime")) {
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("maxChargeTime"));
}
if (itemStack.stackTagCompound.getDouble("radius") > 2.5D)
{
if (itemStack.stackTagCompound.getDouble("radius") > 2.5D) {
itemStack.stackTagCompound.setDouble("radius", 2.5D);
}
if (itemStack.stackTagCompound.getFloat("angle") > 6.0f)
{
if (itemStack.stackTagCompound.getFloat("angle") > 6.0f) {
itemStack.stackTagCompound.setFloat("angle", 0.0f);
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.getBoolean("charging") == false)
{
itemStack.stackTagCompound.setBoolean("charging", true);
}
return itemStack;
}
private void spiralEffect(ItemStack itemStack, World world, EntityPlayer player)
{
double particleX = player.posX + (double)(MathHelper.cos(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
double particleY = player.posY;
double particleZ = player.posZ + (double)(MathHelper.sin(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
float particleScale = ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime"))));
if (!world.isRemote)
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
}
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player)
{
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player) {
double particleX = (player.posX - 0.5D) + rand.nextDouble();
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
if (!world.isRemote)
MysticWorld.proxy.airFeetFX(world, particleX, player.posY, particleZ, 1.0f, 15);
}
private void resetData(ItemStack itemStack)
{
private void incrementData(ItemStack itemStack) {
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
itemStack.stackTagCompound.setFloat("angle", itemStack.stackTagCompound.getFloat("angle") + 0.2f);
itemStack.stackTagCompound.setDouble("radius", itemStack.stackTagCompound.getInteger("chargeTime") * 0.025D);
}
private void resetData(ItemStack itemStack) {
itemStack.stackTagCompound.setInteger("chargeTime", 0);
itemStack.stackTagCompound.setBoolean("charging", false);
itemStack.stackTagCompound.setFloat("angle", 0);
itemStack.stackTagCompound.setDouble("radius", 0);
}
private void incrementData(ItemStack itemStack)
{
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
itemStack.stackTagCompound.setFloat("angle", itemStack.stackTagCompound.getFloat("angle") + 0.2f);
itemStack.stackTagCompound.setDouble("radius", (double)itemStack.stackTagCompound.getInteger("chargeTime") * 0.025D);
private void spiralEffect(ItemStack itemStack, World world, EntityPlayer player) {
double particleX = player.posX + (MathHelper.cos(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
double particleY = player.posY;
double particleZ = player.posZ + (MathHelper.sin(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
float particleScale = ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound.getInteger("maxChargeTime"))));
if (!world.isRemote)
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
}
}

View file

@ -1,257 +1,164 @@
package MysticWorld.Items;
package mysticworld.items;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeAir;
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.BlockLog;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.BlockStem;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
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.potion.Potion;
import net.minecraft.potion.PotionEffect;
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;
public class ItemOrbEarth extends ItemOrb
{
public ItemOrbEarth(int id)
{
public class ItemOrbEarth extends ItemOrb {
public ItemOrbEarth(int id) {
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
return false;
} else {
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) {
if (!par3World.isRemote) {
par3World.playAuxSFX(2005, par4, par5, par6, 0);
}
return true;
}
return false;
}
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else
{
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer))
{
if (!par3World.isRemote)
{
par3World.playAuxSFX(2005, par4, par5, par6, 0);
}
return true;
}
return false;
}
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;
}
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 ((double)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 ((double)par1World.rand.nextFloat() < 0.4D)
{
((BlockMushroom)Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand);
}
itemStack.damageItem(1, player);
}
return true;
}
return true;
}
}

View file

@ -1,94 +1,63 @@
package MysticWorld.Items;
package mysticworld.items;
import MysticWorld.MysticWorld;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Entity.EntityChargeAir;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import mysticworld.MysticWorld;
import mysticworld.blocks.BlockHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
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)
{
public ItemOrbEnergy(int id) {
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if (par7 == 0) {
--par5;
}
if (par7 == 1) {
++par5;
}
if (par7 == 2) {
--par6;
}
if (par7 == 3) {
++par6;
}
if (par7 == 4) {
--par4;
}
if (par7 == 5) {
++par4;
}
if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack)) {
return false;
} else {
int i1 = world.getBlockId(par4, par5, par6);
if (i1 == 0) {
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);
}
itemStack.damageItem(1, entityPlayer);
return true;
}
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack))
{
return false;
}
else
{
int i1 = world.getBlockId(par4, par5, par6);
if (i1 == 0)
{
world.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(par4, par5, par6, BlockHandler.lightCube.blockID);
}
itemStack.damageItem(1, entityPlayer);
return true;
}
}
}

View file

@ -1,18 +1,10 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.Random;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeAir;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFlintAndSteel;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -20,99 +12,68 @@ import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class ItemOrbFire extends ItemOrb {
public ItemOrbFire(int id) {
super(id);
}
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
entityLiving.setFire(5);
entityLiving.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityLiving);
return true;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if (par7 == 0) {
--par5;
}
if (par7 == 1) {
++par5;
}
if (par7 == 2) {
--par6;
}
if (par7 == 3) {
++par6;
}
if (par7 == 4) {
--par4;
}
if (par7 == 5) {
++par4;
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
return false;
} 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);
}
par1ItemStack.damageItem(1, par2EntityPlayer);
return true;
}
}
@Override
public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer entityPlayer, Entity entity) {
entity.setFire(5);
entity.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityPlayer);
return true;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else
{
if (par3World.isAirBlock(par4, par5, par6))
{
par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
par3World.setBlock(par4, par5, par6, Block.fire.blockID);
}
par1ItemStack.damageItem(1, par2EntityPlayer);
return true;
}
}
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving)
{
entityLiving.setFire(5);
entityLiving.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityLiving);
return true;
}
@Override
public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer entityPlayer, Entity entity)
{
entity.setFire(5);
entity.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityPlayer);
return true;
}
}

View file

@ -1,141 +1,87 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.Random;
import MysticWorld.MysticWorld;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Entity.EntityChargeAir;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
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 net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event;
import net.minecraftforge.event.entity.player.FillBucketEvent;
public class ItemOrbWater extends ItemOrb {
public ItemOrbWater(int id)
{
public ItemOrbWater(int id) {
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k)) {
return itemStack;
}
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) {
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);
return itemStack;
} else {
if (movingobjectposition.sideHit == 0) {
--j;
}
if (movingobjectposition.sideHit == 1) {
++j;
}
if (movingobjectposition.sideHit == 2) {
--k;
}
if (movingobjectposition.sideHit == 3) {
++k;
}
if (movingobjectposition.sideHit == 4) {
--i;
}
if (movingobjectposition.sideHit == 5) {
++i;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
int i1 = world.getBlockId(i, j, k);
if (i1 == 0) {
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);
itemStack.damageItem(1, entityPlayer);
}
return itemStack;
}
}
}
return itemStack;
}
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (itemStack != null)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (itemStack != null) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null)
{
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k))
{
return itemStack;
}
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)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlockToAir(i, j, k);
itemStack.damageItem(1, entityPlayer);
return itemStack;
}
else
{
if (movingobjectposition.sideHit == 0)
{
--j;
}
if (movingobjectposition.sideHit == 1)
{
++j;
}
if (movingobjectposition.sideHit == 2)
{
--k;
}
if (movingobjectposition.sideHit == 3)
{
++k;
}
if (movingobjectposition.sideHit == 4)
{
--i;
}
if (movingobjectposition.sideHit == 5)
{
++i;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack))
{
return itemStack;
}
else
{
int i1 = world.getBlockId(i, j, k);
if (i1 == 0)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, Block.waterMoving.blockID);
itemStack.damageItem(1, entityPlayer);
}
return itemStack;
}
}
}
return itemStack;
}
}
}

View file

@ -1,29 +1,25 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.Random;
import mysticworld.MysticWorld;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import net.minecraft.item.Item;
public class ItemStaff extends Item
{
public class ItemStaff extends Item {
Random rand = new Random();
public ItemStaff(int id)
{
public ItemStaff(int id) {
super(id);
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
}
@SideOnly(Side.CLIENT)
public boolean isFull3D() {
return true;
}
}

View file

@ -1,112 +1,80 @@
package MysticWorld.Items;
package mysticworld.items;
import mysticworld.MysticWorld;
import mysticworld.entity.EntityChargeAir;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeAir;
public class ItemStaffAir extends ItemStaff {
public ItemStaffAir(int id)
{
public ItemStaffAir(int id) {
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.getBoolean("charging") == false) {
itemStack.stackTagCompound.setBoolean("charging", true);
}
return itemStack;
}
EntityPlayer player = (EntityPlayer)entity;
ItemStack currentItem = player.inventory.getCurrentItem();
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
itemStack.stackTagCompound.setInteger("maxChargeTime", 3 * 20);
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
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.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))), (float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / (double)itemStack.stackTagCompound.getInteger("maxChargeTime")))));
itemStack.damageItem(1, 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.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);
}
}
resetData(itemStack);
}
else
{
if (itemStack.stackTagCompound.getBoolean("charging") == true)
{
} else {
if (itemStack.stackTagCompound.getBoolean("charging") == true) {
incrementData(itemStack);
}
}
}
}
else
{
}
} else {
resetData(itemStack);
}
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime"))
{
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime")) {
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("maxChargeTime"));
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.getBoolean("charging") == false)
{
itemStack.stackTagCompound.setBoolean("charging", true);
}
return itemStack;
}
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player)
{
double particleX = (player.posX - 0.5D) + rand.nextDouble();
double particleY = player.posY + (player.height/itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime"));
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
float particleScale = ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime"))));
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player) {
double particleX = (player.posX - 0.5D) + rand.nextDouble();
double particleY = player.posY + (player.height / itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime"));
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
float particleScale = ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound.getInteger("maxChargeTime"))));
if (!world.isRemote)
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
}
private void resetData(ItemStack itemStack)
{
private void incrementData(ItemStack itemStack) {
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
}
private void resetData(ItemStack itemStack) {
itemStack.stackTagCompound.setInteger("chargeTime", 0);
itemStack.stackTagCompound.setBoolean("charging", false);
}
private void incrementData(ItemStack itemStack)
{
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
}
}

View file

@ -1,10 +1,7 @@
package MysticWorld.Items;
package mysticworld.items;
import org.lwjgl.input.Keyboard;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeEarth;
import MysticWorld.Entity.EntityChargeFire;
import mysticworld.MysticWorld;
import mysticworld.entity.EntityChargeEarth;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCocoa;
import net.minecraft.block.BlockCrops;
@ -12,14 +9,9 @@ import net.minecraft.block.BlockDirectional;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.BlockStem;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
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.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
@ -28,269 +20,172 @@ import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.BonemealEvent;
import net.minecraftforge.event.entity.player.UseHoeEvent;
public class ItemStaffEarth extends ItemStaff
{
public ItemStaffEarth(int id)
{
import org.lwjgl.input.Keyboard;
public class ItemStaffEarth extends ItemStaff {
public ItemStaffEarth(int id) {
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k)) {
return itemStack;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
if (applyBonemeal(itemStack, world, i, j, k, entityPlayer)) {
if (!world.isRemote) {
world.playAuxSFX(2005, i, j, k, 0);
}
return itemStack;
}
}
}
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) 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);
}
return itemStack;
}
return itemStack;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null)
{
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k))
{
return itemStack;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack))
{
return itemStack;
}
else
{
if (applyBonemeal(itemStack, world, i, j, k, entityPlayer))
{
if (!world.isRemote)
{
world.playAuxSFX(2005, i, j, k, 0);
}
return itemStack;
}
}
}
}
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;
}
else
{
world.playAuxSFXAtEntity((EntityPlayer)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);
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 itemStack;
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 itemStack;
return true;
}
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 ((double)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 ((double)par1World.rand.nextFloat() < 0.4D)
{
((BlockMushroom)Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand);
}
itemStack.damageItem(1, player);
}
return true;
}
return true;
}
}

View file

@ -1,17 +1,10 @@
package MysticWorld.Items;
package mysticworld.items;
import org.lwjgl.input.Keyboard;
import MysticWorld.MysticWorld;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Entity.EntityChargeEnergy;
import MysticWorld.Entity.EntityChargeFire;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import mysticworld.MysticWorld;
import mysticworld.blocks.BlockHandler;
import mysticworld.entity.EntityChargeEnergy;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -19,126 +12,83 @@ 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);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k)) {
return itemStack;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
if (movingobjectposition.sideHit == 0) {
--j;
}
if (movingobjectposition.sideHit == 1) {
++j;
}
if (movingobjectposition.sideHit == 2) {
--k;
}
if (movingobjectposition.sideHit == 3) {
++k;
}
if (movingobjectposition.sideHit == 4) {
--i;
}
if (movingobjectposition.sideHit == 5) {
++i;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} 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);
}
itemStack.damageItem(1, entityPlayer);
return itemStack;
}
}
}
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) 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);
}
return itemStack;
}
return itemStack;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null)
{
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k))
{
return itemStack;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack))
{
return itemStack;
}
else
{
if (movingobjectposition.sideHit == 0)
{
--j;
}
if (movingobjectposition.sideHit == 1)
{
++j;
}
if (movingobjectposition.sideHit == 2)
{
--k;
}
if (movingobjectposition.sideHit == 3)
{
++k;
}
if (movingobjectposition.sideHit == 4)
{
--i;
}
if (movingobjectposition.sideHit == 5)
{
++i;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack))
{
return itemStack;
}
else
{
if (world.isAirBlock(i, j, k))
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, BlockHandler.lightCube.blockID);
}
itemStack.damageItem(1, entityPlayer);
return itemStack;
}
}
}
}
}
else
{
world.playAuxSFXAtEntity((EntityPlayer)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);
}
return itemStack;
}
return itemStack;
}
}

View file

@ -1,22 +1,11 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.Arrays;
import java.util.Random;
import org.lwjgl.input.Keyboard;
import MysticWorld.MysticWorld;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Entity.EntityChargeFire;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import mysticworld.MysticWorld;
import mysticworld.entity.EntityChargeFire;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
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;
@ -26,114 +15,82 @@ 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 boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
entityLiving.setFire(5);
entityLiving.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityLiving);
return true;
}
return true;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k)) {
return itemStack;
}
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;
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.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
itemStack.damageItem(1, entityPlayer);
}
}
}
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) 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);
}
return itemStack;
}
return itemStack;
}
@Override
public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer entityPlayer, Entity entity) {
entity.setFire(5);
entity.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityPlayer);
return true;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving)
{
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
entityLiving.setFire(5);
entityLiving.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityLiving);
return true;
}
return true;
}
public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer entityPlayer, Entity entity)
{
entity.setFire(5);
entity.attackEntityFrom(DamageSource.magic, 7);
itemStack.damageItem(1, entityPlayer);
return true;
}
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null)
{
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k))
{
return itemStack;
}
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;
int meta = result.getItemDamage();
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, 0);
world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
itemStack.damageItem(1, entityPlayer);
}
}
}
}
}
else
{
world.playAuxSFXAtEntity((EntityPlayer)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);
}
return itemStack;
}
return itemStack;
}
}

View file

@ -1,71 +1,60 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.List;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import MysticWorld.MysticWorld;
import MysticWorld.Lib.Strings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemStaffParts extends Item {
private Icon[] icons;
private static final String[] STAFF_PARTS = new String[] {"Staff", "Hilt", "Handle", "Head"};
public ItemStaffParts(int id)
{
private static final String[] STAFF_PARTS = new String[] { "Staff", "Hilt", "Handle", "Head" };
public ItemStaffParts(int id) {
super(id);
this.setHasSubtypes(true);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.setHasSubtypes(true);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
return STAFF_PARTS[meta];
}
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[STAFF_PARTS.length];
for (int i = 0; i < STAFF_PARTS.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:StaffPart_" + STAFF_PARTS[i]);
}
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, STAFF_PARTS.length);
return icons[j];
}
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int var4 = 0; var4 < STAFF_PARTS.length; var4++){
par3List.add(new ItemStack(par1, 1, var4));
}
}
@SideOnly(Side.CLIENT)
public Icon 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) {
for (int var4 = 0; var4 < STAFF_PARTS.length; var4++) {
par3List.add(new ItemStack(par1, 1, var4));
}
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
return STAFF_PARTS[meta];
}
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[STAFF_PARTS.length];
for (int i = 0; i < STAFF_PARTS.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:StaffPart_" + STAFF_PARTS[i]);
}
}
}

View file

@ -1,55 +1,43 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.List;
import MysticWorld.Util.Reference;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemStaffPower extends Item {
private Icon[] icons;
private static final String[] CHARGE_NAMES = new String[] { "Fire", "Water", "Earth", "Air", "Energy"};
private static final String[] CHARGE_NAMES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
public ItemStaffPower(int id)
{
public ItemStaffPower(int id) {
super(id);
this.setHasSubtypes(true);
this.setCreativeTab(null);
maxStackSize = 64;
this.setHasSubtypes(true);
this.setCreativeTab(null);
maxStackSize = 64;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
return super.getUnlocalizedName() + CHARGE_NAMES[meta];
}
@Override
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
icons = new Icon[CHARGE_NAMES.length];
for (int i = 0; i < CHARGE_NAMES.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:Charge" + CHARGE_NAMES[i]);
}
public Icon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, 5);
return icons[j];
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, 5);
return icons[j];
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
return super.getUnlocalizedName() + CHARGE_NAMES[meta];
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[CHARGE_NAMES.length];
for (int i = 0; i < CHARGE_NAMES.length; ++i) {
icons[i] = iconRegister.registerIcon("MysticMods:Charge" + CHARGE_NAMES[i]);
}
}
}

View file

@ -1,160 +1,102 @@
package MysticWorld.Items;
package mysticworld.items;
import org.lwjgl.input.Keyboard;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeEarth;
import MysticWorld.Entity.EntityChargeFire;
import MysticWorld.Entity.EntityChargeWater;
import mysticworld.MysticWorld;
import mysticworld.entity.EntityChargeWater;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.UseHoeEvent;
import org.lwjgl.input.Keyboard;
public class ItemStaffWater extends ItemStaff {
public ItemStaffWater(int id) {
super(id);
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null) {
return itemStack;
} else {
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k)) {
return itemStack;
}
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) {
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);
return itemStack;
} else {
if (movingobjectposition.sideHit == 0) {
--j;
}
if (movingobjectposition.sideHit == 1) {
++j;
}
if (movingobjectposition.sideHit == 2) {
--k;
}
if (movingobjectposition.sideHit == 3) {
++k;
}
if (movingobjectposition.sideHit == 4) {
--i;
}
if (movingobjectposition.sideHit == 5) {
++i;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
return itemStack;
} else {
int i1 = world.getBlockId(i, j, k);
if (i1 == 0) {
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);
itemStack.damageItem(1, entityPlayer);
}
return itemStack;
}
}
}
return itemStack;
}
} else {
world.playAuxSFXAtEntity((EntityPlayer) 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);
}
return itemStack;
}
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
EntityPlayer player = (EntityPlayer) entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
if (!world.isRemote) {
if (currentItem != null) {
if (currentItem.itemID == itemStack.itemID) {
MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
if (movingobjectposition == null)
{
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityPlayer, i, j, k))
{
return itemStack;
}
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)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlockToAir(i, j, k);
itemStack.damageItem(1, entityPlayer);
return itemStack;
}
else
{
if (movingobjectposition.sideHit == 0)
{
--j;
}
if (movingobjectposition.sideHit == 1)
{
++j;
}
if (movingobjectposition.sideHit == 2)
{
--k;
}
if (movingobjectposition.sideHit == 3)
{
++k;
}
if (movingobjectposition.sideHit == 4)
{
--i;
}
if (movingobjectposition.sideHit == 5)
{
++i;
}
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack))
{
return itemStack;
}
else
{
int i1 = world.getBlockId(i, j, k);
if (i1 == 0)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(i, j, k, Block.waterMoving.blockID);
itemStack.damageItem(1, entityPlayer);
}
return itemStack;
}
}
}
return itemStack;
}
}
else
{
world.playAuxSFXAtEntity((EntityPlayer)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);
}
return itemStack;
}
}
}

View file

@ -1,95 +1,72 @@
package MysticWorld.Items;
package mysticworld.items;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeAir;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemVoidShard extends Item {
public ItemVoidShard(int id) {
super(id);
this.setMaxStackSize(1);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.setMaxDamage(1);
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
itemStack.setTagCompound(new NBTTagCompound());
list.add("Experience Stored: " + Integer.toString(itemStack.stackTagCompound.getInteger("xpStored")));
}
@Override
public boolean hasEffect(ItemStack itemStack) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.hasKey("filled")) {
return itemStack.stackTagCompound.getBoolean("filled");
} else {
return false;
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
int experience = entityPlayer.experienceLevel;
int experienceSubtract = entityPlayer.experienceLevel - 30;
if (itemStack.stackTagCompound.getBoolean("filled") == false)
{
if (experience > 0 && experience <= 30)
{
if (itemStack.stackTagCompound.getBoolean("filled") == false) {
if (experience > 0 && experience <= 30) {
entityPlayer.experienceLevel = 0;
itemStack.stackTagCompound.setInteger("xpStored", experience);
itemStack.stackTagCompound.setBoolean("filled", true);
}
else if (experience > 30)
{
} else if (experience > 30) {
entityPlayer.experienceLevel = experienceSubtract;
itemStack.stackTagCompound.setInteger("xpStored", 30);
itemStack.stackTagCompound.setBoolean("filled", true);
}
}
else
{
} else {
entityPlayer.experienceLevel += itemStack.stackTagCompound.getInteger("xpStored");
itemStack.stackTagCompound.setInteger("xpStored", 0);
itemStack.stackTagCompound.setBoolean("filled", false);
itemStack.damageItem(2, entityPlayer);
}
return itemStack;
}
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
list.add("Experience Stored: " + Integer.toString(itemStack.stackTagCompound.getInteger("xpStored")));
}
@Override
public boolean hasEffect(ItemStack itemStack)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.hasKey("filled"))
{
return itemStack.stackTagCompound.getBoolean("filled");
}
else
{
return false;
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticMods:ShardVoid");
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods:ShardVoid");
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.Lib;
package mysticworld.lib;
public class BlockIds {

View file

@ -1,4 +1,4 @@
package MysticWorld.Lib;
package mysticworld.lib;
public class Booleans
{

View file

@ -1,4 +1,4 @@
package MysticWorld.Lib;
package mysticworld.lib;
public class EntityIds {

View file

@ -1,4 +1,4 @@
package MysticWorld.Lib;
package mysticworld.lib;
public class ItemIds {

View file

@ -1,4 +1,4 @@
package MysticWorld.Lib;
package mysticworld.lib;
public class RenderIds {

View file

@ -1,4 +1,4 @@
package MysticWorld.Lib;
package mysticworld.lib;
public class Strings {

View file

@ -1,23 +1,17 @@
package MysticWorld.Model;
import org.lwjgl.opengl.GL11;
package mysticworld.model;
import net.minecraft.client.model.ModelBase;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
public class ModelOrb extends ModelBase {
private IModelCustom modelOrb;
public ModelOrb()
{
public ModelOrb() {
modelOrb = AdvancedModelLoader.loadModel("/assets/mysticmods/models/orb.obj");
}
public void render()
{
public void render() {
modelOrb.renderAll();
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.Model;
package mysticworld.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

View file

@ -1,4 +1,4 @@
package MysticWorld.Model;
package mysticworld.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

View file

@ -1,84 +1,45 @@
package MysticWorld;
package mysticworld;
import java.io.File;
import java.lang.reflect.Array;
import java.util.Random;
import java.util.Set;
import MysticWorld.Biome.BiomeHandler;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Entity.EntityHandler;
import MysticWorld.Items.ItemHandler$1;
import MysticWorld.Lib.Strings;
import MysticWorld.TileEntity.TileEntityHandler;
import MysticWorld.Util.CommonProxy;
import MysticWorld.Util.Config;
import MysticWorld.Util.Localizations;
import MysticWorld.Util.RecipeHandler;
import MysticWorld.Util.Reference;
import MysticWorld.Util.TabMysticWorld;
import MysticWorld.Util.TickHandler;
import MysticWorld.WorldGen.*;
import net.minecraft.block.Block;
import mysticworld.biome.BiomeHandler;
import mysticworld.blocks.BlockHandler;
import mysticworld.entity.EntityHandler;
import mysticworld.items.ItemHandler$1;
import mysticworld.tiles.TileEntityHandler;
import mysticworld.util.CommonProxy;
import mysticworld.util.Config;
import mysticworld.util.Localizations;
import mysticworld.util.RecipeHandler;
import mysticworld.util.Reference;
import mysticworld.util.TabMysticWorld;
import mysticworld.util.TickHandler;
import mysticworld.worldgen.WorldGenHandler$1;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.Mod.ServerStarted;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
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.common.registry.VillagerRegistry;
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
{
public class MysticWorld {
@Instance(Reference.MOD_ID)
public static MysticWorld instance;
public static MysticWorld instance;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
public static CommonProxy proxy;
private TickHandler tickHandler;
public static CreativeTabs MysticWorldTab = new TabMysticWorld(CreativeTabs.getNextID(), "MysticWorldTab");
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic World.cfg"));
Config.save();
BiomeHandler.init();
instance = this;
}
@EventHandler
public void load(FMLInitializationEvent event)
{
public void load(FMLInitializationEvent event) {
this.tickHandler = new TickHandler();
TickRegistry.registerTickHandler(this.tickHandler, Side.SERVER);
TickRegistry.registerTickHandler(this.tickHandler, Side.SERVER);
BlockHandler.init();
ItemHandler$1.init();
TileEntityHandler.init();
@ -86,8 +47,15 @@ public class MysticWorld
EntityHandler.init();
RecipeHandler.init();
Localizations.Initialize();
proxy.registerRenderIDs();
proxy.registerRenders();
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic World.cfg"));
Config.save();
BiomeHandler.init();
instance = this;
}
}

View file

@ -1,50 +1,41 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelPillarInsert;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import MysticWorld.Model.ModelPillarInsert;
import net.minecraftforge.client.IItemRenderer;
public class BlockPillarInsertRenderer implements IItemRenderer {
private static final ResourceLocation texture = new ResourceLocation("mysticmods:textures" + "/models/PillarInsert.png");
private final ModelPillarInsert model;
public BlockPillarInsertRenderer()
{
public BlockPillarInsertRenderer() {
this.model = new ModelPillarInsert();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, -1.0F, 0.0F, 1.0F);
break;
@ -61,21 +52,21 @@ public class BlockPillarInsertRenderer implements IItemRenderer {
break;
}
}
private void renderModel(float x, float y, float z, float scale){
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(0.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(texture);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture);
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
}

View file

@ -1,47 +1,72 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import MysticWorld.Model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemOrbAirRenderer implements IItemRenderer {
private ModelOrb modelOrb;
private ModelOrb modelOrb;
public ItemOrbAirRenderer()
{
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
public ItemOrbAirRenderer() {
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbAir.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -54,45 +79,4 @@ public class ItemOrbAirRenderer implements IItemRenderer {
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type){
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/OrbAir.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,72 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import MysticWorld.Model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemOrbEarthRenderer implements IItemRenderer {
private ModelOrb modelOrb;
private ModelOrb modelOrb;
public ItemOrbEarthRenderer()
{
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
public ItemOrbEarthRenderer() {
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbEarth.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -54,45 +79,4 @@ public class ItemOrbEarthRenderer implements IItemRenderer {
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type){
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/OrbEarth.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,72 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import MysticWorld.Model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemOrbEnergyRenderer implements IItemRenderer {
private ModelOrb modelOrb;
private ModelOrb modelOrb;
public ItemOrbEnergyRenderer()
{
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
public ItemOrbEnergyRenderer() {
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbEnergy.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -54,45 +79,4 @@ public class ItemOrbEnergyRenderer implements IItemRenderer {
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type){
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/OrbEnergy.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,72 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import MysticWorld.Model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemOrbFireRenderer implements IItemRenderer {
private ModelOrb modelOrb;
private ModelOrb modelOrb;
public ItemOrbFireRenderer()
{
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
public ItemOrbFireRenderer() {
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbFire.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -54,45 +79,4 @@ public class ItemOrbFireRenderer implements IItemRenderer {
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type){
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/OrbFire.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,72 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import MysticWorld.Model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemOrbWaterRenderer implements IItemRenderer {
private ModelOrb modelOrb;
private ModelOrb modelOrb;
public ItemOrbWaterRenderer()
{
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
public ItemOrbWaterRenderer() {
modelOrb = new ModelOrb();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbWater.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -54,45 +79,4 @@ public class ItemOrbWaterRenderer implements IItemRenderer {
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type){
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/OrbWater.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,40 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import org.lwjgl.opengl.GL11;
import MysticWorld.Model.ModelStaff;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffAirRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffAirRenderer()
{
public ItemStaffAirRenderer() {
this.model = new ModelStaff();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
@ -58,39 +51,10 @@ public class ItemStaffAirRenderer implements IItemRenderer {
break;
}
}
private void renderModel(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffAir.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffAir.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -103,4 +67,29 @@ public class ItemStaffAirRenderer implements IItemRenderer {
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffAir.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffAir.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,40 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import org.lwjgl.opengl.GL11;
import MysticWorld.Model.ModelStaff;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffEarthRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffEarthRenderer()
{
public ItemStaffEarthRenderer() {
this.model = new ModelStaff();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
@ -58,39 +51,10 @@ public class ItemStaffEarthRenderer implements IItemRenderer {
break;
}
}
private void renderModel(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffEarth.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffEarth.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -103,4 +67,29 @@ public class ItemStaffEarthRenderer implements IItemRenderer {
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEarth.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEarth.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,40 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import org.lwjgl.opengl.GL11;
import MysticWorld.Model.ModelStaff;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffEnergyRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffEnergyRenderer()
{
public ItemStaffEnergyRenderer() {
this.model = new ModelStaff();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
@ -58,39 +51,10 @@ public class ItemStaffEnergyRenderer implements IItemRenderer {
break;
}
}
private void renderModel(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffEnergy.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffEnergy.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -103,4 +67,29 @@ public class ItemStaffEnergyRenderer implements IItemRenderer {
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEnergy.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEnergy.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,46 +1,40 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import MysticWorld.Model.ModelStaff;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffFireRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffFireRenderer()
{
public ItemStaffFireRenderer() {
this.model = new ModelStaff();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
@ -57,39 +51,10 @@ public class ItemStaffFireRenderer implements IItemRenderer {
break;
}
}
private void renderModel(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffFire.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffFire.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -102,4 +67,29 @@ public class ItemStaffFireRenderer implements IItemRenderer {
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffFire.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffFire.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,47 +1,40 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import org.lwjgl.opengl.GL11;
import MysticWorld.Model.ModelStaff;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffWaterRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffWaterRenderer()
{
public ItemStaffWaterRenderer() {
this.model = new ModelStaff();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
case ENTITY:
return true;
case EQUIPPED:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
case INVENTORY:
return true;
default:
return false;
}
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
@ -58,39 +51,10 @@ public class ItemStaffWaterRenderer implements IItemRenderer {
break;
}
}
private void renderModel(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffWater.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("mysticmods:textures" + "/models/StaffWater.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
switch(type)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
@ -103,4 +67,29 @@ public class ItemStaffWaterRenderer implements IItemRenderer {
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffWater.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffWater.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,73 +1,59 @@
package MysticWorld.Renderer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import MysticWorld.Items.ItemHandler$1;
import MysticWorld.Items.ItemStaffPower;
package mysticworld.renderer;
import mysticworld.items.ItemHandler$1;
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.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.Icon;
import net.minecraft.util.ResourceLocation;
public class RenderStaffPower extends Render {
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderStaffPower extends Render {
private Item item;
private int meta = 0;
public RenderStaffPower(int par1)
{
this.meta = par1;
}
public RenderStaffPower(int par1) {
this.meta = par1;
}
public void doRenderEntity(Entity entity, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
this.func_110777_b(entity);
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
Icon icon = ItemHandler$1.staffPower.getIconFromDamage(this.meta);
Tessellator tessellator = Tessellator.instance;
float f3 = icon.getMinU();
float f4 = icon.getMaxU();
float f5 = icon.getMinV();
float f6 = icon.getMaxV();
float f7 = 1.0F;
float f8 = 0.5F;
float f9 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
tessellator.draw();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
this.doRenderEntity(par1Entity, par2, par4, par6, par8, par9);
}
protected ResourceLocation func_110790_a(Entity par1Entity)
{
return TextureMap.field_110576_c;
}
public void doRenderEntity(Entity entity, double par2, double par4, double par6, float par8, float par9) {
GL11.glPushMatrix();
this.bindEntityTexture(entity);
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
Icon icon = ItemHandler$1.staffPower.getIconFromDamage(this.meta);
Tessellator tessellator = Tessellator.instance;
float f3 = icon.getMinU();
float f4 = icon.getMaxU();
float f5 = icon.getMinV();
float f6 = icon.getMaxV();
float f7 = 1.0F;
float f8 = 0.5F;
float f9 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV(0.0F - f8, 0.0F - f9, 0.0D, f3, f6);
tessellator.addVertexWithUV(f7 - f8, 0.0F - f9, 0.0D, f4, f6);
tessellator.addVertexWithUV(f7 - f8, 1.0F - f9, 0.0D, f4, f5);
tessellator.addVertexWithUV(0.0F - f8, 1.0F - f9, 0.0D, f3, f5);
tessellator.draw();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
protected ResourceLocation func_110775_a(Entity par1Entity)
{
return this.func_110790_a(par1Entity);
}
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
this.doRenderEntity(par1Entity, par2, par4, par6, par8, par9);
}
@Override
protected ResourceLocation getEntityTexture(Entity par1Entity) {
return TextureMap.locationItemsTexture;
}
}

View file

@ -1,41 +1,37 @@
package MysticWorld.Renderer;
package mysticworld.renderer;
import mysticworld.model.ModelPillarInsert;
import mysticworld.tiles.TileEntityPillarInsert;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import MysticWorld.Model.ModelPillarInsert;
import MysticWorld.TileEntity.TileEntityPillarInsert;
import cpw.mods.fml.client.FMLClientHandler;
public class TileEntityPillarInsertRenderer extends TileEntitySpecialRenderer {
private static final ResourceLocation texture = new ResourceLocation("mysticmods:textures" + "/models/PillarInsert.png");
private static final ResourceLocation texture = new ResourceLocation("mysticmods:textures" + "/models/PillarInsert.png");
private ModelPillarInsert model;
public TileEntityPillarInsertRenderer()
{
model = new ModelPillarInsert();
}
public void renderAModelAt(TileEntityPillarInsert tileentity, double d, double d1, double d2, float f)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
GL11.glRotatef(0F, 0F, 0F, 0F);
GL11.glScalef(1.0F, -1.0F, -1.0F);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(texture);
GL11.glPushMatrix();
model.renderModel(0.0625F);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((TileEntityPillarInsert)tileentity, d, d1, d2, f);
}
public TileEntityPillarInsertRenderer() {
model = new ModelPillarInsert();
}
public void renderAModelAt(TileEntityPillarInsert tileentity, double d, double d1, double d2, float f) {
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glRotatef(0F, 0F, 0F, 0F);
GL11.glScalef(1.0F, -1.0F, -1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture);
GL11.glPushMatrix();
model.renderModel(0.0625F);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) {
renderAModelAt((TileEntityPillarInsert) tileentity, d, d1, d2, f);
}
}

View file

@ -1,13 +0,0 @@
package MysticWorld.TileEntity;
import MysticWorld.Lib.Strings;
import cpw.mods.fml.common.registry.GameRegistry;
public class TileEntityHandler {
public static void init()
{
GameRegistry.registerTileEntity(TileEntityPillarInsert.class, Strings.PILLAR_INSERT_TE_NAME);
}
}

View file

@ -1,36 +0,0 @@
package MysticWorld.TileEntity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
public class TileEntityPillarInsert extends TileEntity {
@Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbtTag = new NBTTagCompound();
this.writeToNBT(nbtTag);
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag);
}
@Override
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet)
{
readFromNBT(packet.customParam1);
}
@Override
public void writeToNBT(NBTTagCompound par1)
{
super.writeToNBT(par1);
}
@Override
public void readFromNBT(NBTTagCompound par1)
{
super.readFromNBT(par1);
}
}

View file

@ -1,39 +1,33 @@
package MysticWorld.Util;
package mysticworld.util;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.src.ModLoader;
import net.minecraft.world.World;
import MysticWorld.Client.FX.PowerAirFX;
import MysticWorld.Client.FX.LightCubeFX;
public class CommonProxy {
public void registerRenderIDs(){
}
public void registerRenders(){
}
public int addArmor(String armor){
public int addArmor(String armor) {
return 0;
}
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age){
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
}
public void earthFX(World worldObj, double x, double y, double z, float scale){
public void earthFX(World worldObj, double x, double y, double z, float scale) {
}
public void energyFX(World worldObj, double x, double y, double z, float scale){
public void energyFX(World worldObj, double x, double y, double z, float scale) {
}
public void fireFX(World worldObj, double x, double y, double z, float scale){
public void fireFX(World worldObj, double x, double y, double z, float scale) {
}
public void waterFX(World worldObj, double x, double y, double z, float scale){
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
}
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale){
public void registerRenderIDs() {
}
public void registerRenders() {
}
public void waterFX(World worldObj, double x, double y, double z, float scale) {
}
}

View file

@ -1,23 +1,18 @@
package MysticWorld.Util;
package mysticworld.util;
import java.io.File;
import MysticWorld.Lib.BlockIds;
import MysticWorld.Lib.EntityIds;
import MysticWorld.Lib.ItemIds;
import MysticWorld.Lib.Strings;
import MysticWorld.Lib.Booleans;
import mysticworld.lib.BlockIds;
import mysticworld.lib.Booleans;
import mysticworld.lib.ItemIds;
import mysticworld.lib.Strings;
import net.minecraftforge.common.Configuration;
public class Config
{
public class Config {
public static Configuration config;
public static void initialize(File file)
{
public static void initialize(File file) {
config = new Configuration(file);
//Boolean Configurations
Booleans.ENABLE_BUSH_GEN = config.get("World Generation", "Enable Bush Generation", true).getBoolean(Booleans.ENABLE_BUSH_GEN);
Booleans.ENABLE_GLACIER_GEN = config.get("World Generation", "Enable Glacier Biome", true).getBoolean(Booleans.ENABLE_GLACIER_GEN);
@ -25,64 +20,49 @@ public class Config
Booleans.ENABLE_MOUNTAIN_GEN = config.get("World Generation", "Enable Mountain Biome", true).getBoolean(Booleans.ENABLE_MOUNTAIN_GEN);
Booleans.ENABLE_STEPPE_GEN = config.get("World Generation", "Enable Steppe Biome", true).getBoolean(Booleans.ENABLE_STEPPE_GEN);
Booleans.ENABLE_TUNDRA_GEN = config.get("World Generation", "Enable Tundra Biome", true).getBoolean(Booleans.ENABLE_TUNDRA_GEN);
//Block Configuration
BlockIds.ORE_STONE_1 = config.getBlock(Strings.IMBUED_STONE_NAME, BlockIds.ORE_STONE_1_DEFAULT).getInt(BlockIds.ORE_STONE_1);
BlockIds.BUSH = config.getBlock(Strings.BUSH_NAME, BlockIds.BUSH_DEFAULT).getInt(BlockIds.BUSH_DEFAULT);
BlockIds.LIGHT_CUBE = config.getBlock(Strings.LIGHT_CUBE_NAME, BlockIds.LIGHT_CUBE_DEFAULT).getInt(BlockIds.LIGHT_CUBE_DEFAULT);
BlockIds.LIGHT_CUBE = config.getBlock(Strings.LIGHT_CUBE_NAME, BlockIds.LIGHT_CUBE_DEFAULT).getInt(BlockIds.LIGHT_CUBE_DEFAULT);
BlockIds.PLATFORM = config.getBlock(Strings.PLATFORM_NAME, BlockIds.PLATFORM_DEFAULT).getInt(BlockIds.PLATFORM_DEFAULT);
BlockIds.PILLAR = config.getBlock(Strings.PILLAR_NAME, BlockIds.PILLAR_DEFAULT).getInt(BlockIds.PILLAR_DEFAULT);
BlockIds.PILLAR_INSERT = config.getBlock(Strings.PILLAR_INSERT_NAME, BlockIds.PILLAR_INSERT_DEFAULT).getInt(BlockIds.PILLAR_INSERT_DEFAULT);
//Item Configuration
ItemIds.IMBUED_SHARD = config.getItem(Strings.IMBUED_SHARD_NAME, ItemIds.IMBUED_SHARD_DEFAULT).getInt(ItemIds.IMBUED_SHARD_DEFAULT);
ItemIds.STAFF_PARTS = config.getItem(Strings.STAFF_NAME, ItemIds.STAFF_PARTS_DEFAULT).getInt(ItemIds.STAFF_PARTS_DEFAULT);
ItemIds.FIRE_STAFF = config.getItem(Strings.FIRE_STAFF_NAME, ItemIds.FIRE_STAFF_DEFAULT).getInt(ItemIds.FIRE_STAFF_DEFAULT);
ItemIds.WATER_STAFF = config.getItem(Strings.WATER_STAFF_NAME, ItemIds.WATER_STAFF_DEFAULT).getInt(ItemIds.WATER_STAFF_DEFAULT);
ItemIds.EARTH_STAFF = config.getItem(Strings.EARTH_STAFF_NAME, ItemIds.EARTH_STAFF_DEFAULT).getInt(ItemIds.EARTH_STAFF_DEFAULT);
ItemIds.AIR_STAFF = config.getItem(Strings.AIR_STAFF_NAME, ItemIds.AIR_STAFF_DEFAULT).getInt(ItemIds.AIR_STAFF_DEFAULT);
ItemIds.ENERGY_STAFF = config.getItem(Strings.ENERGY_STAFF_NAME, ItemIds.ENERGY_STAFF_DEFAULT).getInt(ItemIds.ENERGY_STAFF_DEFAULT);
ItemIds.STAFF_POWER = config.getItem(Strings.POWER_STAFF_NAME, ItemIds.STAFF_POWER_DEFAULT).getInt(ItemIds.STAFF_POWER_DEFAULT);
ItemIds.BUSH_FRUIT = config.getItem(Strings.BUSH_FRUIT_NAME, ItemIds.BUSH_FRUIT_DEFAULT).getInt(ItemIds.BUSH_FRUIT_DEFAULT);
ItemIds.VERDITE_HELMET = config.getItem(Strings.VERDITE_HELMET_NAME, ItemIds.VERDITE_HELMET_DEFAULT).getInt(ItemIds.VERDITE_HELMET_DEFAULT);
ItemIds.VERDITE_CHESTPLATE = config.getItem(Strings.VERDITE_CHESTPLATE_NAME, ItemIds.VERDITE_CHESTPLATE_DEFAULT).getInt(ItemIds.VERDITE_CHESTPLATE_DEFAULT);
ItemIds.VERDITE_LEGGINGS = config.getItem(Strings.VERDITE_LEGGINGS_NAME, ItemIds.VERDITE_LEGGINGS_DEFAULT).getInt(ItemIds.VERDITE_LEGGINGS_DEFAULT);
ItemIds.VERDITE_BOOTS = config.getItem(Strings.VERDITE_BOOTS_NAME, ItemIds.VERDITE_BOOTS_DEFAULT).getInt(ItemIds.VERDITE_BOOTS_DEFAULT);
ItemIds.MITHRIL_HELMET = config.getItem(Strings.MITHRIL_HELMET_NAME, ItemIds.MITHRIL_HELMET_DEFAULT).getInt(ItemIds.MITHRIL_HELMET_DEFAULT);
ItemIds.MITHRIL_CHESTPLATE = config.getItem(Strings.MITHRIL_CHESTPLATE_NAME, ItemIds.MITHRIL_CHESTPLATE_DEFAULT).getInt(ItemIds.MITHRIL_CHESTPLATE_DEFAULT);
ItemIds.MITHRIL_LEGGINGS = config.getItem(Strings.MITHRIL_LEGGINGS_NAME, ItemIds.MITHRIL_LEGGINGS_DEFAULT).getInt(ItemIds.MITHRIL_LEGGINGS_DEFAULT);
ItemIds.MITHRIL_BOOTS = config.getItem(Strings.MITHRIL_BOOTS_NAME, ItemIds.MITHRIL_BOOTS_DEFAULT).getInt(ItemIds.MITHRIL_BOOTS_DEFAULT);
ItemIds.ADAMANTINE_HELMET = config.getItem(Strings.ADAMANTINE_HELMET_NAME, ItemIds.ADAMANTINE_HELMET_DEFAULT).getInt(ItemIds.ADAMANTINE_HELMET_DEFAULT);
ItemIds.ADAMANTINE_CHESTPLATE = config.getItem(Strings.ADAMANTINE_CHESTPLATE_NAME, ItemIds.ADAMANTINE_CHESTPLATE_DEFAULT).getInt(ItemIds.ADAMANTINE_CHESTPLATE_DEFAULT);
ItemIds.ADAMANTINE_LEGGINGS = config.getItem(Strings.ADAMANTINE_LEGGINGS_NAME, ItemIds.ADAMANTINE_LEGGINGS_DEFAULT).getInt(ItemIds.ADAMANTINE_LEGGINGS_DEFAULT);
ItemIds.ADAMANTINE_BOOTS = config.getItem(Strings.ADAMANTINE_BOOTS_NAME, ItemIds.ADAMANTINE_BOOTS_DEFAULT).getInt(ItemIds.ADAMANTINE_BOOTS_DEFAULT);
ItemIds.IRIDIUM_HELMET = config.getItem(Strings.IRIDIUM_HELMET_NAME, ItemIds.IRIDIUM_HELMET_DEFAULT).getInt(ItemIds.IRIDIUM_HELMET_DEFAULT);
ItemIds.IRIDIUM_CHESTPLATE = config.getItem(Strings.IRIDIUM_CHESTPLATE_NAME, ItemIds.IRIDIUM_CHESTPLATE_DEFAULT).getInt(ItemIds.IRIDIUM_CHESTPLATE_DEFAULT);
ItemIds.IRIDIUM_LEGGINGS = config.getItem(Strings.IRIDIUM_LEGGINGS_NAME, ItemIds.IRIDIUM_LEGGINGS_DEFAULT).getInt(ItemIds.IRIDIUM_LEGGINGS_DEFAULT);
ItemIds.IRIDIUM_BOOTS = config.getItem(Strings.IRIDIUM_BOOTS_NAME, ItemIds.IRIDIUM_BOOTS_DEFAULT).getInt(ItemIds.IRIDIUM_BOOTS_DEFAULT);
ItemIds.FIRE_ORB = config.getItem(Strings.FIRE_ORB_NAME, ItemIds.FIRE_ORB_DEFAULT).getInt(ItemIds.FIRE_ORB_DEFAULT);
ItemIds.WATER_ORB = config.getItem(Strings.WATER_ORB_NAME, ItemIds.WATER_ORB_DEFAULT).getInt(ItemIds.WATER_ORB_DEFAULT);
ItemIds.EARTH_ORB = config.getItem(Strings.EARTH_ORB_NAME, ItemIds.EARTH_ORB_DEFAULT).getInt(ItemIds.EARTH_ORB_DEFAULT);
ItemIds.AIR_ORB = config.getItem(Strings.AIR_ORB_NAME, ItemIds.AIR_ORB_DEFAULT).getInt(ItemIds.AIR_ORB_DEFAULT);
ItemIds.ENERGY_ORB = config.getItem(Strings.ENERGY_ORB_NAME, ItemIds.ENERGY_ORB_DEFAULT).getInt(ItemIds.ENERGY_ORB_DEFAULT);
ItemIds.VOID_SHARD = config.getItem(Strings.VOID_SHARD_NAME, ItemIds.VOID_SHARD_DEFAULT).getInt(ItemIds.VOID_SHARD_DEFAULT);
config.save();
}
}
public static void save()
{
config.save();
}
public static void save() {
config.save();
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.Util;
package mysticworld.util;
import java.io.File;
import java.io.IOException;
@ -10,10 +10,11 @@ import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import MysticWorld.MysticWorld;
import mysticworld.MysticWorld;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.LanguageRegistry;
/*
*
* All credits go to copygirl (or copy....boy) for this one
@ -21,17 +22,14 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
* repository, many thanks friend c:
*
*/
public class Localizations {
private Localizations() {
}
public class Localizations
{
private Localizations(){}
public static void Initialize()
{
public static void Initialize() {
File source = Loader.instance().getReversedModObjectList().get(MysticWorld.instance).getSource();
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
for(String file : getResources(source, pattern))
{
for (String file : getResources(source, pattern)) {
Matcher matcher = pattern.matcher(file);
matcher.find();
String resource = "/" + matcher.group(1);
@ -40,73 +38,58 @@ public class Localizations
LanguageRegistry.instance().loadLocalization(resource, lang, isXML);
}
}
private static Collection<String> getResources(File file, Pattern pattern)
{
private static Collection<String> getResources(File file, Pattern pattern) {
ArrayList<String> retval = new ArrayList<String>();
if(file.isDirectory())
if (file.isDirectory())
retval.addAll(getResourcesFromDirectory(file, pattern));
else retval.addAll(getResourcesFromJarFile(file, pattern));
else
retval.addAll(getResourcesFromJarFile(file, pattern));
return retval;
}
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern)
{
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern) {
ArrayList<String> retval = new ArrayList<String>();
File[] FileList = directory.listFiles();
for (File file : FileList) {
if (file.isDirectory()) {
retval.addAll(getResourcesFromDirectory(file, pattern));
} else
try {
String fileName = file.getCanonicalPath().replace('\\', '/');
boolean accept = pattern.matcher(fileName).matches();
if (accept)
retval.add(fileName);
} catch (final IOException e) {
throw new Error(e);
}
}
return retval;
}
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern) {
ArrayList<String> retval = new ArrayList<String>();
ZipFile Zip;
try
{
try {
Zip = new ZipFile(file);
}
catch (ZipException Ex)
{
} catch (ZipException Ex) {
throw new Error(Ex);
}
catch(IOException Ex)
{
} catch (IOException Ex) {
throw new Error(Ex);
}
Enumeration<? extends ZipEntry> entries = Zip.entries();
while (entries.hasMoreElements())
{
while (entries.hasMoreElements()) {
ZipEntry ZipE = entries.nextElement();
String FileName = ZipE.getName();
boolean accept = pattern.matcher(FileName).matches();
if(accept)
if (accept)
retval.add(FileName);
}
try
{
try {
Zip.close();
}
catch(IOException Ex)
{
} catch (IOException Ex) {
throw new Error(Ex);
}
return retval;
}
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern)
{
ArrayList<String> retval = new ArrayList<String>();
File[] FileList = directory.listFiles();
for (File file : FileList)
{
if (file.isDirectory())
{
retval.addAll(getResourcesFromDirectory(file, pattern));
}
else try
{
String fileName = file.getCanonicalPath().replace('\\', '/');
boolean accept = pattern.matcher(fileName).matches();
if (accept) retval.add(fileName);
}
catch(final IOException e)
{
throw new Error(e);
}
}
return retval;
}
}

View file

@ -1,116 +1,86 @@
package MysticWorld.Util;
package mysticworld.util;
import mysticores.items.Items;
import mysticworld.items.ItemHandler$1;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import MysticOres.Items.Items;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Items.ItemHandler$1;
import cpw.mods.fml.common.registry.GameRegistry;
public class RecipeHandler {
public static void init(){
public static void init() {
itemRecipes();
itemSmelting();
}
private static void itemRecipes(){
private static void bootsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "# #", "# #", '#', input });
}
private static void chestplateRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "# #", "###", "###", '#', input });
}
private static void helmetRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "###", "# #", '#', input });
}
private static void itemRecipes() {
//Staff Hilt Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 1), new Object[] {
" # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond
});
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 1), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond });
//Staff Handle Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 2), new Object[] {
"#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder
});
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 2), new Object[] { "#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder });
//Staff Topper Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 3), new Object[] {
" # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar
});
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 3), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar });
//Staff Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 0), new Object[] {
" #", " X ", "Y ", '#', new ItemStack(ItemHandler$1.staffParts, 1, 3), 'X', new ItemStack(ItemHandler$1.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler$1.staffParts, 1, 1)
});
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 0), new Object[] { " #", " X ", "Y ", '#', new ItemStack(ItemHandler$1.staffParts, 1, 3), 'X',
new ItemStack(ItemHandler$1.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler$1.staffParts, 1, 1) });
//Orb Recipes
orbRecipe(ItemHandler$1.fireOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 0));
orbRecipe(ItemHandler$1.waterOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 1));
orbRecipe(ItemHandler$1.earthOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 2));
orbRecipe(ItemHandler$1.airOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 3));
orbRecipe(ItemHandler$1.energyOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 4));
//Staff Recipes
staffRecipe(ItemHandler$1.fireStaff, new ItemStack(ItemHandler$1.fireOrb));
staffRecipe(ItemHandler$1.waterStaff, new ItemStack(ItemHandler$1.waterOrb));
staffRecipe(ItemHandler$1.earthStaff, new ItemStack(ItemHandler$1.earthOrb));
staffRecipe(ItemHandler$1.airStaff, new ItemStack(ItemHandler$1.airOrb));
staffRecipe(ItemHandler$1.energyStaff, new ItemStack(ItemHandler$1.energyOrb));
//Verdite Armor
helmetRecipe(ItemHandler$1.verditeHelmet, new ItemStack(Items.Resource, 1, 0));
chestplateRecipe(ItemHandler$1.verditeChestplate, new ItemStack(Items.Resource, 1, 0));
leggingsRecipe(ItemHandler$1.verditeLeggings, new ItemStack(Items.Resource, 1, 0));
bootsRecipe(ItemHandler$1.verditeBoots, new ItemStack(Items.Resource, 1, 0));
//Mithril Armor
helmetRecipe(ItemHandler$1.mithrilHelmet, new ItemStack(Items.Resource, 1, 1));
chestplateRecipe(ItemHandler$1.mithrilChestplate, new ItemStack(Items.Resource, 1, 1));
leggingsRecipe(ItemHandler$1.mithrilLeggings, new ItemStack(Items.Resource, 1, 1));
bootsRecipe(ItemHandler$1.mithrilBoots, new ItemStack(Items.Resource, 1, 1));
//Adamantine Armor
helmetRecipe(ItemHandler$1.adamantineHelmet, new ItemStack(Items.Resource, 1, 2));
chestplateRecipe(ItemHandler$1.adamantineChestplate, new ItemStack(Items.Resource, 1, 2));
leggingsRecipe(ItemHandler$1.adamantineLeggings, new ItemStack(Items.Resource, 1, 2));
bootsRecipe(ItemHandler$1.adamantineBoots, new ItemStack(Items.Resource, 1, 2));
//Iridium Armor
helmetRecipe(ItemHandler$1.iridiumHelmet, new ItemStack(Items.Resource, 1, 3));
chestplateRecipe(ItemHandler$1.iridiumChestplate, new ItemStack(Items.Resource, 1, 3));
leggingsRecipe(ItemHandler$1.iridiumLeggings, new ItemStack(Items.Resource, 1, 3));
bootsRecipe(ItemHandler$1.iridiumBoots, new ItemStack(Items.Resource, 1, 3));
}
private static void itemSmelting(){
private static void itemSmelting() {
GameRegistry.addSmelting(ItemHandler$1.imbuedShard.itemID, new ItemStack(ItemHandler$1.voidShard, 1), 0.5f);
}
private static void staffRecipe(Item output, ItemStack input){
private static void leggingsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "###", "# #", "# #", '#', input });
}
private static void orbRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "##", "##", '#', input });
}
private static void staffRecipe(Item output, ItemStack input) {
GameRegistry.addShapelessRecipe(new ItemStack(output, 1), input, new ItemStack(ItemHandler$1.staffParts, 1, 0));
}
private static void orbRecipe(Item output, ItemStack input){
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
"##", "##", '#', input
});
}
private static void helmetRecipe(Item output, ItemStack input){
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
"###", "# #", '#', input
});
}
private static void chestplateRecipe(Item output, ItemStack input){
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
"# #", "###", "###", '#', input
});
}
private static void leggingsRecipe(Item output, ItemStack input){
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
"###", "# #", "# #", '#', input
});
}
private static void bootsRecipe(Item output, ItemStack input){
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
"# #", "# #", '#', input
});
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.Util;
package mysticworld.util;
public class Reference {

View file

@ -1,19 +1,16 @@
package MysticWorld.Util;
package mysticworld.util;
import net.minecraft.block.Block;
import mysticworld.items.ItemHandler$1;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import MysticWorld.Items.ItemHandler$1;
public class TabMysticWorld extends CreativeTabs {
public TabMysticWorld(int par1, String par2Str) {
super(par1, par2Str);
}
@Override
public ItemStack getIconItemStack() {
return new ItemStack(ItemHandler$1.earthStaff, 1);
return new ItemStack(ItemHandler$1.earthStaff, 1);
}
}

View file

@ -1,129 +1,113 @@
package MysticWorld.Util;
package mysticworld.util;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import MysticWorld.Blocks.BlockBush;
import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Blocks.BlockPlatform;
import MysticWorld.Items.ItemHandler$1;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import mysticworld.blocks.BlockHandler;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
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 implements IScheduledTickHandler {
private EnumSet ticks;
public static final Enchantment[] enchantmentsPick = { Enchantment.efficiency, Enchantment.fortune, Enchantment.silkTouch, Enchantment.unbreaking };
public TickHandler(){
public TickHandler() {
this.ticks = EnumSet.of(TickType.PLAYER);
}
public void tickStart(EnumSet<TickType> type, Object... tickData){
Random rand = new Random();
EntityPlayer player = (EntityPlayer)tickData[0];
World world = player.worldObj;
InventoryPlayer inventory = player.inventory;
ItemStack itemstack = inventory.getCurrentItem();
pillarTick(player, world, inventory, rand);
}
public void tickEnd(EnumSet<TickType> type, Object... tickData){
EntityPlayer player = (EntityPlayer)tickData[0];
World world = player.worldObj;
InventoryPlayer inventory = player.inventory;
}
public EnumSet ticks(){
return this.ticks;
}
public String getLabel(){
@Override
public String getLabel() {
return "mystic world tick";
}
public int nextTickSpacing(){
@Override
public int nextTickSpacing() {
return 20;
}
private static void pillarTick(EntityPlayer player, World world, InventoryPlayer inventory, Random rand)
{
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
EntityPlayer player = (EntityPlayer) tickData[0];
World world = player.worldObj;
InventoryPlayer inventory = player.inventory;
}
@Override
public EnumSet ticks() {
return this.ticks;
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
Random rand = new Random();
EntityPlayer player = (EntityPlayer) tickData[0];
World world = player.worldObj;
InventoryPlayer inventory = player.inventory;
ItemStack itemstack = inventory.getCurrentItem();
pillarTick(player, world, inventory, rand);
}
private static void pillarTick(EntityPlayer player, World world, InventoryPlayer inventory, Random rand) {
ItemStack itemStack = inventory.getCurrentItem();
int blockX = (int)player.posX - 1;
int blockY = (int)(player.posY - 0.15D);
int blockZ = (int)player.posZ - 1;
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);
int blockMeta = world.getBlockMetadata(blockX, blockY, blockZ);
if (blockId == BlockHandler.pillarPlatform.blockID)
{
switch (blockMeta)
{
//food
case 0:
int foodLevel = player.getFoodStats().getFoodLevel();
player.getFoodStats().setFoodLevel((int)((double)foodLevel + 0.5D));
player.getFoodStats().setFoodSaturationLevel(20);
break;
//regeneration
case 1:
player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 6000, 4));
break;
//speed
case 2:
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 6000, 4));
break;
//haste
case 3:
player.addPotionEffect(new PotionEffect(Potion.digSpeed.getId(), 6000, 4));
break;
//resistance
case 4:
player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 6000, 4));
break;
//jump boost
case 5:
player.addPotionEffect(new PotionEffect(Potion.jump.getId(), 6000, 4));
break;
//fire
case 6:
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 6000, 4));
break;
//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))
{
if (itemStack.isItemEnchanted() != true && player.experienceLevel >= 10)
{
player.experienceLevel -= 10;
itemStack.addEnchantment(enchantmentsPick[rand.nextInt(3)], rand.nextInt(4) + 1);
}
}
break;
default:
break;
}
}
if (blockId == BlockHandler.pillarPlatform.blockID) {
switch (blockMeta) {
//food
case 0:
int foodLevel = player.getFoodStats().getFoodLevel();
player.getFoodStats().setFoodLevel((int) (foodLevel + 0.5D));
player.getFoodStats().setFoodSaturationLevel(20);
break;
//regeneration
case 1:
player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 6000, 4));
break;
//speed
case 2:
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 6000, 4));
break;
//haste
case 3:
player.addPotionEffect(new PotionEffect(Potion.digSpeed.getId(), 6000, 4));
break;
//resistance
case 4:
player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 6000, 4));
break;
//jump boost
case 5:
player.addPotionEffect(new PotionEffect(Potion.jump.getId(), 6000, 4));
break;
//fire
case 6:
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 6000, 4));
break;
//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)) {
if (itemStack.isItemEnchanted() != true && player.experienceLevel >= 10) {
player.experienceLevel -= 10;
itemStack.addEnchantment(enchantmentsPick[rand.nextInt(3)], rand.nextInt(4) + 1);
}
}
break;
default:
break;
}
}
}
}

View file

@ -1,30 +1,24 @@
package MysticWorld.WorldGen;
package mysticworld.worldgen;
import java.util.Random;
import MysticWorld.Blocks.BlockHandler;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BushesGen extends WorldGenerator
{
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
int bushType = par2Random.nextInt(12);
for (int l = 0; l < 20; ++l)
{
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);
}
}
return true;
}
public class BushesGen extends WorldGenerator {
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
int bushType = par2Random.nextInt(12);
for (int l = 0; l < 20; ++l) {
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);
}
}
return true;
}
}

View file

@ -1,28 +1,23 @@
package MysticWorld.WorldGen;
package mysticworld.worldgen;
import java.util.Random;
import MysticWorld.Blocks.BlockHandler;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class StonesGen extends WorldGenerator
{
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
for (int l = 0; l < 1; ++l)
{
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);
}
}
return true;
}
public class StonesGen extends WorldGenerator {
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
for (int l = 0; l < 1; ++l) {
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);
}
}
return true;
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.WorldGen;
package mysticworld.worldgen;
import java.util.Random;

View file

@ -1,16 +1,12 @@
package MysticWorld.WorldGen;
package mysticworld.worldgen;
import MysticWorld.Lib.Booleans;
import mysticworld.lib.Booleans;
import cpw.mods.fml.common.registry.GameRegistry;
public class WorldGenHandler$1 {
public static void init()
{
if(Booleans.ENABLE_BUSH_GEN)
public static void init() {
if (Booleans.ENABLE_BUSH_GEN)
GameRegistry.registerWorldGenerator(new WorldGenBushes());
GameRegistry.registerWorldGenerator(new WorldGenStones());
}
}

View file

@ -1,4 +1,4 @@
package MysticWorld.WorldGen;
package mysticworld.worldgen;
import java.util.Random;