Initial commit!
This commit is contained in:
commit
d15d9ac848
61 changed files with 4590 additions and 0 deletions
25
common/MysticWorld/Biome/BiomeGenBasic.java
Normal file
25
common/MysticWorld/Biome/BiomeGenBasic.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package MysticWorld.Biome;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class BiomeGenBasic extends BiomeGenBase {
|
||||
|
||||
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||
super(id);
|
||||
this.topBlock = (byte) blockTop;
|
||||
this.fillerBlock = (byte) blockFiller;
|
||||
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
||||
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
||||
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
||||
this.theBiomeDecorator.reedsPerChunk = reedsChunk;;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
29
common/MysticWorld/Biome/BiomeGenGlacier.java
Normal file
29
common/MysticWorld/Biome/BiomeGenGlacier.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package MysticWorld.Biome;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class BiomeGenGlacier extends BiomeGenBase {
|
||||
|
||||
public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||
super(id);
|
||||
this.topBlock = (byte) blockTop;
|
||||
this.fillerBlock = (byte) blockFiller;
|
||||
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
||||
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
||||
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
||||
this.theBiomeDecorator.reedsPerChunk = reedsChunk;;
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableMonsterList.clear();
|
||||
this.spawnableWaterCreatureList.clear();
|
||||
this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.entity.passive.EntityWolf.class, 5, 4, 4));
|
||||
this.waterColorMultiplier = 15397370;
|
||||
}
|
||||
}
|
||||
|
||||
58
common/MysticWorld/Biome/BiomeGenJungle.java
Normal file
58
common/MysticWorld/Biome/BiomeGenJungle.java
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package MysticWorld.Biome;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.passive.EntityChicken;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenHugeTrees;
|
||||
import net.minecraft.world.gen.feature.WorldGenShrub;
|
||||
import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
||||
import net.minecraft.world.gen.feature.WorldGenTrees;
|
||||
import net.minecraft.world.gen.feature.WorldGenVines;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class BiomeGenJungle extends BiomeGenBase
|
||||
{
|
||||
public BiomeGenJungle(int par1)
|
||||
{
|
||||
super(par1);
|
||||
this.theBiomeDecorator.treesPerChunk = 50;
|
||||
this.theBiomeDecorator.grassPerChunk = 25;
|
||||
this.theBiomeDecorator.flowersPerChunk = 4;
|
||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a WorldGen appropriate for this biome.
|
||||
*/
|
||||
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
|
||||
{
|
||||
return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenHugeTrees(false, 10 + par1Random.nextInt(20), 3, 3) : new WorldGenTrees(false, 4 + par1Random.nextInt(7), 3, 3, true)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a WorldGen appropriate for this biome.
|
||||
*/
|
||||
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
|
||||
{
|
||||
return par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1);
|
||||
}
|
||||
|
||||
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||
{
|
||||
super.decorate(par1World, par2Random, par3, par4);
|
||||
WorldGenVines worldgenvines = new WorldGenVines();
|
||||
|
||||
for (int k = 0; k < 50; ++k)
|
||||
{
|
||||
int l = par3 + par2Random.nextInt(16) + 8;
|
||||
byte b0 = 64;
|
||||
int i1 = par4 + par2Random.nextInt(16) + 8;
|
||||
worldgenvines.generate(par1World, par2Random, l, b0, i1);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
common/MysticWorld/Biome/BiomeGenMountain.java
Normal file
23
common/MysticWorld/Biome/BiomeGenMountain.java
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package MysticWorld.Biome;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class BiomeGenMountain extends BiomeGenBase {
|
||||
|
||||
public BiomeGenMountain(int id, int blockTop, int blockFiller)
|
||||
{
|
||||
super(id);
|
||||
this.topBlock = (byte) blockTop;
|
||||
this.fillerBlock = (byte) blockFiller;
|
||||
}
|
||||
}
|
||||
|
||||
28
common/MysticWorld/Biome/BiomeGenTundra.java
Normal file
28
common/MysticWorld/Biome/BiomeGenTundra.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package MysticWorld.Biome;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class BiomeGenTundra extends BiomeGenBase {
|
||||
|
||||
public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||
super(id);
|
||||
this.topBlock = (byte) blockTop;
|
||||
this.fillerBlock = (byte) blockFiller;
|
||||
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
||||
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
||||
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
||||
this.theBiomeDecorator.reedsPerChunk = reedsChunk;;
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableMonsterList.clear();
|
||||
this.spawnableWaterCreatureList.clear();
|
||||
this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.entity.passive.EntityWolf.class, 5, 4, 4));
|
||||
}
|
||||
}
|
||||
|
||||
63
common/MysticWorld/Biome/BiomeHandler.java
Normal file
63
common/MysticWorld/Biome/BiomeHandler.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package MysticWorld.Biome;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeDecorator;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeManager;
|
||||
|
||||
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()
|
||||
{
|
||||
initializeBiomes();
|
||||
registerBiomes();
|
||||
addSpawnBiomes();
|
||||
addStructureBiomes();
|
||||
}
|
||||
|
||||
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);;
|
||||
}
|
||||
|
||||
public static void registerBiomes()
|
||||
{
|
||||
GameRegistry.removeBiome(BiomeGenBase.jungle);
|
||||
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
|
||||
GameRegistry.addBiome(Mountain);
|
||||
GameRegistry.addBiome(Tundra);
|
||||
GameRegistry.addBiome(Steppe);
|
||||
GameRegistry.addBiome(Glacier);
|
||||
GameRegistry.addBiome(Jungle);
|
||||
}
|
||||
|
||||
public static void addSpawnBiomes()
|
||||
{
|
||||
BiomeManager.addSpawnBiome(Steppe);
|
||||
BiomeManager.addSpawnBiome(Mountain);
|
||||
BiomeManager.addSpawnBiome(Jungle);
|
||||
}
|
||||
|
||||
public static void addStructureBiomes()
|
||||
{
|
||||
BiomeManager.addVillageBiome(Steppe, true);
|
||||
|
||||
BiomeManager.addStrongholdBiome(Glacier);
|
||||
BiomeManager.addStrongholdBiome(Mountain);
|
||||
BiomeManager.addStrongholdBiome(Steppe);
|
||||
BiomeManager.addStrongholdBiome(Tundra);
|
||||
BiomeManager.addStrongholdBiome(Jungle);
|
||||
}
|
||||
}
|
||||
196
common/MysticWorld/Blocks/BlockBush.java
Normal file
196
common/MysticWorld/Blocks/BlockBush.java
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
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 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;
|
||||
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;
|
||||
|
||||
public class BlockBush extends Block implements IPlantable{
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
public BlockBush(int id) {
|
||||
super(id, Material.leaves);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setHardness(0.3F);
|
||||
setResistance(0.1F);
|
||||
setStepSound(Block.soundGrassFootstep);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "Bush_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
//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)
|
||||
{
|
||||
return EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
//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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
46
common/MysticWorld/Blocks/BlockHandler.java
Normal file
46
common/MysticWorld/Blocks/BlockHandler.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
package MysticWorld.Blocks;
|
||||
|
||||
import MysticWorld.Lib.BlockIds;
|
||||
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 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;
|
||||
|
||||
public class BlockHandler {
|
||||
|
||||
public static Block OreImbuedStone;
|
||||
public static Block bush;
|
||||
|
||||
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);
|
||||
|
||||
registerBlocks();
|
||||
setBlockHarvestLevels();
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
GameRegistry.registerBlock(OreImbuedStone, ItemBlockImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
||||
GameRegistry.registerBlock(bush, ItemBlockBush.class, Strings.BUSH_NAME);
|
||||
|
||||
GameRegistry.registerWorldGenerator(new WorldGenBushes());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenStones());
|
||||
|
||||
}
|
||||
|
||||
private static void setBlockHarvestLevels() {
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 0, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 1, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 2, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 3, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 4, "pickaxe", 2);
|
||||
}
|
||||
}
|
||||
133
common/MysticWorld/Blocks/BlockImbuedStone.java
Normal file
133
common/MysticWorld/Blocks/BlockImbuedStone.java
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
package MysticWorld.Blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "OreStone_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
//meta specific stuff
|
||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
for(int j=0;j<5;j++)
|
||||
{
|
||||
list.add(new ItemStack(i,1,j));
|
||||
}
|
||||
}
|
||||
}
|
||||
53
common/MysticWorld/Blocks/ItemBlockBush.java
Normal file
53
common/MysticWorld/Blocks/ItemBlockBush.java
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
package MysticWorld.Blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import MysticWorld.Lib.Strings;
|
||||
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockBush extends ItemBlock {
|
||||
|
||||
public ItemBlockBush(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return Strings.BUSH_NAME;
|
||||
case 1:return Strings.POISON_BUSH_NAME;
|
||||
case 2:return Strings.WEAKNESS_BUSH_NAME;
|
||||
case 3:return Strings.SLOWNESS_BUSH_NAME;
|
||||
case 4:return Strings.HARMING_BUSH_NAME;
|
||||
case 5:return Strings.WITHER_BUSH_NAME;
|
||||
case 6:return Strings.HEALTH_BUSH_NAME;
|
||||
case 7:return Strings.SPEED_BUSH_NAME;
|
||||
case 8:return Strings.FIRE_RESISTANCE_BUSH_NAME;
|
||||
case 9:return Strings.REGEN_BUSH_NAME;
|
||||
case 10:return Strings.NIGHT_VISION_BUSH_NAME;
|
||||
case 11:return Strings.INVISIBILITY_BUSH_NAME;
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return BlockHandler.bush.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
43
common/MysticWorld/Blocks/ItemBlockImbuedStone.java
Normal file
43
common/MysticWorld/Blocks/ItemBlockImbuedStone.java
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package MysticWorld.Blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockImbuedStone extends ItemBlock {
|
||||
|
||||
public ItemBlockImbuedStone(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return "Fire";
|
||||
case 1:return "Water";
|
||||
case 2:return "Earth";
|
||||
case 3:return "Air";
|
||||
case 4:return "Energy";
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return BlockHandler.OreImbuedStone.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
75
common/MysticWorld/Client/ClientProxy.java
Normal file
75
common/MysticWorld/Client/ClientProxy.java
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
package MysticWorld.Client;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.client.renderer.entity.RenderFireball;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
import MysticWorld.CommonProxy;
|
||||
import MysticWorld.Client.FX.AirFX;
|
||||
import MysticWorld.Client.FX.EarthFX;
|
||||
import MysticWorld.Client.FX.EnergyFX;
|
||||
import MysticWorld.Client.FX.FireFX;
|
||||
import MysticWorld.Client.FX.WaterFX;
|
||||
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.Renderer.RenderStaffPower;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
public int addArmor(String armor)
|
||||
{
|
||||
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
||||
}
|
||||
|
||||
//particles
|
||||
@Override
|
||||
public void airFX(World worldObj, double x, double y, double z, float scale)
|
||||
{
|
||||
AirFX airFX = new AirFX(worldObj, x, y, z, scale);
|
||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void earthFX(World worldObj, double x, double y, double z, float scale)
|
||||
{
|
||||
EarthFX earthFX = new EarthFX(worldObj, x, y, z, scale);
|
||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(earthFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void energyFX(World worldObj, double x, double y, double z, float scale)
|
||||
{
|
||||
EnergyFX energyFX = new EnergyFX(worldObj, x, y, z, scale);
|
||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(energyFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireFX(World worldObj, double x, double y, double z, float scale)
|
||||
{
|
||||
FireFX fireFX = new FireFX(worldObj, x, y, z, scale);
|
||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(fireFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void waterFX(World worldObj, double x, double y, double z, float scale)
|
||||
{
|
||||
WaterFX waterFX = new WaterFX(worldObj, x, y, z, scale);
|
||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(waterFX);
|
||||
}
|
||||
|
||||
}
|
||||
85
common/MysticWorld/Client/FX/AirFX.java
Normal file
85
common/MysticWorld/Client/FX/AirFX.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
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.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AirFX extends EntityFX
|
||||
{
|
||||
public AirFX(World world, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public AirFX(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.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.99D;
|
||||
this.motionY *= 0.99D;
|
||||
this.motionZ *= 0.99D;
|
||||
|
||||
if (this.particleMaxAge-- <= 0)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
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("/mods/MysticTextures/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.bindTexture("/particles.png");
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
85
common/MysticWorld/Client/FX/EarthFX.java
Normal file
85
common/MysticWorld/Client/FX/EarthFX.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
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.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EarthFX extends EntityFX
|
||||
{
|
||||
public EarthFX(World world, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public EarthFX(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.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.99D;
|
||||
this.motionY *= 0.99D;
|
||||
this.motionZ *= 0.99D;
|
||||
|
||||
if (this.particleMaxAge-- <= 0)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
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("/mods/MysticTextures/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.bindTexture("/particles.png");
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
85
common/MysticWorld/Client/FX/EnergyFX.java
Normal file
85
common/MysticWorld/Client/FX/EnergyFX.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
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.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EnergyFX extends EntityFX
|
||||
{
|
||||
public EnergyFX(World world, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public EnergyFX(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.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.99D;
|
||||
this.motionY *= 0.99D;
|
||||
this.motionZ *= 0.99D;
|
||||
|
||||
if (this.particleMaxAge-- <= 0)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
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("/mods/MysticTextures/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.bindTexture("/particles.png");
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
86
common/MysticWorld/Client/FX/FireFX.java
Normal file
86
common/MysticWorld/Client/FX/FireFX.java
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
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.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FireFX extends EntityFX
|
||||
{
|
||||
public FireFX(World world, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public FireFX(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.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.99D;
|
||||
this.motionY *= 0.99D;
|
||||
this.motionZ *= 0.99D;
|
||||
|
||||
if (this.particleMaxAge-- <= 0)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
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("/mods/MysticTextures/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.bindTexture("/particles.png");
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
|
||||
85
common/MysticWorld/Client/FX/WaterFX.java
Normal file
85
common/MysticWorld/Client/FX/WaterFX.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
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.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class WaterFX extends EntityFX
|
||||
{
|
||||
public WaterFX(World world, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public WaterFX(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.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.99D;
|
||||
this.motionY *= 0.99D;
|
||||
this.motionZ *= 0.99D;
|
||||
|
||||
if (this.particleMaxAge-- <= 0)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
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("/mods/MysticTextures/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.bindTexture("/particles.png");
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
33
common/MysticWorld/CommonProxy.java
Normal file
33
common/MysticWorld/CommonProxy.java
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package MysticWorld;
|
||||
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.world.World;
|
||||
import MysticWorld.Client.FX.AirFX;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
public int addArmor(String armor)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void registerRenders(){
|
||||
}
|
||||
|
||||
//particles
|
||||
public void airFX(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 fireFX(World worldObj, double x, double y, double z, float scale){
|
||||
}
|
||||
|
||||
public void waterFX(World worldObj, double x, double y, double z, float scale){
|
||||
}
|
||||
|
||||
}
|
||||
65
common/MysticWorld/Config.java
Normal file
65
common/MysticWorld/Config.java
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
package MysticWorld;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import MysticWorld.Lib.BlockIds;
|
||||
import MysticWorld.Lib.EntityIds;
|
||||
import MysticWorld.Lib.ItemIds;
|
||||
import MysticWorld.Lib.Strings;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
||||
public class Config
|
||||
{
|
||||
public static Configuration config;
|
||||
|
||||
public static void initialize(File file)
|
||||
{
|
||||
config = new Configuration(file);
|
||||
|
||||
//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);
|
||||
|
||||
//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);
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
public static void save()
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
239
common/MysticWorld/Entity/EntityChargeAir.java
Normal file
239
common/MysticWorld/Entity/EntityChargeAir.java
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
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 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;
|
||||
|
||||
public class EntityChargeAir extends Entity {
|
||||
|
||||
public EntityLiving 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 inTile = 0;
|
||||
private int ticksAlive;
|
||||
private int ticksInAir = 0;
|
||||
|
||||
public EntityChargeAir(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeAir(World par1World, EntityLiving par2EntityLiving)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.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 = par2EntityLiving;
|
||||
}
|
||||
|
||||
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(vec3, vec31);
|
||||
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((double)f, (double)f, (double)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 * (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.airFX(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, 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 != entityPlayer && par1MovingObjectPosition.entityHit != entityDragon && par1MovingObjectPosition.entityHit != entityWither)
|
||||
{
|
||||
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, 2.5, 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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
251
common/MysticWorld/Entity/EntityChargeEarth.java
Normal file
251
common/MysticWorld/Entity/EntityChargeEarth.java
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
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 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;
|
||||
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;
|
||||
|
||||
public class EntityChargeEarth extends Entity {
|
||||
|
||||
public EntityLiving 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 inTile = 0;
|
||||
private int ticksAlive;
|
||||
private int ticksInAir = 0;
|
||||
|
||||
public EntityChargeEarth(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeEarth(World par1World, EntityLiving par2EntityLiving)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.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 = par2EntityLiving;
|
||||
}
|
||||
|
||||
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(vec3, vec31);
|
||||
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((double)f, (double)f, (double)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 * (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, this.posY + 0.5D, this.posZ, 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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
230
common/MysticWorld/Entity/EntityChargeEnergy.java
Normal file
230
common/MysticWorld/Entity/EntityChargeEnergy.java
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
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 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;
|
||||
|
||||
public class EntityChargeEnergy extends Entity {
|
||||
|
||||
public EntityLiving shootingEntity;
|
||||
private boolean inGround = false;
|
||||
private int xTile = -1;
|
||||
private int yTile = -1;
|
||||
private int zTile = -1;
|
||||
private int inTile = 0;
|
||||
private int ticksAlive;
|
||||
private int ticksInAir = 0;
|
||||
|
||||
public EntityChargeEnergy(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeEnergy(World par1World, EntityLiving par2EntityLiving)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.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 = par2EntityLiving;
|
||||
}
|
||||
|
||||
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(vec3, vec31);
|
||||
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((double)f, (double)f, (double)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 * (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, this.posY + 0.5D, this.posZ, 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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
239
common/MysticWorld/Entity/EntityChargeFire.java
Normal file
239
common/MysticWorld/Entity/EntityChargeFire.java
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
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 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;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityChargeFire extends Entity {
|
||||
|
||||
public EntityLiving shootingEntity;
|
||||
private boolean inGround = false;
|
||||
private int xTile = -1;
|
||||
private int yTile = -1;
|
||||
private int zTile = -1;
|
||||
private int inTile = 0;
|
||||
private int ticksAlive;
|
||||
private int ticksInAir = 0;
|
||||
|
||||
public EntityChargeFire(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeFire(World par1World, EntityLiving par2EntityLiving)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.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 = par2EntityLiving;
|
||||
}
|
||||
|
||||
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(vec3, vec31);
|
||||
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((double)f, (double)f, (double)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 * (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, this.posY + 0.5D, this.posZ, 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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
233
common/MysticWorld/Entity/EntityChargeWater.java
Normal file
233
common/MysticWorld/Entity/EntityChargeWater.java
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
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 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;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityChargeWater extends Entity {
|
||||
|
||||
public EntityLiving shootingEntity;
|
||||
private boolean inGround = false;
|
||||
private int xTile = -1;
|
||||
private int yTile = -1;
|
||||
private int zTile = -1;
|
||||
private int inTile = 0;
|
||||
private int ticksAlive;
|
||||
private int ticksInAir = 0;
|
||||
|
||||
public EntityChargeWater(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeWater(World par1World, EntityLiving par2EntityLiving)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.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 = par2EntityLiving;
|
||||
}
|
||||
|
||||
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(vec3, vec31);
|
||||
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((double)f, (double)f, (double)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 * (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, this.posY + 0.5D, this.posZ, 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);
|
||||
}
|
||||
}
|
||||
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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
30
common/MysticWorld/Entity/EntityHandler.java
Normal file
30
common/MysticWorld/Entity/EntityHandler.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package MysticWorld.Entity;
|
||||
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
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(){
|
||||
registerEntities();
|
||||
}
|
||||
|
||||
public static void registerEntities(){
|
||||
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, EntityIds.ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||
EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, EntityIds.ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false);
|
||||
EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, EntityIds.ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||
EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, EntityIds.ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||
EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, EntityIds.ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||
|
||||
EntityRegistry.registerModEntity(EntityPigman.class, Strings.ENTITY_PIGMAN_NAME, EntityIds.ENTITY_PIGMAN, MysticWorld.instance, 80, 3, false);
|
||||
|
||||
BiomeGenBase[] overworldbiomes = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.PLAINS.DESERT.MAGICAL.MOUNTAIN.FOREST.HILLS);
|
||||
|
||||
EntityRegistry.addSpawn(EntityPigman.class, 10, 2, 12, EnumCreatureType.creature, overworldbiomes);
|
||||
}
|
||||
}
|
||||
133
common/MysticWorld/Entity/EntityPigman.java
Normal file
133
common/MysticWorld/Entity/EntityPigman.java
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
package MysticWorld.Entity;
|
||||
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.ai.EntityAIControlledByPlayer;
|
||||
import net.minecraft.entity.ai.EntityAIFollowParent;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIMate;
|
||||
import net.minecraft.entity.ai.EntityAIPanic;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAITempt;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityPigman extends EntityAnimal
|
||||
{
|
||||
public EntityPigman(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
this.texture = "/mob/pigman.png";
|
||||
this.setSize(0.9F, 0.9F);
|
||||
this.getNavigator().setAvoidsWater(true);
|
||||
float f = 0.25F;
|
||||
this.tasks.addTask(0, new EntityAISwimming(this));
|
||||
this.tasks.addTask(1, new EntityAIPanic(this, 0.38F));
|
||||
this.tasks.addTask(3, new EntityAIMate(this, f));
|
||||
this.tasks.addTask(4, new EntityAITempt(this, 0.3F, Item.carrot.itemID, false));
|
||||
this.tasks.addTask(5, new EntityAIFollowParent(this, 0.28F));
|
||||
this.tasks.addTask(6, new EntityAIWander(this, f));
|
||||
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
|
||||
this.tasks.addTask(8, new EntityAILookIdle(this));
|
||||
}
|
||||
|
||||
|
||||
public boolean isAIEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getMaxHealth()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
protected void updateAITasks()
|
||||
{
|
||||
super.updateAITasks();
|
||||
}
|
||||
|
||||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
protected String getLivingSound()
|
||||
{
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String getDeathSound()
|
||||
{
|
||||
return "mob.pig.death";
|
||||
}
|
||||
|
||||
protected void playStepSound(int par1, int par2, int par3, int par4)
|
||||
{
|
||||
this.playSound("mob.pig.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected int getDropItemId()
|
||||
{
|
||||
return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID;
|
||||
}
|
||||
|
||||
protected void dropFewItems(boolean par1, int par2)
|
||||
{
|
||||
int j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2);
|
||||
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
if (this.isBurning())
|
||||
{
|
||||
this.dropItem(Item.porkCooked.itemID, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dropItem(Item.porkRaw.itemID, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt)
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
|
||||
entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
this.worldObj.spawnEntityInWorld(entitypigzombie);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public EntityPigman spawnBabyAnimal(EntityAgeable par1EntityAgeable)
|
||||
{
|
||||
return new EntityPigman(this.worldObj);
|
||||
}
|
||||
|
||||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return par1ItemStack != null && par1ItemStack.itemID == Item.carrot.itemID;
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable par1EntityAgeable)
|
||||
{
|
||||
return this.spawnBabyAnimal(par1EntityAgeable);
|
||||
}
|
||||
}
|
||||
12
common/MysticWorld/Items/EnumArmor.java
Normal file
12
common/MysticWorld/Items/EnumArmor.java
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
|
||||
public class EnumArmor
|
||||
{
|
||||
static EnumArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5);
|
||||
static EnumArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9);
|
||||
static EnumArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13);
|
||||
static EnumArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15);
|
||||
}
|
||||
58
common/MysticWorld/Items/ItemAdamantineArmor.java
Normal file
58
common/MysticWorld/Items/ItemAdamantineArmor.java
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.IArmorTextureProvider;
|
||||
|
||||
public class ItemAdamantineArmor extends ItemArmor implements IArmorTextureProvider
|
||||
{
|
||||
int ArmorType;
|
||||
|
||||
String ArmorFile_1;
|
||||
String ArmorFile_2;
|
||||
|
||||
public ItemAdamantineArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||
|
||||
super(par1, par2EnumArmorMaterial,par3,par4);
|
||||
this.ArmorType=par4;
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
this.ArmorFile_1 = "/mods/MysticTextures/textures/armor/adamantine_1.png";
|
||||
this.ArmorFile_2 = "/mods/MysticTextures/textures/armor/adamantine_2.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
switch (ArmorType){
|
||||
case 0:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.helmetAdamantine");
|
||||
break;
|
||||
case 1:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.chestplateAdamantine");
|
||||
break;
|
||||
case 2:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.leggingsAdamantine");
|
||||
break;
|
||||
case 3:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.bootsAdamantine");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public String getArmorTextureFile(ItemStack par1){
|
||||
if(par1.itemID == ItemHandler$1.adamantineHelmet.itemID||par1.itemID == ItemHandler$1.adamantineChestplate.itemID||par1.itemID == ItemHandler$1.adamantineBoots.itemID)
|
||||
{
|
||||
return ArmorFile_1;
|
||||
}
|
||||
if(par1.itemID == ItemHandler$1.adamantineLeggings.itemID)
|
||||
{
|
||||
return ArmorFile_2;
|
||||
}
|
||||
return ArmorFile_2;
|
||||
|
||||
}
|
||||
}
|
||||
179
common/MysticWorld/Items/ItemBushFruit.java
Normal file
179
common/MysticWorld/Items/ItemBushFruit.java
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Reference;
|
||||
import MysticWorld.Lib.Strings;
|
||||
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemBushFruit extends ItemFood {
|
||||
|
||||
private Icon[] icons;
|
||||
|
||||
private static final String[] FRUIT_TYPES = new String[] {"Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "Fire Resistance", "Regen", "Night Vision", "Invisibility"};
|
||||
|
||||
|
||||
public ItemBushFruit(int id, int health)
|
||||
{
|
||||
super(id, health, 0.6F, false);
|
||||
this.setHasSubtypes(true);
|
||||
this.setUnlocalizedName(Strings.BUSH_FRUIT_NAME);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
maxStackSize = 64;
|
||||
setAlwaysEdible();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack itemstack)
|
||||
{
|
||||
return 24;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
|
||||
return super.getUnlocalizedName() + FRUIT_TYPES[meta];
|
||||
}
|
||||
|
||||
@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("MysticTextures" + ":" + "item.fruit_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
96
common/MysticWorld/Items/ItemHandler$1.java
Normal file
96
common/MysticWorld/Items/ItemHandler$1.java
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
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 net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraftforge.liquids.LiquidDictionary;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
public class ItemHandler$1 {
|
||||
|
||||
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 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 ItemStaffPower;
|
||||
|
||||
public static Item bushFruit;
|
||||
|
||||
public static void init(){
|
||||
|
||||
staffParts = new ItemStaffParts(ItemIds.STAFF_PARTS).setUnlocalizedName(Strings.STAFF_NAME);
|
||||
|
||||
imbuedShard = new ItemImbuedShard(ItemIds.IMBUED_SHARD).setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
|
||||
|
||||
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);
|
||||
|
||||
ItemStaffPower = new ItemStaffPower(ItemIds.STAFF_POWER);
|
||||
|
||||
bushFruit = new ItemBushFruit(ItemIds.BUSH_FRUIT, 2).setUnlocalizedName(Strings.BUSH_FRUIT_NAME);
|
||||
|
||||
verditeHelmet = new ItemVerditeArmor(ItemIds.VERDITE_HELMET, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 0).setUnlocalizedName(Strings.VERDITE_HELMET_NAME);
|
||||
verditeChestplate = new ItemVerditeArmor(ItemIds.VERDITE_CHESTPLATE, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 1).setUnlocalizedName(Strings.VERDITE_CHESTPLATE_NAME);
|
||||
verditeLeggings = new ItemVerditeArmor(ItemIds.VERDITE_LEGGINGS, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 2).setUnlocalizedName(Strings.VERDITE_LEGGINGS_NAME);
|
||||
verditeBoots = new ItemVerditeArmor(ItemIds.VERDITE_BOOTS, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 3).setUnlocalizedName(Strings.VERDITE_BOOTS_NAME);
|
||||
|
||||
mithrilHelmet = new ItemMithrilArmor(ItemIds.MITHRIL_HELMET, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 0).setUnlocalizedName(Strings.MITHRIL_HELMET_NAME);
|
||||
mithrilChestplate = new ItemMithrilArmor(ItemIds.MITHRIL_CHESTPLATE, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 1).setUnlocalizedName(Strings.MITHRIL_CHESTPLATE_NAME);
|
||||
mithrilLeggings = new ItemMithrilArmor(ItemIds.MITHRIL_LEGGINGS, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 2).setUnlocalizedName(Strings.MITHRIL_LEGGINGS_NAME);
|
||||
mithrilBoots = new ItemMithrilArmor(ItemIds.MITHRIL_BOOTS, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 3).setUnlocalizedName(Strings.MITHRIL_BOOTS_NAME);
|
||||
|
||||
adamantineHelmet = new ItemAdamantineArmor(ItemIds.ADAMANTINE_HELMET, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 0).setUnlocalizedName(Strings.ADAMANTINE_HELMET_NAME);
|
||||
adamantineChestplate = new ItemAdamantineArmor(ItemIds.ADAMANTINE_CHESTPLATE, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 1).setUnlocalizedName(Strings.ADAMANTINE_CHESTPLATE_NAME);
|
||||
adamantineLeggings = new ItemAdamantineArmor(ItemIds.ADAMANTINE_LEGGINGS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 2).setUnlocalizedName(Strings.ADAMANTINE_LEGGINGS_NAME);
|
||||
adamantineBoots = new ItemAdamantineArmor(ItemIds.ADAMANTINE_BOOTS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 3).setUnlocalizedName(Strings.ADAMANTINE_BOOTS_NAME);
|
||||
|
||||
iridiumHelmet = new ItemIridiumArmor(ItemIds.IRIDIUM_HELMET, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 0).setUnlocalizedName(Strings.IRIDIUM_HELMET_NAME);
|
||||
iridiumChestplate = new ItemIridiumArmor(ItemIds.IRIDIUM_CHESTPLATE, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 1).setUnlocalizedName(Strings.IRIDIUM_CHESTPLATE_NAME);
|
||||
iridiumLeggings = new ItemIridiumArmor(ItemIds.IRIDIUM_LEGGINGS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 2).setUnlocalizedName(Strings.IRIDIUM_LEGGINGS_NAME);
|
||||
iridiumBoots = new ItemIridiumArmor(ItemIds.IRIDIUM_BOOTS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 3).setUnlocalizedName(Strings.IRIDIUM_BOOTS_NAME);
|
||||
}
|
||||
}
|
||||
62
common/MysticWorld/Items/ItemImbuedShard.java
Normal file
62
common/MysticWorld/Items/ItemImbuedShard.java
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.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 ItemMysticWorld {
|
||||
|
||||
private Icon[] icons;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@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("MysticTextures" + ":" + "item.shard_" + 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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
104
common/MysticWorld/Items/ItemIridiumArmor.java
Normal file
104
common/MysticWorld/Items/ItemIridiumArmor.java
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
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.EnumArmorMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IArmorTextureProvider;
|
||||
|
||||
public class ItemIridiumArmor extends ItemArmor implements IArmorTextureProvider
|
||||
{
|
||||
int ArmorType;
|
||||
|
||||
String ArmorFile_1;
|
||||
String ArmorFile_2;
|
||||
|
||||
public ItemIridiumArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||
|
||||
super(par1, par2EnumArmorMaterial,par3,par4);
|
||||
this.ArmorType=par4;
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
this.ArmorFile_1 = "/mods/MysticTextures/textures/armor/iridium_1.png";
|
||||
this.ArmorFile_2 = "/mods/MysticTextures/textures/armor/iridium_2.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
switch (ArmorType){
|
||||
case 0:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.helmetIridium");
|
||||
break;
|
||||
case 1:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.chestplateIridium");
|
||||
break;
|
||||
case 2:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.leggingsIridium");
|
||||
break;
|
||||
case 3:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.bootsIridium");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public String getArmorTextureFile(ItemStack par1){
|
||||
if(par1.itemID == ItemHandler$1.iridiumHelmet.itemID||par1.itemID == ItemHandler$1.iridiumChestplate.itemID||par1.itemID == ItemHandler$1.iridiumBoots.itemID)
|
||||
{
|
||||
return ArmorFile_1;
|
||||
}
|
||||
if(par1.itemID == ItemHandler$1.iridiumLeggings.itemID)
|
||||
{
|
||||
return ArmorFile_2;
|
||||
}
|
||||
return ArmorFile_2;
|
||||
}
|
||||
|
||||
@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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
common/MysticWorld/Items/ItemMithrilArmor.java
Normal file
57
common/MysticWorld/Items/ItemMithrilArmor.java
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.IArmorTextureProvider;
|
||||
|
||||
public class ItemMithrilArmor extends ItemArmor implements IArmorTextureProvider
|
||||
{
|
||||
int ArmorType;
|
||||
|
||||
String ArmorFile_1;
|
||||
String ArmorFile_2;
|
||||
|
||||
public ItemMithrilArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||
|
||||
super(par1, par2EnumArmorMaterial,par3,par4);
|
||||
this.ArmorType=par4;
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
this.ArmorFile_1 = "/mods/MysticTextures/textures/armor/mithril_1.png";
|
||||
this.ArmorFile_2 = "/mods/MysticTextures/textures/armor/mithril_2.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
switch (ArmorType){
|
||||
case 0:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.helmetMithril");
|
||||
break;
|
||||
case 1:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.chestplateMithril");
|
||||
break;
|
||||
case 2:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.leggingsMithril");
|
||||
break;
|
||||
case 3:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.bootsMithril");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public String getArmorTextureFile(ItemStack par1){
|
||||
if(par1.itemID == ItemHandler$1.mithrilHelmet.itemID||par1.itemID == ItemHandler$1.mithrilChestplate.itemID||par1.itemID == ItemHandler$1.mithrilBoots.itemID)
|
||||
{
|
||||
return ArmorFile_1;
|
||||
}
|
||||
if(par1.itemID == ItemHandler$1.mithrilLeggings.itemID)
|
||||
{
|
||||
return ArmorFile_2;
|
||||
}
|
||||
return ArmorFile_2;
|
||||
}
|
||||
}
|
||||
25
common/MysticWorld/Items/ItemMysticWorld.java
Normal file
25
common/MysticWorld/Items/ItemMysticWorld.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
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.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemMysticWorld extends Item
|
||||
{
|
||||
public ItemMysticWorld(int i)
|
||||
{
|
||||
super(i);
|
||||
maxStackSize = 64;
|
||||
this.setCreativeTab(CreativeTabs.tabMaterials);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
40
common/MysticWorld/Items/ItemStaffAir.java
Normal file
40
common/MysticWorld/Items/ItemStaffAir.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Entity.EntityChargeAir;
|
||||
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.world.World;
|
||||
|
||||
public class ItemStaffAir extends Item {
|
||||
|
||||
public ItemStaffAir(int id) {
|
||||
super(id);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + "item.AirStaff");
|
||||
}
|
||||
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){
|
||||
world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityChargeAir(world, entityPlayer));
|
||||
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
46
common/MysticWorld/Items/ItemStaffEarth.java
Normal file
46
common/MysticWorld/Items/ItemStaffEarth.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Entity.EntityChargeEarth;
|
||||
import MysticWorld.Entity.EntityChargeFire;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
public class ItemStaffEarth extends Item {
|
||||
|
||||
public ItemStaffEarth(int id) {
|
||||
super(id);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + "item.EarthStaff");
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){
|
||||
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;
|
||||
}
|
||||
}
|
||||
41
common/MysticWorld/Items/ItemStaffEnegy.java
Normal file
41
common/MysticWorld/Items/ItemStaffEnegy.java
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Entity.EntityChargeEnergy;
|
||||
import MysticWorld.Entity.EntityChargeFire;
|
||||
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.world.World;
|
||||
|
||||
public class ItemStaffEnegy extends Item{
|
||||
|
||||
public ItemStaffEnegy(int id) {
|
||||
super(id);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + "item.EnergyStaff");
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
41
common/MysticWorld/Items/ItemStaffFire.java
Normal file
41
common/MysticWorld/Items/ItemStaffFire.java
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Entity.EntityChargeFire;
|
||||
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.world.World;
|
||||
|
||||
public class ItemStaffFire extends Item{
|
||||
|
||||
public ItemStaffFire(int id) {
|
||||
super(id);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + "item.FireStaff");
|
||||
}
|
||||
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
62
common/MysticWorld/Items/ItemStaffParts.java
Normal file
62
common/MysticWorld/Items/ItemStaffParts.java
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.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 ItemMysticWorld {
|
||||
|
||||
private Icon[] icons;
|
||||
|
||||
private static final String[] STAFF_PARTS = new String[] {"Staff", "Hilt", "Handle", "Head"};
|
||||
|
||||
public ItemStaffParts(int id) {
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
|
||||
return super.getUnlocalizedName() + STAFF_PARTS[meta];
|
||||
}
|
||||
|
||||
@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("MysticTextures" + ":" + "item.staff_" + 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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
57
common/MysticWorld/Items/ItemStaffPower.java
Normal file
57
common/MysticWorld/Items/ItemStaffPower.java
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import MysticWorld.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;
|
||||
|
||||
public class ItemStaffPower extends Item {
|
||||
|
||||
private Icon[] icons;
|
||||
|
||||
private static final String[] CHARGE_NAMES = new String[] { "Fire", "Water", "Earth", "Air", "Energy"};
|
||||
|
||||
public ItemStaffPower(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
this.setUnlocalizedName("charge");
|
||||
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
|
||||
@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("MysticTextures" + ":" + "item.charge_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
|
||||
int j = MathHelper.clamp_int(meta, 0, 5);
|
||||
return icons[j];
|
||||
}
|
||||
}
|
||||
|
||||
47
common/MysticWorld/Items/ItemStaffWater.java
Normal file
47
common/MysticWorld/Items/ItemStaffWater.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Entity.EntityChargeEarth;
|
||||
import MysticWorld.Entity.EntityChargeFire;
|
||||
import MysticWorld.Entity.EntityChargeWater;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
public class ItemStaffWater extends Item {
|
||||
|
||||
public ItemStaffWater(int id) {
|
||||
super(id);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + "item.WaterStaff");
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){
|
||||
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;
|
||||
}
|
||||
}
|
||||
58
common/MysticWorld/Items/ItemVerditeArmor.java
Normal file
58
common/MysticWorld/Items/ItemVerditeArmor.java
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package MysticWorld.Items;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.IArmorTextureProvider;
|
||||
|
||||
public class ItemVerditeArmor extends ItemArmor implements IArmorTextureProvider
|
||||
{
|
||||
int ArmorType;
|
||||
|
||||
String ArmorFile_1;
|
||||
String ArmorFile_2;
|
||||
|
||||
public ItemVerditeArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||
|
||||
super(par1, par2EnumArmorMaterial,par3,par4);
|
||||
this.ArmorType=par4;
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
this.ArmorFile_1 = "/mods/MysticTextures/textures/armor/verdite_1.png";
|
||||
this.ArmorFile_2 = "/mods/MysticTextures/textures/armor/verdite_2.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
switch (ArmorType){
|
||||
case 0:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.helmetVerdite");
|
||||
break;
|
||||
case 1:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.chestplateVerdite");
|
||||
break;
|
||||
case 2:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.leggingsVerdite");
|
||||
break;
|
||||
case 3:
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures:item.bootsVerdite");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public String getArmorTextureFile(ItemStack par1){
|
||||
if(par1.itemID == ItemHandler$1.verditeHelmet.itemID||par1.itemID == ItemHandler$1.verditeChestplate.itemID||par1.itemID == ItemHandler$1.verditeBoots.itemID)
|
||||
{
|
||||
return ArmorFile_1;
|
||||
}
|
||||
if(par1.itemID == ItemHandler$1.verditeLeggings.itemID)
|
||||
{
|
||||
return ArmorFile_2;
|
||||
}
|
||||
return ArmorFile_2;
|
||||
|
||||
}
|
||||
}
|
||||
79
common/MysticWorld/Lang.java
Normal file
79
common/MysticWorld/Lang.java
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
package MysticWorld;
|
||||
|
||||
import MysticWorld.Blocks.BlockHandler;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
public class Lang
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
//Creative Tab Name
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.MysticWorldTab", "en_US", "Mystic World!");
|
||||
|
||||
//Blocks
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.OreImbuedStone, 1, 0), "Charred Stone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.OreImbuedStone, 1, 1), "Moistened Stone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.OreImbuedStone, 1, 2), "Mossified Stone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.OreImbuedStone, 1, 3), "Oxygenated Stone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.OreImbuedStone, 1, 4), "Energized Stone");
|
||||
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 0), "Bush");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 1), "Poisonous Bush");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 2), "Bush of Weakness");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 3), "Bush of Slowness");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 4), "Bush of Harming");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 5), "Withering Bush");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 6), "Bush of Health");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 7), "Bush of Speed");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 8), "Bush of Flames");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 9), "Bush of Regen");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 10), "Bush of Vision");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.bush, 1, 11), "Bush of Invisibility");
|
||||
|
||||
//Items
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.staffParts, 1, 0), "Staff");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.staffParts, 1, 1), "Staff Hilt");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.staffParts, 1, 2), "Staff Handle");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.staffParts, 1, 3), "Staff Topper");
|
||||
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.imbuedShard, 1, 0), "Charred Shard");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.imbuedShard, 1, 1), "Moistened Shard");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.imbuedShard, 1, 2), "Mossified Shard");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.imbuedShard, 1, 3), "Oxygenated Shard");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.imbuedShard, 1, 4), "Energized Shard");
|
||||
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.fireStaff, "Fire Staff");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.waterStaff, "Water Staff");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.earthStaff, "Earth Staff");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.airStaff, "Air Staff");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.energyStaff, "Energy Staff");
|
||||
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.verditeHelmet, "Verdite Helmet");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.verditeChestplate, "Verdite Chestplate");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.verditeLeggings, "Verdite Leggings");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.verditeBoots, "Verdite Boots");
|
||||
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.mithrilHelmet, "Mithril Helmet");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.mithrilChestplate, "Mithril Chestplate");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.mithrilLeggings, "Mithril Leggings");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.mithrilBoots, "Mithril Boots");
|
||||
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.adamantineHelmet, "Adamantine Helmet");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.adamantineChestplate, "Adamantine Chestplate");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.adamantineLeggings, "Adamantine Leggings");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.adamantineBoots, "Adamantine Boots");
|
||||
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.iridiumHelmet, "Iridium Helmet");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.iridiumChestplate, "Iridium Chestplate");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.iridiumLeggings, "Iridium Leggings");
|
||||
LanguageRegistry.instance().addName(ItemHandler$1.iridiumBoots, "Iridium Boots");
|
||||
|
||||
|
||||
for(int i=0;i<12;i++)
|
||||
{
|
||||
LanguageRegistry.instance().addName(new ItemStack(ItemHandler$1.bushFruit, 1, i), "Strange Fruit");
|
||||
}
|
||||
}
|
||||
}
|
||||
37
common/MysticWorld/Lib/BlockIds.java
Normal file
37
common/MysticWorld/Lib/BlockIds.java
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
package MysticWorld.Lib;
|
||||
|
||||
public class BlockIds {
|
||||
|
||||
//Default Block IDs
|
||||
public static int ORE_STONE_1_DEFAULT = 600;
|
||||
|
||||
public static int BUSH_DEFAULT = 601;
|
||||
public static int POISON_BUSH_DEFAULT = 602;
|
||||
public static int WEAKNESS_BUSH_DEFAULT = 603;
|
||||
public static int SLOWNESS_BUSH_DEFAULT = 604;
|
||||
public static int HARMING_BUSH_DEFAULT = 605;
|
||||
public static int WITHER_BUSH_DEFAULT = 606;
|
||||
public static int HEALTH_BUSH_DEFAULT = 607;
|
||||
public static int SPEED_BUSH_DEFAULT = 608;
|
||||
public static int FIRE_RESISTANCE_BUSH_DEFAULT = 609;
|
||||
public static int REGEN_BUSH_DEFAULT = 610;
|
||||
public static int NIGHT_VISION_BUSH_DEFAULT = 611;
|
||||
public static int INVISIBILITY_BUSH_DEFAULT = 612;
|
||||
|
||||
//Current Block IDs
|
||||
public static int ORE_STONE_1;
|
||||
|
||||
public static int BUSH;
|
||||
public static int POISON_BUSH;
|
||||
public static int WEAKNESS_BUSH;
|
||||
public static int SLOWNESS_BUSH;
|
||||
public static int HARMING_BUSH;
|
||||
public static int WITHER_BUSH;
|
||||
public static int HEALTH_BUSH;
|
||||
public static int SPEED_BUSH;
|
||||
public static int FIRE_RESISTANCE_BUSH;
|
||||
public static int REGEN_BUSH;
|
||||
public static int NIGHT_VISION_BUSH;
|
||||
public static int INVISIBILITY_BUSH;
|
||||
|
||||
}
|
||||
14
common/MysticWorld/Lib/EntityIds.java
Normal file
14
common/MysticWorld/Lib/EntityIds.java
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package MysticWorld.Lib;
|
||||
|
||||
public class EntityIds {
|
||||
|
||||
//Entity IDs
|
||||
public static int ENTITY_AIR_CHARGE = 1;
|
||||
public static int ENTITY_FIREBALL = 2;
|
||||
public static int ENTITY_EARTH_CHARGE = 3;
|
||||
public static int ENTITY_ENERGY_CHARGE = 4;
|
||||
public static int ENTITY_WATER_CHARGE = 5;
|
||||
|
||||
public static int ENTITY_PIGMAN = 6;
|
||||
|
||||
}
|
||||
68
common/MysticWorld/Lib/ItemIds.java
Normal file
68
common/MysticWorld/Lib/ItemIds.java
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
package MysticWorld.Lib;
|
||||
|
||||
public class ItemIds {
|
||||
|
||||
//Default Item IDs
|
||||
public static int STAFF_PARTS_DEFAULT = 5503;
|
||||
|
||||
public static int IMBUED_SHARD_DEFAULT = 5504;
|
||||
|
||||
public static int FIRE_STAFF_DEFAULT = 5505;
|
||||
public static int WATER_STAFF_DEFAULT = 5506;
|
||||
public static int EARTH_STAFF_DEFAULT = 5507;
|
||||
public static int AIR_STAFF_DEFAULT = 5508;
|
||||
public static int ENERGY_STAFF_DEFAULT = 5509;
|
||||
public static int STAFF_POWER_DEFAULT = 5510;
|
||||
|
||||
public static int BUSH_FRUIT_DEFAULT = 5511;
|
||||
|
||||
public static int VERDITE_HELMET_DEFAULT = 5512;
|
||||
public static int VERDITE_CHESTPLATE_DEFAULT = 5513;
|
||||
public static int VERDITE_LEGGINGS_DEFAULT = 5514;
|
||||
public static int VERDITE_BOOTS_DEFAULT = 5515;
|
||||
public static int MITHRIL_HELMET_DEFAULT = 5516;
|
||||
public static int MITHRIL_CHESTPLATE_DEFAULT = 5517;
|
||||
public static int MITHRIL_LEGGINGS_DEFAULT = 5518;
|
||||
public static int MITHRIL_BOOTS_DEFAULT = 5519;
|
||||
public static int ADAMANTINE_HELMET_DEFAULT = 5520;
|
||||
public static int ADAMANTINE_CHESTPLATE_DEFAULT = 5521;
|
||||
public static int ADAMANTINE_LEGGINGS_DEFAULT = 5522;
|
||||
public static int ADAMANTINE_BOOTS_DEFAULT = 5523;
|
||||
public static int IRIDIUM_HELMET_DEFAULT = 5524;
|
||||
public static int IRIDIUM_CHESTPLATE_DEFAULT = 5525;
|
||||
public static int IRIDIUM_LEGGINGS_DEFAULT = 5526;
|
||||
public static int IRIDIUM_BOOTS_DEFAULT = 5527;
|
||||
|
||||
|
||||
//Current Item IDs
|
||||
public static int STAFF_PARTS;
|
||||
|
||||
public static int IMBUED_SHARD;
|
||||
|
||||
public static int FIRE_STAFF;
|
||||
public static int WATER_STAFF;
|
||||
public static int EARTH_STAFF;
|
||||
public static int AIR_STAFF;
|
||||
public static int ENERGY_STAFF;
|
||||
public static int STAFF_POWER;
|
||||
|
||||
public static int BUSH_FRUIT;
|
||||
|
||||
public static int VERDITE_HELMET;
|
||||
public static int VERDITE_CHESTPLATE;
|
||||
public static int VERDITE_LEGGINGS;
|
||||
public static int VERDITE_BOOTS;
|
||||
public static int MITHRIL_HELMET;
|
||||
public static int MITHRIL_CHESTPLATE;
|
||||
public static int MITHRIL_LEGGINGS;
|
||||
public static int MITHRIL_BOOTS;
|
||||
public static int ADAMANTINE_HELMET;
|
||||
public static int ADAMANTINE_CHESTPLATE;
|
||||
public static int ADAMANTINE_LEGGINGS;
|
||||
public static int ADAMANTINE_BOOTS;
|
||||
public static int IRIDIUM_HELMET;
|
||||
public static int IRIDIUM_CHESTPLATE;
|
||||
public static int IRIDIUM_LEGGINGS;
|
||||
public static int IRIDIUM_BOOTS;
|
||||
|
||||
}
|
||||
69
common/MysticWorld/Lib/Strings.java
Normal file
69
common/MysticWorld/Lib/Strings.java
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
package MysticWorld.Lib;
|
||||
|
||||
public class Strings {
|
||||
|
||||
//Block Names
|
||||
public static final String IMBUED_STONE_NAME = "imbuedStone";
|
||||
|
||||
public static final String BUSH_NAME = "bush";
|
||||
public static final String POISON_BUSH_NAME = "poisonBush";
|
||||
public static final String WEAKNESS_BUSH_NAME = "weaknessBush";
|
||||
public static final String SLOWNESS_BUSH_NAME = "slownessBush";
|
||||
public static final String HARMING_BUSH_NAME = "harmingBush";
|
||||
public static final String WITHER_BUSH_NAME = "witherBush";
|
||||
public static final String HEALTH_BUSH_NAME = "healthBush";
|
||||
public static final String SPEED_BUSH_NAME = "speedBush";
|
||||
public static final String FIRE_RESISTANCE_BUSH_NAME = "fireResistanceBush";
|
||||
public static final String REGEN_BUSH_NAME = "regenBush";
|
||||
public static final String NIGHT_VISION_BUSH_NAME = "nightVisionBush";
|
||||
public static final String INVISIBILITY_BUSH_NAME = "invisibilityBush";
|
||||
|
||||
//Item Names
|
||||
public static final String STAFF_HILT_NAME = "staffHilt";
|
||||
public static final String STAFF_HANDLE_NAME = "staffHandle";
|
||||
public static final String STAFF_HEAD_NAME = "staffHead";
|
||||
public static final String STAFF_NAME = "staff";
|
||||
|
||||
public static final String IMBUED_SHARD_NAME = "imbuedShard";
|
||||
|
||||
public static final String FIRE_STAFF_NAME = "fireStaff";
|
||||
public static final String WATER_STAFF_NAME = "waterStaff";
|
||||
public static final String EARTH_STAFF_NAME = "earthStaff";
|
||||
public static final String AIR_STAFF_NAME = "airStaff";
|
||||
public static final String ENERGY_STAFF_NAME = "energyStaff";
|
||||
|
||||
public static final String BUSH_FRUIT_NAME = "bushFruit";
|
||||
public static final String POWER_STAFF_NAME = "staffPoweredItem";
|
||||
|
||||
public static final String VERDITE_HELMET_NAME = "verditeHelmet";
|
||||
public static final String VERDITE_CHESTPLATE_NAME = "verditeChestplate";
|
||||
public static final String VERDITE_LEGGINGS_NAME = "verditeLeggings";
|
||||
public static final String VERDITE_BOOTS_NAME = "verditeBoots";
|
||||
|
||||
public static final String MITHRIL_HELMET_NAME = "mithrilHelmet";
|
||||
public static final String MITHRIL_CHESTPLATE_NAME = "mithrilChestplate";
|
||||
public static final String MITHRIL_LEGGINGS_NAME = "mithrilLeggings";
|
||||
public static final String MITHRIL_BOOTS_NAME = "mithrilBoots";
|
||||
|
||||
public static final String ADAMANTINE_HELMET_NAME = "adamantineHelmet";
|
||||
public static final String ADAMANTINE_CHESTPLATE_NAME = "adamantineChestplate";
|
||||
public static final String ADAMANTINE_LEGGINGS_NAME = "adamantineLeggings";
|
||||
public static final String ADAMANTINE_BOOTS_NAME = "adamantineBoots";
|
||||
|
||||
public static final String IRIDIUM_HELMET_NAME = "iridiumHelmet";
|
||||
public static final String IRIDIUM_CHESTPLATE_NAME = "iridiumChestplate";
|
||||
public static final String IRIDIUM_LEGGINGS_NAME = "iridiumLeggings";
|
||||
public static final String IRIDIUM_BOOTS_NAME = "iridiumBoots";
|
||||
|
||||
//Entity Names
|
||||
public static final String ENTITY_AIR_CHARGE_NAME = "entityAirCharge";
|
||||
public static final String ENTITY_FIREBALL_NAME = "entityFireball";
|
||||
public static final String ENTITY_EARTH_CHARGE_NAME = "entityEarthCharge";
|
||||
public static final String ENTITY_ENERGY_CHARGE_NAME = "entityEnergyCharge";
|
||||
public static final String ENTITY_WATER_CHARGE_NAME = "entityWaterCharge";
|
||||
|
||||
public static final String ENTITY_PIGMAN_NAME = "entityPigman";
|
||||
|
||||
//Config Category Names
|
||||
public static final String ENTITY_CATEGORY = "entity";
|
||||
}
|
||||
82
common/MysticWorld/MysticWorld.java
Normal file
82
common/MysticWorld/MysticWorld.java
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
package MysticWorld;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
|
||||
import MysticWorld.Biome.BiomeHandler;
|
||||
import MysticWorld.Blocks.BlockHandler;
|
||||
import MysticWorld.Entity.EntityHandler;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import MysticWorld.Lib.Strings;
|
||||
import MysticWorld.WorldGen.*;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
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.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.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
|
||||
{
|
||||
@Instance(Reference.MOD_ID)
|
||||
public static MysticWorld instance;
|
||||
|
||||
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
|
||||
public static CommonProxy proxy;
|
||||
|
||||
private TickHandler tickHandler;
|
||||
|
||||
public static CreativeTabs MysticWorldTab = new TabMysticWorld(CreativeTabs.getNextID(), "MysticWorldTab");
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic World.cfg"));
|
||||
Config.save();
|
||||
BiomeHandler.init();
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
proxy.registerRenders();
|
||||
|
||||
this.tickHandler = new TickHandler();
|
||||
|
||||
TickRegistry.registerTickHandler(this.tickHandler, Side.SERVER);
|
||||
VillagerRegistry.instance().registerVillagerType(98943, "/mods/MysticTextures/textures/mob/MysticVillager.png");
|
||||
VillagerRegistry.instance().registerVillageTradeHandler(98943, new MysticVillagerTrades());
|
||||
VillagerRegistry.instance().registerVillageCreationHandler(new VillageHutHandler());
|
||||
BlockHandler.init();
|
||||
ItemHandler$1.init();
|
||||
EntityHandler.init();
|
||||
RecipeHandler.init();
|
||||
MysticHutUtil.addLoot();
|
||||
Lang.init();
|
||||
}
|
||||
|
||||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
}
|
||||
}
|
||||
122
common/MysticWorld/RecipeHandler.java
Normal file
122
common/MysticWorld/RecipeHandler.java
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
package MysticWorld;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import MysticWorld.Blocks.BlockHandler;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class RecipeHandler {
|
||||
|
||||
public static void init(){
|
||||
itemRecipes();
|
||||
itemSmelting();
|
||||
}
|
||||
|
||||
private static void itemRecipes(){
|
||||
|
||||
//Staff Hilt Recipe
|
||||
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
|
||||
});
|
||||
|
||||
//Staff Topper Recipe
|
||||
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)
|
||||
});
|
||||
|
||||
staffRecipe(ItemHandler$1.fireStaff, new ItemStack(ItemHandler$1.imbuedShard, 1, 0));
|
||||
staffRecipe(ItemHandler$1.waterStaff, new ItemStack(ItemHandler$1.imbuedShard, 1, 1));
|
||||
staffRecipe(ItemHandler$1.earthStaff, new ItemStack(ItemHandler$1.imbuedShard, 1, 2));
|
||||
staffRecipe(ItemHandler$1.airStaff, new ItemStack(ItemHandler$1.imbuedShard, 1, 3));
|
||||
staffRecipe(ItemHandler$1.energyStaff, new ItemStack(ItemHandler$1.imbuedShard, 1, 4));
|
||||
|
||||
/*----------------------------------Verdite--------------------------------------*/
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.verditeHelmet), new Object[] {
|
||||
"###", "# #", '#', ItemHandler.VerditeIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.verditeChestplate), new Object[] {
|
||||
"# #", "###", "###", '#', ItemHandler.VerditeIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.verditeLeggings), new Object[] {
|
||||
"###", "# #", "# #", '#', ItemHandler.VerditeIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.verditeBoots), new Object[] {
|
||||
"# #", "# #", '#', ItemHandler.VerditeIngot
|
||||
});
|
||||
|
||||
/*----------------------------------Mithril--------------------------------------*/
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.mithrilHelmet), new Object[] {
|
||||
"###", "# #", '#', ItemHandler.MithrilIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.mithrilChestplate), new Object[] {
|
||||
"# #", "###", "###", '#', ItemHandler.MithrilIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.mithrilLeggings), new Object[] {
|
||||
"###", "# #", "# #", '#', ItemHandler.MithrilIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.mithrilBoots), new Object[] {
|
||||
"# #", "# #", '#', ItemHandler.MithrilIngot
|
||||
});
|
||||
|
||||
/*----------------------------------Adamantine--------------------------------------*/
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.adamantineHelmet), new Object[] {
|
||||
"###", "# #", '#', ItemHandler.AdamantineIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.adamantineChestplate), new Object[] {
|
||||
"# #", "###", "###", '#', ItemHandler.AdamantineIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.adamantineLeggings), new Object[] {
|
||||
"###", "# #", "# #", '#', ItemHandler.AdamantineIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.adamantineBoots), new Object[] {
|
||||
"# #", "# #", '#', ItemHandler.AdamantineIngot
|
||||
});
|
||||
|
||||
/*----------------------------------Iridium--------------------------------------*/
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.iridiumHelmet), new Object[] {
|
||||
"###", "# #", '#', ItemHandler.IridiumIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.iridiumChestplate), new Object[] {
|
||||
"# #", "###", "###", '#', ItemHandler.IridiumIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.iridiumLeggings), new Object[] {
|
||||
"###", "# #", "# #", '#', ItemHandler.IridiumIngot
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.iridiumBoots), new Object[] {
|
||||
"# #", "# #", '#', ItemHandler.IridiumIngot
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private static void itemSmelting(){
|
||||
|
||||
}
|
||||
|
||||
private static void staffRecipe(Item outputItem, ItemStack inputBlock){
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(outputItem, 1), inputBlock, new ItemStack(ItemHandler$1.staffParts, 1, 0));
|
||||
}
|
||||
}
|
||||
11
common/MysticWorld/Reference.java
Normal file
11
common/MysticWorld/Reference.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package MysticWorld;
|
||||
|
||||
public class Reference {
|
||||
|
||||
public static final String MOD_ID = "MysticWorld";
|
||||
public static final String MOD_NAME = "Mystic World";
|
||||
public static final String VERSION_NUMBER = "0.1a";
|
||||
public static final String SERVER_PROXY_CLASS = "MysticWorld.CommonProxy";
|
||||
public static final String CLIENT_PROXY_CLASS = "MysticWorld.Client.ClientProxy";
|
||||
|
||||
}
|
||||
80
common/MysticWorld/Renderer/RenderStaffPower.java
Normal file
80
common/MysticWorld/Renderer/RenderStaffPower.java
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
package MysticWorld.Renderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import MysticWorld.Items.ItemStaffPower;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
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;
|
||||
|
||||
public class RenderStaffPower extends Render {
|
||||
|
||||
private Item item;
|
||||
private int meta = 0;
|
||||
|
||||
public RenderStaffPower(int par1){
|
||||
this.item = ItemHandler$1.ItemStaffPower;
|
||||
this.meta = par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) {
|
||||
Icon icon = ItemHandler$1.ItemStaffPower.getIconFromDamage(this.meta);
|
||||
|
||||
if (icon != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d0, (float)d1, (float)d2);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.loadTexture("/gui/items.png");
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (icon == ItemPotion.func_94589_d("potion_splash"))
|
||||
{
|
||||
int i = PotionHelper.func_77915_a(((EntityPotion)entity).getPotionDamage(), false);
|
||||
float f2 = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f3 = (float)(i >> 8 & 255) / 255.0F;
|
||||
float f4 = (float)(i & 255) / 255.0F;
|
||||
GL11.glColor3f(f2, f3, f4);
|
||||
GL11.glPushMatrix();
|
||||
this.func_77026_a(tessellator, ItemPotion.func_94589_d("potion_contents"));
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
this.func_77026_a(tessellator, icon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon)
|
||||
{
|
||||
float f = par2Icon.getMinU();
|
||||
float f1 = par2Icon.getMaxU();
|
||||
float f2 = par2Icon.getMinV();
|
||||
float f3 = par2Icon.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 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);
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
}
|
||||
19
common/MysticWorld/TabMysticWorld.java
Normal file
19
common/MysticWorld/TabMysticWorld.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package MysticWorld;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
51
common/MysticWorld/TickHandler.java
Normal file
51
common/MysticWorld/TickHandler.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package MysticWorld;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import MysticWorld.Blocks.BlockBush;
|
||||
import MysticWorld.Blocks.BlockHandler;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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
|
||||
{
|
||||
private EnumSet ticks;
|
||||
|
||||
public TickHandler(){
|
||||
this.ticks = EnumSet.of(TickType.PLAYER);
|
||||
}
|
||||
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData){
|
||||
EntityPlayer player = (EntityPlayer)tickData[0];
|
||||
World world = player.worldObj;
|
||||
}
|
||||
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData){
|
||||
EntityPlayer player = (EntityPlayer)tickData[0];
|
||||
World world = player.worldObj;
|
||||
}
|
||||
|
||||
public EnumSet ticks(){
|
||||
return this.ticks;
|
||||
}
|
||||
|
||||
public String getLabel(){
|
||||
return "mystic world tick";
|
||||
}
|
||||
|
||||
public int nextTickSpacing(){
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
28
common/MysticWorld/WorldGen/BushesGen.java
Normal file
28
common/MysticWorld/WorldGen/BushesGen.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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)
|
||||
{
|
||||
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, par2Random.nextInt(12), 2);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
116
common/MysticWorld/WorldGen/ComponentVillagerHut.java
Normal file
116
common/MysticWorld/WorldGen/ComponentVillagerHut.java
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticStones.MysticStones;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.structure.ComponentVillage;
|
||||
import net.minecraft.world.gen.structure.ComponentVillageStartPiece;
|
||||
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
||||
import net.minecraft.world.gen.structure.StructureComponent;
|
||||
|
||||
public class ComponentVillagerHut extends ComponentVillage
|
||||
{
|
||||
private int averageGroundLevel = -1;
|
||||
|
||||
public ComponentVillagerHut(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5)
|
||||
{
|
||||
super(par1ComponentVillageStartPiece, par2);
|
||||
this.coordBaseMode = par5;
|
||||
this.boundingBox = par4StructureBoundingBox;
|
||||
}
|
||||
public static ComponentVillagerHut buildComponent (ComponentVillageStartPiece villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5)
|
||||
{
|
||||
StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4);
|
||||
return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentVillagerHut(villagePiece, p5, random,
|
||||
structureboundingbox, p4) : null;
|
||||
}
|
||||
public boolean addComponentParts (World world, Random random, StructureBoundingBox sbb)
|
||||
{
|
||||
if (this.averageGroundLevel < 0)
|
||||
{
|
||||
this.averageGroundLevel = this.getAverageGroundLevel(world, sbb);
|
||||
if (this.averageGroundLevel < 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + 4, 0);
|
||||
}
|
||||
/*------------------------------------------------------------------Base------------------------------------------------------------------------*/
|
||||
this.fillWithMetadataBlocks(world, sbb, 0, 0, 0, 6, 0, 6, MysticStones.StoneBricks.blockID, 2, MysticStones.StoneBricks.blockID, 2, false);
|
||||
this.fillWithBlocks(world, sbb, 0, 5, 0, 6, 5, 6, Block.cobblestoneWall.blockID, Block.cobblestoneWall.blockID, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 0, 1, 5, 0, 5, MysticStones.StoneBricks.blockID, 2, MysticStones.StoneBricks.blockID, 2, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 2, 0, 2, 4, 0, 4, MysticStones.ReinforcedBricks.blockID, 4, MysticStones.ReinforcedBricks.blockID, 4, false);
|
||||
/*------------------------------------------------------------------Edges-------------------------------------------------------------------------*/
|
||||
this.fillWithMetadataBlocks(world, sbb, 0, 1, 0, 0, 4, 0, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 0, 1, 6, 0, 4, 6, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 6, 1, 0, 6, 4, 0, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 6, 1, 6, 6, 4, 6, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
/*-------------------------------------------------------------------Walls------------------------------------------------------------------------*/
|
||||
this.fillWithMetadataBlocks(world, sbb, 0, 1, 1, 0, 1, 5, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 1, 0, 5, 1, 0, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 6, 1, 1, 6, 1, 5, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 1, 6, 5, 1, 6, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 0, 3, 1, 0, 3, 5, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 3, 0, 5, 3, 0, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 6, 3, 1, 6, 3, 5, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 3, 6, 5, 3, 6, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 0, 4, 1, 0, 4, 5, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 4, 0, 5, 4, 0, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 6, 4, 1, 6, 4, 5, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 4, 6, 5, 4, 6, Block.stoneBrick.blockID, 0, Block.stoneBrick.blockID, 0, false);
|
||||
this.fillWithBlocks(world, sbb, 1, 1, 1, 5, 5, 5, 0, 0, false);
|
||||
this.fillWithMetadataBlocks(world, sbb, 1, 4, 1, 5, 4, 5, MysticStones.Planks.blockID, 5, MysticStones.Planks.blockID, 5, false);
|
||||
/*---------------------------------------------------------Glass and Door--------------------------------------------------------------------------*/
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 1, 2, 0, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, MysticStones.Planks.blockID, 5, 2, 2, 0, sbb);
|
||||
this.placeDoorAtCurrentPosition(world, sbb, random, 3, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1));
|
||||
this.placeBlockAtCurrentPosition(world, MysticStones.Planks.blockID, 5, 4, 2, 0, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 5, 2, 0, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 1, 2, 6, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 2, 2, 6, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, MysticStones.Planks.blockID, 5, 3, 2, 6, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 4, 2, 6, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 5, 2, 6, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 0, 2, 1, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 0, 2, 2, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, MysticStones.Planks.blockID, 5, 0, 2, 3, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 0, 2, 4, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 0, 2, 5, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 6, 2, 1, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 6, 2, 2, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, MysticStones.Planks.blockID, 5, 6, 2, 3, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 6, 2, 4, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, BlockHandler.ReinforcedGlass.blockID, 0, 6, 2, 5, sbb);
|
||||
/*-------------------------------------------------------------Ladders---------------------------------------------------------------------------*/
|
||||
int i = this.getMetadataWithOffset(Block.ladder.blockID, 3);
|
||||
this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 1, 5, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 2, 5, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 3, 5, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 4, 5, sbb);
|
||||
/*---------------------------------------------------------------Inside--------------------------------------------------------------------------*/
|
||||
this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 1, 1, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, Block.workbench.blockID, 0, 1, 1, 4, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, Block.anvil.blockID, 2, 1, 1, 5, sbb);
|
||||
this.generateStructureChestContents(world, sbb, random, 4, 1, 5, MysticHutUtil.MysticHutChest.getItems(random), MysticHutUtil.MysticHutChest.getCount(random));
|
||||
|
||||
for (int l = 0; l < 6; ++l)
|
||||
{
|
||||
for (int i1 = 0; i1 < 9; ++i1)
|
||||
{
|
||||
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
|
||||
this.fillCurrentPositionBlocksDownwards(world, MysticStones.StoneBricks.blockID, 2, i1, -1, l, sbb);
|
||||
}
|
||||
}
|
||||
this.spawnVillagers(world, sbb, 3, 1, 3, 1);
|
||||
return true;
|
||||
}
|
||||
protected int getVillagerType (int par1)
|
||||
{
|
||||
return 98943;
|
||||
}
|
||||
}
|
||||
27
common/MysticWorld/WorldGen/MysticHutUtil.java
Normal file
27
common/MysticWorld/WorldGen/MysticHutUtil.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
|
||||
public class MysticHutUtil
|
||||
{
|
||||
public MysticHutUtil()
|
||||
{
|
||||
addLoot();
|
||||
}
|
||||
|
||||
public static ChestGenHooks MysticHutChest;
|
||||
|
||||
public static void addLoot()
|
||||
{
|
||||
MysticHutChest = new ChestGenHooks("MysticHutChest", new WeightedRandomChestContent[0], 3, 27);
|
||||
MysticHutChest.addItem(new WeightedRandomChestContent(new ItemStack(ItemHandler.ObsidianRod, 1, 0), 1, 1, 1));
|
||||
MysticHutChest.addItem(new WeightedRandomChestContent(new ItemStack(ItemHandler.MysticPowder, 1, 0), 1, 1, 1));
|
||||
MysticHutChest.addItem(new WeightedRandomChestContent(new ItemStack(ItemHandler.IridiumNugget, 1, 0), 1, 1, 1));
|
||||
}
|
||||
}
|
||||
30
common/MysticWorld/WorldGen/MysticVillagerTrades.java
Normal file
30
common/MysticWorld/WorldGen/MysticVillagerTrades.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticWorld.*;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.village.MerchantRecipe;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
|
||||
|
||||
public class MysticVillagerTrades implements IVillageTradeHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void manipulateTradesForVillager (EntityVillager villager, MerchantRecipeList recipeList, Random random)
|
||||
{
|
||||
if (villager.getProfession() == 98943)
|
||||
{
|
||||
recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(ItemHandler$1.imbuedShard, 19, 0), new ItemStack(Item.emerald, 1, 0)));
|
||||
recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(ItemHandler$1.imbuedShard, 16, 1), new ItemStack(Item.emerald, 1, 0)));
|
||||
recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(ItemHandler$1.imbuedShard, 17, 2), new ItemStack(Item.emerald, 1, 0)));
|
||||
recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(ItemHandler$1.imbuedShard, 13, 3), new ItemStack(Item.emerald, 1, 0)));
|
||||
recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(ItemHandler$1.imbuedShard, 11, 4), new ItemStack(Item.emerald, 1, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
28
common/MysticWorld/WorldGen/StonesGen.java
Normal file
28
common/MysticWorld/WorldGen/StonesGen.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
31
common/MysticWorld/WorldGen/VillageHutHandler.java
Normal file
31
common/MysticWorld/WorldGen/VillageHutHandler.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.gen.structure.ComponentVillageStartPiece;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieceWeight;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
|
||||
|
||||
public class VillageHutHandler implements IVillageCreationHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i)
|
||||
{
|
||||
return new StructureVillagePieceWeight(ComponentVillagerHut.class, 30, i + random.nextInt(4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComponentClass ()
|
||||
{
|
||||
return ComponentVillagerHut.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object buildComponent (StructureVillagePieceWeight villagePiece, ComponentVillageStartPiece startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5)
|
||||
{
|
||||
return ComponentVillagerHut.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5);
|
||||
}
|
||||
|
||||
}
|
||||
31
common/MysticWorld/WorldGen/WorldGenBushes.java
Normal file
31
common/MysticWorld/WorldGen/WorldGenBushes.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenBushes implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||
int Ycoord1 = random.nextInt(11) + 60;
|
||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||
|
||||
(new BushesGen()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
common/MysticWorld/WorldGen/WorldGenStones.java
Normal file
31
common/MysticWorld/WorldGen/WorldGenStones.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package MysticWorld.WorldGen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenStones implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||
int Ycoord1 = random.nextInt(11) + 60;
|
||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||
|
||||
(new StonesGen()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue