Reorganized github - Renamed packages lowercase

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

221
.gitignore vendored Normal file
View 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/*

View file

@ -1,14 +1,14 @@
package MysticOres.Blocks;
package mysticores.blocks;
import java.util.List;
import java.util.Random;
import mysticores.items.Items;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
@ -16,223 +16,234 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import MysticOres.MysticOres;
import MysticOres.Items.Items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBase extends Block
{
public class BlockBase extends Block {
Icon[] textures;
public BlockBase(int ID)
{
public BlockBase(int ID) {
super(ID, Material.rock);
setCreativeTab(MysticOres.MysticOresTab);
setCreativeTab(mysticores.MysticOres.MysticOresTab);
}
@Override
public float getBlockHardness(World world, int x, int y, int z)
{
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 float getBlockHardness(World world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
if(meta == 12)
if (meta == 12)
return 4.5f;
else
return 3.0f;
}
@Override
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY,
double explosionZ)
{
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
int meta = world.getBlockMetadata(x, y, z);
if(meta == 12)
if (meta == 12)
return 2000.0f;
else
return 2.0f;
}
}
@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);
if(meta == 2 || meta == 3)
if (meta == 2 || meta == 3)
return 7;
else
return 0;
}
@Override
@SideOnly(Side.CLIENT)
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)
{
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
return new ItemStack(this, 1, meta);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs tab, List list)
{
for(int meta = 0;meta<ItemBase.BLOCK_NAMES.length; meta ++)
{
public void getSubBlocks(int i, CreativeTabs tab, List list) {
for (int meta = 0; meta < ItemBase.BLOCK_NAMES.length; meta++) {
list.add(new ItemStack(i, 1, meta));
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par)
{
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);
int blockID = world.getBlockId(x, y, z);
if(meta == 12 && blockID == this.blockID)
if (meta == 12)
return false;
else
return true;
}
@Override
public boolean renderAsNormalBlock()
{
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
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
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
{
@SideOnly(Side.CLIENT)
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);
if(meta == 12)
int blockID = world.getBlockId(x, y, z);
if (meta == 12 && blockID == this.blockID)
return false;
else
return true;
}
public static int BlackSoulstoneDrops(int par1, Random random, int par3)
{
@Override
protected boolean canSilkHarvest() {
return true;
}
public static int BlackSoulstoneDrops(int par1, Random random, int par3) {
int rand = random.nextInt(2);
switch(rand)
{
case 0:return Item.coal.itemID;
case 1:return Item.gunpowder.itemID;
default:return Item.sugar.itemID;
switch (rand) {
case 0:
return Item.coal.itemID;
case 1:
return Item.gunpowder.itemID;
default:
return Item.sugar.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;
}
}
public static int BlueSoulstoneDrops(int par1, Random random, int par3)
{
public static int BlueSoulstoneDrops(int par1, Random random, int par3) {
int rand = random.nextInt(5);
switch(rand)
{
case 0:return Item.diamond.itemID;
case 1:return Block.obsidian.blockID;
case 2:return Item.gunpowder.itemID;
case 3:return Item.glowstone.itemID;
case 4:return Item.blazeRod.itemID;
case 5:return Item.emerald.itemID;
default:return Item.emerald.itemID;
switch (rand) {
case 0:
return Item.diamond.itemID;
case 1:
return Block.obsidian.blockID;
case 2:
return Item.gunpowder.itemID;
case 3:
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;
}
}
}

View file

@ -1,22 +1,19 @@
package MysticOres.Blocks;
package mysticores.blocks;
import mysticores.lib.BlockID;
import net.minecraft.block.Block;
import net.minecraftforge.common.MinecraftForge;
import MysticOres.Lib.BlockID;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockHandler {
public static Block BlockBase;
public static void Initialize()
{
public static void Initialize() {
BlockBase = new BlockBase(BlockID.BASEID).setStepSound(Block.soundStoneFootstep);
GameRegistry.registerBlock(BlockBase, ItemBase.class, "Base Blocks");
setBlockHarvestLevels();
}
private static void setBlockHarvestLevels() {
MinecraftForge.setBlockHarvestLevel(BlockBase, 0, "pickaxe", 3);
MinecraftForge.setBlockHarvestLevel(BlockBase, 1, "pickaxe", 2);
@ -31,5 +28,4 @@ public class BlockHandler {
MinecraftForge.setBlockHarvestLevel(BlockBase, 10, "pickaxe", 2);
MinecraftForge.setBlockHarvestLevel(BlockBase, 11, "pickaxe", 2);
}
}

View file

@ -1,45 +1,36 @@
package MysticOres.Blocks;
import java.util.List;
import MysticOres.MysticOres;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
package mysticores.blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class 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",
"Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass"};
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",
"Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass" };
public ItemBase(int par1)
{
public ItemBase(int par1) {
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length);
return BLOCK_NAMES[meta];
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return BlockHandler.BlockBase.getIcon(2, par1);
}
public Icon getIconFromDamage(int par1) {
return BlockHandler.BlockBase.getIcon(2, par1);
}
@Override
public int getMetadata(int par1) {
return par1;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length);
return BLOCK_NAMES[meta];
}
}

View file

@ -1,4 +1,4 @@
package MysticOres.Items;
package mysticores.items;
import net.minecraft.block.Block;
import net.minecraft.item.EnumToolMaterial;

View file

@ -1,4 +1,4 @@
package MysticOres.Items;
package mysticores.items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.IFuelHandler;

View file

@ -1,20 +1,18 @@
package MysticOres.Items;
package mysticores.items;
import mysticores.MysticOres;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemAxe;
import MysticOres.MysticOres;
public class ItemAxes extends ItemAxe
{
public ItemAxes(int par1, EnumToolMaterial par2EnumToolMaterial)
{
public class ItemAxes extends ItemAxe {
public ItemAxes(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
setCreativeTab(MysticOres.MysticOresTab);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
}

View file

@ -1,30 +1,18 @@
package MysticOres.Items;
package mysticores.items;
import MysticOres.MysticOres;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticores.MysticOres;
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.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) {
super(par1, par2EnumToolMaterial);
this.setCreativeTab(MysticOres.MysticOresTab);
}
public ItemHoes(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, par2EnumToolMaterial);
this.setCreativeTab(MysticOres.MysticOresTab);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
}

View file

@ -1,28 +1,18 @@
package MysticOres.Items;
package mysticores.items;
import MysticOres.MysticOres;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticores.MysticOres;
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.ItemPickaxe;
import net.minecraft.item.ItemStack;
public class ItemPickaxes extends ItemPickaxe
{
public class ItemPickaxes extends ItemPickaxe {
public ItemPickaxes(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
this.setCreativeTab(MysticOres.MysticOresTab);
}
public ItemPickaxes(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, par2EnumToolMaterial);
this.setCreativeTab(MysticOres.MysticOresTab);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
}

View file

@ -1,66 +1,53 @@
package MysticOres.Items;
package mysticores.items;
import java.util.List;
import mysticores.MysticOres;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import MysticOres.MysticOres;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemResource extends Item
{
public class ItemResource extends Item {
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",
"Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod"};
public ItemResource(int id)
{
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" };
public ItemResource(int id) {
super(id);
this.setHasSubtypes(true);
this.setCreativeTab(MysticOres.MysticOresTab);
this.setHasSubtypes(true);
this.setCreativeTab(MysticOres.MysticOresTab);
}
@Override
@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);
return RESOURCE_TYPES[meta];
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[RESOURCE_TYPES.length];
for (int i = 0; i < RESOURCE_TYPES.length; ++i)
icons[i] = iconRegister.registerIcon("MysticMods:" + RESOURCE_TYPES[i]);
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, RESOURCE_TYPES.length);
return RESOURCE_TYPES[meta];
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
icons = new Icon[RESOURCE_TYPES.length];
for (int i = 0; i < RESOURCE_TYPES.length; ++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));
}
}

View file

@ -1,48 +1,40 @@
package MysticOres.Items;
package mysticores.items;
import MysticOres.MysticOres;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticores.MysticOres;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.src.*;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSatchel extends Item
{
public ItemSatchel(int par1)
{
public class ItemSatchel extends Item {
public ItemSatchel(int par1) {
super(par1);
setCreativeTab(MysticOres.MysticOresTab);
maxStackSize = 1;
}
@Override
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player)
{
if(!player.isSneaking())
{
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack) {
return true;
}
@Override
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player) {
if (!player.isSneaking()) {
IInventory inv;
inv = player.getInventoryEnderChest();
player.displayGUIChest(inv);
}
return is;
}
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack)
{
return true;
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
}

View file

@ -1,28 +1,18 @@
package MysticOres.Items;
package mysticores.items;
import MysticOres.MysticOres;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticores.MysticOres;
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.ItemSpade;
import net.minecraft.item.ItemStack;
public class ItemShovels extends ItemSpade
{
public class ItemShovels extends ItemSpade {
public ItemShovels(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
this.setCreativeTab(MysticOres.MysticOresTab);
}
public ItemShovels(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, par2EnumToolMaterial);
this.setCreativeTab(MysticOres.MysticOresTab);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
}

View file

@ -1,21 +1,18 @@
package MysticOres.Items;
package mysticores.items;
import mysticores.MysticOres;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemSword;
import MysticOres.MysticOres;
public class ItemSwords extends ItemSword
{
public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial)
{
public class ItemSwords extends ItemSword {
public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
setCreativeTab(MysticOres.MysticOresTab);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}
}

View file

@ -1,11 +1,9 @@
package MysticOres.Items;
package mysticores.items;
import mysticores.lib.ItemID;
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 VerditePickaxe;
public static Item VerditeShovel;
@ -36,14 +34,11 @@ public class Items
public static Item ObsidianShovel;
public static Item ObsidianAxe;
public static Item ObsidianHoe;
public static Item Resource;
public static Item Satchel;
public static void Initialize()
{
public static void Initialize() {
Resource = new ItemResource(ItemID.RESOURCES);
VerditeSword = new ItemSwords(ItemID.VERDITESWORD, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
VerditePickaxe = new ItemPickaxes(ItemID.VERDITEPICKAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
VerditeShovel = new ItemShovels(ItemID.VERDITESHOVEL, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
@ -74,6 +69,6 @@ public class Items
ObsidianShovel = new ItemShovels(ItemID.OBSIDIANSHOVEL, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel");
ObsidianAxe = new ItemAxes(ItemID.OBSIDIANAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe");
ObsidianHoe = new ItemHoes(ItemID.OBSIDIANHOE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe");
Satchel = new ItemSatchel(ItemID.SATCHEL).setUnlocalizedName("Satchel");
Satchel = new ItemSatchel(ItemID.SATCHEL).setUnlocalizedName("Satchel");
}
}

View file

@ -1,4 +1,4 @@
package MysticOres.Lib;
package mysticores.lib;
public class BlockID
{

View file

@ -1,4 +1,4 @@
package MysticOres.Lib;
package mysticores.lib;
public class ItemID
{

View file

@ -1,4 +1,4 @@
package MysticOres.Lib;
package mysticores.lib;
public class Rarity
{

View file

@ -1,4 +1,4 @@
package MysticOres.Lib;
package mysticores.lib;
public class Strings {

View file

@ -1,17 +1,17 @@
package MysticOres;
package mysticores;
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 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.EventHandler;
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")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MysticOres
{
public class MysticOres {
@Instance("Mystic Ores")
public static MysticOres instance;
public static CreativeTabs MysticOresTab = new TabMysticOres(CreativeTabs.getNextID(), "MysticOresTab");
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ConfigurationManager.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Ores.cfg"));
ConfigurationManager.save();
public void preInit(FMLPreInitializationEvent event) {
ConfigurationManager.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Ores.cfg"));
ConfigurationManager.save();
BlockHandler.Initialize();
Items.Initialize();
RecipeManager.Initialize();
OreDictManager.Initialize();
GeneratorManager.Initialize();
Localizations.Initialize();
GameRegistry.registerFuelHandler(new IridiumFuelHandler());
}
}

View file

@ -1,20 +1,17 @@
package MysticOres.Util;
package mysticores.util;
import java.io.File;
import mysticores.lib.BlockID;
import mysticores.lib.ItemID;
import mysticores.lib.Rarity;
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 void initialize(File file)
{
public static void initialize(File file) {
config = new Configuration(file);
ItemID.RESOURCES = config.getItem("Resource Items", ItemID.RESOURCES_DEFAULT).getInt();
ItemID.VERDITESWORD = config.getItem("Tools", "Verdite Sword", ItemID.VERDITESWORD_DEFAULT).getInt();
ItemID.VERDITEPICKAXE = config.getItem("Tools", "Verdite Pickaxe", ItemID.VERDITEPICKAXE_DEFAULT).getInt();
@ -47,26 +44,22 @@ public class ConfigurationManager
ItemID.OBSIDIANAXE = config.getItem("Tools", "Obsidian Axe", ItemID.OBSIDIANAXE_DEFAULT).getInt();
ItemID.OBSIDIANHOE = config.getItem("Tools", "Obsidian Hoe", ItemID.OBSIDIANHOE_DEFAULT).getInt();
ItemID.SATCHEL = config.getItem("Satchel ID", ItemID.SATCHEL_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.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL_DEFAULT).getInt();
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE_DEFAULT).getInt();
Rarity.IRIDIUM = config.get("Ore Rarity", "Iridium Ore", Rarity.IRIDIUM_DEFAULT).getInt();
Rarity.AGATE = config.get("Ore Rarity", "Agate Ore", Rarity.AGATE_DEFAULT).getInt();
Rarity.AMETHYST = config.get("Ore Rarity", "Amethyst Ore", Rarity.AMETHYST_DEFAULT).getInt();
Rarity.TOPAZ = config.get("Ore Rarity", "Topaz Ore", Rarity.TOPAZ_DEFAULT).getInt();
Rarity.BLOODSTONE = config.get("Nether Ore Rarity", "Bloodstone", Rarity.BLOODSTONE_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.BLUESOULSTONE = config.get("Nether Ore Rarity", "Blue Soulstone", Rarity.BLUESOULSTONE_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.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL_DEFAULT).getInt();
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE_DEFAULT).getInt();
Rarity.IRIDIUM = config.get("Ore Rarity", "Iridium Ore", Rarity.IRIDIUM_DEFAULT).getInt();
Rarity.AGATE = config.get("Ore Rarity", "Agate Ore", Rarity.AGATE_DEFAULT).getInt();
Rarity.AMETHYST = config.get("Ore Rarity", "Amethyst Ore", Rarity.AMETHYST_DEFAULT).getInt();
Rarity.TOPAZ = config.get("Ore Rarity", "Topaz Ore", Rarity.TOPAZ_DEFAULT).getInt();
Rarity.BLOODSTONE = config.get("Nether Ore Rarity", "Bloodstone", Rarity.BLOODSTONE_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.BLUESOULSTONE = config.get("Nether Ore Rarity", "Blue Soulstone", Rarity.BLUESOULSTONE_DEFAULT).getInt();
config.save();
}
}
public static void save()
{
config.save();
}
public static void save() {
config.save();
}
}

View file

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

View file

@ -1,14 +1,12 @@
package MysticOres.Util;
package mysticores.util;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Items.Items;
import mysticores.blocks.BlockHandler;
import mysticores.items.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class OreDictManager
{
public static void Initialize()
{
public class OreDictManager {
public static void Initialize() {
OreDictionary.registerOre("ingotAdamantine", new ItemStack(Items.Resource, 1, 2));
OreDictionary.registerOre("ingotMithril", new ItemStack(Items.Resource, 1, 1));
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("gemAmethyst", new ItemStack(Items.Resource, 1, 8));
OreDictionary.registerOre("gemAgate", new ItemStack(Items.Resource, 1, 6));
OreDictionary.registerOre("oreAdamantine", new ItemStack(BlockHandler.BlockBase, 1, 0));
OreDictionary.registerOre("oreAmethyst", new ItemStack(BlockHandler.BlockBase, 1, 1));
OreDictionary.registerOre("oreIridium", new ItemStack(BlockHandler.BlockBase, 1, 2));

View file

@ -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.item.Item;
import net.minecraft.item.ItemStack;
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;
public class RecipeManager
{
public static void Initialize()
{
public class RecipeManager {
public static void Initialize() {
Recipes();
ToolRecipes();
PowderRecipes();
Smelting();
}
private static void Recipes()
{
GameRegistry.addRecipe(new ItemStack(Block.glass, 1), new Object [] {
"##", "##", '#', new ItemStack(Items.Resource, 1, 11)
});
GameRegistry.addRecipe(new ItemStack(Block.obsidian, 1), new Object[] {
"##", "##", '#', new ItemStack(Items.Resource, 1, 12)
});
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), new Object[] {
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), new ItemStack(Items.Resource, 1, 6)
});
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), 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'), 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()
{
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
});
private static void PowderRecipes() {
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 PowderRecipes()
{
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 Recipes() {
GameRegistry.addRecipe(new ItemStack(Block.glass, 1), new Object[] { "##", "##", '#', new ItemStack(Items.Resource, 1, 11) });
GameRegistry.addRecipe(new ItemStack(Block.obsidian, 1), new Object[] { "##", "##", '#', new ItemStack(Items.Resource, 1, 12) });
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), new Object[] { "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
new ItemStack(Items.Resource, 1, 6) });
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7),
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'),
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 Smelting()
{
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, 3, new ItemStack(Items.Resource, 1, 1), 0.7F);
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, 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 });
}
}

View file

@ -1,20 +1,16 @@
package MysticOres.Util;
package mysticores.util;
import MysticOres.Blocks.BlockHandler;
import net.minecraft.block.Block;
import mysticores.blocks.BlockHandler;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class TabMysticOres extends CreativeTabs
{
public TabMysticOres(int par1, String par2Str)
{
super(par1, par2Str);
public class TabMysticOres extends CreativeTabs {
public TabMysticOres(int par1, String par2Str) {
super(par1, par2Str);
}
@Override
public ItemStack getIconItemStack()
{
return new ItemStack(BlockHandler.BlockBase, 1, 7);
public ItemStack getIconItemStack() {
return new ItemStack(BlockHandler.BlockBase, 1, 7);
}
}

View file

@ -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.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
public class ToolRecipes
{
public static void SwordRecipe(Item output, ItemStack input)
{
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
"#", "#", "S", 'S', "stickWood", '#', input));
public class ToolRecipes {
public static void AdvancedAxeRecipe(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 });
}
public static void PickaxeRecipe(Item output, ItemStack input)
{
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
"###", " S ", " S ", 'S', "stickWood", '#', 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 ItemStack(output, 1), new Object[] { "## ", "S ", "S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input });
}
public static void ShovelRecipe(Item output, ItemStack input)
{
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1),
"#", "S", "S", 'S', "stickWood", '#', 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 });
}
public static void AxeRecipe(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));
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 });
}
public static void HoeRecipe(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));
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 });
}
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
});
public static void AxeRecipe(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));
}
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
});
public static void HoeRecipe(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));
}
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
});
public static void PickaxeRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "###", " S ", " S ", 'S', "stickWood", '#', input));
}
public static void AdvancedAxeRecipe(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
});
public static void ShovelRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "#", "S", "S", 'S', "stickWood", '#', 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 ItemStack(output, 1), new Object[] {
"## ", "S ", "S ", 'S', new ItemStack(Items.Resource, 1, 13), '#', input
});
public static void SwordRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output, 1), "#", "#", "S", 'S', "stickWood", '#', input));
}
}

View file

@ -1,13 +1,11 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import cpw.mods.fml.common.registry.GameRegistry;
public class GeneratorManager
{
public static void Initialize()
{
public class GeneratorManager {
public static void Initialize() {
GameRegistry.registerWorldGenerator(new WorldGenVerdite());
GameRegistry.registerWorldGenerator(new WorldGenTopaz());
GameRegistry.registerWorldGenerator(new WorldGenTourmaline());

View file

@ -1,4 +1,4 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;

View file

@ -1,30 +1,28 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenAdamantine implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.ADAMANTINE; i++)
{
for (int i = 0; i < Rarity.ADAMANTINE; i++) {
int Xcoord = blockX + random.nextInt(8);
int Ycoord = random.nextInt(16);
int Zcoord = blockZ + random.nextInt(8);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 0, 3)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,31 +1,29 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenAgate implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldGenAgate implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.AGATE; i++)
{
for (int i = 0; i < Rarity.AGATE; i++) {
int Xcoord = blockX + random.nextInt(32);
int Ycoord = random.nextInt(60);
int Zcoord = blockZ + random.nextInt(32);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 11, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,32 +1,29 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenAmethyst implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for (int i = 0; i < Rarity.AMETHYST; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.AMETHYST; i++) {
int Xcoord = blockX + random.nextInt(24);
int Ycoord = random.nextInt(60);
int Zcoord = blockZ + random.nextInt(24);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 1, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,32 +1,29 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenIridium implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for (int i = 0; i < Rarity.IRIDIUM; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.IRIDIUM; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(12);
int Zcoord = blockZ + random.nextInt(16);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 2, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,32 +1,30 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenMithril implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.MITHRIL; i++)
{
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(64);
int Zcoord = blockZ + random.nextInt(16);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 3, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
for (int i = 0; i < Rarity.MITHRIL; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(64);
int Zcoord = blockZ + random.nextInt(16);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 3, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
}

View file

@ -1,32 +1,30 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenTopaz implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.TOPAZ; i++)
{
for (int i = 0; i < Rarity.TOPAZ; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(60);
int Zcoord = blockZ + random.nextInt(16);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 5, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
}
}

View file

@ -1,30 +1,30 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenTourmaline implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.TOURMALINE; i++){
for (int i = 0; i < Rarity.TOURMALINE; i++) {
int Xcoord = blockX + random.nextInt(32);
int Ycoord = random.nextInt(60);
int Zcoord = blockZ + random.nextInt(32);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 4, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
}
}

View file

@ -1,32 +1,29 @@
package MysticOres.Worldgen;
package mysticores.worldgen;
import java.util.Random;
import mysticores.blocks.BlockHandler;
import mysticores.lib.Rarity;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import MysticOres.Blocks.BlockHandler;
import MysticOres.Lib.Rarity;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenVerdite implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for (int i = 0; i < Rarity.VERDITE; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; i < Rarity.VERDITE; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(20) + 80;
int Zcoord = blockZ + random.nextInt(16);
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 6, 9, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.io.File;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.io.File;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package MysticRuins;
package mysticruins;
import java.util.Random;

View file

@ -1,9 +1,8 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import java.util.Random;
import MysticStones.MysticStones;
import mysticstones.MysticStones;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
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.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlanks extends Block {
Icon[] textures;
public BlockPlanks(int ID) {
@ -29,63 +26,47 @@ public class BlockPlanks extends Block {
setUnlocalizedName("BlockMysticPlanks");
setStepSound(Block.soundWoodFootstep);
}
@Override
public int damageDropped(int j)
{
public int damageDropped(int j) {
return j;
}
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
{
int id = idPicked(world, x, y, z);
if (id == 0)
{
return null;
}
Item item = Item.itemsList[id];
if (item == null)
{
return null;
}
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
}
@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]);
}
}
@Override
public Icon getIcon(int side, int meta)
{
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,1));
list.add(new ItemStack(i,1,2));
list.add(new ItemStack(i,1,3));
list.add(new ItemStack(i,1,4));
list.add(new ItemStack(i,1,5));
list.add(new ItemStack(i,1,6));
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
int id = idPicked(world, x, y, z);
if (id == 0) {
return null;
}
Item item = Item.itemsList[id];
if (item == null) {
return null;
}
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
}
@Override
public void getSubBlocks(int i, CreativeTabs tab, List list) {
list.add(new ItemStack(i, 1, 0));
list.add(new ItemStack(i, 1, 1));
list.add(new ItemStack(i, 1, 2));
list.add(new ItemStack(i, 1, 3));
list.add(new ItemStack(i, 1, 4));
list.add(new ItemStack(i, 1, 5));
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]);
}
}
}

View file

@ -1,25 +1,21 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import java.util.Random;
import MysticStones.MysticStones;
import mysticstones.MysticStones;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockReinforced extends Block {
Icon[] textures;
public BlockReinforced(int ID) {
@ -30,60 +26,48 @@ public class BlockReinforced extends Block {
setUnlocalizedName("BlockMysticReinforcedBrick");
setStepSound(Block.soundMetalFootstep);
}
@Override
public int damageDropped(int j)
{
public int damageDropped(int j) {
return j;
}
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
{
return (true);
}
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
{
int id = idPicked(world, x, y, z);
if (id == 0)
{
return null;
}
Item item = Item.itemsList[id];
if (item == null)
{
return null;
}
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[16];
for (int i = 0; i < 8; i++)
{
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemReinforced.BRICK_TYPE[i] + " Bricks");
}
}
@Override
public Icon getIcon(int side, int meta)
{
public Icon getIcon(int side, int meta) {
return textures[meta];
}
public void getSubBlocks(int i,CreativeTabs tab, List list)
{
for(int k=0;k<8;k++)
{
list.add(new ItemStack(i,1,k));
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
int id = idPicked(world, x, y, z);
if (id == 0) {
return null;
}
Item item = Item.itemsList[id];
if (item == null) {
return null;
}
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
}
@Override
public void getSubBlocks(int i, CreativeTabs tab, List list) {
for (int k = 0; k < 8; k++) {
list.add(new ItemStack(i, 1, k));
}
}
@Override
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return (true);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 8; i++) {
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemReinforced.BRICK_TYPE[i] + " Bricks");
}
}
}

View file

@ -1,9 +1,8 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import java.util.Random;
import MysticStones.MysticStones;
import mysticstones.MysticStones;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@ -13,14 +12,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockStoneBricks extends Block {
Icon[] textures;
public BlockStoneBricks(int ID) {
super(ID, Material.rock);
setHardness(2F);
@ -29,59 +26,47 @@ public class BlockStoneBricks extends Block {
setUnlocalizedName("BlockMysticStoneBricks");
setStepSound(Block.soundStoneFootstep);
}
@Override
public int damageDropped(int j)
{
public int damageDropped(int 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);
if (id == 0)
{
if (id == 0) {
return null;
}
Item item = Item.itemsList[id];
if (item == null)
{
if (item == null) {
return null;
}
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
}
@Override
public void getSubBlocks(int i, CreativeTabs tab, List list) {
list.add(new ItemStack(i, 1, 0));
list.add(new ItemStack(i, 1, 1));
list.add(new ItemStack(i, 1, 2));
list.add(new ItemStack(i, 1, 3));
list.add(new ItemStack(i, 1, 4));
list.add(new ItemStack(i, 1, 5));
list.add(new ItemStack(i, 1, 6));
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 7; i++)
{
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,1));
list.add(new ItemStack(i,1,2));
list.add(new ItemStack(i,1,3));
list.add(new ItemStack(i,1,4));
list.add(new ItemStack(i,1,5));
list.add(new ItemStack(i,1,6));
}
}

View file

@ -1,24 +1,20 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import java.util.Random;
import MysticStones.MysticStones;
import mysticstones.MysticStones;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockStones extends Block {
Icon[] textures;
public BlockStones(int ID) {
@ -29,68 +25,69 @@ public class BlockStones extends Block {
setUnlocalizedName("BlockMysticStones");
setStepSound(Block.soundStoneFootstep);
}
@Override
public int damageDropped(int j)
{
switch(j)
{
case 0:return 1;
case 2:return 3;
case 4:return 5;
case 6:return 7;
case 8:return 9;
case 10:return 11;
case 12:return 13;
default:return j;
public int damageDropped(int j) {
switch (j) {
case 0:
return 1;
case 2:
return 3;
case 4:
return 5;
case 6:
return 7;
case 8:
return 9;
case 10:
return 11;
case 12:
return 13;
default:
return j;
}
}
protected boolean canSilkHarvest()
{
return true;
@Override
public Icon getIcon(int side, int meta) {
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);
return new ItemStack(this, 1, meta);
}
@Override
public void getSubBlocks(int i, CreativeTabs tab, List list) {
list.add(new ItemStack(i, 1, 0));
list.add(new ItemStack(i, 1, 1));
list.add(new ItemStack(i, 1, 2));
list.add(new ItemStack(i, 1, 3));
list.add(new ItemStack(i, 1, 4));
list.add(new ItemStack(i, 1, 5));
list.add(new ItemStack(i, 1, 6));
list.add(new ItemStack(i, 1, 7));
list.add(new ItemStack(i, 1, 8));
list.add(new ItemStack(i, 1, 9));
list.add(new ItemStack(i, 1, 10));
list.add(new ItemStack(i, 1, 11));
list.add(new ItemStack(i, 1, 12));
list.add(new ItemStack(i, 1, 13));
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 14; i++)
{
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,1));
list.add(new ItemStack(i,1,2));
list.add(new ItemStack(i,1,3));
list.add(new ItemStack(i,1,4));
list.add(new ItemStack(i,1,5));
list.add(new ItemStack(i,1,6));
list.add(new ItemStack(i,1,7));
list.add(new ItemStack(i,1,8));
list.add(new ItemStack(i,1,9));
list.add(new ItemStack(i,1,10));
list.add(new ItemStack(i,1,11));
list.add(new ItemStack(i,1,12));
list.add(new ItemStack(i,1,13));
protected boolean canSilkHarvest() {
return true;
}
}

View file

@ -1,40 +1,36 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import MysticStones.MysticStones;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticstones.MysticStones;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class 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) {
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, PLANK_TYPE.length);
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);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return MysticStones.Planks.getIcon(2, par1);
}
@Override
public int getMetadata(int par1) {
return par1;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, PLANK_TYPE.length);
return PLANK_TYPE[meta];
}
}

View file

@ -1,52 +1,47 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import MysticStones.MysticStones;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticstones.MysticStones;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class 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) {
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BRICK_TYPE.length);
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)
{
@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!");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return MysticStones.ReinforcedBricks.getIcon(2, par1);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return MysticStones.ReinforcedBricks.getIcon(2, par1);
}
@Override
public int getMetadata(int par1) {
return par1;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BRICK_TYPE.length);
return BRICK_TYPE[meta] + " Bricks";
}
}

View file

@ -1,40 +1,36 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import MysticStones.MysticStones;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticstones.MysticStones;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class 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) {
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONEBRICK_TYPES.length);
return STONEBRICK_TYPES[meta];
}
public int getMetadata(int par1)
{
return par1;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return MysticStones.StoneBricks.getIcon(2, par1);
}
public Icon getIconFromDamage(int par1) {
return MysticStones.StoneBricks.getIcon(2, par1);
}
@Override
public int getMetadata(int par1) {
return par1;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONEBRICK_TYPES.length);
return STONEBRICK_TYPES[meta];
}
}

View file

@ -1,42 +1,37 @@
package MysticStones.Blocks;
package mysticstones.blocks;
import java.util.List;
import MysticStones.MysticStones;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticstones.MysticStones;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemStones extends ItemBlock {
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"};
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" };
public ItemStones(int par1) {
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONE_TYPES.length);
return STONE_TYPES[meta];
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return MysticStones.Stones.getIcon(2, par1);
}
public Icon getIconFromDamage(int par1) {
return MysticStones.Stones.getIcon(2, par1);
}
@Override
public int getMetadata(int par1) {
return par1;
}
@Override
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, STONE_TYPES.length);
return STONE_TYPES[meta];
}
}

View file

@ -1,96 +1,71 @@
package MysticStones;
package mysticstones;
import java.io.File;
import java.util.Random;
import MysticStones.Blocks.BlockPlanks;
import MysticStones.Blocks.BlockReinforced;
import MysticStones.Blocks.BlockStoneBricks;
import MysticStones.Blocks.BlockStones;
import MysticStones.Blocks.ItemPlanks;
import MysticStones.Blocks.ItemReinforced;
import MysticStones.Blocks.ItemStoneBricks;
import MysticStones.Blocks.ItemStones;
import MysticStones.Util.Config;
import MysticStones.Util.Localizations;
import MysticStones.Util.RecipeHandler;
import MysticStones.Util.TabMysticStones;
import MysticStones.Worldgen.WorldgenSmoothAnorthosite;
import MysticStones.Worldgen.WorldgenSmoothLimestone;
import MysticStones.Worldgen.WorldgenSmoothMarble;
import MysticStones.Worldgen.WorldgenSmoothMigmatite;
import MysticStones.Worldgen.WorldgenSmoothOrthogneiss;
import MysticStones.Worldgen.WorldgenSmoothSlate;
import MysticStones.Worldgen.WorldgenSmoothTravertine;
import mysticstones.blocks.BlockPlanks;
import mysticstones.blocks.BlockReinforced;
import mysticstones.blocks.BlockStoneBricks;
import mysticstones.blocks.BlockStones;
import mysticstones.blocks.ItemPlanks;
import mysticstones.blocks.ItemReinforced;
import mysticstones.blocks.ItemStoneBricks;
import mysticstones.blocks.ItemStones;
import mysticstones.util.Config;
import mysticstones.util.Localizations;
import mysticstones.util.RecipeHandler;
import mysticstones.util.TabMysticStones;
import mysticstones.worldgen.WorldgenSmoothAnorthosite;
import mysticstones.worldgen.WorldgenSmoothLimestone;
import mysticstones.worldgen.WorldgenSmoothMarble;
import mysticstones.worldgen.WorldgenSmoothMigmatite;
import mysticstones.worldgen.WorldgenSmoothOrthogneiss;
import mysticstones.worldgen.WorldgenSmoothSlate;
import mysticstones.worldgen.WorldgenSmoothTravertine;
import net.minecraft.block.Block;
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.MinecraftForge;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "Mystic Stones", name = "Mystic Stones", version = "0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MysticStones
{
public class MysticStones {
@Instance("Mystic Stones")
public static MysticStones instance;
public static Block Planks;
public static Block Stones;
public static Block StoneBricks;
public static Block ReinforcedBricks;
public static CreativeTabs MysticStonesTab = new TabMysticStones(CreativeTabs.getNextID(), "MysticStonesTab");
private Configuration config;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
public void preInit(FMLPreInitializationEvent event) {
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Stones.cfg"));
Config.save();
Config.save();
Planks = new BlockPlanks(Config.PlanksID);
Stones = new BlockStones(Config.StonesID);
StoneBricks = new BlockStoneBricks(Config.StoneBricksID);
ReinforcedBricks = new BlockReinforced(Config.ReinforcedBricksID);
GameRegistry.registerBlock(Planks, ItemPlanks.class, "Planks");
GameRegistry.registerBlock(Stones, ItemStones.class, "Stones");
GameRegistry.registerBlock(StoneBricks, ItemStoneBricks.class, "StoneBricks");
GameRegistry.registerBlock(ReinforcedBricks, ItemReinforced.class, "Reinforcedbricks");
Localizations.Initialize();
RecipeHandler.CraftPlanks();
RecipeHandler.CraftStoneBricks();
RecipeHandler.CraftElse();
RecipeHandler.CraftReinforced();
GameRegistry.registerWorldGenerator(new WorldgenSmoothAnorthosite());
GameRegistry.registerWorldGenerator(new WorldgenSmoothLimestone());
GameRegistry.registerWorldGenerator(new WorldgenSmoothMarble());
GameRegistry.registerWorldGenerator(new WorldgenSmoothMigmatite());
GameRegistry.registerWorldGenerator(new WorldgenSmoothOrthogneiss());
GameRegistry.registerWorldGenerator(new WorldgenSmoothSlate());
GameRegistry.registerWorldGenerator(new WorldgenSmoothTravertine());
GameRegistry.registerWorldGenerator(new WorldgenSmoothTravertine());
}
}

View file

@ -1,35 +1,28 @@
package MysticStones.Util;
package mysticstones.util;
import java.io.File;
import net.minecraftforge.common.Configuration;
public class Config
{
public class Config {
public static Configuration config;
public static int PlanksID;
public static int StonesID;
public static int StoneBricksID;
public static int ReinforcedBricksID;
public static boolean Rare;
public static void initialize(File file)
{
config = new Configuration(file);
PlanksID = config.getBlock("Plank IDs", 509).getInt();
StonesID = config.getBlock("Stone IDs", 510).getInt();
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
Rare = config.get("General", "Increase the Rarity of Stones?", false).getBoolean(Rare);
config.save();
}
public static void save()
{
config.save();
}
public static void initialize(File file) {
config = new Configuration(file);
PlanksID = config.getBlock("Plank IDs", 509).getInt();
StonesID = config.getBlock("Stone IDs", 510).getInt();
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
Rare = config.get("General", "Increase the Rarity of Stones?", false).getBoolean(Rare);
config.save();
}
public static void save() {
config.save();
}
}

View file

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

View file

@ -1,6 +1,6 @@
package MysticStones.Util;
package mysticstones.util;
import MysticStones.MysticStones;
import mysticstones.MysticStones;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
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.registry.GameRegistry;
public class RecipeHandler
{
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 class RecipeHandler {
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 }));
}
}
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
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);
@ -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, 11, new ItemStack(MysticStones.Stones, 1, 10), 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));
}
}
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) });
}
}

View file

@ -1,12 +1,10 @@
package MysticStones.Util;
package mysticstones.util;
import MysticStones.MysticStones;
import net.minecraft.block.Block;
import mysticstones.MysticStones;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class TabMysticStones extends CreativeTabs {
public TabMysticStones(int par1, String par2Str) {
super(par1, par2Str);
// TODO Auto-generated constructor stub
@ -14,7 +12,6 @@ public class TabMysticStones extends CreativeTabs {
@Override
public ItemStack getIconItemStack() {
return new ItemStack(MysticStones.ReinforcedBricks, 1, 4);
return new ItemStack(MysticStones.ReinforcedBricks, 1, 4);
}
}

View file

@ -1,29 +1,26 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothAnorthosite implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothAnorthosite implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<2 : i<3; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);

View file

@ -1,29 +1,26 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothLimestone implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothLimestone implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<2 : i<3; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);

View file

@ -1,32 +1,29 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothMarble implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothMarble implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random ,int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<2 : i<3; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);
int Zcoord = blockZ + random.nextInt(16);
new WorldGenMinable(MysticStones.Stones.blockID, 4, 24, Block.stone.blockID).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,32 +1,29 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothMigmatite implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothMigmatite implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<2 : i<3; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);
int Zcoord = blockZ + random.nextInt(16);
new WorldGenMinable(MysticStones.Stones.blockID, 6, 48, Block.stone.blockID).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}

View file

@ -1,29 +1,26 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothOrthogneiss implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothOrthogneiss implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<3 : i<2; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 3 : i < 2; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);

View file

@ -1,29 +1,26 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothSlate implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothSlate implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<2 : i<3; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);

View file

@ -1,33 +1,30 @@
package MysticStones.Worldgen;
package mysticstones.worldgen;
import java.util.Random;
import MysticStones.MysticStones;
import MysticStones.Util.Config;
import mysticstones.MysticStones;
import mysticstones.util.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldgenSmoothTravertine implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0:generateSurface(world, random, chunkX*16, chunkZ*16);
public class WorldgenSmoothTravertine implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for(int i=0; Config.Rare ? i<2 : i<3; i++)
{
private void generateSurface(World world, Random random, int blockX, int blockZ) {
for (int i = 0; Config.Rare ? i < 2 : i < 3; i++) {
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(40) + 20;
int Zcoord = blockZ + random.nextInt(16);
new WorldGenMinable(MysticStones.Stones.blockID, 12, 24, Block.stone.blockID).generate(world, random, Xcoord, Ycoord, Zcoord);
new WorldGenMinable(MysticStones.Stones.blockID, 12, 24, Block.stone.blockID).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,20 +1,16 @@
package MysticWorld.Entity;
package mysticworld.entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import mysticworld.MysticWorld;
import mysticworld.lib.EntityIds;
import mysticworld.lib.Strings;
import cpw.mods.fml.common.registry.EntityRegistry;
import MysticWorld.MysticWorld;
import MysticWorld.Lib.EntityIds;
import MysticWorld.Lib.Strings;
public class EntityHandler {
public static void init(){
public static void init() {
registerEntities();
}
public static void registerEntities(){
public static void registerEntities() {
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, EntityIds.ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, EntityIds.ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false);
EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, EntityIds.ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

Some files were not shown because too many files have changed in this diff Show more