Reorganized github - Renamed packages lowercase
This commit is contained in:
parent
5a3a6d4a8e
commit
579ddee7f0
362 changed files with 5163 additions and 8935 deletions
221
.gitignore
vendored
Normal file
221
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,221 @@
|
||||||
|
#################
|
||||||
|
## Eclipse
|
||||||
|
#################
|
||||||
|
|
||||||
|
*.pydevproject
|
||||||
|
.project
|
||||||
|
.metadata
|
||||||
|
bin/
|
||||||
|
tmp/
|
||||||
|
*.class
|
||||||
|
*.tmp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
*~.nib
|
||||||
|
local.properties
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
.loadpath
|
||||||
|
|
||||||
|
# External tool builders
|
||||||
|
.externalToolBuilders/
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# CDT-specific
|
||||||
|
.cproject
|
||||||
|
|
||||||
|
# PDT-specific
|
||||||
|
.buildpath
|
||||||
|
|
||||||
|
|
||||||
|
#################
|
||||||
|
## Visual Studio
|
||||||
|
#################
|
||||||
|
|
||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
*.pubxml
|
||||||
|
|
||||||
|
# NuGet Packages Directory
|
||||||
|
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||||
|
#packages/
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
App_Data/*.mdf
|
||||||
|
App_Data/*.ldf
|
||||||
|
|
||||||
|
#############
|
||||||
|
## Windows detritus
|
||||||
|
#############
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac crap
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
|
||||||
|
#############
|
||||||
|
## Python
|
||||||
|
#############
|
||||||
|
|
||||||
|
*.py[co]
|
||||||
|
|
||||||
|
# Packages
|
||||||
|
*.egg
|
||||||
|
*.egg-info
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
eggs/
|
||||||
|
parts/
|
||||||
|
var/
|
||||||
|
sdist/
|
||||||
|
develop-eggs/
|
||||||
|
.installed.cfg
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
.coverage
|
||||||
|
.tox
|
||||||
|
|
||||||
|
#Translations
|
||||||
|
*.mo
|
||||||
|
|
||||||
|
#Mr Developer
|
||||||
|
.mr.developer.cfg
|
||||||
|
|
||||||
|
/mcp/*
|
||||||
|
/eclipse/*
|
||||||
|
/api/*
|
||||||
|
/releases/*
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package MysticOres.Blocks;
|
package mysticores.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.items.Items;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.item.EntityXPOrb;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
|
|
@ -16,25 +16,47 @@ import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
import MysticOres.MysticOres;
|
|
||||||
import MysticOres.Items.Items;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockBase extends Block
|
public class BlockBase extends Block {
|
||||||
{
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockBase(int ID)
|
public BlockBase(int ID) {
|
||||||
{
|
|
||||||
super(ID, Material.rock);
|
super(ID, Material.rock);
|
||||||
setCreativeTab(MysticOres.MysticOresTab);
|
setCreativeTab(mysticores.MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int j) {
|
||||||
|
switch (j) {
|
||||||
|
case 1:
|
||||||
|
return 8;
|
||||||
|
case 2:
|
||||||
|
return 4;
|
||||||
|
case 4:
|
||||||
|
return 5;
|
||||||
|
case 5:
|
||||||
|
return 7;
|
||||||
|
case 7:
|
||||||
|
return 10;
|
||||||
|
case 8:
|
||||||
|
return 0;
|
||||||
|
case 9:
|
||||||
|
return 0;
|
||||||
|
case 10:
|
||||||
|
return 0;
|
||||||
|
case 11:
|
||||||
|
return 6;
|
||||||
|
case 12:
|
||||||
|
return 11;
|
||||||
|
default:
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getBlockHardness(World world, int x, int y, int z)
|
public float getBlockHardness(World world, int x, int y, int z) {
|
||||||
{
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta == 12)
|
if (meta == 12)
|
||||||
return 4.5f;
|
return 4.5f;
|
||||||
|
|
@ -43,9 +65,7 @@ public class BlockBase extends Block
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY,
|
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
|
||||||
double explosionZ)
|
|
||||||
{
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta == 12)
|
if (meta == 12)
|
||||||
return 2000.0f;
|
return 2000.0f;
|
||||||
|
|
@ -54,8 +74,13 @@ public class BlockBase extends Block
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public Icon getIcon(int side, int meta) {
|
||||||
|
return textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta == 2 || meta == 3)
|
if (meta == 2 || meta == 3)
|
||||||
return 7;
|
return 7;
|
||||||
|
|
@ -64,109 +89,103 @@ public class BlockBase extends Block
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||||
public void registerIcons(IconRegister register)
|
|
||||||
{
|
|
||||||
textures = new Icon[16];
|
|
||||||
for(int i=0;i<ItemBase.BLOCK_NAMES.length;i++)
|
|
||||||
{
|
|
||||||
textures[i] = register.registerIcon("MysticMods:" + ItemBase.BLOCK_NAMES[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIcon(int side, int meta)
|
|
||||||
{
|
|
||||||
return textures[meta];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int idDropped(int par1, Random random, int par3)
|
|
||||||
{
|
|
||||||
switch(par1)
|
|
||||||
{
|
|
||||||
case 1:return Items.Resource.itemID;
|
|
||||||
case 2:return Items.Resource.itemID;
|
|
||||||
case 4:return Items.Resource.itemID;
|
|
||||||
case 5:return Items.Resource.itemID;
|
|
||||||
case 7:return Items.Resource.itemID;
|
|
||||||
case 8:return this.BlackSoulstoneDrops(par1, random, par3);
|
|
||||||
case 9:return this.BlueSoulstoneDrops(par1, random, par3);
|
|
||||||
case 10:return this.RedSoulstoneDrops(par1, random, par3);
|
|
||||||
case 11:return Items.Resource.itemID;
|
|
||||||
case 12:return Items.Resource.itemID;
|
|
||||||
default:return blockID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int damageDropped(int j)
|
|
||||||
{
|
|
||||||
switch(j)
|
|
||||||
{
|
|
||||||
case 1:return 8;
|
|
||||||
case 2:return 4;
|
|
||||||
case 4:return 5;
|
|
||||||
case 5:return 7;
|
|
||||||
case 7:return 10;
|
|
||||||
case 8:return 0;
|
|
||||||
case 9:return 0;
|
|
||||||
case 10:return 0;
|
|
||||||
case 11:return 6;
|
|
||||||
case 12:return 11;
|
|
||||||
default:return j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int quantityDropped(int meta, int fortune, Random random)
|
|
||||||
{
|
|
||||||
switch(meta)
|
|
||||||
{
|
|
||||||
case 2:return random.nextInt(5) + 1;
|
|
||||||
case 7:return random.nextInt(3) + 1;
|
|
||||||
case 8:return random.nextInt(4) + 1;
|
|
||||||
case 9:return random.nextInt(4) + 1;
|
|
||||||
case 10:return random.nextInt(4) + 1;
|
|
||||||
case 12:return random.nextInt(5) + 1;
|
|
||||||
default:return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean canSilkHarvest()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int idPicked(World world, int x, int y, int z)
|
|
||||||
{
|
|
||||||
return this.blockID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
|
||||||
{
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
return new ItemStack(this, 1, meta);
|
return new ItemStack(this, 1, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(int i, CreativeTabs tab, List list)
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
{
|
for (int meta = 0; meta < ItemBase.BLOCK_NAMES.length; meta++) {
|
||||||
for(int meta = 0;meta<ItemBase.BLOCK_NAMES.length; meta ++)
|
|
||||||
{
|
|
||||||
list.add(new ItemStack(i, 1, meta));
|
list.add(new ItemStack(i, 1, meta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idDropped(int par1, Random random, int par3) {
|
||||||
|
switch (par1) {
|
||||||
|
case 1:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
case 2:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
case 4:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
case 5:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
case 7:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
case 8:
|
||||||
|
return this.BlackSoulstoneDrops(par1, random, par3);
|
||||||
|
case 9:
|
||||||
|
return this.BlueSoulstoneDrops(par1, random, par3);
|
||||||
|
case 10:
|
||||||
|
return this.RedSoulstoneDrops(par1, random, par3);
|
||||||
|
case 11:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
case 12:
|
||||||
|
return Items.Resource.itemID;
|
||||||
|
default:
|
||||||
|
return blockID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idPicked(World world, int x, int y, int z) {
|
||||||
|
return this.blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if (meta == 12)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int quantityDropped(int meta, int fortune, Random random) {
|
||||||
|
switch (meta) {
|
||||||
|
case 2:
|
||||||
|
return random.nextInt(5) + 1;
|
||||||
|
case 7:
|
||||||
|
return random.nextInt(3) + 1;
|
||||||
|
case 8:
|
||||||
|
return random.nextInt(4) + 1;
|
||||||
|
case 9:
|
||||||
|
return random.nextInt(4) + 1;
|
||||||
|
case 10:
|
||||||
|
return random.nextInt(4) + 1;
|
||||||
|
case 12:
|
||||||
|
return random.nextInt(5) + 1;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par)
|
public void registerIcons(IconRegister register) {
|
||||||
{
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < ItemBase.BLOCK_NAMES.length; i++) {
|
||||||
|
textures[i] = register.registerIcon("MysticMods:" + ItemBase.BLOCK_NAMES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
int blockID = world.getBlockId(x, y, z);
|
int blockID = world.getBlockId(x, y, z);
|
||||||
if (meta == 12 && blockID == this.blockID)
|
if (meta == 12 && blockID == this.blockID)
|
||||||
|
|
@ -176,63 +195,55 @@ public class BlockBase extends Block
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock()
|
protected boolean canSilkHarvest() {
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
|
|
||||||
{
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
if(meta == 12)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int BlackSoulstoneDrops(int par1, Random random, int par3)
|
public static int BlackSoulstoneDrops(int par1, Random random, int par3) {
|
||||||
{
|
|
||||||
int rand = random.nextInt(2);
|
int rand = random.nextInt(2);
|
||||||
switch(rand)
|
switch (rand) {
|
||||||
{
|
case 0:
|
||||||
case 0:return Item.coal.itemID;
|
return Item.coal.itemID;
|
||||||
case 1:return Item.gunpowder.itemID;
|
case 1:
|
||||||
default:return Item.sugar.itemID;
|
return Item.gunpowder.itemID;
|
||||||
|
default:
|
||||||
|
return Item.sugar.itemID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int RedSoulstoneDrops(int par1, Random random, int par3)
|
public static int BlueSoulstoneDrops(int par1, Random random, int par3) {
|
||||||
{
|
|
||||||
int rand = random.nextInt(4);
|
|
||||||
switch(rand)
|
|
||||||
{
|
|
||||||
case 0:return Item.glowstone.itemID;
|
|
||||||
case 1:return Item.gunpowder.itemID;
|
|
||||||
case 2:return Item.redstone.itemID;
|
|
||||||
case 3:return Block.obsidian.blockID;
|
|
||||||
default:return Item.blazePowder.itemID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int BlueSoulstoneDrops(int par1, Random random, int par3)
|
|
||||||
{
|
|
||||||
int rand = random.nextInt(5);
|
int rand = random.nextInt(5);
|
||||||
switch(rand)
|
switch (rand) {
|
||||||
{
|
case 0:
|
||||||
case 0:return Item.diamond.itemID;
|
return Item.diamond.itemID;
|
||||||
case 1:return Block.obsidian.blockID;
|
case 1:
|
||||||
case 2:return Item.gunpowder.itemID;
|
return Block.obsidian.blockID;
|
||||||
case 3:return Item.glowstone.itemID;
|
case 2:
|
||||||
case 4:return Item.blazeRod.itemID;
|
return Item.gunpowder.itemID;
|
||||||
case 5:return Item.emerald.itemID;
|
case 3:
|
||||||
default:return Item.emerald.itemID;
|
return Item.glowstone.itemID;
|
||||||
|
case 4:
|
||||||
|
return Item.blazeRod.itemID;
|
||||||
|
case 5:
|
||||||
|
return Item.emerald.itemID;
|
||||||
|
default:
|
||||||
|
return Item.emerald.itemID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int RedSoulstoneDrops(int par1, Random random, int par3) {
|
||||||
|
int rand = random.nextInt(4);
|
||||||
|
switch (rand) {
|
||||||
|
case 0:
|
||||||
|
return Item.glowstone.itemID;
|
||||||
|
case 1:
|
||||||
|
return Item.gunpowder.itemID;
|
||||||
|
case 2:
|
||||||
|
return Item.redstone.itemID;
|
||||||
|
case 3:
|
||||||
|
return Block.obsidian.blockID;
|
||||||
|
default:
|
||||||
|
return Item.blazePowder.itemID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
package MysticOres.Blocks;
|
package mysticores.blocks;
|
||||||
|
|
||||||
|
import mysticores.lib.BlockID;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import MysticOres.Lib.BlockID;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class BlockHandler {
|
public class BlockHandler {
|
||||||
|
|
||||||
public static Block BlockBase;
|
public static Block BlockBase;
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize() {
|
||||||
{
|
|
||||||
BlockBase = new BlockBase(BlockID.BASEID).setStepSound(Block.soundStoneFootstep);
|
BlockBase = new BlockBase(BlockID.BASEID).setStepSound(Block.soundStoneFootstep);
|
||||||
GameRegistry.registerBlock(BlockBase, ItemBase.class, "Base Blocks");
|
GameRegistry.registerBlock(BlockBase, ItemBase.class, "Base Blocks");
|
||||||
|
|
||||||
setBlockHarvestLevels();
|
setBlockHarvestLevels();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,5 +28,4 @@ public class BlockHandler {
|
||||||
MinecraftForge.setBlockHarvestLevel(BlockBase, 10, "pickaxe", 2);
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 10, "pickaxe", 2);
|
||||||
MinecraftForge.setBlockHarvestLevel(BlockBase, 11, "pickaxe", 2);
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 11, "pickaxe", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,36 @@
|
||||||
package MysticOres.Blocks;
|
package mysticores.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import MysticOres.MysticOres;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemBase extends ItemBlock
|
public class ItemBase extends ItemBlock {
|
||||||
{
|
|
||||||
public static String[] BLOCK_NAMES = new String[] { "Adamantine Ore", "Amethyst Ore", "Iridium Ore", "Mithril Ore", "Tourmaline Ore", "Topaz Ore", "Verdite Ore", "Bloodstone", "Black Soulstone",
|
public static String[] BLOCK_NAMES = new String[] { "Adamantine Ore", "Amethyst Ore", "Iridium Ore", "Mithril Ore", "Tourmaline Ore", "Topaz Ore", "Verdite Ore", "Bloodstone", "Black Soulstone",
|
||||||
"Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass" };
|
"Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass" };
|
||||||
|
|
||||||
public ItemBase(int par1)
|
public ItemBase(int par1) {
|
||||||
{
|
|
||||||
super(par1);
|
super(par1);
|
||||||
setMaxDamage(0);
|
setMaxDamage(0);
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public Icon getIconFromDamage(int par1) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length);
|
return BlockHandler.BlockBase.getIcon(2, par1);
|
||||||
return BLOCK_NAMES[meta];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata(int par1)
|
public int getMetadata(int par1) {
|
||||||
{
|
|
||||||
return par1;
|
return par1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@Override
|
||||||
public Icon getIconFromDamage(int par1)
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
{
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length);
|
||||||
return BlockHandler.BlockBase.getIcon(2, par1);
|
return BLOCK_NAMES[meta];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import cpw.mods.fml.common.IFuelHandler;
|
import cpw.mods.fml.common.IFuelHandler;
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,18 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.ItemAxe;
|
import net.minecraft.item.ItemAxe;
|
||||||
import MysticOres.MysticOres;
|
|
||||||
|
|
||||||
public class ItemAxes extends ItemAxe
|
public class ItemAxes extends ItemAxe {
|
||||||
{
|
public ItemAxes(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
public ItemAxes(int par1, EnumToolMaterial par2EnumToolMaterial)
|
|
||||||
{
|
|
||||||
super(par1, par2EnumToolMaterial);
|
super(par1, par2EnumToolMaterial);
|
||||||
setCreativeTab(MysticOres.MysticOresTab);
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,18 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import MysticOres.MysticOres;
|
import mysticores.MysticOres;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.EnumRarity;
|
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.ItemHoe;
|
import net.minecraft.item.ItemHoe;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.Event.Result;
|
|
||||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
|
||||||
|
|
||||||
public class ItemHoes extends ItemHoe
|
public class ItemHoes extends ItemHoe {
|
||||||
{
|
public ItemHoes(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
|
||||||
public ItemHoes(int par1, EnumToolMaterial par2EnumToolMaterial)
|
|
||||||
{
|
|
||||||
super(par1, par2EnumToolMaterial);
|
super(par1, par2EnumToolMaterial);
|
||||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,18 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import MysticOres.MysticOres;
|
import mysticores.MysticOres;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.EnumRarity;
|
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.ItemPickaxe;
|
import net.minecraft.item.ItemPickaxe;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public class ItemPickaxes extends ItemPickaxe
|
public class ItemPickaxes extends ItemPickaxe {
|
||||||
{
|
public ItemPickaxes(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
|
||||||
public ItemPickaxes(int par1, EnumToolMaterial par2EnumToolMaterial)
|
|
||||||
{
|
|
||||||
super(par1, par2EnumToolMaterial);
|
super(par1, par2EnumToolMaterial);
|
||||||
|
|
||||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,66 +1,53 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import MysticOres.MysticOres;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemResource extends Item
|
public class ItemResource extends Item {
|
||||||
{
|
|
||||||
|
|
||||||
private Icon[] icons;
|
private Icon[] icons;
|
||||||
|
|
||||||
private static final String[] RESOURCE_TYPES = new String[] { "Verdite Ingot", "Mithril Ingot", "Adamantine Ingot", "Iridium Ingot", "Iridium Nugget", "Tourmaline Gem", "Agate Gem", "Topaz Gem",
|
private static final String[] RESOURCE_TYPES = new String[] { "Verdite Ingot", "Mithril Ingot", "Adamantine Ingot", "Iridium Ingot", "Iridium Nugget", "Tourmaline Gem", "Agate Gem", "Topaz Gem",
|
||||||
"Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod" };
|
"Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod" };
|
||||||
|
|
||||||
|
public ItemResource(int id) {
|
||||||
public ItemResource(int id)
|
|
||||||
{
|
|
||||||
super(id);
|
super(id);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public Icon getIconFromDamage(int meta) {
|
||||||
|
int j = MathHelper.clamp_int(meta, 0, RESOURCE_TYPES.length);
|
||||||
|
return icons[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
|
for (int var4 = 0; var4 < RESOURCE_TYPES.length; var4++)
|
||||||
|
par3List.add(new ItemStack(par1, 1, var4));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, RESOURCE_TYPES.length);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, RESOURCE_TYPES.length);
|
||||||
return RESOURCE_TYPES[meta];
|
return RESOURCE_TYPES[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
icons = new Icon[RESOURCE_TYPES.length];
|
icons = new Icon[RESOURCE_TYPES.length];
|
||||||
|
|
||||||
for (int i = 0; i < RESOURCE_TYPES.length; ++i)
|
for (int i = 0; i < RESOURCE_TYPES.length; ++i)
|
||||||
icons[i] = iconRegister.registerIcon("MysticMods:" + RESOURCE_TYPES[i]);
|
icons[i] = iconRegister.registerIcon("MysticMods:" + RESOURCE_TYPES[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int meta)
|
|
||||||
{
|
|
||||||
int j = MathHelper.clamp_int(meta, 0, RESOURCE_TYPES.length);
|
|
||||||
return icons[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
||||||
{
|
|
||||||
for (int var4 = 0; var4 < RESOURCE_TYPES.length; var4++)
|
|
||||||
par3List.add(new ItemStack(par1, 1, var4));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,31 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import MysticOres.MysticOres;
|
import mysticores.MysticOres;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.src.*;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemSatchel extends Item
|
public class ItemSatchel extends Item {
|
||||||
{
|
public ItemSatchel(int par1) {
|
||||||
|
|
||||||
public ItemSatchel(int par1)
|
|
||||||
{
|
|
||||||
super(par1);
|
super(par1);
|
||||||
setCreativeTab(MysticOres.MysticOresTab);
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
maxStackSize = 1;
|
maxStackSize = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public boolean hasEffect(ItemStack par1ItemStack) {
|
||||||
if(!player.isSneaking())
|
return true;
|
||||||
{
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player) {
|
||||||
|
if (!player.isSneaking()) {
|
||||||
IInventory inv;
|
IInventory inv;
|
||||||
inv = player.getInventoryEnderChest();
|
inv = player.getInventoryEnderChest();
|
||||||
player.displayGUIChest(inv);
|
player.displayGUIChest(inv);
|
||||||
|
|
@ -34,15 +33,8 @@ public class ItemSatchel extends Item
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,18 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
import MysticOres.MysticOres;
|
import mysticores.MysticOres;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.EnumRarity;
|
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.ItemSpade;
|
import net.minecraft.item.ItemSpade;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public class ItemShovels extends ItemSpade
|
public class ItemShovels extends ItemSpade {
|
||||||
{
|
public ItemShovels(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
|
||||||
public ItemShovels(int par1, EnumToolMaterial par2EnumToolMaterial)
|
|
||||||
{
|
|
||||||
super(par1, par2EnumToolMaterial);
|
super(par1, par2EnumToolMaterial);
|
||||||
|
|
||||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,18 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.ItemSword;
|
import net.minecraft.item.ItemSword;
|
||||||
import MysticOres.MysticOres;
|
|
||||||
|
|
||||||
public class ItemSwords extends ItemSword
|
public class ItemSwords extends ItemSword {
|
||||||
{
|
public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial)
|
|
||||||
{
|
|
||||||
super(par1, par2EnumToolMaterial);
|
super(par1, par2EnumToolMaterial);
|
||||||
setCreativeTab(MysticOres.MysticOresTab);
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
package MysticOres.Items;
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.lib.ItemID;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import MysticOres.Lib.ItemID;
|
|
||||||
import MysticOres.Util.ConfigurationManager;
|
|
||||||
|
|
||||||
public class Items
|
public class Items {
|
||||||
{
|
|
||||||
public static Item VerditeSword;
|
public static Item VerditeSword;
|
||||||
public static Item VerditePickaxe;
|
public static Item VerditePickaxe;
|
||||||
public static Item VerditeShovel;
|
public static Item VerditeShovel;
|
||||||
|
|
@ -36,14 +34,11 @@ public class Items
|
||||||
public static Item ObsidianShovel;
|
public static Item ObsidianShovel;
|
||||||
public static Item ObsidianAxe;
|
public static Item ObsidianAxe;
|
||||||
public static Item ObsidianHoe;
|
public static Item ObsidianHoe;
|
||||||
|
|
||||||
public static Item Resource;
|
public static Item Resource;
|
||||||
public static Item Satchel;
|
public static Item Satchel;
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize() {
|
||||||
{
|
|
||||||
Resource = new ItemResource(ItemID.RESOURCES);
|
Resource = new ItemResource(ItemID.RESOURCES);
|
||||||
|
|
||||||
VerditeSword = new ItemSwords(ItemID.VERDITESWORD, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
VerditeSword = new ItemSwords(ItemID.VERDITESWORD, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
||||||
VerditePickaxe = new ItemPickaxes(ItemID.VERDITEPICKAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
VerditePickaxe = new ItemPickaxes(ItemID.VERDITEPICKAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
||||||
VerditeShovel = new ItemShovels(ItemID.VERDITESHOVEL, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
VerditeShovel = new ItemShovels(ItemID.VERDITESHOVEL, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Lib;
|
package mysticores.lib;
|
||||||
|
|
||||||
public class BlockID
|
public class BlockID
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Lib;
|
package mysticores.lib;
|
||||||
|
|
||||||
public class ItemID
|
public class ItemID
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Lib;
|
package mysticores.lib;
|
||||||
|
|
||||||
public class Rarity
|
public class Rarity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Lib;
|
package mysticores.lib;
|
||||||
|
|
||||||
public class Strings {
|
public class Strings {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
package MysticOres;
|
package mysticores;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.items.IridiumFuelHandler;
|
||||||
|
import mysticores.items.Items;
|
||||||
|
import mysticores.util.ConfigurationManager;
|
||||||
|
import mysticores.util.Localizations;
|
||||||
|
import mysticores.util.OreDictManager;
|
||||||
|
import mysticores.util.RecipeManager;
|
||||||
|
import mysticores.util.TabMysticOres;
|
||||||
|
import mysticores.worldgen.GeneratorManager;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Items.IridiumFuelHandler;
|
|
||||||
import MysticOres.Items.Items;
|
|
||||||
import MysticOres.Util.ConfigurationManager;
|
|
||||||
import MysticOres.Util.Localizations;
|
|
||||||
import MysticOres.Util.OreDictManager;
|
|
||||||
import MysticOres.Util.RecipeManager;
|
|
||||||
import MysticOres.Util.TabMysticOres;
|
|
||||||
import MysticOres.Worldgen.GeneratorManager;
|
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
|
|
@ -21,27 +21,21 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
@Mod(modid = "Mystic Ores", name = "Mystic Ores", version = "0.1")
|
@Mod(modid = "Mystic Ores", name = "Mystic Ores", version = "0.1")
|
||||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||||
|
public class MysticOres {
|
||||||
public class MysticOres
|
|
||||||
{
|
|
||||||
@Instance("Mystic Ores")
|
@Instance("Mystic Ores")
|
||||||
public static MysticOres instance;
|
public static MysticOres instance;
|
||||||
|
|
||||||
public static CreativeTabs MysticOresTab = new TabMysticOres(CreativeTabs.getNextID(), "MysticOresTab");
|
public static CreativeTabs MysticOresTab = new TabMysticOres(CreativeTabs.getNextID(), "MysticOresTab");
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event)
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
{
|
|
||||||
ConfigurationManager.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Ores.cfg"));
|
ConfigurationManager.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Ores.cfg"));
|
||||||
ConfigurationManager.save();
|
ConfigurationManager.save();
|
||||||
|
|
||||||
BlockHandler.Initialize();
|
BlockHandler.Initialize();
|
||||||
Items.Initialize();
|
Items.Initialize();
|
||||||
RecipeManager.Initialize();
|
RecipeManager.Initialize();
|
||||||
OreDictManager.Initialize();
|
OreDictManager.Initialize();
|
||||||
GeneratorManager.Initialize();
|
GeneratorManager.Initialize();
|
||||||
Localizations.Initialize();
|
Localizations.Initialize();
|
||||||
|
|
||||||
GameRegistry.registerFuelHandler(new IridiumFuelHandler());
|
GameRegistry.registerFuelHandler(new IridiumFuelHandler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
package MysticOres.Util;
|
package mysticores.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import mysticores.lib.BlockID;
|
||||||
|
import mysticores.lib.ItemID;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraftforge.common.Configuration;
|
import net.minecraftforge.common.Configuration;
|
||||||
import MysticOres.Lib.BlockID;
|
|
||||||
import MysticOres.Lib.ItemID;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
|
|
||||||
public class ConfigurationManager
|
public class ConfigurationManager {
|
||||||
{
|
|
||||||
public static Configuration config;
|
public static Configuration config;
|
||||||
|
|
||||||
public static void initialize(File file)
|
public static void initialize(File file) {
|
||||||
{
|
|
||||||
config = new Configuration(file);
|
config = new Configuration(file);
|
||||||
|
|
||||||
ItemID.RESOURCES = config.getItem("Resource Items", ItemID.RESOURCES_DEFAULT).getInt();
|
ItemID.RESOURCES = config.getItem("Resource Items", ItemID.RESOURCES_DEFAULT).getInt();
|
||||||
ItemID.VERDITESWORD = config.getItem("Tools", "Verdite Sword", ItemID.VERDITESWORD_DEFAULT).getInt();
|
ItemID.VERDITESWORD = config.getItem("Tools", "Verdite Sword", ItemID.VERDITESWORD_DEFAULT).getInt();
|
||||||
ItemID.VERDITEPICKAXE = config.getItem("Tools", "Verdite Pickaxe", ItemID.VERDITEPICKAXE_DEFAULT).getInt();
|
ItemID.VERDITEPICKAXE = config.getItem("Tools", "Verdite Pickaxe", ItemID.VERDITEPICKAXE_DEFAULT).getInt();
|
||||||
|
|
@ -47,9 +44,7 @@ public class ConfigurationManager
|
||||||
ItemID.OBSIDIANAXE = config.getItem("Tools", "Obsidian Axe", ItemID.OBSIDIANAXE_DEFAULT).getInt();
|
ItemID.OBSIDIANAXE = config.getItem("Tools", "Obsidian Axe", ItemID.OBSIDIANAXE_DEFAULT).getInt();
|
||||||
ItemID.OBSIDIANHOE = config.getItem("Tools", "Obsidian Hoe", ItemID.OBSIDIANHOE_DEFAULT).getInt();
|
ItemID.OBSIDIANHOE = config.getItem("Tools", "Obsidian Hoe", ItemID.OBSIDIANHOE_DEFAULT).getInt();
|
||||||
ItemID.SATCHEL = config.getItem("Satchel ID", ItemID.SATCHEL_DEFAULT).getInt();
|
ItemID.SATCHEL = config.getItem("Satchel ID", ItemID.SATCHEL_DEFAULT).getInt();
|
||||||
|
|
||||||
BlockID.BASEID = config.getBlock("Base Block ID", BlockID.BASEID_DEFAULT).getInt();
|
BlockID.BASEID = config.getBlock("Base Block ID", BlockID.BASEID_DEFAULT).getInt();
|
||||||
|
|
||||||
Rarity.VERDITE = config.get("Ore Rarity", "Verdite Ore", Rarity.VERDITE_DEFAULT).getInt();
|
Rarity.VERDITE = config.get("Ore Rarity", "Verdite Ore", Rarity.VERDITE_DEFAULT).getInt();
|
||||||
Rarity.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL_DEFAULT).getInt();
|
Rarity.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL_DEFAULT).getInt();
|
||||||
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE_DEFAULT).getInt();
|
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE_DEFAULT).getInt();
|
||||||
|
|
@ -61,12 +56,10 @@ public class ConfigurationManager
|
||||||
Rarity.REDSOULSTONE = config.get("Nether Ore Rarity", "Red Soulstone", Rarity.REDSOULSTONE_DEFAULT).getInt();
|
Rarity.REDSOULSTONE = config.get("Nether Ore Rarity", "Red Soulstone", Rarity.REDSOULSTONE_DEFAULT).getInt();
|
||||||
Rarity.BLACKSOULSTONE = config.get("Nether Ore Rarity", "Black Soulstone", Rarity.BLACKSOULSTONE_DEFAULT).getInt();
|
Rarity.BLACKSOULSTONE = config.get("Nether Ore Rarity", "Black Soulstone", Rarity.BLACKSOULSTONE_DEFAULT).getInt();
|
||||||
Rarity.BLUESOULSTONE = config.get("Nether Ore Rarity", "Blue Soulstone", Rarity.BLUESOULSTONE_DEFAULT).getInt();
|
Rarity.BLUESOULSTONE = config.get("Nether Ore Rarity", "Blue Soulstone", Rarity.BLUESOULSTONE_DEFAULT).getInt();
|
||||||
|
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void save()
|
public static void save() {
|
||||||
{
|
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Util;
|
package mysticores.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -11,9 +11,10 @@ import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipException;
|
import java.util.zip.ZipException;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import MysticOres.MysticOres;
|
import mysticores.MysticOres;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* All credits go to copygirl (or copy....boy) for this one
|
* All credits go to copygirl (or copy....boy) for this one
|
||||||
|
|
@ -21,17 +22,14 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
* repository, many thanks friend c:
|
* repository, many thanks friend c:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
public class Localizations {
|
||||||
|
private Localizations() {
|
||||||
|
}
|
||||||
|
|
||||||
public class Localizations
|
public static void Initialize() {
|
||||||
{
|
|
||||||
private Localizations(){}
|
|
||||||
|
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
File source = Loader.instance().getReversedModObjectList().get(MysticOres.instance).getSource();
|
File source = Loader.instance().getReversedModObjectList().get(MysticOres.instance).getSource();
|
||||||
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
|
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
|
||||||
for(String file : getResources(source, pattern))
|
for (String file : getResources(source, pattern)) {
|
||||||
{
|
|
||||||
Matcher matcher = pattern.matcher(file);
|
Matcher matcher = pattern.matcher(file);
|
||||||
matcher.find();
|
matcher.find();
|
||||||
String resource = "/" + matcher.group(1);
|
String resource = "/" + matcher.group(1);
|
||||||
|
|
@ -41,72 +39,57 @@ public class Localizations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<String> getResources(File file, Pattern pattern)
|
private static Collection<String> getResources(File file, Pattern pattern) {
|
||||||
{
|
|
||||||
ArrayList<String> retval = new ArrayList<String>();
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
if (file.isDirectory())
|
if (file.isDirectory())
|
||||||
retval.addAll(getResourcesFromDirectory(file, pattern));
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
else retval.addAll(getResourcesFromJarFile(file, pattern));
|
else
|
||||||
|
retval.addAll(getResourcesFromJarFile(file, pattern));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern)
|
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern) {
|
||||||
{
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
File[] FileList = directory.listFiles();
|
||||||
|
for (File file : FileList) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
|
} else
|
||||||
|
try {
|
||||||
|
String fileName = file.getCanonicalPath().replace('\\', '/');
|
||||||
|
boolean accept = pattern.matcher(fileName).matches();
|
||||||
|
if (accept)
|
||||||
|
retval.add(fileName);
|
||||||
|
} catch (final IOException e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern) {
|
||||||
ArrayList<String> retval = new ArrayList<String>();
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
ZipFile Zip;
|
ZipFile Zip;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Zip = new ZipFile(file);
|
Zip = new ZipFile(file);
|
||||||
}
|
} catch (ZipException Ex) {
|
||||||
catch (ZipException Ex)
|
|
||||||
{
|
|
||||||
throw new Error(Ex);
|
throw new Error(Ex);
|
||||||
}
|
} catch (IOException Ex) {
|
||||||
catch(IOException Ex)
|
|
||||||
{
|
|
||||||
throw new Error(Ex);
|
throw new Error(Ex);
|
||||||
}
|
}
|
||||||
Enumeration<? extends ZipEntry> entries = Zip.entries();
|
Enumeration<? extends ZipEntry> entries = Zip.entries();
|
||||||
while (entries.hasMoreElements())
|
while (entries.hasMoreElements()) {
|
||||||
{
|
|
||||||
ZipEntry ZipE = entries.nextElement();
|
ZipEntry ZipE = entries.nextElement();
|
||||||
String FileName = ZipE.getName();
|
String FileName = ZipE.getName();
|
||||||
boolean accept = pattern.matcher(FileName).matches();
|
boolean accept = pattern.matcher(FileName).matches();
|
||||||
if (accept)
|
if (accept)
|
||||||
retval.add(FileName);
|
retval.add(FileName);
|
||||||
}
|
}
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Zip.close();
|
Zip.close();
|
||||||
}
|
} catch (IOException Ex) {
|
||||||
catch(IOException Ex)
|
|
||||||
{
|
|
||||||
throw new Error(Ex);
|
throw new Error(Ex);
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern)
|
|
||||||
{
|
|
||||||
ArrayList<String> retval = new ArrayList<String>();
|
|
||||||
File[] FileList = directory.listFiles();
|
|
||||||
for (File file : FileList)
|
|
||||||
{
|
|
||||||
if (file.isDirectory())
|
|
||||||
{
|
|
||||||
retval.addAll(getResourcesFromDirectory(file, pattern));
|
|
||||||
}
|
|
||||||
else try
|
|
||||||
{
|
|
||||||
String fileName = file.getCanonicalPath().replace('\\', '/');
|
|
||||||
boolean accept = pattern.matcher(fileName).matches();
|
|
||||||
if (accept) retval.add(fileName);
|
|
||||||
}
|
|
||||||
catch(final IOException e)
|
|
||||||
{
|
|
||||||
throw new Error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
package MysticOres.Util;
|
package mysticores.util;
|
||||||
|
|
||||||
import MysticOres.Blocks.BlockHandler;
|
import mysticores.blocks.BlockHandler;
|
||||||
import MysticOres.Items.Items;
|
import mysticores.items.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
public class OreDictManager
|
public class OreDictManager {
|
||||||
{
|
public static void Initialize() {
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
OreDictionary.registerOre("ingotAdamantine", new ItemStack(Items.Resource, 1, 2));
|
OreDictionary.registerOre("ingotAdamantine", new ItemStack(Items.Resource, 1, 2));
|
||||||
OreDictionary.registerOre("ingotMithril", new ItemStack(Items.Resource, 1, 1));
|
OreDictionary.registerOre("ingotMithril", new ItemStack(Items.Resource, 1, 1));
|
||||||
OreDictionary.registerOre("ingotVerdite", new ItemStack(Items.Resource, 1, 0));
|
OreDictionary.registerOre("ingotVerdite", new ItemStack(Items.Resource, 1, 0));
|
||||||
|
|
@ -18,7 +16,6 @@ public class OreDictManager
|
||||||
OreDictionary.registerOre("gemTopaz", new ItemStack(Items.Resource, 1, 7));
|
OreDictionary.registerOre("gemTopaz", new ItemStack(Items.Resource, 1, 7));
|
||||||
OreDictionary.registerOre("gemAmethyst", new ItemStack(Items.Resource, 1, 8));
|
OreDictionary.registerOre("gemAmethyst", new ItemStack(Items.Resource, 1, 8));
|
||||||
OreDictionary.registerOre("gemAgate", new ItemStack(Items.Resource, 1, 6));
|
OreDictionary.registerOre("gemAgate", new ItemStack(Items.Resource, 1, 6));
|
||||||
|
|
||||||
OreDictionary.registerOre("oreAdamantine", new ItemStack(BlockHandler.BlockBase, 1, 0));
|
OreDictionary.registerOre("oreAdamantine", new ItemStack(BlockHandler.BlockBase, 1, 0));
|
||||||
OreDictionary.registerOre("oreAmethyst", new ItemStack(BlockHandler.BlockBase, 1, 1));
|
OreDictionary.registerOre("oreAmethyst", new ItemStack(BlockHandler.BlockBase, 1, 1));
|
||||||
OreDictionary.registerOre("oreIridium", new ItemStack(BlockHandler.BlockBase, 1, 2));
|
OreDictionary.registerOre("oreIridium", new ItemStack(BlockHandler.BlockBase, 1, 2));
|
||||||
|
|
|
||||||
|
|
@ -1,201 +1,63 @@
|
||||||
package MysticOres.Util;
|
package mysticores.util;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.items.Items;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Items.Items;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class RecipeManager
|
public class RecipeManager {
|
||||||
{
|
public static void Initialize() {
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
Recipes();
|
Recipes();
|
||||||
ToolRecipes();
|
ToolRecipes();
|
||||||
PowderRecipes();
|
PowderRecipes();
|
||||||
Smelting();
|
Smelting();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Recipes()
|
private static void PowderRecipes() {
|
||||||
{
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreGold, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreGold });
|
||||||
GameRegistry.addRecipe(new ItemStack(Block.glass, 1), new Object [] {
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreIron, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreIron });
|
||||||
"##", "##", '#', new ItemStack(Items.Resource, 1, 11)
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 2, 10), new Object[] { new ItemStack(Items.Resource, 1, 9), new ItemStack(Items.Resource, 1, 10) });
|
||||||
});
|
GameRegistry.addShapelessRecipe(new ItemStack(Item.gunpowder, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Item.gunpowder });
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 2, 4), new Object[] { new ItemStack(Items.Resource, 1, 9), new ItemStack(Items.Resource, 1, 4) });
|
||||||
GameRegistry.addRecipe(new ItemStack(Block.obsidian, 1), new Object[] {
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreCoal, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreCoal });
|
||||||
"##", "##", '#', new ItemStack(Items.Resource, 1, 12)
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreIron, 3), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreIron });
|
||||||
});
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreGold, 3), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreGold });
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreRedstone, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreRedstone });
|
||||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), new Object[] {
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreLapis, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreLapis });
|
||||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), new ItemStack(Items.Resource, 1, 6)
|
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreDiamond, 2), new Object[] { new ItemStack(Items.Resource, 1, 9), Block.oreDiamond });
|
||||||
});
|
GameRegistry.addShapelessRecipe(new ItemStack(Item.sugar, 18), new Object[] { new ItemStack(Items.Resource, 1, 9), Item.sugar });
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(Item.redstone, 12), new Object[] { new ItemStack(Items.Resource, 1, 9), Item.redstone });
|
||||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), new Object[] {
|
GameRegistry.addShapelessRecipe(new ItemStack(Item.glowstone, 6), new Object[] { new ItemStack(Items.Resource, 1, 9), Item.glowstone });
|
||||||
"XXX", "XOX", "XXX", Character.valueOf('X'), new ItemStack(BlockHandler.BlockBase, 1, 3), Character.valueOf('O'), new ItemStack(Items.Resource, 1, 6)
|
GameRegistry.addShapelessRecipe(new ItemStack(Item.gunpowder, 3), new Object[] { new ItemStack(Items.Resource, 1, 9), Item.gunpowder });
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), new Object[] {
|
|
||||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), new ItemStack(Items.Resource, 1, 8)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 12), new Object[] {
|
|
||||||
"###", "#D#", "###", '#', new ItemStack(Items.Resource, 1, 11), 'D', new ItemStack(Items.Resource, 1, 12)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 1, 7), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(Items.Resource, 1, 10)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockBase, 2, 7), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), new ItemStack(BlockHandler.BlockBase, 1, 7)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockBase, 2, 3), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), new ItemStack(BlockHandler.BlockBase, 1, 3)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockBase, 2, 0), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), new ItemStack(BlockHandler.BlockBase, 1, 0)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(Items.Resource, 2, 13), new Object[] {
|
|
||||||
"#", "#", '#', new ItemStack(Items.Resource, 1, 12)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(Items.Resource, 1, 3), new Object[] {
|
|
||||||
"###", "#O#", "###", '#', new ItemStack(Items.Resource, 1, 4), 'O', new ItemStack(Items.Resource, 1, 2)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), new Object[] {
|
|
||||||
Block.glass
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), new Object[] {
|
|
||||||
Block.obsidian
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 8, 9), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 5), new ItemStack(Items.Resource, 1, 7), new ItemStack(Items.Resource, 1, 8), new ItemStack(Items.Resource, 1, 6)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ToolRecipes()
|
private static void Recipes() {
|
||||||
{
|
GameRegistry.addRecipe(new ItemStack(Block.glass, 1), new Object[] { "##", "##", '#', new ItemStack(Items.Resource, 1, 11) });
|
||||||
ToolRecipes.SwordRecipe(Items.VerditeSword, new ItemStack(Items.Resource, 1, 0));
|
GameRegistry.addRecipe(new ItemStack(Block.obsidian, 1), new Object[] { "##", "##", '#', new ItemStack(Items.Resource, 1, 12) });
|
||||||
ToolRecipes.PickaxeRecipe(Items.VerditePickaxe, new ItemStack(Items.Resource, 1, 0));
|
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), new Object[] { "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
|
||||||
ToolRecipes.ShovelRecipe(Items.VerditeShovel, new ItemStack(Items.Resource, 1, 0));
|
new ItemStack(Items.Resource, 1, 6) });
|
||||||
ToolRecipes.AxeRecipe(Items.VerditeAxe, new ItemStack(Items.Resource, 1, 0));
|
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7),
|
||||||
ToolRecipes.HoeRecipe(Items.VerditeHoe, new ItemStack(Items.Resource, 1, 0));
|
new Object[] { "XXX", "XOX", "XXX", Character.valueOf('X'), new ItemStack(BlockHandler.BlockBase, 1, 3), Character.valueOf('O'), new ItemStack(Items.Resource, 1, 6) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), new Object[] { "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
|
||||||
ToolRecipes.SwordRecipe(Items.MithrilSword, new ItemStack(Items.Resource, 1, 1));
|
new ItemStack(Items.Resource, 1, 8) });
|
||||||
ToolRecipes.PickaxeRecipe(Items.MithrilPickaxe, new ItemStack(Items.Resource, 1, 1));
|
GameRegistry
|
||||||
ToolRecipes.ShovelRecipe(Items.MithrilShovel, new ItemStack(Items.Resource, 1, 1));
|
.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 12), new Object[] { "###", "#D#", "###", '#', new ItemStack(Items.Resource, 1, 11), 'D', new ItemStack(Items.Resource, 1, 12) });
|
||||||
ToolRecipes.AxeRecipe(Items.MithrilAxe, new ItemStack(Items.Resource, 1, 1));
|
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 1, 7), new Object[] { "##", "##", '#', new ItemStack(Items.Resource, 1, 10) });
|
||||||
ToolRecipes.HoeRecipe(Items.MithrilHoe, new ItemStack(Items.Resource, 1, 1));
|
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockBase, 2, 7), new Object[] { new ItemStack(Items.Resource, 1, 9), new ItemStack(BlockHandler.BlockBase, 1, 7) });
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockBase, 2, 3), new Object[] { new ItemStack(Items.Resource, 1, 9), new ItemStack(BlockHandler.BlockBase, 1, 3) });
|
||||||
ToolRecipes.AdvancedSwordRecipe(Items.AdamantineSword, new ItemStack(Items.Resource, 1, 2));
|
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockBase, 2, 0), new Object[] { new ItemStack(Items.Resource, 1, 9), new ItemStack(BlockHandler.BlockBase, 1, 0) });
|
||||||
ToolRecipes.AdvancedPickaxeRecipe(Items.AdamantinePickaxe, new ItemStack(Items.Resource, 1, 2));
|
GameRegistry.addRecipe(new ItemStack(Items.Resource, 2, 13), new Object[] { "#", "#", '#', new ItemStack(Items.Resource, 1, 12) });
|
||||||
ToolRecipes.AdvancedShovelRecipe(Items.AdamantineShovel, new ItemStack(Items.Resource, 1, 2));
|
GameRegistry.addRecipe(new ItemStack(Items.Resource, 1, 3), new Object[] { "###", "#O#", "###", '#', new ItemStack(Items.Resource, 1, 4), 'O', new ItemStack(Items.Resource, 1, 2) });
|
||||||
ToolRecipes.AdvancedAxeRecipe(Items.AdamantineAxe, new ItemStack(Items.Resource, 1, 2));
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), new Object[] { Block.glass });
|
||||||
ToolRecipes.AdvancedHoeRecipe(Items.AdamantineHoe, new ItemStack(Items.Resource, 1, 2));
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), new Object[] { Block.obsidian });
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 8, 9), new Object[] { new ItemStack(Items.Resource, 1, 5), new ItemStack(Items.Resource, 1, 7),
|
||||||
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, new ItemStack(Items.Resource, 1, 3));
|
new ItemStack(Items.Resource, 1, 8), new ItemStack(Items.Resource, 1, 6) });
|
||||||
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
|
|
||||||
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, new ItemStack(Items.Resource, 1, 3));
|
|
||||||
|
|
||||||
ToolRecipes.AdvancedSwordRecipe(Items.ObsidianSword, new ItemStack(Block.obsidian));
|
|
||||||
ToolRecipes.AdvancedPickaxeRecipe(Items.ObsidianPickaxe, new ItemStack(Block.obsidian));
|
|
||||||
ToolRecipes.AdvancedShovelRecipe(Items.ObsidianShovel, new ItemStack(Block.obsidian));
|
|
||||||
ToolRecipes.AdvancedAxeRecipe(Items.ObsidianAxe, new ItemStack(Block.obsidian));
|
|
||||||
ToolRecipes.AdvancedHoeRecipe(Items.ObsidianHoe, new ItemStack(Block.obsidian));
|
|
||||||
|
|
||||||
ToolRecipes.AdvancedSwordRecipe(Items.BloodstoneSword, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
|
||||||
ToolRecipes.AdvancedPickaxeRecipe(Items.BloodstonePickaxe, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
|
||||||
ToolRecipes.AdvancedShovelRecipe(Items.BloodstoneShovel, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
|
||||||
ToolRecipes.AdvancedAxeRecipe(Items.BloodstoneAxe, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
|
||||||
ToolRecipes.AdvancedHoeRecipe(Items.BloodstoneHoe, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(Items.Satchel, 1), new Object[] {
|
|
||||||
"#$#", "$%$", "#$#", '#', Item.silk, '$', new ItemStack(Items.Resource, 1, 9), '%', Block.enderChest
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PowderRecipes()
|
private static void Smelting() {
|
||||||
{
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreGold, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreGold
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreIron, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreIron
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 2, 10), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), new ItemStack(Items.Resource, 1, 10)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.gunpowder, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Item.gunpowder
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 2, 4), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), new ItemStack(Items.Resource, 1, 4)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreCoal, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreCoal
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreIron, 3), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreIron
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreGold, 3), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreGold
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreRedstone, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreRedstone
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreLapis, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreLapis
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreDiamond, 2), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Block.oreDiamond
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.sugar, 18), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Item.sugar
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.redstone, 12), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Item.redstone
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.glowstone, 6), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Item.glowstone
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.gunpowder, 3), new Object[] {
|
|
||||||
new ItemStack(Items.Resource, 1, 9), Item.gunpowder
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Smelting()
|
|
||||||
{
|
|
||||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 0, new ItemStack(Items.Resource, 1, 2), 0.9F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 0, new ItemStack(Items.Resource, 1, 2), 0.9F);
|
||||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 3, new ItemStack(Items.Resource, 1, 1), 0.7F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 3, new ItemStack(Items.Resource, 1, 1), 0.7F);
|
||||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 6, new ItemStack(Items.Resource, 1, 0), 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 6, new ItemStack(Items.Resource, 1, 0), 0.4F);
|
||||||
|
|
@ -206,4 +68,43 @@ public class RecipeManager
|
||||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 7, new ItemStack(Items.Resource, 1, 10), 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 7, new ItemStack(Items.Resource, 1, 10), 0.4F);
|
||||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 11, new ItemStack(Items.Resource, 1, 6), 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 11, new ItemStack(Items.Resource, 1, 6), 0.4F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ToolRecipes() {
|
||||||
|
ToolRecipes.SwordRecipe(Items.VerditeSword, new ItemStack(Items.Resource, 1, 0));
|
||||||
|
ToolRecipes.PickaxeRecipe(Items.VerditePickaxe, new ItemStack(Items.Resource, 1, 0));
|
||||||
|
ToolRecipes.ShovelRecipe(Items.VerditeShovel, new ItemStack(Items.Resource, 1, 0));
|
||||||
|
ToolRecipes.AxeRecipe(Items.VerditeAxe, new ItemStack(Items.Resource, 1, 0));
|
||||||
|
ToolRecipes.HoeRecipe(Items.VerditeHoe, new ItemStack(Items.Resource, 1, 0));
|
||||||
|
ToolRecipes.SwordRecipe(Items.MithrilSword, new ItemStack(Items.Resource, 1, 1));
|
||||||
|
ToolRecipes.PickaxeRecipe(Items.MithrilPickaxe, new ItemStack(Items.Resource, 1, 1));
|
||||||
|
ToolRecipes.ShovelRecipe(Items.MithrilShovel, new ItemStack(Items.Resource, 1, 1));
|
||||||
|
ToolRecipes.AxeRecipe(Items.MithrilAxe, new ItemStack(Items.Resource, 1, 1));
|
||||||
|
ToolRecipes.HoeRecipe(Items.MithrilHoe, new ItemStack(Items.Resource, 1, 1));
|
||||||
|
ToolRecipes.AdvancedSwordRecipe(Items.AdamantineSword, new ItemStack(Items.Resource, 1, 2));
|
||||||
|
ToolRecipes.AdvancedPickaxeRecipe(Items.AdamantinePickaxe, new ItemStack(Items.Resource, 1, 2));
|
||||||
|
ToolRecipes.AdvancedShovelRecipe(Items.AdamantineShovel, new ItemStack(Items.Resource, 1, 2));
|
||||||
|
ToolRecipes.AdvancedAxeRecipe(Items.AdamantineAxe, new ItemStack(Items.Resource, 1, 2));
|
||||||
|
ToolRecipes.AdvancedHoeRecipe(Items.AdamantineHoe, new ItemStack(Items.Resource, 1, 2));
|
||||||
|
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, new ItemStack(Items.Resource, 1, 3));
|
||||||
|
ToolRecipes.AdvancedSwordRecipe(Items.ObsidianSword, new ItemStack(Block.obsidian));
|
||||||
|
ToolRecipes.AdvancedPickaxeRecipe(Items.ObsidianPickaxe, new ItemStack(Block.obsidian));
|
||||||
|
ToolRecipes.AdvancedShovelRecipe(Items.ObsidianShovel, new ItemStack(Block.obsidian));
|
||||||
|
ToolRecipes.AdvancedAxeRecipe(Items.ObsidianAxe, new ItemStack(Block.obsidian));
|
||||||
|
ToolRecipes.AdvancedHoeRecipe(Items.ObsidianHoe, new ItemStack(Block.obsidian));
|
||||||
|
ToolRecipes.AdvancedSwordRecipe(Items.BloodstoneSword, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
||||||
|
ToolRecipes.AdvancedPickaxeRecipe(Items.BloodstonePickaxe, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
||||||
|
ToolRecipes.AdvancedShovelRecipe(Items.BloodstoneShovel, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
||||||
|
ToolRecipes.AdvancedAxeRecipe(Items.BloodstoneAxe, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
||||||
|
ToolRecipes.AdvancedHoeRecipe(Items.BloodstoneHoe, new ItemStack(BlockHandler.BlockBase, 1, 7));
|
||||||
|
GameRegistry.addRecipe(new ItemStack(Items.Satchel, 1), new Object[] { "#$#", "$%$", "#$#", '#', Item.silk, '$', new ItemStack(Items.Resource, 1, 9), '%', Block.enderChest });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,16 @@
|
||||||
package MysticOres.Util;
|
package mysticores.util;
|
||||||
|
|
||||||
import MysticOres.Blocks.BlockHandler;
|
import mysticores.blocks.BlockHandler;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class TabMysticOres extends CreativeTabs
|
public class TabMysticOres extends CreativeTabs {
|
||||||
{
|
public TabMysticOres(int par1, String par2Str) {
|
||||||
public TabMysticOres(int par1, String par2Str)
|
|
||||||
{
|
|
||||||
super(par1, par2Str);
|
super(par1, par2Str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getIconItemStack()
|
public ItemStack getIconItemStack() {
|
||||||
{
|
|
||||||
return new ItemStack(BlockHandler.BlockBase, 1, 7);
|
return new ItemStack(BlockHandler.BlockBase, 1, 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,90 +1,53 @@
|
||||||
package MysticOres.Util;
|
package mysticores.util;
|
||||||
|
|
||||||
import MysticOres.Items.Items;
|
import mysticores.items.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class ToolRecipes
|
public class ToolRecipes {
|
||||||
{
|
public static void AdvancedAxeRecipe(Item output, ItemStack input) {
|
||||||
public static void SwordRecipe(Item output, ItemStack input)
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "## ", "#S ", " S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
{
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "## ", "S# ", "S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
|
||||||
"#", "#", "S", 'S', "stickWood", '#', input));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void PickaxeRecipe(Item output, ItemStack input)
|
public static void AdvancedHoeRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "## ", " S ", " S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "## ", "S ", "S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
"###", " S ", " S ", 'S', "stickWood", '#', input));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShovelRecipe(Item output, ItemStack input)
|
public static void AdvancedPickaxeRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "###", " S ", " S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
|
||||||
"#", "S", "S", 'S', "stickWood", '#', input));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AxeRecipe(Item output, ItemStack input)
|
public static void AdvancedShovelRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "#", "S", "S", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
|
||||||
"## ", "#S ", " S ", 'S', "stickWood", '#', input));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
|
||||||
"## ", "S# ", "S ", 'S', "stickWood", '#', input));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HoeRecipe(Item output, ItemStack input)
|
public static void AdvancedSwordRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "#", "#", "S", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
|
||||||
"## ", " S ", " S ", 'S', "stickWood", '#', input));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
|
|
||||||
"## ", "S ", "S ", 'S', "stickWood", '#', input));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AxeRecipe(Item output, ItemStack input) {
|
||||||
public static void AdvancedSwordRecipe(Item output, ItemStack input)
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "## ", "#S ", " S ", 'S', "stickWood", '#', input));
|
||||||
{
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "## ", "S# ", "S ", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
|
||||||
"#", "#", "S", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AdvancedPickaxeRecipe(Item output, ItemStack input)
|
public static void HoeRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "## ", " S ", " S ", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "## ", "S ", "S ", 'S', "stickWood", '#', input));
|
||||||
"###", " S ", " S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AdvancedShovelRecipe(Item output, ItemStack input)
|
public static void PickaxeRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "###", " S ", " S ", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
|
||||||
"#", "S", "S", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AdvancedAxeRecipe(Item output, ItemStack input)
|
public static void ShovelRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "#", "S", "S", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
|
||||||
"## ", "#S ", " S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
|
||||||
"## ", "S# ", "S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AdvancedHoeRecipe(Item output, ItemStack input)
|
public static void SwordRecipe(Item output, ItemStack input) {
|
||||||
{
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "#", "#", "S", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
|
||||||
"## ", " S ", " S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] {
|
|
||||||
"## ", "S ", "S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import MysticOres.Blocks.BlockHandler;
|
import mysticores.blocks.BlockHandler;
|
||||||
import MysticOres.Lib.Rarity;
|
import mysticores.lib.Rarity;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class GeneratorManager
|
public class GeneratorManager {
|
||||||
{
|
public static void Initialize() {
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
GameRegistry.registerWorldGenerator(new WorldGenVerdite());
|
GameRegistry.registerWorldGenerator(new WorldGenVerdite());
|
||||||
GameRegistry.registerWorldGenerator(new WorldGenTopaz());
|
GameRegistry.registerWorldGenerator(new WorldGenTopaz());
|
||||||
GameRegistry.registerWorldGenerator(new WorldGenTourmaline());
|
GameRegistry.registerWorldGenerator(new WorldGenTourmaline());
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,28 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenAdamantine implements IWorldGenerator {
|
public class WorldGenAdamantine implements IWorldGenerator {
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
@Override
|
||||||
{
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
for (int i = 0; i < Rarity.ADAMANTINE; i++)
|
for (int i = 0; i < Rarity.ADAMANTINE; i++) {
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(8);
|
int Xcoord = blockX + random.nextInt(8);
|
||||||
int Ycoord = random.nextInt(16);
|
int Ycoord = random.nextInt(16);
|
||||||
int Zcoord = blockZ + random.nextInt(8);
|
int Zcoord = blockZ + random.nextInt(8);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 0, 3)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 0, 3)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,29 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenAgate implements IWorldGenerator
|
public class WorldGenAgate implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
for (int i = 0; i < Rarity.AGATE; i++)
|
for (int i = 0; i < Rarity.AGATE; i++) {
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(32);
|
int Xcoord = blockX + random.nextInt(32);
|
||||||
int Ycoord = random.nextInt(60);
|
int Ycoord = random.nextInt(60);
|
||||||
int Zcoord = blockZ + random.nextInt(32);
|
int Zcoord = blockZ + random.nextInt(32);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 11, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 11, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,29 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenAmethyst implements IWorldGenerator {
|
public class WorldGenAmethyst implements IWorldGenerator {
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
@Override
|
||||||
{
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; i < Rarity.AMETHYST; i++) {
|
||||||
for (int i = 0; i < Rarity.AMETHYST; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(24);
|
int Xcoord = blockX + random.nextInt(24);
|
||||||
int Ycoord = random.nextInt(60);
|
int Ycoord = random.nextInt(60);
|
||||||
int Zcoord = blockZ + random.nextInt(24);
|
int Zcoord = blockZ + random.nextInt(24);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 1, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 1, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,29 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenIridium implements IWorldGenerator {
|
public class WorldGenIridium implements IWorldGenerator {
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
@Override
|
||||||
{
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; i < Rarity.IRIDIUM; i++) {
|
||||||
for (int i = 0; i < Rarity.IRIDIUM; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(12);
|
int Ycoord = random.nextInt(12);
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 2, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 2, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,29 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenMithril implements IWorldGenerator {
|
public class WorldGenMithril implements IWorldGenerator {
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
@Override
|
||||||
{
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
for (int i = 0; i < Rarity.MITHRIL; i++)
|
for (int i = 0; i < Rarity.MITHRIL; i++) {
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(64);
|
int Ycoord = random.nextInt(64);
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 3, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 3, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,29 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenTopaz implements IWorldGenerator {
|
public class WorldGenTopaz implements IWorldGenerator {
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
@Override
|
||||||
{
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
for (int i = 0; i < Rarity.TOPAZ; i++)
|
for (int i = 0; i < Rarity.TOPAZ; i++) {
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(60);
|
int Ycoord = random.nextInt(60);
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 5, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 5, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,21 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenTourmaline implements IWorldGenerator {
|
public class WorldGenTourmaline implements IWorldGenerator {
|
||||||
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,7 +24,6 @@ public class WorldGenTourmaline implements IWorldGenerator {
|
||||||
int Xcoord = blockX + random.nextInt(32);
|
int Xcoord = blockX + random.nextInt(32);
|
||||||
int Ycoord = random.nextInt(60);
|
int Ycoord = random.nextInt(60);
|
||||||
int Zcoord = blockZ + random.nextInt(32);
|
int Zcoord = blockZ + random.nextInt(32);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 4, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 4, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,29 @@
|
||||||
package MysticOres.Worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import MysticOres.Lib.Rarity;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldGenVerdite implements IWorldGenerator {
|
public class WorldGenVerdite implements IWorldGenerator {
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
@Override
|
||||||
{
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
switch (world.provider.dimensionId)
|
switch (world.provider.dimensionId) {
|
||||||
{
|
case 0:
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; i < Rarity.VERDITE; i++) {
|
||||||
for (int i = 0; i < Rarity.VERDITE; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(20) + 80;
|
int Ycoord = random.nextInt(20) + 80;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
||||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 6, 9, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 6, 9, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticRuins;
|
package mysticruins;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
|
@ -13,12 +12,10 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.common.ModMetadata;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockPlanks extends Block {
|
public class BlockPlanks extends Block {
|
||||||
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockPlanks(int ID) {
|
public BlockPlanks(int ID) {
|
||||||
|
|
@ -31,53 +28,30 @@ public class BlockPlanks extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int j)
|
public int damageDropped(int j) {
|
||||||
{
|
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
@Override
|
||||||
{
|
public Icon getIcon(int side, int meta) {
|
||||||
|
return textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||||
int id = idPicked(world, x, y, z);
|
int id = idPicked(world, x, y, z);
|
||||||
|
if (id == 0) {
|
||||||
if (id == 0)
|
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item item = Item.itemsList[id];
|
Item item = Item.itemsList[id];
|
||||||
if (item == null)
|
if (item == null) {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
public void registerIcons(IconRegister iconRegister)
|
|
||||||
{
|
|
||||||
textures = new Icon[16];
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemPlanks.PLANK_TYPE[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Icon getIcon(int side, int meta)
|
|
||||||
{
|
|
||||||
return textures[meta];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
|
||||||
{
|
|
||||||
list.add(new ItemStack(i, 1, 0));
|
list.add(new ItemStack(i, 1, 0));
|
||||||
list.add(new ItemStack(i, 1, 1));
|
list.add(new ItemStack(i, 1, 1));
|
||||||
list.add(new ItemStack(i, 1, 2));
|
list.add(new ItemStack(i, 1, 2));
|
||||||
|
|
@ -87,5 +61,12 @@ public class BlockPlanks extends Block {
|
||||||
list.add(new ItemStack(i, 1, 6));
|
list.add(new ItemStack(i, 1, 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < 7; i++) {
|
||||||
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemPlanks.PLANK_TYPE[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.common.ModMetadata;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockReinforced extends Block {
|
public class BlockReinforced extends Block {
|
||||||
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockReinforced(int ID) {
|
public BlockReinforced(int ID) {
|
||||||
|
|
@ -32,58 +28,46 @@ public class BlockReinforced extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int j)
|
public int damageDropped(int j) {
|
||||||
{
|
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
@Override
|
||||||
{
|
public Icon getIcon(int side, int meta) {
|
||||||
return (true);
|
return textures[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
@Override
|
||||||
{
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||||
int id = idPicked(world, x, y, z);
|
int id = idPicked(world, x, y, z);
|
||||||
|
if (id == 0) {
|
||||||
if (id == 0)
|
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item item = Item.itemsList[id];
|
Item item = Item.itemsList[id];
|
||||||
if (item == null)
|
if (item == null) {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
public void registerIcons(IconRegister iconRegister)
|
for (int k = 0; k < 8; k++) {
|
||||||
{
|
list.add(new ItemStack(i, 1, k));
|
||||||
textures = new Icon[16];
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemReinforced.BRICK_TYPE[i] + " Bricks");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Icon getIcon(int side, int meta)
|
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||||
{
|
return (true);
|
||||||
return textures[meta];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
for(int k=0;k<8;k++)
|
textures = new Icon[16];
|
||||||
{
|
for (int i = 0; i < 8; i++) {
|
||||||
list.add(new ItemStack(i,1,k));
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemReinforced.BRICK_TYPE[i] + " Bricks");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
|
@ -13,12 +12,10 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.common.ModMetadata;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockStoneBricks extends Block {
|
public class BlockStoneBricks extends Block {
|
||||||
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockStoneBricks(int ID) {
|
public BlockStoneBricks(int ID) {
|
||||||
|
|
@ -31,49 +28,30 @@ public class BlockStoneBricks extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int j)
|
public int damageDropped(int j) {
|
||||||
{
|
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
@Override
|
||||||
{
|
public Icon getIcon(int side, int meta) {
|
||||||
|
return textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||||
int id = idPicked(world, x, y, z);
|
int id = idPicked(world, x, y, z);
|
||||||
|
if (id == 0) {
|
||||||
if (id == 0)
|
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item item = Item.itemsList[id];
|
Item item = Item.itemsList[id];
|
||||||
if (item == null)
|
if (item == null) {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
public void registerIcons(IconRegister iconRegister)
|
|
||||||
{
|
|
||||||
textures = new Icon[16];
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStoneBricks.STONEBRICK_TYPES[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Icon getIcon(int side, int meta)
|
|
||||||
{
|
|
||||||
return textures[meta];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
|
||||||
{
|
|
||||||
list.add(new ItemStack(i, 1, 0));
|
list.add(new ItemStack(i, 1, 0));
|
||||||
list.add(new ItemStack(i, 1, 1));
|
list.add(new ItemStack(i, 1, 1));
|
||||||
list.add(new ItemStack(i, 1, 2));
|
list.add(new ItemStack(i, 1, 2));
|
||||||
|
|
@ -83,5 +61,12 @@ public class BlockStoneBricks extends Block {
|
||||||
list.add(new ItemStack(i, 1, 6));
|
list.add(new ItemStack(i, 1, 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < 7; i++) {
|
||||||
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStoneBricks.STONEBRICK_TYPES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,20 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.common.ModMetadata;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockStones extends Block {
|
public class BlockStones extends Block {
|
||||||
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockStones(int ID) {
|
public BlockStones(int ID) {
|
||||||
|
|
@ -31,53 +27,40 @@ public class BlockStones extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int j)
|
public int damageDropped(int j) {
|
||||||
{
|
switch (j) {
|
||||||
switch(j)
|
case 0:
|
||||||
{
|
return 1;
|
||||||
case 0:return 1;
|
case 2:
|
||||||
case 2:return 3;
|
return 3;
|
||||||
case 4:return 5;
|
case 4:
|
||||||
case 6:return 7;
|
return 5;
|
||||||
case 8:return 9;
|
case 6:
|
||||||
case 10:return 11;
|
return 7;
|
||||||
case 12:return 13;
|
case 8:
|
||||||
default:return j;
|
return 9;
|
||||||
|
case 10:
|
||||||
|
return 11;
|
||||||
|
case 12:
|
||||||
|
return 13;
|
||||||
|
default:
|
||||||
|
return j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean canSilkHarvest()
|
@Override
|
||||||
{
|
public Icon getIcon(int side, int meta) {
|
||||||
return true;
|
return textures[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
@Override
|
||||||
{
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
return new ItemStack(this, 1, meta);
|
return new ItemStack(this, 1, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
public void registerIcons(IconRegister iconRegister)
|
|
||||||
{
|
|
||||||
textures = new Icon[16];
|
|
||||||
|
|
||||||
for (int i = 0; i < 14; i++)
|
|
||||||
{
|
|
||||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStones.STONE_TYPES[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Icon getIcon(int side, int meta)
|
|
||||||
{
|
|
||||||
return textures[meta];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
|
||||||
{
|
|
||||||
list.add(new ItemStack(i, 1, 0));
|
list.add(new ItemStack(i, 1, 0));
|
||||||
list.add(new ItemStack(i, 1, 1));
|
list.add(new ItemStack(i, 1, 1));
|
||||||
list.add(new ItemStack(i, 1, 2));
|
list.add(new ItemStack(i, 1, 2));
|
||||||
|
|
@ -93,4 +76,18 @@ public class BlockStones extends Block {
|
||||||
list.add(new ItemStack(i, 1, 12));
|
list.add(new ItemStack(i, 1, 12));
|
||||||
list.add(new ItemStack(i, 1, 13));
|
list.add(new ItemStack(i, 1, 13));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < 14; i++) {
|
||||||
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStones.STONE_TYPES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canSilkHarvest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import mysticstones.MysticStones;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemPlanks extends ItemBlock {
|
public class ItemPlanks extends ItemBlock {
|
||||||
|
|
||||||
public static String[] PLANK_TYPE = new String[] { "Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks" };
|
public static String[] PLANK_TYPE = new String[] { "Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks" };
|
||||||
|
|
||||||
public ItemPlanks(int par1) {
|
public ItemPlanks(int par1) {
|
||||||
|
|
@ -20,21 +17,20 @@ public class ItemPlanks extends ItemBlock {
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return MysticStones.Planks.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, PLANK_TYPE.length);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, PLANK_TYPE.length);
|
||||||
return PLANK_TYPE[meta];
|
return PLANK_TYPE[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMetadata(int par1)
|
|
||||||
{
|
|
||||||
return par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int par1)
|
|
||||||
{
|
|
||||||
return MysticStones.Planks.getIcon(2, par1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemReinforced extends ItemBlock {
|
public class ItemReinforced extends ItemBlock {
|
||||||
|
|
||||||
public static String[] BRICK_TYPE = new String[] { "Mithril", "Verdite", "Iridium", "Adamantine", "Tourmaline", "Topaz", "Amethyst", "Agate" };
|
public static String[] BRICK_TYPE = new String[] { "Mithril", "Verdite", "Iridium", "Adamantine", "Tourmaline", "Topaz", "Amethyst", "Agate" };
|
||||||
|
|
||||||
public ItemReinforced(int par1) {
|
public ItemReinforced(int par1) {
|
||||||
|
|
@ -21,32 +20,28 @@ public class ItemReinforced extends ItemBlock {
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
|
if (par2EntityPlayer.isSneaking() == true) {
|
||||||
|
par3List.add("Works As A Beacon Block Too!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return MysticStones.ReinforcedBricks.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BRICK_TYPE.length);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BRICK_TYPE.length);
|
||||||
return BRICK_TYPE[meta] + " Bricks";
|
return BRICK_TYPE[meta] + " Bricks";
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMetadata(int par1)
|
|
||||||
{
|
|
||||||
return par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
if(par2EntityPlayer.isSneaking() == true)
|
|
||||||
{
|
|
||||||
par3List.add("Works As A Beacon Block Too!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int par1)
|
|
||||||
{
|
|
||||||
return MysticStones.ReinforcedBricks.getIcon(2, par1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import mysticstones.MysticStones;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemStoneBricks extends ItemBlock {
|
public class ItemStoneBricks extends ItemBlock {
|
||||||
|
|
||||||
public static String[] STONEBRICK_TYPES = new String[] { "Anorthosite Bricks", "Limestone Bricks", "Marble Bricks", "Migmatite Bricks", "Orthogneiss Bricks", "Slate Bricks", "Travertine Bricks" };
|
public static String[] STONEBRICK_TYPES = new String[] { "Anorthosite Bricks", "Limestone Bricks", "Marble Bricks", "Migmatite Bricks", "Orthogneiss Bricks", "Slate Bricks", "Travertine Bricks" };
|
||||||
|
|
||||||
public ItemStoneBricks(int par1) {
|
public ItemStoneBricks(int par1) {
|
||||||
|
|
@ -20,21 +17,20 @@ public class ItemStoneBricks extends ItemBlock {
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return MysticStones.StoneBricks.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONEBRICK_TYPES.length);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONEBRICK_TYPES.length);
|
||||||
return STONEBRICK_TYPES[meta];
|
return STONEBRICK_TYPES[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMetadata(int par1)
|
|
||||||
{
|
|
||||||
return par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int par1)
|
|
||||||
{
|
|
||||||
return MysticStones.StoneBricks.getIcon(2, par1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
package MysticStones.Blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import mysticstones.MysticStones;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemStones extends ItemBlock {
|
public class ItemStones extends ItemBlock {
|
||||||
|
|
||||||
public static String[] STONE_TYPES = new String[] { "Smooth Anorthosite", "Anorthosite", "Smooth Limestone", "Limestone", "Smooth Marble", "Marble", "Smooth Migmatite", "Migmatite",
|
public static String[] STONE_TYPES = new String[] { "Smooth Anorthosite", "Anorthosite", "Smooth Limestone", "Limestone", "Smooth Marble", "Marble", "Smooth Migmatite", "Migmatite",
|
||||||
"Smooth Orthogneiss", "Orthogneiss", "Smooth Slate", "Slate", "Smooth Travertine", "Travertine" };
|
"Smooth Orthogneiss", "Orthogneiss", "Smooth Slate", "Slate", "Smooth Travertine", "Travertine" };
|
||||||
|
|
||||||
|
|
@ -21,22 +18,20 @@ public class ItemStones extends ItemBlock {
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return MysticStones.Stones.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONE_TYPES.length);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONE_TYPES.length);
|
||||||
return STONE_TYPES[meta];
|
return STONE_TYPES[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMetadata(int par1)
|
|
||||||
{
|
|
||||||
return par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int par1)
|
|
||||||
{
|
|
||||||
return MysticStones.Stones.getIcon(2, par1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,90 +1,65 @@
|
||||||
package MysticStones;
|
package mysticstones;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import MysticStones.Blocks.BlockPlanks;
|
import mysticstones.blocks.BlockPlanks;
|
||||||
import MysticStones.Blocks.BlockReinforced;
|
import mysticstones.blocks.BlockReinforced;
|
||||||
import MysticStones.Blocks.BlockStoneBricks;
|
import mysticstones.blocks.BlockStoneBricks;
|
||||||
import MysticStones.Blocks.BlockStones;
|
import mysticstones.blocks.BlockStones;
|
||||||
import MysticStones.Blocks.ItemPlanks;
|
import mysticstones.blocks.ItemPlanks;
|
||||||
import MysticStones.Blocks.ItemReinforced;
|
import mysticstones.blocks.ItemReinforced;
|
||||||
import MysticStones.Blocks.ItemStoneBricks;
|
import mysticstones.blocks.ItemStoneBricks;
|
||||||
import MysticStones.Blocks.ItemStones;
|
import mysticstones.blocks.ItemStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import MysticStones.Util.Localizations;
|
import mysticstones.util.Localizations;
|
||||||
import MysticStones.Util.RecipeHandler;
|
import mysticstones.util.RecipeHandler;
|
||||||
import MysticStones.Util.TabMysticStones;
|
import mysticstones.util.TabMysticStones;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothAnorthosite;
|
import mysticstones.worldgen.WorldgenSmoothAnorthosite;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothLimestone;
|
import mysticstones.worldgen.WorldgenSmoothLimestone;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothMarble;
|
import mysticstones.worldgen.WorldgenSmoothMarble;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothMigmatite;
|
import mysticstones.worldgen.WorldgenSmoothMigmatite;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothOrthogneiss;
|
import mysticstones.worldgen.WorldgenSmoothOrthogneiss;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothSlate;
|
import mysticstones.worldgen.WorldgenSmoothSlate;
|
||||||
import MysticStones.Worldgen.WorldgenSmoothTravertine;
|
import mysticstones.worldgen.WorldgenSmoothTravertine;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
|
||||||
import net.minecraftforge.common.DungeonHooks;
|
|
||||||
import net.minecraftforge.common.EnumHelper;
|
|
||||||
import net.minecraftforge.common.Configuration;
|
import net.minecraftforge.common.Configuration;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import cpw.mods.fml.common.Loader;
|
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Init;
|
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.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.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.common.network.NetworkMod;
|
import cpw.mods.fml.common.network.NetworkMod;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
|
||||||
|
|
||||||
@Mod(modid = "Mystic Stones", name = "Mystic Stones", version = "0.1")
|
@Mod(modid = "Mystic Stones", name = "Mystic Stones", version = "0.1")
|
||||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||||
|
public class MysticStones {
|
||||||
public class MysticStones
|
|
||||||
{
|
|
||||||
@Instance("Mystic Stones")
|
@Instance("Mystic Stones")
|
||||||
public static MysticStones instance;
|
public static MysticStones instance;
|
||||||
|
|
||||||
public static Block Planks;
|
public static Block Planks;
|
||||||
public static Block Stones;
|
public static Block Stones;
|
||||||
public static Block StoneBricks;
|
public static Block StoneBricks;
|
||||||
public static Block ReinforcedBricks;
|
public static Block ReinforcedBricks;
|
||||||
|
|
||||||
public static CreativeTabs MysticStonesTab = new TabMysticStones(CreativeTabs.getNextID(), "MysticStonesTab");
|
public static CreativeTabs MysticStonesTab = new TabMysticStones(CreativeTabs.getNextID(), "MysticStonesTab");
|
||||||
|
|
||||||
private Configuration config;
|
private Configuration config;
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event)
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
{
|
|
||||||
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Stones.cfg"));
|
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Stones.cfg"));
|
||||||
Config.save();
|
Config.save();
|
||||||
|
|
||||||
Planks = new BlockPlanks(Config.PlanksID);
|
Planks = new BlockPlanks(Config.PlanksID);
|
||||||
Stones = new BlockStones(Config.StonesID);
|
Stones = new BlockStones(Config.StonesID);
|
||||||
StoneBricks = new BlockStoneBricks(Config.StoneBricksID);
|
StoneBricks = new BlockStoneBricks(Config.StoneBricksID);
|
||||||
ReinforcedBricks = new BlockReinforced(Config.ReinforcedBricksID);
|
ReinforcedBricks = new BlockReinforced(Config.ReinforcedBricksID);
|
||||||
|
|
||||||
GameRegistry.registerBlock(Planks, ItemPlanks.class, "Planks");
|
GameRegistry.registerBlock(Planks, ItemPlanks.class, "Planks");
|
||||||
GameRegistry.registerBlock(Stones, ItemStones.class, "Stones");
|
GameRegistry.registerBlock(Stones, ItemStones.class, "Stones");
|
||||||
GameRegistry.registerBlock(StoneBricks, ItemStoneBricks.class, "StoneBricks");
|
GameRegistry.registerBlock(StoneBricks, ItemStoneBricks.class, "StoneBricks");
|
||||||
GameRegistry.registerBlock(ReinforcedBricks, ItemReinforced.class, "Reinforcedbricks");
|
GameRegistry.registerBlock(ReinforcedBricks, ItemReinforced.class, "Reinforcedbricks");
|
||||||
|
|
||||||
Localizations.Initialize();
|
Localizations.Initialize();
|
||||||
RecipeHandler.CraftPlanks();
|
RecipeHandler.CraftPlanks();
|
||||||
RecipeHandler.CraftStoneBricks();
|
RecipeHandler.CraftStoneBricks();
|
||||||
RecipeHandler.CraftElse();
|
RecipeHandler.CraftElse();
|
||||||
RecipeHandler.CraftReinforced();
|
RecipeHandler.CraftReinforced();
|
||||||
|
|
||||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothAnorthosite());
|
GameRegistry.registerWorldGenerator(new WorldgenSmoothAnorthosite());
|
||||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothLimestone());
|
GameRegistry.registerWorldGenerator(new WorldgenSmoothLimestone());
|
||||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothMarble());
|
GameRegistry.registerWorldGenerator(new WorldgenSmoothMarble());
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,28 @@
|
||||||
package MysticStones.Util;
|
package mysticstones.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import net.minecraftforge.common.Configuration;
|
import net.minecraftforge.common.Configuration;
|
||||||
|
|
||||||
public class Config
|
public class Config {
|
||||||
{
|
|
||||||
public static Configuration config;
|
public static Configuration config;
|
||||||
|
|
||||||
public static int PlanksID;
|
public static int PlanksID;
|
||||||
public static int StonesID;
|
public static int StonesID;
|
||||||
public static int StoneBricksID;
|
public static int StoneBricksID;
|
||||||
public static int ReinforcedBricksID;
|
public static int ReinforcedBricksID;
|
||||||
|
|
||||||
public static boolean Rare;
|
public static boolean Rare;
|
||||||
|
|
||||||
public static void initialize(File file)
|
public static void initialize(File file) {
|
||||||
{
|
|
||||||
config = new Configuration(file);
|
config = new Configuration(file);
|
||||||
|
|
||||||
PlanksID = config.getBlock("Plank IDs", 509).getInt();
|
PlanksID = config.getBlock("Plank IDs", 509).getInt();
|
||||||
StonesID = config.getBlock("Stone IDs", 510).getInt();
|
StonesID = config.getBlock("Stone IDs", 510).getInt();
|
||||||
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
|
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
|
||||||
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
|
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
|
||||||
Rare = config.get("General", "Increase the Rarity of Stones?", false).getBoolean(Rare);
|
Rare = config.get("General", "Increase the Rarity of Stones?", false).getBoolean(Rare);
|
||||||
|
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void save()
|
public static void save() {
|
||||||
{
|
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticStones.Util;
|
package mysticstones.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -10,10 +10,11 @@ import java.util.regex.Pattern;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipException;
|
import java.util.zip.ZipException;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
import MysticStones.MysticStones;
|
|
||||||
|
|
||||||
|
import mysticstones.MysticStones;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* All credits go to copygirl (or copy....boy) for this one
|
* All credits go to copygirl (or copy....boy) for this one
|
||||||
|
|
@ -21,17 +22,14 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
* repository, many thanks friend c:
|
* repository, many thanks friend c:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
public class Localizations {
|
||||||
|
private Localizations() {
|
||||||
|
}
|
||||||
|
|
||||||
public class Localizations
|
public static void Initialize() {
|
||||||
{
|
|
||||||
private Localizations(){}
|
|
||||||
|
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
File source = Loader.instance().getReversedModObjectList().get(MysticStones.instance).getSource();
|
File source = Loader.instance().getReversedModObjectList().get(MysticStones.instance).getSource();
|
||||||
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
|
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
|
||||||
for(String file : getResources(source, pattern))
|
for (String file : getResources(source, pattern)) {
|
||||||
{
|
|
||||||
Matcher matcher = pattern.matcher(file);
|
Matcher matcher = pattern.matcher(file);
|
||||||
matcher.find();
|
matcher.find();
|
||||||
String resource = "/" + matcher.group(1);
|
String resource = "/" + matcher.group(1);
|
||||||
|
|
@ -41,72 +39,57 @@ public class Localizations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<String> getResources(File file, Pattern pattern)
|
private static Collection<String> getResources(File file, Pattern pattern) {
|
||||||
{
|
|
||||||
ArrayList<String> retval = new ArrayList<String>();
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
if (file.isDirectory())
|
if (file.isDirectory())
|
||||||
retval.addAll(getResourcesFromDirectory(file, pattern));
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
else retval.addAll(getResourcesFromJarFile(file, pattern));
|
else
|
||||||
|
retval.addAll(getResourcesFromJarFile(file, pattern));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern)
|
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern) {
|
||||||
{
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
File[] FileList = directory.listFiles();
|
||||||
|
for (File file : FileList) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
|
} else
|
||||||
|
try {
|
||||||
|
String fileName = file.getCanonicalPath().replace('\\', '/');
|
||||||
|
boolean accept = pattern.matcher(fileName).matches();
|
||||||
|
if (accept)
|
||||||
|
retval.add(fileName);
|
||||||
|
} catch (final IOException e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern) {
|
||||||
ArrayList<String> retval = new ArrayList<String>();
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
ZipFile Zip;
|
ZipFile Zip;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Zip = new ZipFile(file);
|
Zip = new ZipFile(file);
|
||||||
}
|
} catch (ZipException Ex) {
|
||||||
catch (ZipException Ex)
|
|
||||||
{
|
|
||||||
throw new Error(Ex);
|
throw new Error(Ex);
|
||||||
}
|
} catch (IOException Ex) {
|
||||||
catch(IOException Ex)
|
|
||||||
{
|
|
||||||
throw new Error(Ex);
|
throw new Error(Ex);
|
||||||
}
|
}
|
||||||
Enumeration<? extends ZipEntry> entries = Zip.entries();
|
Enumeration<? extends ZipEntry> entries = Zip.entries();
|
||||||
while (entries.hasMoreElements())
|
while (entries.hasMoreElements()) {
|
||||||
{
|
|
||||||
ZipEntry ZipE = entries.nextElement();
|
ZipEntry ZipE = entries.nextElement();
|
||||||
String FileName = ZipE.getName();
|
String FileName = ZipE.getName();
|
||||||
boolean accept = pattern.matcher(FileName).matches();
|
boolean accept = pattern.matcher(FileName).matches();
|
||||||
if (accept)
|
if (accept)
|
||||||
retval.add(FileName);
|
retval.add(FileName);
|
||||||
}
|
}
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Zip.close();
|
Zip.close();
|
||||||
}
|
} catch (IOException Ex) {
|
||||||
catch(IOException Ex)
|
|
||||||
{
|
|
||||||
throw new Error(Ex);
|
throw new Error(Ex);
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern)
|
|
||||||
{
|
|
||||||
ArrayList<String> retval = new ArrayList<String>();
|
|
||||||
File[] FileList = directory.listFiles();
|
|
||||||
for (File file : FileList)
|
|
||||||
{
|
|
||||||
if (file.isDirectory())
|
|
||||||
{
|
|
||||||
retval.addAll(getResourcesFromDirectory(file, pattern));
|
|
||||||
}
|
|
||||||
else try
|
|
||||||
{
|
|
||||||
String fileName = file.getCanonicalPath().replace('\\', '/');
|
|
||||||
boolean accept = pattern.matcher(fileName).matches();
|
|
||||||
if (accept) retval.add(fileName);
|
|
||||||
}
|
|
||||||
catch(final IOException e)
|
|
||||||
{
|
|
||||||
throw new Error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package MysticStones.Util;
|
package mysticstones.util;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.CraftingManager;
|
import net.minecraft.item.crafting.CraftingManager;
|
||||||
|
|
@ -11,156 +11,26 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class RecipeHandler
|
public class RecipeHandler {
|
||||||
{
|
public static void CraftElse() {
|
||||||
public static void CraftPlanks()
|
if (Loader.isModLoaded("Mystic Ores") == true) {
|
||||||
{
|
CraftingManager.getInstance().getRecipeList()
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 0),
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 0), true, new Object[] { "#$#", "$$$", "#$#", '$', "ingotMithril", '#', Block.stone }));
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 0)}));
|
CraftingManager.getInstance().getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 1), true, new Object[] { "#$#", "$$$", "#$#", '$', "ingotVerdite", '#', Block.stone }));
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 0),
|
CraftingManager.getInstance().getRecipeList()
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 1)}));
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 2), true, new Object[] { "#$#", "$$$", "#$#", '$', "ingotIridium", '#', Block.stone }));
|
||||||
|
CraftingManager.getInstance().getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 3), true, new Object[] { "#$#", "$$$", "#$#", '$', "ingotAdamantine", '#', Block.stone }));
|
||||||
|
CraftingManager.getInstance().getRecipeList()
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 1),
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 4), true, new Object[] { "#$#", "$$$", "#$#", '$', "gemTourmaline", '#', Block.stone }));
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 2)}));
|
CraftingManager.getInstance().getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 5), true, new Object[] { "#$#", "$$$", "#$#", '$', "gemTopaz", '#', Block.stone }));
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 1),
|
CraftingManager.getInstance().getRecipeList()
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 3)}));
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 6), true, new Object[] { "#$#", "$$$", "#$#", '$', "gemAmethyst", '#', Block.stone }));
|
||||||
|
CraftingManager.getInstance().getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 7), true, new Object[] { "#$#", "$$$", "#$#", '$', "gemAgate", '#', Block.stone }));
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 2),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 4)}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 2),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 5)}));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 3),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 6)}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 3),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 7)}));
|
|
||||||
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 4),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 8)}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 4),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 9)}));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 5),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 10)}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 5),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 11)}));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 6),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 12)}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 6),
|
|
||||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 13)}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CraftReinforced()
|
|
||||||
{
|
|
||||||
if(Loader.isModLoaded("MysticOres"))
|
|
||||||
{
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 0), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotMithril", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 1), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotVerdite", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 2), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotIridium", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 3), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotAdamantine", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 4), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemTourmaline", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 5), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemTopaz", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 6), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemAmethyst", Character.valueOf('X'), Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 7), new Object[] {
|
|
||||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemAgate", Character.valueOf('X'), Block.stone}));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CraftStoneBricks()
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 0), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 0)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 1), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 2)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 2), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 4)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 3), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 6)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 4), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 8)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 5), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 10)
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 6), new Object[] {
|
|
||||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 12)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CraftElse()
|
|
||||||
{
|
|
||||||
|
|
||||||
if(Loader.isModLoaded("Mystic Ores") == true)
|
|
||||||
{
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 0),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotMithril", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 1),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotVerdite", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 2),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotIridium", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 3),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotAdamantine", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 4),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemTourmaline", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 5),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemTopaz", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 6),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemAmethyst", '#', Block.stone}));
|
|
||||||
|
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 7),
|
|
||||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemAgate", '#', Block.stone}));
|
|
||||||
}
|
|
||||||
|
|
||||||
//smelting
|
//smelting
|
||||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 1, new ItemStack(MysticStones.Stones, 1, 0), 0.1F);
|
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 1, new ItemStack(MysticStones.Stones, 1, 0), 0.1F);
|
||||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 3, new ItemStack(MysticStones.Stones, 1, 2), 0.1F);
|
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 3, new ItemStack(MysticStones.Stones, 1, 2), 0.1F);
|
||||||
|
|
@ -169,12 +39,80 @@ public class RecipeHandler
|
||||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 9, new ItemStack(MysticStones.Stones, 1, 8), 0.1F);
|
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 9, new ItemStack(MysticStones.Stones, 1, 8), 0.1F);
|
||||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 11, new ItemStack(MysticStones.Stones, 1, 10), 0.1F);
|
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 11, new ItemStack(MysticStones.Stones, 1, 10), 0.1F);
|
||||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 13, new ItemStack(MysticStones.Stones, 1, 12), 0.1F);
|
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 13, new ItemStack(MysticStones.Stones, 1, 12), 0.1F);
|
||||||
|
for (int i = 0; i < 7; i++) {
|
||||||
for (int i=0;i<7;i++)
|
|
||||||
{
|
|
||||||
OreDictionary.registerOre("plankWood", new ItemStack(MysticStones.Planks, 1, i));
|
OreDictionary.registerOre("plankWood", new ItemStack(MysticStones.Planks, 1, i));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CraftPlanks() {
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 0), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 0) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 0), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 1) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 1), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 2) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 1), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 3) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 2), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 4) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 2), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 5) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 3), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 6) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 3), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 7) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 4), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 8) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 4), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 9) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 5), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 10) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 5), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 11) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 6), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 12) }));
|
||||||
|
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 6), new Object[] { "plankWood", new ItemStack(MysticStones.Stones, 1, 13) }));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CraftReinforced() {
|
||||||
|
if (Loader.isModLoaded("MysticOres")) {
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 0), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "ingotMithril", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 1), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "ingotVerdite", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 2), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "ingotIridium", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 3), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "ingotAdamantine", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 4), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "gemTourmaline", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 5), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "gemTopaz", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 6), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "gemAmethyst", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
CraftingManager
|
||||||
|
.getInstance()
|
||||||
|
.getRecipeList()
|
||||||
|
.add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 7), new Object[] { "X#X", "###", "X#X", Character.valueOf('#'), "gemAgate", Character.valueOf('X'),
|
||||||
|
Block.stone }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CraftStoneBricks() {
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 0), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 0) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 1), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 2) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 2), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 4) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 3), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 6) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 4), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 8) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 5), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 10) });
|
||||||
|
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 6), new Object[] { "##", "##", '#', new ItemStack(MysticStones.Stones, 1, 12) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
package MysticStones.Util;
|
package mysticstones.util;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class TabMysticStones extends CreativeTabs {
|
public class TabMysticStones extends CreativeTabs {
|
||||||
|
|
||||||
public TabMysticStones(int par1, String par2Str) {
|
public TabMysticStones(int par1, String par2Str) {
|
||||||
super(par1, par2Str);
|
super(par1, par2Str);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
|
|
@ -16,5 +14,4 @@ public class TabMysticStones extends CreativeTabs {
|
||||||
public ItemStack getIconItemStack() {
|
public ItemStack getIconItemStack() {
|
||||||
return new ItemStack(MysticStones.ReinforcedBricks, 1, 4);
|
return new ItemStack(MysticStones.ReinforcedBricks, 1, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothAnorthosite implements IWorldGenerator
|
public class WorldgenSmoothAnorthosite implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
|
||||||
for(int i=0; Config.Rare ? i<2 : i<3; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothLimestone implements IWorldGenerator
|
public class WorldgenSmoothLimestone implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
|
||||||
for(int i=0; Config.Rare ? i<2 : i<3; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothMarble implements IWorldGenerator
|
public class WorldgenSmoothMarble implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random ,int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
|
||||||
for(int i=0; Config.Rare ? i<2 : i<3; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothMigmatite implements IWorldGenerator
|
public class WorldgenSmoothMigmatite implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
|
||||||
for(int i=0; Config.Rare ? i<2 : i<3; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothOrthogneiss implements IWorldGenerator
|
public class WorldgenSmoothOrthogneiss implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 3 : i < 2; i++) {
|
||||||
for(int i=0; Config.Rare ? i<3 : i<2; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothSlate implements IWorldGenerator
|
public class WorldgenSmoothSlate implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
|
||||||
for(int i=0; Config.Rare ? i<2 : i<3; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
package MysticStones.Worldgen;
|
package mysticstones.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticStones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import MysticStones.Util.Config;
|
import mysticstones.util.Config;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
public class WorldgenSmoothTravertine implements IWorldGenerator
|
public class WorldgenSmoothTravertine implements IWorldGenerator {
|
||||||
{
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
{
|
switch (world.provider.dimensionId) {
|
||||||
switch(world.provider.dimensionId)
|
case 0:
|
||||||
{
|
generateSurface(world, random, chunkX * 16, chunkZ * 16);
|
||||||
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||||
{
|
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
|
||||||
for(int i=0; Config.Rare ? i<2 : i<3; i++)
|
|
||||||
{
|
|
||||||
int Xcoord = blockX + random.nextInt(16);
|
int Xcoord = blockX + random.nextInt(16);
|
||||||
int Ycoord = random.nextInt(40) + 20;
|
int Ycoord = random.nextInt(40) + 20;
|
||||||
int Zcoord = blockZ + random.nextInt(16);
|
int Zcoord = blockZ + random.nextInt(16);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,64 +1,57 @@
|
||||||
package MysticWorld.Biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import mysticworld.lib.Booleans;
|
||||||
import MysticWorld.Lib.*;
|
|
||||||
import MysticOres.Blocks.BlockHandler;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.biome.BiomeDecorator;
|
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
import net.minecraftforge.common.BiomeManager;
|
import net.minecraftforge.common.BiomeManager;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class BiomeHandler
|
public class BiomeHandler {
|
||||||
{
|
|
||||||
public static BiomeGenBase Mountain;
|
public static BiomeGenBase Mountain;
|
||||||
public static BiomeGenBase Tundra;
|
public static BiomeGenBase Tundra;
|
||||||
public static BiomeGenBase Steppe;
|
public static BiomeGenBase Steppe;
|
||||||
public static BiomeGenBase Glacier;
|
public static BiomeGenBase Glacier;
|
||||||
public static BiomeGenBase Jungle;
|
public static BiomeGenBase Jungle;
|
||||||
|
|
||||||
public static void init()
|
public static void init() {
|
||||||
{
|
|
||||||
initializeBiomes();
|
initializeBiomes();
|
||||||
registerBiomes();
|
registerBiomes();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initializeBiomes()
|
public static void initializeBiomes() {
|
||||||
{
|
Mountain = new BiomeGenMountain(23, Block.stone.blockID, Block.stone.blockID).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||||
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);
|
.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);
|
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);
|
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);
|
Glacier = new BiomeGenGlacier(26, 0, 0, 0, 0, Block.ice.blockID, Block.ice.blockID).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||||
Jungle = new BiomeGenJungle(27).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F);;
|
.setMinMaxHeight(0.5F, 0.7F);
|
||||||
|
Jungle = new BiomeGenJungle(27).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerBiomes()
|
public static void registerBiomes() {
|
||||||
{
|
if (Booleans.ENABLE_JUNGLE_REWRITE) {
|
||||||
if(Booleans.ENABLE_JUNGLE_REWRITE)
|
|
||||||
{
|
|
||||||
GameRegistry.removeBiome(BiomeGenBase.jungle);
|
GameRegistry.removeBiome(BiomeGenBase.jungle);
|
||||||
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
|
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
|
||||||
GameRegistry.addBiome(Jungle);
|
GameRegistry.addBiome(Jungle);
|
||||||
BiomeManager.addSpawnBiome(Jungle);
|
BiomeManager.addSpawnBiome(Jungle);
|
||||||
BiomeManager.addStrongholdBiome(Jungle);
|
BiomeManager.addStrongholdBiome(Jungle);
|
||||||
}
|
}
|
||||||
if(Booleans.ENABLE_GLACIER_GEN)
|
if (Booleans.ENABLE_GLACIER_GEN) {
|
||||||
{
|
|
||||||
GameRegistry.addBiome(Glacier);
|
GameRegistry.addBiome(Glacier);
|
||||||
BiomeManager.addStrongholdBiome(Glacier);
|
BiomeManager.addStrongholdBiome(Glacier);
|
||||||
}
|
}
|
||||||
if(Booleans.ENABLE_MOUNTAIN_GEN)
|
if (Booleans.ENABLE_MOUNTAIN_GEN) {
|
||||||
{
|
|
||||||
GameRegistry.addBiome(Mountain);
|
GameRegistry.addBiome(Mountain);
|
||||||
BiomeManager.addSpawnBiome(Mountain);
|
BiomeManager.addSpawnBiome(Mountain);
|
||||||
BiomeManager.addStrongholdBiome(Mountain);
|
BiomeManager.addStrongholdBiome(Mountain);
|
||||||
}
|
}
|
||||||
if(Booleans.ENABLE_TUNDRA_GEN)
|
if (Booleans.ENABLE_TUNDRA_GEN) {
|
||||||
{
|
|
||||||
GameRegistry.addBiome(Tundra);
|
GameRegistry.addBiome(Tundra);
|
||||||
BiomeManager.addStrongholdBiome(Tundra);
|
BiomeManager.addStrongholdBiome(Tundra);
|
||||||
}
|
}
|
||||||
if(Booleans.ENABLE_STEPPE_GEN)
|
if (Booleans.ENABLE_STEPPE_GEN) {
|
||||||
{
|
|
||||||
GameRegistry.addBiome(Steppe);
|
GameRegistry.addBiome(Steppe);
|
||||||
BiomeManager.addSpawnBiome(Steppe);
|
BiomeManager.addSpawnBiome(Steppe);
|
||||||
BiomeManager.addVillageBiome(Steppe, true);
|
BiomeManager.addVillageBiome(Steppe, true);
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,17 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import mysticworld.MysticWorld;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import mysticworld.items.ItemHandler$1;
|
||||||
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.projectile.EntityPotion;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.world.ColorizerFoliage;
|
import net.minecraft.world.ColorizerFoliage;
|
||||||
import net.minecraft.world.ColorizerGrass;
|
import net.minecraft.world.ColorizerGrass;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
@ -29,10 +19,10 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.EnumPlantType;
|
import net.minecraftforge.common.EnumPlantType;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
import net.minecraftforge.common.IPlantable;
|
import net.minecraftforge.common.IPlantable;
|
||||||
import net.minecraftforge.common.IShearable;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockBush extends Block implements IPlantable {
|
public class BlockBush extends Block implements IPlantable {
|
||||||
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockBush(int id) {
|
public BlockBush(int id) {
|
||||||
|
|
@ -45,152 +35,136 @@ public class BlockBush extends Block implements IPlantable{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public boolean canBlockStay(World par1World, int par2, int par3, int par4) {
|
||||||
public void registerIcons(IconRegister iconRegister)
|
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||||
{
|
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4))
|
||||||
textures = new Icon[16];
|
&& (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||||
|
|
||||||
for (int i = 0; i < 12; i++)
|
|
||||||
{
|
|
||||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Plant Specific Stuff
|
//Plant Specific Stuff
|
||||||
|
@Override
|
||||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||||
{
|
|
||||||
return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, 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
|
@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)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getBlockColor()
|
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
|
||||||
{
|
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
||||||
|
return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int j) {
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBlockColor() {
|
||||||
double d0 = 0.5D;
|
double d0 = 0.5D;
|
||||||
double d1 = 1.0D;
|
double d1 = 1.0D;
|
||||||
return ColorizerGrass.getGrassColor(d0, d1);
|
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
|
@Override
|
||||||
public int damageDropped(int j)
|
public int getDamageValue(World par1World, int par2, int par3, int par4) {
|
||||||
{
|
|
||||||
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);
|
return par1World.getBlockMetadata(par2, par3, par4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
//Sprite Inits
|
||||||
{
|
@Override
|
||||||
for(int j=0;j<12;j++)
|
public Icon getIcon(int side, int meta) {
|
||||||
{
|
return textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPlantID(World world, int x, int y, int z) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPlantMetadata(World world, int x, int y, int z) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumPlantType getPlantType(World world, int x, int y, int z) {
|
||||||
|
return EnumPlantType.Plains;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getRenderColor(int par1) {
|
||||||
|
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
|
for (int j = 0; j < 12; j++) {
|
||||||
list.add(new ItemStack(i, 1, j));
|
list.add(new ItemStack(i, 1, j));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
||||||
|
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
|
return ItemHandler$1.bushFruit.itemID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||||
|
return blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
|
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
|
||||||
|
this.checkBushChange(par1World, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Meta Inits
|
||||||
|
@Override
|
||||||
|
public int quantityDroppedWithBonus(int par1, Random par2Random) {
|
||||||
|
return 1 + par2Random.nextInt(par1 * 2 + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||||
|
this.checkBushChange(par1World, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean canThisPlantGrowOnThisBlockID(int par1) {
|
||||||
|
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final void checkBushChange(World par1World, int par2, int par3, int par4) {
|
||||||
|
if (!this.canBlockStay(par1World, par2, par3, par4)) {
|
||||||
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||||
|
par1World.setBlockToAir(par2, par3, par4);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,14 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import MysticWorld.Lib.BlockIds;
|
import mysticworld.lib.BlockIds;
|
||||||
import MysticWorld.Lib.Booleans;
|
import mysticworld.lib.Strings;
|
||||||
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.block.Block;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
|
|
||||||
public class BlockHandler {
|
public class BlockHandler {
|
||||||
|
|
||||||
public static Block oreImbuedStone;
|
public static Block oreImbuedStone;
|
||||||
public static Block bush;
|
public static Block bush;
|
||||||
public static Block lightCube;
|
public static Block lightCube;
|
||||||
|
|
||||||
public static Block pillarPlatform;
|
public static Block pillarPlatform;
|
||||||
public static Block pillar;
|
public static Block pillar;
|
||||||
public static Block pillarInsert;
|
public static Block pillarInsert;
|
||||||
|
|
@ -28,11 +17,9 @@ public class BlockHandler {
|
||||||
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
||||||
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
|
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
|
||||||
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
|
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
|
||||||
|
|
||||||
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
|
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
|
||||||
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME);
|
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME);
|
||||||
pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME);
|
pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME);
|
||||||
|
|
||||||
registerBlocks();
|
registerBlocks();
|
||||||
setBlockHarvestLevels();
|
setBlockHarvestLevels();
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +28,6 @@ public class BlockHandler {
|
||||||
GameRegistry.registerBlock(oreImbuedStone, ItemImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
GameRegistry.registerBlock(oreImbuedStone, ItemImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
||||||
GameRegistry.registerBlock(bush, ItemBush.class, Strings.BUSH_NAME);
|
GameRegistry.registerBlock(bush, ItemBush.class, Strings.BUSH_NAME);
|
||||||
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
|
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
|
||||||
|
|
||||||
GameRegistry.registerBlock(pillarPlatform, Strings.PLATFORM_NAME);
|
GameRegistry.registerBlock(pillarPlatform, Strings.PLATFORM_NAME);
|
||||||
GameRegistry.registerBlock(pillar, Strings.PILLAR_NAME);
|
GameRegistry.registerBlock(pillar, Strings.PILLAR_NAME);
|
||||||
GameRegistry.registerBlock(pillarInsert, Strings.PILLAR_INSERT_NAME);
|
GameRegistry.registerBlock(pillarInsert, Strings.PILLAR_INSERT_NAME);
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,22 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import mysticworld.items.ItemHandler$1;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockBreakable;
|
|
||||||
import net.minecraft.block.BlockFence;
|
import net.minecraft.block.BlockFence;
|
||||||
import net.minecraft.block.material.Material;
|
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.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
|
||||||
import MysticWorld.Items.ItemHandler$1;
|
|
||||||
|
|
||||||
public class BlockImbuedStone extends Block {
|
public class BlockImbuedStone extends Block {
|
||||||
|
|
||||||
Icon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockImbuedStone(int ID) {
|
public BlockImbuedStone(int ID) {
|
||||||
|
|
@ -39,95 +29,84 @@ public class BlockImbuedStone extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||||
public void registerIcons(IconRegister iconRegister)
|
|
||||||
{
|
|
||||||
textures = new Icon[16];
|
|
||||||
|
|
||||||
for (int i = 0; i < 5; i++)
|
|
||||||
{
|
|
||||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
@Override
|
||||||
{
|
public int damageDropped(int j) {
|
||||||
boolean flag = false;
|
return j;
|
||||||
|
|
||||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)))
|
|
||||||
{
|
|
||||||
flag = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag)
|
@Override
|
||||||
{
|
public int getDamageValue(World par1World, int par2, int par3, int par4) {
|
||||||
|
return par1World.getBlockMetadata(par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Icon getIcon(int side, int meta) {
|
||||||
|
return textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
|
for (int j = 0; j < 5; j++) {
|
||||||
|
list.add(new ItemStack(i, 1, j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
|
return ItemHandler$1.imbuedShard.itemID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||||
|
return blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) {
|
||||||
|
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
|
boolean flag = false;
|
||||||
|
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
par1World.setBlockToAir(par2, par3, par4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Icon getIcon(int side, int meta)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
return textures[meta];
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return ItemHandler$1.imbuedShard.itemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int j)
|
public boolean renderAsNormalBlock() {
|
||||||
{
|
return false;
|
||||||
return j;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int xpDropAmount(int j)
|
public int xpDropAmount(int j) {
|
||||||
{
|
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderAsNormalBlock()
|
@Override
|
||||||
{
|
protected boolean canSilkHarvest() {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean canSilkHarvest()
|
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
|
|
||||||
{
|
|
||||||
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return blockID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
|
||||||
{
|
|
||||||
for(int j=0;j<5;j++)
|
|
||||||
{
|
|
||||||
list.add(new ItemStack(i,1,j));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,20 +1,16 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import mysticworld.MysticWorld;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
|
||||||
import MysticWorld.Items.ItemHandler$1;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.util.Icon;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockLightCube extends Block {
|
public class BlockLightCube extends Block {
|
||||||
|
|
||||||
public BlockLightCube(int id) {
|
public BlockLightCube(int id) {
|
||||||
super(id, Material.circuits);
|
super(id, Material.circuits);
|
||||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||||
|
|
@ -23,40 +19,34 @@ public class BlockLightCube extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock()
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean canSilkHarvest()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
public boolean isOpaqueCube() {
|
||||||
{
|
return false;
|
||||||
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
}
|
||||||
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
|
||||||
|
@Override
|
||||||
|
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||||
|
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||||
|
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "lightCube");
|
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "lightCube");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canSilkHarvest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import mysticworld.MysticWorld;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import MysticWorld.MysticWorld;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockPillar extends Block {
|
public class BlockPillar extends Block {
|
||||||
|
|
||||||
public BlockPillar(int id) {
|
public BlockPillar(int id) {
|
||||||
super(id, Material.rock);
|
super(id, Material.rock);
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
|
|
@ -17,21 +16,19 @@ public class BlockPillar extends Block {
|
||||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderAsNormalBlock()
|
@Override
|
||||||
{
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Pillar");
|
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Pillar");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,18 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import MysticWorld.Lib.RenderIds;
|
import mysticworld.lib.RenderIds;
|
||||||
import MysticWorld.TileEntity.TileEntityPillarInsert;
|
import mysticworld.tiles.TileEntityPillarInsert;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockPillarInsert extends BlockContainer {
|
public class BlockPillarInsert extends BlockContainer {
|
||||||
|
public BlockPillarInsert(int id) {
|
||||||
public BlockPillarInsert(int id)
|
|
||||||
{
|
|
||||||
super(id, Material.rock);
|
super(id, Material.rock);
|
||||||
this.setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
this.setResistance(6000000.0F);
|
this.setResistance(6000000.0F);
|
||||||
|
|
@ -24,35 +21,8 @@ public class BlockPillarInsert extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
public TileEntity createNewTileEntity(World world) {
|
||||||
{
|
return new TileEntityPillarInsert();
|
||||||
if (world.isRemote)
|
|
||||||
{
|
|
||||||
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID)
|
|
||||||
{
|
|
||||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType()
|
|
||||||
{
|
|
||||||
return RenderIds.RENDER_PILLAR_INSERT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -61,15 +31,32 @@ public class BlockPillarInsert extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock()
|
public int getRenderType() {
|
||||||
{
|
return RenderIds.RENDER_PILLAR_INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
return new TileEntityPillarInsert();
|
if (world.isRemote) {
|
||||||
|
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) {
|
||||||
|
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,14 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockPillarPlatform extends Block {
|
public class BlockPillarPlatform extends Block {
|
||||||
|
|
||||||
public BlockPillarPlatform(int id) {
|
public BlockPillarPlatform(int id) {
|
||||||
super(id, Material.rock);
|
super(id, Material.rock);
|
||||||
this.setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
|
|
@ -22,63 +18,52 @@ public class BlockPillarPlatform extends Block {
|
||||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderAsNormalBlock()
|
@Override
|
||||||
{
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
@Override
|
||||||
{
|
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||||
return false;
|
if (this.isTowersNearby(world, x, y, z)) {
|
||||||
}
|
|
||||||
|
|
||||||
public int tickRate(World par1World)
|
|
||||||
{
|
|
||||||
return 30;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
|
||||||
{
|
|
||||||
double posX = (double)x;
|
|
||||||
double posY = (double)y;
|
|
||||||
double posZ = (double)z;
|
|
||||||
|
|
||||||
if (this.isTowersNearby(world, x, y, z))
|
|
||||||
{
|
|
||||||
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateTick(World world, int x, int y, int z, Random random)
|
|
||||||
{
|
|
||||||
if (this.isTowersNearby(world, x, y, z))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
|
||||||
{
|
|
||||||
if (this.isTowersNearby(world, x, y, z))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
super.onEntityWalking(world, x, y, z, entity);
|
super.onEntityWalking(world, x, y, z, entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTowersNearby(World world, int x, int y, int z)
|
@Override
|
||||||
{
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||||
int block = BlockHandler.pillar.blockID;
|
double posX = x;
|
||||||
|
double posY = y;
|
||||||
if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block
|
double posZ = z;
|
||||||
&& world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z - 2) == block
|
if (this.isTowersNearby(world, x, y, z)) {
|
||||||
&& world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block)
|
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
||||||
{
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tickRate(World par1World) {
|
||||||
|
return 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||||
|
if (this.isTowersNearby(world, x, y, z)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||||
|
int block = BlockHandler.pillar.blockID;
|
||||||
|
if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block
|
||||||
|
&& world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block
|
||||||
|
&& world.getBlockId(x + 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block
|
||||||
|
&& world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockPillarTower extends Block {
|
public class BlockPillarTower extends Block {
|
||||||
|
|
||||||
public BlockPillarTower(int id) {
|
public BlockPillarTower(int id) {
|
||||||
super(id, Material.rock);
|
super(id, Material.rock);
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
|
|
@ -14,14 +13,13 @@ public class BlockPillarTower extends Block {
|
||||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderAsNormalBlock()
|
@Override
|
||||||
{
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
@Override
|
||||||
{
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,17 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import mysticworld.MysticWorld;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockPlatform extends Block {
|
public class BlockPlatform extends Block {
|
||||||
|
|
||||||
public BlockPlatform(int id) {
|
public BlockPlatform(int id) {
|
||||||
super(id, Material.rock);
|
super(id, Material.rock);
|
||||||
this.setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
|
|
@ -28,77 +22,61 @@ public class BlockPlatform extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock()
|
public boolean isOpaqueCube() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube()
|
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
|
||||||
{
|
|
||||||
int block = BlockHandler.pillar.blockID;
|
|
||||||
|
|
||||||
double posX = (double)x;
|
|
||||||
double posY = (double)y;
|
|
||||||
double posZ = (double)z;
|
|
||||||
|
|
||||||
if (this.isTowersNearby(world, x, y, z))
|
|
||||||
{
|
|
||||||
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
|
||||||
|
|
||||||
if (rand.nextInt(3) == 0)
|
|
||||||
{
|
|
||||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x - 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z - 2 - z) + rand.nextFloat()) - 0.5D);
|
|
||||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x - 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z + 2 - z) + rand.nextFloat()) - 0.5D);
|
|
||||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x + 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z + 2 - z) + rand.nextFloat()) - 0.5D);
|
|
||||||
world.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, (double)((float)(x + 2 - x) + rand.nextFloat()) - 0.5D, (double)((float)(y + 2 - y) - rand.nextFloat() - 1.0F), (double)((float)(z - 2 - z) + rand.nextFloat()) - 0.5D);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateTick(World world, int x, int y, int z, Random random)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int tickRate(World par1World)
|
|
||||||
{
|
|
||||||
return 30;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
|
||||||
{
|
|
||||||
super.onEntityWalking(world, x, y, z, entity);
|
super.onEntityWalking(world, x, y, z, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTowersNearby(World world, int x, int y, int z)
|
@Override
|
||||||
{
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||||
int pillar = BlockHandler.pillar.blockID;
|
int block = BlockHandler.pillar.blockID;
|
||||||
int insert = BlockHandler.pillarInsert.blockID;
|
double posX = x;
|
||||||
|
double posY = y;
|
||||||
if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar
|
double posZ = z;
|
||||||
&& world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z - 2) == insert
|
if (this.isTowersNearby(world, x, y, z)) {
|
||||||
&& world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar)
|
MysticWorld.proxy.fireFX(world, posX + rand.nextDouble(), posY + 0.20, posZ + rand.nextDouble(), 1.0F);
|
||||||
{
|
if (rand.nextInt(3) == 0) {
|
||||||
return true;
|
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x - 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z - 2 - z + rand.nextFloat() - 0.5D);
|
||||||
|
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x - 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z + 2 - z + rand.nextFloat() - 0.5D);
|
||||||
|
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x + 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z + 2 - z + rand.nextFloat() - 0.5D);
|
||||||
|
world.spawnParticle("enchantmenttable", x + 0.5D, y + 1.0D, z + 0.5D, x + 2 - x + rand.nextFloat() - 0.5D, y + 2 - y - rand.nextFloat() - 1.0F, z - 2 - z + rand.nextFloat() - 0.5D);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
|
||||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Platform");
|
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Platform");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tickRate(World par1World) {
|
||||||
|
return 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||||
|
int pillar = BlockHandler.pillar.blockID;
|
||||||
|
int insert = BlockHandler.pillarInsert.blockID;
|
||||||
|
if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar
|
||||||
|
&& world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert
|
||||||
|
&& world.getBlockId(x + 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar
|
||||||
|
&& world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,17 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import MysticWorld.Lib.Strings;
|
|
||||||
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
|
import mysticworld.lib.Strings;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemBush extends ItemBlock {
|
public class ItemBush extends ItemBlock {
|
||||||
|
public static String[] BUSH_TYPES = new String[] { Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME,
|
||||||
public static String[] BUSH_TYPES = new String[] {Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME,
|
Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME,
|
||||||
Strings.HARMING_BUSH_NAME, Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME,
|
Strings.INVISIBILITY_BUSH_NAME };
|
||||||
Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME, Strings.INVISIBILITY_BUSH_NAME};
|
|
||||||
|
|
||||||
public ItemBush(int par1) {
|
public ItemBush(int par1) {
|
||||||
super(par1);
|
super(par1);
|
||||||
|
|
@ -25,22 +19,20 @@ public class ItemBush extends ItemBlock {
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return BlockHandler.bush.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
|
||||||
return BUSH_TYPES[meta];
|
return BUSH_TYPES[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getMetadata(int par1)
|
|
||||||
{
|
|
||||||
return par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int par1)
|
|
||||||
{
|
|
||||||
return BlockHandler.bush.getIcon(2, par1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,121 +1,106 @@
|
||||||
package MysticWorld.Client;
|
package mysticworld.client;
|
||||||
|
|
||||||
|
import mysticworld.blocks.BlockHandler;
|
||||||
|
import mysticworld.client.fx.LightCubeFX;
|
||||||
|
import mysticworld.client.fx.PowerAirFX;
|
||||||
|
import mysticworld.client.fx.PowerEarthFX;
|
||||||
|
import mysticworld.client.fx.PowerEnergyFX;
|
||||||
|
import mysticworld.client.fx.PowerFireFX;
|
||||||
|
import mysticworld.client.fx.PowerWaterFX;
|
||||||
|
import mysticworld.entity.EntityChargeAir;
|
||||||
|
import mysticworld.entity.EntityChargeEarth;
|
||||||
|
import mysticworld.entity.EntityChargeEnergy;
|
||||||
|
import mysticworld.entity.EntityChargeFire;
|
||||||
|
import mysticworld.entity.EntityChargeWater;
|
||||||
|
import mysticworld.items.ItemHandler$1;
|
||||||
|
import mysticworld.lib.RenderIds;
|
||||||
|
import mysticworld.renderer.BlockPillarInsertRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbAirRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbEarthRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbEnergyRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbFireRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbWaterRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffAirRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffEarthRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffEnergyRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffFireRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffWaterRenderer;
|
||||||
|
import mysticworld.renderer.RenderStaffPower;
|
||||||
|
import mysticworld.renderer.TileEntityPillarInsertRenderer;
|
||||||
|
import mysticworld.tiles.TileEntityPillarInsert;
|
||||||
|
import mysticworld.util.CommonProxy;
|
||||||
import net.minecraft.src.ModLoader;
|
import net.minecraft.src.ModLoader;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
import MysticWorld.Blocks.BlockHandler;
|
|
||||||
import MysticWorld.Client.FX.LightCubeFX;
|
|
||||||
import MysticWorld.Client.FX.PowerAirFX;
|
|
||||||
import MysticWorld.Client.FX.PowerEarthFX;
|
|
||||||
import MysticWorld.Client.FX.PowerEnergyFX;
|
|
||||||
import MysticWorld.Client.FX.PowerFireFX;
|
|
||||||
import MysticWorld.Client.FX.PowerWaterFX;
|
|
||||||
import MysticWorld.Entity.EntityChargeAir;
|
|
||||||
import MysticWorld.Entity.EntityChargeEarth;
|
|
||||||
import MysticWorld.Entity.EntityChargeEnergy;
|
|
||||||
import MysticWorld.Entity.EntityChargeFire;
|
|
||||||
import MysticWorld.Entity.EntityChargeWater;
|
|
||||||
import MysticWorld.Items.ItemHandler$1;
|
|
||||||
import MysticWorld.Lib.RenderIds;
|
|
||||||
import MysticWorld.Renderer.BlockPillarInsertRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemOrbAirRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemOrbEarthRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemOrbEnergyRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemOrbFireRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemOrbWaterRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemStaffAirRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemStaffEarthRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemStaffEnergyRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemStaffFireRenderer;
|
|
||||||
import MysticWorld.Renderer.ItemStaffWaterRenderer;
|
|
||||||
import MysticWorld.Renderer.RenderStaffPower;
|
|
||||||
import MysticWorld.Renderer.TileEntityPillarInsertRenderer;
|
|
||||||
import MysticWorld.TileEntity.TileEntityPillarInsert;
|
|
||||||
import MysticWorld.Util.CommonProxy;
|
|
||||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerRenderIDs()
|
public int addArmor(String armor) {
|
||||||
{
|
|
||||||
RenderIds.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerRenders()
|
|
||||||
{
|
|
||||||
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
|
|
||||||
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireStaff.itemID, new ItemStaffFireRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthStaff.itemID, new ItemStaffEarthRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airStaff.itemID, new ItemStaffAirRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyStaff.itemID, new ItemStaffEnergyRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterStaff.itemID, new ItemStaffWaterRenderer());
|
|
||||||
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireOrb.itemID, new ItemOrbFireRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthOrb.itemID, new ItemOrbEarthRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airOrb.itemID, new ItemOrbAirRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyOrb.itemID, new ItemOrbEnergyRenderer());
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterOrb.itemID, new ItemOrbWaterRenderer());
|
|
||||||
|
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
|
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
|
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
|
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower(3));
|
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower(4));
|
|
||||||
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillarInsert.class, new TileEntityPillarInsertRenderer());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int addArmor(String armor)
|
|
||||||
{
|
|
||||||
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//particles
|
//particles
|
||||||
@Override
|
@Override
|
||||||
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age)
|
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
|
||||||
{
|
|
||||||
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void earthFX(World worldObj, double x, double y, double z, float scale)
|
public void earthFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
{
|
|
||||||
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
|
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(earthFX);
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(earthFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void energyFX(World worldObj, double x, double y, double z, float scale)
|
public void energyFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
{
|
|
||||||
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
|
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(energyFX);
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(energyFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fireFX(World worldObj, double x, double y, double z, float scale)
|
public void fireFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
{
|
|
||||||
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
|
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(fireFX);
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(fireFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void waterFX(World worldObj, double x, double y, double z, float scale)
|
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
|
||||||
{
|
|
||||||
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
|
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(waterFX);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale)
|
|
||||||
{
|
|
||||||
LightCubeFX lightCubeFX = new LightCubeFX(worldObj, x, y, z, motionX, motionY, motionZ, scale);
|
LightCubeFX lightCubeFX = new LightCubeFX(worldObj, x, y, z, motionX, motionY, motionZ, scale);
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(lightCubeFX);
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(lightCubeFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerRenderIDs() {
|
||||||
|
RenderIds.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerRenders() {
|
||||||
|
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireStaff.itemID, new ItemStaffFireRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthStaff.itemID, new ItemStaffEarthRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airStaff.itemID, new ItemStaffAirRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyStaff.itemID, new ItemStaffEnergyRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterStaff.itemID, new ItemStaffWaterRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireOrb.itemID, new ItemOrbFireRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthOrb.itemID, new ItemOrbEarthRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airOrb.itemID, new ItemOrbAirRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyOrb.itemID, new ItemOrbEnergyRenderer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterOrb.itemID, new ItemOrbWaterRenderer());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower(3));
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower(4));
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillarInsert.class, new TileEntityPillarInsertRenderer());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void waterFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
|
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
|
||||||
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(waterFX);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
package MysticWorld.Client.FX;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
import net.minecraft.client.particle.EntityFX;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class LightCubeFX extends EntityFX {
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public LightCubeFX(World world, double x, double y, double z)
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
{
|
|
||||||
|
public class LightCubeFX extends EntityFX {
|
||||||
|
public LightCubeFX(World world, double x, double y, double z) {
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,72 +30,54 @@ public class LightCubeFX extends EntityFX {
|
||||||
this.particleMaxAge = rand.nextInt(25);
|
this.particleMaxAge = rand.nextInt(25);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public void onUpdate() {
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
this.prevPosY = this.posY;
|
this.prevPosY = this.posY;
|
||||||
this.prevPosZ = this.posZ;
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionY += 0.004D;
|
this.motionY += 0.004D;
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
if (this.posY == this.prevPosY)
|
|
||||||
{
|
|
||||||
this.motionX *= 1.1D;
|
this.motionX *= 1.1D;
|
||||||
this.motionZ *= 1.1D;
|
this.motionZ *= 1.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionX *= 0.9599999785423279D;
|
this.motionX *= 0.9599999785423279D;
|
||||||
this.motionY *= 0.9599999785423279D;
|
this.motionY *= 0.9599999785423279D;
|
||||||
this.motionZ *= 0.9599999785423279D;
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
this.motionX *= 0.699999988079071D;
|
||||||
this.motionZ *= 0.699999988079071D;
|
this.motionZ *= 0.699999988079071D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
@Override
|
||||||
{
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/lightCubeFX.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/lightCubeFX.png"));
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setBrightness(240);
|
tessellator.setBrightness(240);
|
||||||
|
|
||||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
|
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,35 @@
|
||||||
package MysticWorld.Client.FX;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
public class PowerAirFX extends EntityFX {
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
public PowerAirFX(World world, double x, double y, double z) {
|
||||||
import net.minecraft.src.ModLoader;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class PowerAirFX extends EntityFX
|
|
||||||
{
|
|
||||||
public PowerAirFX(World world, double x, double y, double z)
|
|
||||||
{
|
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.particleRed = 1.0F;
|
||||||
|
this.particleGreen = 1.0F;
|
||||||
|
this.particleBlue = 1.0F;
|
||||||
|
this.particleScale = 1.0F;
|
||||||
|
this.noClip = true;
|
||||||
|
this.particleMaxAge = 120;
|
||||||
|
this.rotationPitch = rotPitch;
|
||||||
|
this.rotationYaw = rotYaw;
|
||||||
|
}
|
||||||
|
|
||||||
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
|
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.motionX += motionX;
|
this.motionX += motionX;
|
||||||
|
|
@ -34,93 +46,58 @@ public class PowerAirFX extends EntityFX
|
||||||
this.particleMaxAge = age;
|
this.particleMaxAge = age;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw){
|
@Override
|
||||||
super(world, x, y, z);
|
public void onUpdate() {
|
||||||
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
|
|
||||||
this.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI));
|
|
||||||
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
|
|
||||||
this.particleRed = 1.0F;
|
|
||||||
this.particleGreen = 1.0F;
|
|
||||||
this.particleBlue = 1.0F;
|
|
||||||
this.particleScale = 1.0F;
|
|
||||||
this.noClip = true;
|
|
||||||
this.particleMaxAge = 120;
|
|
||||||
this.rotationPitch = rotPitch;
|
|
||||||
this.rotationYaw = rotYaw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onUpdate()
|
|
||||||
{
|
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
this.prevPosY = this.posY;
|
this.prevPosY = this.posY;
|
||||||
this.prevPosZ = this.posZ;
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionY += 0.004D;
|
this.motionY += 0.004D;
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
if (this.posY == this.prevPosY)
|
|
||||||
{
|
|
||||||
this.motionX *= 1.1D;
|
this.motionX *= 1.1D;
|
||||||
this.motionZ *= 1.1D;
|
this.motionZ *= 1.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionX *= 0.9599999785423279D;
|
this.motionX *= 0.9599999785423279D;
|
||||||
this.motionY *= 0.9599999785423279D;
|
this.motionY *= 0.9599999785423279D;
|
||||||
this.motionZ *= 0.9599999785423279D;
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
this.motionX *= 0.699999988079071D;
|
||||||
this.motionZ *= 0.699999988079071D;
|
this.motionZ *= 0.699999988079071D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
@Override
|
||||||
{
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/airFX.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/airFX.png"));
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setBrightness(240);
|
tessellator.setBrightness(240);
|
||||||
|
|
||||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
|
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
package MysticWorld.Client.FX;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
public class PowerEarthFX extends EntityFX {
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
public PowerEarthFX(World world, double x, double y, double z) {
|
||||||
import net.minecraft.src.ModLoader;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class PowerEarthFX extends EntityFX
|
|
||||||
{
|
|
||||||
public PowerEarthFX(World world, double x, double y, double z)
|
|
||||||
{
|
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,72 +30,54 @@ public class PowerEarthFX extends EntityFX
|
||||||
this.particleMaxAge = 15;
|
this.particleMaxAge = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public void onUpdate() {
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
this.prevPosY = this.posY;
|
this.prevPosY = this.posY;
|
||||||
this.prevPosZ = this.posZ;
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionY += 0.004D;
|
this.motionY += 0.004D;
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
if (this.posY == this.prevPosY)
|
|
||||||
{
|
|
||||||
this.motionX *= 1.1D;
|
this.motionX *= 1.1D;
|
||||||
this.motionZ *= 1.1D;
|
this.motionZ *= 1.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionX *= 0.9599999785423279D;
|
this.motionX *= 0.9599999785423279D;
|
||||||
this.motionY *= 0.9599999785423279D;
|
this.motionY *= 0.9599999785423279D;
|
||||||
this.motionZ *= 0.9599999785423279D;
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
this.motionX *= 0.699999988079071D;
|
||||||
this.motionZ *= 0.699999988079071D;
|
this.motionZ *= 0.699999988079071D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
@Override
|
||||||
{
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/earthFX.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/earthFX.png"));
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setBrightness(240);
|
tessellator.setBrightness(240);
|
||||||
|
|
||||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
|
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
package MysticWorld.Client.FX;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
public class PowerEnergyFX extends EntityFX {
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
public PowerEnergyFX(World world, double x, double y, double z) {
|
||||||
import net.minecraft.src.ModLoader;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class PowerEnergyFX extends EntityFX
|
|
||||||
{
|
|
||||||
public PowerEnergyFX(World world, double x, double y, double z)
|
|
||||||
{
|
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,72 +30,54 @@ public class PowerEnergyFX extends EntityFX
|
||||||
this.particleMaxAge = 15;
|
this.particleMaxAge = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public void onUpdate() {
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
this.prevPosY = this.posY;
|
this.prevPosY = this.posY;
|
||||||
this.prevPosZ = this.posZ;
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionY += 0.004D;
|
this.motionY += 0.004D;
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
if (this.posY == this.prevPosY)
|
|
||||||
{
|
|
||||||
this.motionX *= 1.1D;
|
this.motionX *= 1.1D;
|
||||||
this.motionZ *= 1.1D;
|
this.motionZ *= 1.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionX *= 0.9599999785423279D;
|
this.motionX *= 0.9599999785423279D;
|
||||||
this.motionY *= 0.9599999785423279D;
|
this.motionY *= 0.9599999785423279D;
|
||||||
this.motionZ *= 0.9599999785423279D;
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
this.motionX *= 0.699999988079071D;
|
||||||
this.motionZ *= 0.699999988079071D;
|
this.motionZ *= 0.699999988079071D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
@Override
|
||||||
{
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/energyFX.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/energyFX.png"));
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setBrightness(240);
|
tessellator.setBrightness(240);
|
||||||
|
|
||||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
|
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
package MysticWorld.Client.FX;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
public class PowerFireFX extends EntityFX {
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
public PowerFireFX(World world, double x, double y, double z) {
|
||||||
import net.minecraft.src.ModLoader;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class PowerFireFX extends EntityFX
|
|
||||||
{
|
|
||||||
public PowerFireFX(World world, double x, double y, double z)
|
|
||||||
{
|
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,73 +30,54 @@ public class PowerFireFX extends EntityFX
|
||||||
this.particleMaxAge = 15;
|
this.particleMaxAge = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public void onUpdate() {
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
this.prevPosY = this.posY;
|
this.prevPosY = this.posY;
|
||||||
this.prevPosZ = this.posZ;
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionY += 0.004D;
|
this.motionY += 0.004D;
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
if (this.posY == this.prevPosY)
|
|
||||||
{
|
|
||||||
this.motionX *= 1.1D;
|
this.motionX *= 1.1D;
|
||||||
this.motionZ *= 1.1D;
|
this.motionZ *= 1.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionX *= 0.9599999785423279D;
|
this.motionX *= 0.9599999785423279D;
|
||||||
this.motionY *= 0.9599999785423279D;
|
this.motionY *= 0.9599999785423279D;
|
||||||
this.motionZ *= 0.9599999785423279D;
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
this.motionX *= 0.699999988079071D;
|
||||||
this.motionZ *= 0.699999988079071D;
|
this.motionZ *= 0.699999988079071D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
@Override
|
||||||
{
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/fireFX.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/fireFX.png"));
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setBrightness(240);
|
tessellator.setBrightness(240);
|
||||||
|
|
||||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
|
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
package MysticWorld.Client.FX;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
public class PowerWaterFX extends EntityFX {
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
public PowerWaterFX(World world, double x, double y, double z) {
|
||||||
import net.minecraft.src.ModLoader;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class PowerWaterFX extends EntityFX
|
|
||||||
{
|
|
||||||
public PowerWaterFX(World world, double x, double y, double z)
|
|
||||||
{
|
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,72 +30,54 @@ public class PowerWaterFX extends EntityFX
|
||||||
this.particleMaxAge = 15;
|
this.particleMaxAge = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public void onUpdate() {
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
this.prevPosY = this.posY;
|
this.prevPosY = this.posY;
|
||||||
this.prevPosZ = this.posZ;
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionY += 0.004D;
|
this.motionY += 0.004D;
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
if (this.posY == this.prevPosY)
|
|
||||||
{
|
|
||||||
this.motionX *= 1.1D;
|
this.motionX *= 1.1D;
|
||||||
this.motionZ *= 1.1D;
|
this.motionZ *= 1.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.motionX *= 0.9599999785423279D;
|
this.motionX *= 0.9599999785423279D;
|
||||||
this.motionY *= 0.9599999785423279D;
|
this.motionY *= 0.9599999785423279D;
|
||||||
this.motionZ *= 0.9599999785423279D;
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
this.motionX *= 0.699999988079071D;
|
||||||
this.motionZ *= 0.699999988079071D;
|
this.motionZ *= 0.699999988079071D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
@Override
|
||||||
{
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/waterFX.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("MysticMods:textures" + "/misc/waterFX.png"));
|
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setBrightness(240);
|
tessellator.setBrightness(240);
|
||||||
|
|
||||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);
|
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,186 +1,153 @@
|
||||||
package MysticWorld.Entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import mysticworld.MysticWorld;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.Entity;
|
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.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.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.FakePlayerFactory;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
|
||||||
|
|
||||||
public class EntityChargeAir extends Entity {
|
public class EntityChargeAir extends Entity {
|
||||||
|
|
||||||
public EntityPlayer shootingEntity;
|
public EntityPlayer shootingEntity;
|
||||||
|
|
||||||
private boolean inGround = false;
|
private boolean inGround = false;
|
||||||
|
|
||||||
private int xTile = -1;
|
private int xTile = -1;
|
||||||
private int yTile = -1;
|
private int yTile = -1;
|
||||||
private int zTile = -1;
|
private int zTile = -1;
|
||||||
private int inTile = 0;
|
private int inTile = 0;
|
||||||
private int ticksAlive;
|
private int ticksAlive;
|
||||||
private int ticksInAir = 0;
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
private float particleScale = 1.0f;
|
private float particleScale = 1.0f;
|
||||||
|
|
||||||
private double powerHeight = 0.75D;
|
private double powerHeight = 0.75D;
|
||||||
|
|
||||||
public EntityChargeAir(World par1World)
|
public EntityChargeAir(World par1World) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight)
|
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
this.setSize(0.25F, 0.25F);
|
this.setSize(0.25F, 0.25F);
|
||||||
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
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.motionX = -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.motionY = (-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.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
this.shootingEntity = par2EntityPlayer;
|
this.shootingEntity = par2EntityPlayer;
|
||||||
this.particleScale = pScale;
|
this.particleScale = pScale;
|
||||||
this.powerHeight = pHeight;
|
this.powerHeight = pHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public boolean canBeCollidedWith() {
|
||||||
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
|
return true;
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
Vec3 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);
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
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);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
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));
|
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;
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
for (int j = 0; j < list.size(); ++j)
|
|
||||||
{
|
|
||||||
Entity entity1 = (Entity) list.get(j);
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
|
|
||||||
{
|
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
if (movingobjectposition1 != null)
|
|
||||||
{
|
|
||||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
if (d1 < d0 || d0 == 0.0D)
|
|
||||||
{
|
|
||||||
entity = entity1;
|
entity = entity1;
|
||||||
d0 = d1;
|
d0 = d1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entity != null) {
|
||||||
if (entity != null)
|
|
||||||
{
|
|
||||||
movingobjectposition = new MovingObjectPosition(entity);
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
}
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
this.onImpact(movingobjectposition);
|
this.onImpact(movingobjectposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
float f2 = this.getMotionFactor();
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
if (this.isInWater())
|
for (int k = 0; k < 4; ++k) {
|
||||||
{
|
|
||||||
for (int k = 0; k < 4; ++k)
|
|
||||||
{
|
|
||||||
float f3 = 0.25F;
|
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);
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
f2 = 0.8F;
|
f2 = 0.8F;
|
||||||
}
|
}
|
||||||
|
|
||||||
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
||||||
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
||||||
|
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getMotionFactor()
|
@Override
|
||||||
{
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
return 0.95F;
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
{
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
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);
|
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) {
|
||||||
if (par1MovingObjectPosition.entityHit != null)
|
|
||||||
{
|
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
if (f3 > 0.0F) {
|
||||||
if (f3 > 0.0F)
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 2 * 0.6000000238418579D / f3, 1.0D + powerHeight, this.motionZ * 2 * 0.6000000238418579D / f3);
|
||||||
{
|
|
||||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * (double)2 * 0.6000000238418579D / (double)f3, 1.0D + powerHeight, this.motionZ * (double)2 * 0.6000000238418579D / (double)f3);
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
switch (par1MovingObjectPosition.sideHit)
|
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
--j;
|
--j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -200,15 +167,10 @@ public class EntityChargeAir extends Entity {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
}
|
}
|
||||||
|
|
@ -216,31 +178,4 @@ public class EntityChargeAir extends Entity {
|
||||||
@Override
|
@Override
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,27 +1,16 @@
|
||||||
package MysticWorld.Entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.Entity;
|
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.EntityDragon;
|
||||||
import net.minecraft.entity.boss.EntityWither;
|
import net.minecraft.entity.boss.EntityWither;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.monster.EntityBlaze;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
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.Item;
|
||||||
import net.minecraft.item.ItemDye;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
|
@ -30,11 +19,10 @@ import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.FakePlayerFactory;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EntityChargeEarth extends Entity {
|
public class EntityChargeEarth extends Entity {
|
||||||
|
|
||||||
public EntityPlayer shootingEntity;
|
public EntityPlayer shootingEntity;
|
||||||
public EntityPlayer entityPlayer;
|
public EntityPlayer entityPlayer;
|
||||||
public EntityDragon entityDragon;
|
public EntityDragon entityDragon;
|
||||||
|
|
@ -47,127 +35,120 @@ public class EntityChargeEarth extends Entity {
|
||||||
private int ticksAlive;
|
private int ticksAlive;
|
||||||
private int ticksInAir = 0;
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public EntityChargeEarth(World par1World)
|
public EntityChargeEarth(World par1World) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeEarth(World par1World, EntityPlayer par2EntityPlayer)
|
public EntityChargeEarth(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
this.setSize(0.25F, 0.25F);
|
this.setSize(0.25F, 0.25F);
|
||||||
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
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.motionX = -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.motionY = (-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.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
this.shootingEntity = par2EntityPlayer;
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public boolean canBeCollidedWith() {
|
||||||
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
|
return true;
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
Vec3 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);
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
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);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
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));
|
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;
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
for (int j = 0; j < list.size(); ++j)
|
|
||||||
{
|
|
||||||
Entity entity1 = (Entity) list.get(j);
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
|
|
||||||
{
|
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
if (movingobjectposition1 != null)
|
|
||||||
{
|
|
||||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
if (d1 < d0 || d0 == 0.0D)
|
|
||||||
{
|
|
||||||
entity = entity1;
|
entity = entity1;
|
||||||
d0 = d1;
|
d0 = d1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entity != null) {
|
||||||
if (entity != null)
|
|
||||||
{
|
|
||||||
movingobjectposition = new MovingObjectPosition(entity);
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
}
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
this.onImpact(movingobjectposition);
|
this.onImpact(movingobjectposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
float f2 = this.getMotionFactor();
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
if (this.isInWater())
|
for (int k = 0; k < 4; ++k) {
|
||||||
{
|
|
||||||
for (int k = 0; k < 4; ++k)
|
|
||||||
{
|
|
||||||
float f3 = 0.25F;
|
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);
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
f2 = 0.8F;
|
f2 = 0.8F;
|
||||||
}
|
}
|
||||||
|
|
||||||
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getMotionFactor()
|
@Override
|
||||||
{
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
return 0.95F;
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
{
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
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);
|
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) {
|
||||||
if (par1MovingObjectPosition.entityHit != null)
|
|
||||||
{
|
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
if (f3 > 0.0F) {
|
||||||
if (f3 > 0.0F)
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
{
|
|
||||||
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);
|
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(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(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(Item.appleRed, rand.nextInt(2))));
|
||||||
|
|
@ -177,15 +158,11 @@ public class EntityChargeEarth extends Entity {
|
||||||
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), 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(Block.sapling, rand.nextInt(2), 3)));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.melonSeeds, rand.nextInt(3))));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.melonSeeds, rand.nextInt(3))));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
switch (par1MovingObjectPosition.sideHit)
|
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
--j;
|
--j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -205,15 +182,10 @@ public class EntityChargeEarth extends Entity {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
}
|
}
|
||||||
|
|
@ -221,31 +193,4 @@ public class EntityChargeEarth extends Entity {
|
||||||
@Override
|
@Override
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,21 @@
|
||||||
package MysticWorld.Entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
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.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.IProjectile;
|
|
||||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
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.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.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EntityChargeEnergy extends Entity {
|
public class EntityChargeEnergy extends Entity {
|
||||||
|
|
||||||
public EntityPlayer shootingEntity;
|
public EntityPlayer shootingEntity;
|
||||||
private boolean inGround = false;
|
private boolean inGround = false;
|
||||||
private int xTile = -1;
|
private int xTile = -1;
|
||||||
|
|
@ -37,133 +25,124 @@ public class EntityChargeEnergy extends Entity {
|
||||||
private int ticksAlive;
|
private int ticksAlive;
|
||||||
private int ticksInAir = 0;
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public EntityChargeEnergy(World par1World)
|
public EntityChargeEnergy(World par1World) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeEnergy(World par1World, EntityPlayer par2EntityPlayer)
|
public EntityChargeEnergy(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
this.setSize(0.25F, 0.25F);
|
this.setSize(0.25F, 0.25F);
|
||||||
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
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.motionX = -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.motionY = (-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.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
this.shootingEntity = par2EntityPlayer;
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public boolean canBeCollidedWith() {
|
||||||
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
|
return true;
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
Vec3 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);
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
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);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
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));
|
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;
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
for (int j = 0; j < list.size(); ++j)
|
|
||||||
{
|
|
||||||
Entity entity1 = (Entity) list.get(j);
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
|
|
||||||
{
|
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
if (movingobjectposition1 != null)
|
|
||||||
{
|
|
||||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
if (d1 < d0 || d0 == 0.0D)
|
|
||||||
{
|
|
||||||
entity = entity1;
|
entity = entity1;
|
||||||
d0 = d1;
|
d0 = d1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entity != null) {
|
||||||
if (entity != null)
|
|
||||||
{
|
|
||||||
movingobjectposition = new MovingObjectPosition(entity);
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
}
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
this.onImpact(movingobjectposition);
|
this.onImpact(movingobjectposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
float f2 = this.getMotionFactor();
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
if (this.isInWater())
|
for (int k = 0; k < 4; ++k) {
|
||||||
{
|
|
||||||
for (int k = 0; k < 4; ++k)
|
|
||||||
{
|
|
||||||
float f3 = 0.25F;
|
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);
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
f2 = 0.8F;
|
f2 = 0.8F;
|
||||||
}
|
}
|
||||||
|
|
||||||
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getMotionFactor()
|
@Override
|
||||||
{
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
return 0.95F;
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
{
|
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
if (!this.worldObj.isRemote)
|
if (par1MovingObjectPosition.entityHit != null) {
|
||||||
{
|
|
||||||
if (par1MovingObjectPosition.entityHit != null)
|
|
||||||
{
|
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
if (f3 > 0.0F) {
|
||||||
if (f3 > 0.0F)
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
{
|
|
||||||
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));
|
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
|
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
|
||||||
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
switch (par1MovingObjectPosition.sideHit)
|
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
--j;
|
--j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -183,15 +162,10 @@ public class EntityChargeEnergy extends Entity {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
}
|
}
|
||||||
|
|
@ -199,32 +173,4 @@ public class EntityChargeEnergy extends Entity {
|
||||||
@Override
|
@Override
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,22 +1,11 @@
|
||||||
package MysticWorld.Entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.Entity;
|
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.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.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
|
@ -24,9 +13,10 @@ import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EntityChargeFire extends Entity {
|
public class EntityChargeFire extends Entity {
|
||||||
|
|
||||||
public EntityPlayer shootingEntity;
|
public EntityPlayer shootingEntity;
|
||||||
private boolean inGround = false;
|
private boolean inGround = false;
|
||||||
private int xTile = -1;
|
private int xTile = -1;
|
||||||
|
|
@ -36,137 +26,127 @@ public class EntityChargeFire extends Entity {
|
||||||
private int ticksAlive;
|
private int ticksAlive;
|
||||||
private int ticksInAir = 0;
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public EntityChargeFire(World par1World)
|
public EntityChargeFire(World par1World) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeFire(World par1World, EntityPlayer par2EntityPlayer)
|
public EntityChargeFire(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
this.setSize(0.25F, 0.25F);
|
this.setSize(0.25F, 0.25F);
|
||||||
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
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.motionX = -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.motionY = (-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.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
this.shootingEntity = par2EntityPlayer;
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public boolean canBeCollidedWith() {
|
||||||
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
|
return true;
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
Vec3 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);
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
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);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
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));
|
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;
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
for (int j = 0; j < list.size(); ++j)
|
|
||||||
{
|
|
||||||
Entity entity1 = (Entity) list.get(j);
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
|
|
||||||
{
|
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
if (movingobjectposition1 != null)
|
|
||||||
{
|
|
||||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
if (d1 < d0 || d0 == 0.0D)
|
|
||||||
{
|
|
||||||
entity = entity1;
|
entity = entity1;
|
||||||
d0 = d1;
|
d0 = d1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entity != null) {
|
||||||
if (entity != null)
|
|
||||||
{
|
|
||||||
movingobjectposition = new MovingObjectPosition(entity);
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
}
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
this.onImpact(movingobjectposition);
|
this.onImpact(movingobjectposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
float f2 = this.getMotionFactor();
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
if (this.isInWater())
|
for (int k = 0; k < 4; ++k) {
|
||||||
{
|
|
||||||
for (int k = 0; k < 4; ++k)
|
|
||||||
{
|
|
||||||
float f3 = 0.25F;
|
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);
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
f2 = 0.8F;
|
f2 = 0.8F;
|
||||||
}
|
}
|
||||||
|
|
||||||
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getMotionFactor()
|
@Override
|
||||||
{
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
return 0.95F;
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
{
|
if (!this.worldObj.isRemote) {
|
||||||
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);
|
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) {
|
||||||
if (par1MovingObjectPosition.entityHit != null)
|
|
||||||
{
|
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
if (f3 > 0.0F) {
|
||||||
if (f3 > 0.0F)
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
{
|
|
||||||
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()) {
|
||||||
if (!par1MovingObjectPosition.entityHit.isImmuneToFire())
|
|
||||||
{
|
|
||||||
par1MovingObjectPosition.entityHit.setFire(5);
|
par1MovingObjectPosition.entityHit.setFire(5);
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 7);
|
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 7);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
switch (par1MovingObjectPosition.sideHit)
|
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
--j;
|
--j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -185,22 +165,14 @@ public class EntityChargeFire extends Entity {
|
||||||
case 5:
|
case 5:
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
if (this.worldObj.isAirBlock(i, j, k)) {
|
||||||
if (this.worldObj.isAirBlock(i, j, k))
|
|
||||||
{
|
|
||||||
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
|
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
}
|
}
|
||||||
|
|
@ -208,32 +180,4 @@ public class EntityChargeFire extends Entity {
|
||||||
@Override
|
@Override
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,10 @@
|
||||||
package MysticWorld.Entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
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.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.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.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
|
@ -24,9 +12,10 @@ import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EntityChargeWater extends Entity {
|
public class EntityChargeWater extends Entity {
|
||||||
|
|
||||||
public EntityPlayer shootingEntity;
|
public EntityPlayer shootingEntity;
|
||||||
private boolean inGround = false;
|
private boolean inGround = false;
|
||||||
private int xTile = -1;
|
private int xTile = -1;
|
||||||
|
|
@ -36,141 +25,129 @@ public class EntityChargeWater extends Entity {
|
||||||
private int ticksAlive;
|
private int ticksAlive;
|
||||||
private int ticksInAir = 0;
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public EntityChargeWater(World par1World)
|
public EntityChargeWater(World par1World) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeWater(World par1World, EntityPlayer par2EntityPlayer)
|
public EntityChargeWater(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
{
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
this.setSize(0.25F, 0.25F);
|
this.setSize(0.25F, 0.25F);
|
||||||
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + (double)par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
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.motionX = -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.motionY = (-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.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
this.shootingEntity = par2EntityPlayer;
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdate()
|
@Override
|
||||||
{
|
public boolean canBeCollidedWith() {
|
||||||
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)))
|
return true;
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
Vec3 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);
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
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);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
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));
|
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;
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
for (int j = 0; j < list.size(); ++j)
|
|
||||||
{
|
|
||||||
Entity entity1 = (Entity) list.get(j);
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25))
|
|
||||||
{
|
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
if (movingobjectposition1 != null)
|
|
||||||
{
|
|
||||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
if (d1 < d0 || d0 == 0.0D)
|
|
||||||
{
|
|
||||||
entity = entity1;
|
entity = entity1;
|
||||||
d0 = d1;
|
d0 = d1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entity != null) {
|
||||||
if (entity != null)
|
|
||||||
{
|
|
||||||
movingobjectposition = new MovingObjectPosition(entity);
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
}
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
if (movingobjectposition != null)
|
|
||||||
{
|
|
||||||
this.onImpact(movingobjectposition);
|
this.onImpact(movingobjectposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
float f2 = this.getMotionFactor();
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
if (this.isInWater())
|
for (int k = 0; k < 4; ++k) {
|
||||||
{
|
|
||||||
for (int k = 0; k < 4; ++k)
|
|
||||||
{
|
|
||||||
float f3 = 0.25F;
|
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);
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
f2 = 0.8F;
|
f2 = 0.8F;
|
||||||
}
|
}
|
||||||
|
|
||||||
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getMotionFactor()
|
@Override
|
||||||
{
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
return 0.95F;
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
{
|
if (!this.worldObj.isRemote) {
|
||||||
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);
|
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) {
|
||||||
if (par1MovingObjectPosition.entityHit != null)
|
|
||||||
{
|
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
if (f3 > 0.0F) {
|
||||||
if (f3 > 0.0F)
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
{
|
|
||||||
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()) {
|
||||||
if (par1MovingObjectPosition.entityHit.isImmuneToFire())
|
|
||||||
{
|
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
||||||
}
|
}
|
||||||
|
if (par1MovingObjectPosition.entityHit.isBurning()) {
|
||||||
if (par1MovingObjectPosition.entityHit.isBurning())
|
|
||||||
{
|
|
||||||
par1MovingObjectPosition.entityHit.extinguish();
|
par1MovingObjectPosition.entityHit.extinguish();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
switch (par1MovingObjectPosition.sideHit)
|
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
--j;
|
--j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -190,15 +167,10 @@ public class EntityChargeWater extends Entity {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
}
|
}
|
||||||
|
|
@ -206,33 +178,4 @@ public class EntityChargeWater extends Entity {
|
||||||
@Override
|
@Override
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
package MysticWorld.Entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import mysticworld.lib.EntityIds;
|
||||||
import net.minecraftforge.common.BiomeDictionary;
|
import mysticworld.lib.Strings;
|
||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
import MysticWorld.MysticWorld;
|
|
||||||
import MysticWorld.Lib.EntityIds;
|
|
||||||
import MysticWorld.Lib.Strings;
|
|
||||||
|
|
||||||
public class EntityHandler {
|
public class EntityHandler {
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
registerEntities();
|
registerEntities();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package MysticWorld.Items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import net.minecraft.item.EnumArmorMaterial;
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
import net.minecraftforge.common.EnumHelper;
|
import net.minecraftforge.common.EnumHelper;
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
package MysticWorld.Items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.item.EnumArmorMaterial;
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ItemArmorAdamantine extends ItemArmor
|
public class ItemArmorAdamantine extends ItemArmor {
|
||||||
{
|
|
||||||
int ArmorType;
|
int ArmorType;
|
||||||
|
|
||||||
String ArmorFile_1;
|
String ArmorFile_1;
|
||||||
String ArmorFile_2;
|
String ArmorFile_2;
|
||||||
|
|
||||||
|
|
@ -25,8 +22,13 @@ public class ItemArmorAdamantine extends ItemArmor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
{
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Adamantine_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
switch (ArmorType) {
|
switch (ArmorType) {
|
||||||
case 0:
|
case 0:
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_0");
|
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_0");
|
||||||
|
|
@ -42,11 +44,4 @@ public class ItemArmorAdamantine extends ItemArmor
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
|
|
||||||
{
|
|
||||||
int suffix = this.armorType == 2 ? 2 : 1;
|
|
||||||
|
|
||||||
return "MysticMods:textures" + "/models/armor/Adamantine_layer_" + suffix + ".png";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
package MysticWorld.Items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.EnumArmorMaterial;
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
|
|
@ -12,15 +11,12 @@ import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemArmorIridium extends ItemArmor
|
public class ItemArmorIridium extends ItemArmor {
|
||||||
{
|
|
||||||
int ArmorType;
|
int ArmorType;
|
||||||
|
|
||||||
String ArmorFile_1;
|
String ArmorFile_1;
|
||||||
String ArmorFile_2;
|
String ArmorFile_2;
|
||||||
|
|
||||||
public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
|
||||||
super(par1, par2EnumArmorMaterial, par3, par4);
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
this.ArmorType = par4;
|
this.ArmorType = par4;
|
||||||
this.setMaxDamage(4000);
|
this.setMaxDamage(4000);
|
||||||
|
|
@ -30,8 +26,44 @@ public class ItemArmorIridium extends ItemArmor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
{
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Iridium_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
ItemStack helmet = player.getCurrentItemOrArmor(4);
|
||||||
|
ItemStack plate = player.getCurrentItemOrArmor(3);
|
||||||
|
ItemStack legs = player.getCurrentItemOrArmor(2);
|
||||||
|
ItemStack boots = player.getCurrentItemOrArmor(1);
|
||||||
|
if (helmet != null) {
|
||||||
|
if (helmet.itemID == ItemHandler$1.iridiumHelmet.itemID) {
|
||||||
|
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (plate != null) {
|
||||||
|
if (plate.itemID == ItemHandler$1.iridiumChestplate.itemID) {
|
||||||
|
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (legs != null) {
|
||||||
|
if (legs.itemID == ItemHandler$1.iridiumLeggings.itemID) {
|
||||||
|
player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2)));
|
||||||
|
player.addVelocity(0.0005, 0, 0.0005);
|
||||||
|
player.stepHeight = 1.001F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (boots != null) {
|
||||||
|
if (boots.itemID == ItemHandler$1.iridiumBoots.itemID) {
|
||||||
|
player.fallDistance = 0.0F;
|
||||||
|
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
switch (ArmorType) {
|
switch (ArmorType) {
|
||||||
case 0:
|
case 0:
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_0");
|
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_0");
|
||||||
|
|
@ -47,54 +79,4 @@ public class ItemArmorIridium extends ItemArmor
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
|
|
||||||
{
|
|
||||||
int suffix = this.armorType == 2 ? 2 : 1;
|
|
||||||
|
|
||||||
return "MysticMods:textures" + "/models/armor/Iridium_layer_" + suffix + ".png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack)
|
|
||||||
{
|
|
||||||
ItemStack helmet = player.getCurrentItemOrArmor(4);
|
|
||||||
ItemStack plate = player.getCurrentItemOrArmor(3);
|
|
||||||
ItemStack legs = player.getCurrentItemOrArmor(2);
|
|
||||||
ItemStack boots = player.getCurrentItemOrArmor(1);
|
|
||||||
if (helmet != null)
|
|
||||||
{
|
|
||||||
if(helmet.itemID == ItemHandler$1.iridiumHelmet.itemID)
|
|
||||||
{
|
|
||||||
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plate != null)
|
|
||||||
{
|
|
||||||
if(plate.itemID == ItemHandler$1.iridiumChestplate.itemID)
|
|
||||||
{
|
|
||||||
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (legs != null)
|
|
||||||
{
|
|
||||||
if(legs.itemID == ItemHandler$1.iridiumLeggings.itemID)
|
|
||||||
{
|
|
||||||
player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2)));
|
|
||||||
player.addVelocity(0.0005, 0, 0.0005);
|
|
||||||
player.stepHeight = 1.001F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (boots != null)
|
|
||||||
{
|
|
||||||
if(boots.itemID == ItemHandler$1.iridiumBoots.itemID)
|
|
||||||
{
|
|
||||||
player.fallDistance = 0.0F;
|
|
||||||
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,22 +1,18 @@
|
||||||
package MysticWorld.Items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.item.EnumArmorMaterial;
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ItemArmorMithril extends ItemArmor
|
public class ItemArmorMithril extends ItemArmor {
|
||||||
{
|
|
||||||
int ArmorType;
|
int ArmorType;
|
||||||
|
|
||||||
String ArmorFile_1;
|
String ArmorFile_1;
|
||||||
String ArmorFile_2;
|
String ArmorFile_2;
|
||||||
|
|
||||||
public ItemArmorMithril(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
public ItemArmorMithril(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
|
||||||
super(par1, par2EnumArmorMaterial, par3, par4);
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
this.ArmorType = par4;
|
this.ArmorType = par4;
|
||||||
this.setMaxDamage(500);
|
this.setMaxDamage(500);
|
||||||
|
|
@ -26,8 +22,13 @@ public class ItemArmorMithril extends ItemArmor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
{
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Mithril_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
switch (ArmorType) {
|
switch (ArmorType) {
|
||||||
case 0:
|
case 0:
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_0");
|
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_0");
|
||||||
|
|
@ -43,11 +44,4 @@ public class ItemArmorMithril extends ItemArmor
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
|
|
||||||
{
|
|
||||||
int suffix = this.armorType == 2 ? 2 : 1;
|
|
||||||
|
|
||||||
return "MysticMods:textures" + "/models/armor/Mithril_layer_" + suffix + ".png";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,18 @@
|
||||||
package MysticWorld.Items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.item.EnumArmorMaterial;
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ItemArmorVerdite extends ItemArmor
|
public class ItemArmorVerdite extends ItemArmor {
|
||||||
{
|
|
||||||
int ArmorType;
|
int ArmorType;
|
||||||
|
|
||||||
String ArmorFile_1;
|
String ArmorFile_1;
|
||||||
String ArmorFile_2;
|
String ArmorFile_2;
|
||||||
|
|
||||||
public ItemArmorVerdite(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
public ItemArmorVerdite(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
|
||||||
super(par1, par2EnumArmorMaterial, par3, par4);
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
this.ArmorType = par4;
|
this.ArmorType = par4;
|
||||||
this.setMaxDamage(262);
|
this.setMaxDamage(262);
|
||||||
|
|
@ -26,8 +22,13 @@ public class ItemArmorVerdite extends ItemArmor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
{
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Verdite_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
switch (ArmorType) {
|
switch (ArmorType) {
|
||||||
case 0:
|
case 0:
|
||||||
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_0");
|
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_0");
|
||||||
|
|
@ -43,11 +44,4 @@ public class ItemArmorVerdite extends ItemArmor
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
|
|
||||||
{
|
|
||||||
int suffix = this.armorType == 2 ? 2 : 1;
|
|
||||||
|
|
||||||
return "MysticMods:textures" + "/models/armor/Verdite_layer_" + suffix + ".png";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
package MysticWorld.Items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import MysticWorld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import MysticWorld.Lib.Strings;
|
|
||||||
import MysticWorld.Util.Reference;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemFood;
|
import net.minecraft.item.ItemFood;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
|
|
@ -18,16 +13,15 @@ import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemBushFruit extends ItemFood {
|
public class ItemBushFruit extends ItemFood {
|
||||||
|
|
||||||
private Icon[] icons;
|
private Icon[] icons;
|
||||||
|
private static final String[] FRUIT_TYPES = new String[] { "Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision",
|
||||||
|
"Invisibility" };
|
||||||
|
|
||||||
private static final String[] FRUIT_TYPES = new String[] {"Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision", "Invisibility"};
|
public ItemBushFruit(int id, int health) {
|
||||||
|
|
||||||
|
|
||||||
public ItemBushFruit(int id, int health)
|
|
||||||
{
|
|
||||||
super(id, health, 0.6F, false);
|
super(id, health, 0.6F, false);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
|
@ -36,97 +30,122 @@ public class ItemBushFruit extends ItemFood {
|
||||||
setUnlocalizedName("bushFruit");
|
setUnlocalizedName("bushFruit");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player)
|
@Override
|
||||||
{
|
@SideOnly(Side.CLIENT)
|
||||||
if ((player.canEat(true)) && (player.getFoodStats().getSaturationLevel() < 20.0F))
|
public Icon getIconFromDamage(int meta) {
|
||||||
{
|
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
|
||||||
player.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
return icons[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxItemUseDuration(ItemStack itemstack) {
|
||||||
|
return 24;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
|
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) {
|
||||||
|
par3List.add(new ItemStack(par1, 1, var4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player) {
|
||||||
|
if ((player.canEat(true)) && (player.getFoodStats().getSaturationLevel() < 20.0F)) {
|
||||||
|
player.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||||
|
}
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer player)
|
@Override
|
||||||
{
|
@SideOnly(Side.CLIENT)
|
||||||
if (!world.isRemote)
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
{
|
icons = new Icon[FRUIT_TYPES.length];
|
||||||
|
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
|
||||||
|
icons[i] = iconRegister.registerIcon("MysticMods:Fruit" + FRUIT_TYPES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer player) {
|
||||||
|
if (!world.isRemote) {
|
||||||
int duration = 0;
|
int duration = 0;
|
||||||
PotionEffect potion;
|
PotionEffect potion;
|
||||||
switch(itemstack.getItemDamage())
|
switch (itemstack.getItemDamage()) {
|
||||||
{
|
case 1:
|
||||||
case 1:potion = player.getActivePotionEffect(Potion.poison);
|
potion = player.getActivePotionEffect(Potion.poison);
|
||||||
if(potion != null)
|
if (potion != null) {
|
||||||
{
|
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 2:potion = player.getActivePotionEffect(Potion.weakness);
|
case 2:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.weakness);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 3:potion = player.getActivePotionEffect(Potion.moveSlowdown);
|
case 3:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.moveSlowdown);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 4:potion = player.getActivePotionEffect(Potion.harm);
|
case 4:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.harm);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
|
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
|
||||||
break;
|
break;
|
||||||
case 5:potion = player.getActivePotionEffect(Potion.wither);
|
case 5:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.wither);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 6:potion = player.getActivePotionEffect(Potion.heal);
|
case 6:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.heal);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
|
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
|
||||||
break;
|
break;
|
||||||
case 7:potion = player.getActivePotionEffect(Potion.moveSpeed);
|
case 7:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.moveSpeed);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 8:potion = player.getActivePotionEffect(Potion.fireResistance);
|
case 8:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.fireResistance);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 9:potion = player.getActivePotionEffect(Potion.regeneration);
|
case 9:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.regeneration);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 10:potion = player.getActivePotionEffect(Potion.nightVision);
|
case 10:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.nightVision);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 11:potion = player.getActivePotionEffect(Potion.invisibility);
|
case 11:
|
||||||
if(potion != null)
|
potion = player.getActivePotionEffect(Potion.invisibility);
|
||||||
{
|
if (potion != null) {
|
||||||
duration = potion.duration;
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
|
||||||
|
|
@ -134,38 +153,4 @@ public class ItemBushFruit extends ItemFood {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxItemUseDuration(ItemStack itemstack)
|
|
||||||
{
|
|
||||||
return 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerIcons(IconRegister iconRegister)
|
|
||||||
{
|
|
||||||
icons = new Icon[FRUIT_TYPES.length];
|
|
||||||
|
|
||||||
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
|
|
||||||
icons[i] = iconRegister.registerIcon("MysticMods:Fruit" + FRUIT_TYPES[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Icon getIconFromDamage(int meta) {
|
|
||||||
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue