Finished all Blocks
This commit is contained in:
parent
e5abfd03e5
commit
419f532502
|
@ -122,7 +122,7 @@ import WayofTime.alchemicalWizardry.common.harvest.GourdHarvestHandler;
|
|||
import WayofTime.alchemicalWizardry.common.items.ItemIncense;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
|
||||
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
|
||||
import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame;
|
||||
//import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.holding.HoldingPacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmFire;
|
||||
|
@ -282,7 +282,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
|||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
|
||||
import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration;
|
||||
//import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration;
|
||||
|
||||
|
||||
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.3", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory")
|
||||
|
@ -560,7 +560,6 @@ public class AlchemicalWizardry
|
|||
FluidRegistry.registerFluid(lifeEssenceFluid);
|
||||
|
||||
ModBlocks.init();
|
||||
ModBlocks.registerBlocksInPre();
|
||||
ModItems.init();
|
||||
ModItems.registerItems();
|
||||
|
||||
|
@ -656,7 +655,7 @@ public class AlchemicalWizardry
|
|||
ItemStack largeBloodStoneBrickStack = new ItemStack(ModBlocks.largeBloodStoneBrick);
|
||||
ItemStack bloodStoneBrickStackCrafted = new ItemStack(ModBlocks.bloodStoneBrick, 4);
|
||||
ItemStack growthSigilStack = new ItemStack(ModItems.growthSigil);
|
||||
ItemStack blockHomHeartStack = new ItemStack(ModBlocks.blockHomHeart);
|
||||
ItemStack blockHomHeartStack = new ItemStack(ModBlocks.blockSpellTable);
|
||||
ItemStack redWoolStack = new ItemStack(Blocks.wool, 1, 14);
|
||||
ItemStack simpleCatalystStack = new ItemStack(ModItems.simpleCatalyst);
|
||||
ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner);
|
||||
|
@ -795,7 +794,7 @@ public class AlchemicalWizardry
|
|||
ModBlocks.bloodStoneBrick.setHarvestLevel("pickaxe", 0);
|
||||
ModBlocks.largeBloodStoneBrick.setHarvestLevel("pickaxe", 0);
|
||||
ModBlocks.blockWritingTable.setHarvestLevel("pickaxe", 1);
|
||||
ModBlocks.blockHomHeart.setHarvestLevel("pickaxe", 1);
|
||||
ModBlocks.blockSpellTable.setHarvestLevel("pickaxe", 1);
|
||||
ModBlocks.blockPedestal.setHarvestLevel("pickaxe", 2);
|
||||
ModBlocks.blockPlinth.setHarvestLevel("pickaxe", 2);
|
||||
ModBlocks.blockTeleposer.setHarvestLevel("pickaxe", 2);
|
||||
|
@ -1068,7 +1067,7 @@ public class AlchemicalWizardry
|
|||
GameRegistry.addRecipe(new ItemStack(ModItems.itemTankSegmenter), "gqi", " rq", "q g", 'q', quartzRodStack, 'i', ironIngotStack, 'r', strengthenedCatalystStack, 'g', goldIngotStack);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.itemDestinationClearer), "qcq", "c c", "qcq", 'q', quartzRodStack, 'c', simpleCatalystStack);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockAlchemicCalcinator), "pgp", "gsg", "ccc", 'p', crackedRunicPlateStack, 'g', glassStack, 's', strengthenedCatalystStack, 'c', cobblestoneStack);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockAlchemicalCalcinator), "pgp", "gsg", "ccc", 'p', crackedRunicPlateStack, 'g', glassStack, 's', strengthenedCatalystStack, 'c', cobblestoneStack);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystalBelljar), "GGG", "GcG", "www", 'G', glassStack, 'c', concentratedCatalystStack, 'w', new ItemStack(Blocks.wooden_slab, 1, craftingConstant));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockReagentConduit), "isi", "scs", "isi", 'c', concentratedCatalystStack, 's', stringStack, 'i', ironIngotStack);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockArmourForge;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockAlchemicCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockAlchemicalCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockAltar;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockBelljar;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource;
|
||||
|
@ -126,7 +126,7 @@ public class ModBlocks
|
|||
blockSpellTable = registerBlock(new BlockSpellTable(), "spell_table");
|
||||
blockPedestal = registerBlock(new BlockPedestal(), "pedestal");
|
||||
blockPlinth = registerBlock(new BlockPlinth(), "plinth");
|
||||
blockConduit = registerBlock(new BlockConduit(), "conduit");
|
||||
blockConduit = registerBlock(new BlockConduit(), "spell_conduit");
|
||||
blockBloodLight = registerBlock(new BlockBloodLightSource(), "blood_light");
|
||||
blockSpellEffect = registerBlock(new BlockSpellEffect(), "spell_effect");
|
||||
blockSpellParadigm = registerBlock(new BlockSpellParadigm(), ItemSpellParadigmBlock.class, "spell_paradigm");
|
||||
|
@ -136,7 +136,7 @@ public class ModBlocks
|
|||
blockDemonPortal = registerBlock(new BlockDemonPortal(), "demon_portal");
|
||||
blockBuildingSchematicSaver = registerBlock(new BlockSchematicSaver(), "schematic_saver");
|
||||
blockReagentConduit = registerBlock(new BlockReagentConduit(), "reagent_conduit");
|
||||
blockAlchemicalCalcinator = registerBlock(new BlockAlchemicCalcinator(), "alchemical_calcinator");
|
||||
blockAlchemicalCalcinator = registerBlock(new BlockAlchemicalCalcinator(), "alchemical_calcinator");
|
||||
blockCrystalBelljar = registerBlock(new BlockBelljar(), ItemBlockCrystalBelljar.class, "belljar");
|
||||
blockDemonChest = registerBlock(new BlockDemonChest(), "demon_chest");
|
||||
blockCrystal = registerBlock(new BlockCrystal(), ItemCrystalBlock.class, "crystal_block");
|
||||
|
@ -145,14 +145,15 @@ public class ModBlocks
|
|||
blockLifeEssence = registerBlock(new BlockLifeEssence(), "life_essence");
|
||||
blockEnchantmentGlyph = registerBlock(new BlockEnchantmentGlyph(), ItemEnchantmentGlyphBlock.class, "enchantment_glyph");
|
||||
blockStabilityGlyph = registerBlock(new BlockStabilityGlyph(), ItemStabilityGlyphBlock.class, "stability_glyph");
|
||||
blockCrucible = registerBlock(new BlockIncenseCrucible(), "incense_cruicible");
|
||||
blockCrucible = registerBlock(new BlockIncenseCrucible(), "incense_crucible");
|
||||
}
|
||||
|
||||
public static Block registerBlock(Block block, String unlocalizedName)
|
||||
{
|
||||
//TODO Insert Model Code here
|
||||
block.setUnlocalizedName(unlocalizedName);
|
||||
|
||||
// if (!)
|
||||
// if (!) //creative tab blacklist
|
||||
{
|
||||
block.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAlchemicCalcinator extends BlockContainer
|
||||
public class BlockAlchemicalCalcinator extends BlockContainer
|
||||
{
|
||||
public BlockAlchemicCalcinator()
|
||||
public BlockAlchemicalCalcinator()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("alchemicCalcinator");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,12 +33,6 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
return new TEAlchemicCalcinator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -53,7 +46,7 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -65,16 +58,16 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -92,9 +85,7 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world,
|
||||
x + rx, y + ry, z + rz,
|
||||
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
@ -112,9 +103,9 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(x, y, z);
|
||||
TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -160,7 +151,7 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
tileEntity.getWorldObj().markBlockForUpdate(x, y, z);
|
||||
tileEntity.getWorld().markBlockForUpdate(blockPos);
|
||||
|
||||
return true;
|
||||
}
|
|
@ -2,67 +2,33 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAltar extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockAltar()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodAltar");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top");
|
||||
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,9 +38,9 @@ public class BlockAltar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
|
||||
public int getComparatorInputOverride(World world, BlockPos blockPos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
|
||||
if (tile instanceof TEAltar)
|
||||
{
|
||||
|
@ -94,9 +60,9 @@ public class BlockAltar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z);
|
||||
TEAltar tileEntity = (TEAltar) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -111,7 +77,7 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
|
@ -122,7 +88,7 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
|
@ -141,7 +107,7 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
|
@ -152,7 +118,7 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
|
@ -176,21 +142,21 @@ public class BlockAltar extends BlockContainer
|
|||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -208,9 +174,7 @@ public class BlockAltar extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world,
|
||||
x + rx, y + ry, z + rz,
|
||||
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
@ -227,12 +191,6 @@ public class BlockAltar extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -246,15 +204,16 @@ public class BlockAltar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, BlockPos blockPos, IBlockState blockState, Random rand)
|
||||
{
|
||||
TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z);
|
||||
TEAltar tileEntity = (TEAltar) world.getTileEntity(blockPos);
|
||||
|
||||
if (!tileEntity.isActive())
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
|||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -16,19 +17,19 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockArmourForge extends Block
|
||||
{
|
||||
public List<ArmourComponent> helmetList = new ArrayList();
|
||||
public List<ArmourComponent> plateList = new ArrayList();
|
||||
public List<ArmourComponent> leggingsList = new ArrayList();
|
||||
public List<ArmourComponent> bootsList = new ArrayList();
|
||||
public static List<ArmourComponent> helmetList = new ArrayList<ArmourComponent>();
|
||||
public static List<ArmourComponent> plateList = new ArrayList<ArmourComponent>();
|
||||
public static List<ArmourComponent> leggingsList = new ArrayList<ArmourComponent>();
|
||||
public static List<ArmourComponent> bootsList = new ArrayList<ArmourComponent>();
|
||||
|
||||
public BlockArmourForge()
|
||||
{
|
||||
|
@ -39,23 +40,23 @@ public class BlockArmourForge extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int armourType = getArmourType(world, x, y, z);
|
||||
int armourType = getArmourType(world, blockPos);
|
||||
|
||||
if (armourType == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int direction = getDirectionForArmourType(world, x, y, z, armourType);
|
||||
int direction = getDirectionForArmourType(world, blockPos, armourType);
|
||||
|
||||
if (!isParadigmValid(armourType, direction, world, x, y, z))
|
||||
if (!isParadigmValid(armourType, direction, world, blockPos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -110,27 +111,27 @@ public class BlockArmourForge extends Block
|
|||
switch (direction)
|
||||
{
|
||||
case 1:
|
||||
tileEntity = world.getTileEntity(x + xOff, y, z - zOff);
|
||||
tileEntity = world.getTileEntity(blockPos.add(xOff, 0, -zOff));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
tileEntity = world.getTileEntity(x + zOff, y, z + xOff);
|
||||
tileEntity = world.getTileEntity(blockPos.add(zOff, 0, xOff));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
tileEntity = world.getTileEntity(x - xOff, y, z + zOff);
|
||||
tileEntity = world.getTileEntity(blockPos.add(-xOff, 0, zOff));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
tileEntity = world.getTileEntity(x - zOff, y, z - xOff);
|
||||
tileEntity = world.getTileEntity(blockPos.add(-zOff, 0, -xOff));
|
||||
break;
|
||||
|
||||
case 5:
|
||||
tileEntity = world.getTileEntity(x + xOff, y + zOff, z);
|
||||
tileEntity = world.getTileEntity(blockPos.add(xOff, zOff, 0));
|
||||
break;
|
||||
|
||||
case 6:
|
||||
tileEntity = world.getTileEntity(x, y + zOff, z + xOff);
|
||||
tileEntity = world.getTileEntity(blockPos.add(0, zOff, xOff));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -140,15 +141,13 @@ public class BlockArmourForge extends Block
|
|||
if (tileEntity instanceof TESocket)
|
||||
{
|
||||
ItemStack itemStack = ((TESocket) tileEntity).getStackInSlot(0);
|
||||
int xCoord = tileEntity.xCoord;
|
||||
int yCoord = tileEntity.yCoord;
|
||||
int zCoord = tileEntity.zCoord;
|
||||
BlockPos tilePos = tileEntity.getPos();
|
||||
((TESocket) tileEntity).setInventorySlotContents(0, null);
|
||||
world.setBlockToAir(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
world.setBlockToAir(tilePos);
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, world.provider.getDimensionId(), 1, xCoord, yCoord, zCoord);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, tilePos, 20, world.provider.getDimensionId(), 1, tilePos);
|
||||
}
|
||||
|
||||
if (itemStack != null)
|
||||
|
@ -168,19 +167,19 @@ public class BlockArmourForge extends Block
|
|||
{
|
||||
int xOff = (world.rand.nextInt(11) - 5);
|
||||
int zOff = (int) (Math.sqrt(25 - xOff * xOff) * (world.rand.nextInt(2) - 0.5) * 2);
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x + xOff, y + 5, z + zOff));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x, y + 1, z, armourPiece));
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX() + xOff, blockPos.getY() + 5, blockPos.getZ() + zOff));
|
||||
world.spawnEntityInWorld(new EntityItem(world, blockPos.getX(), blockPos.getY() + 1, blockPos.getZ(), armourPiece));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//0 for plate, 1 for leggings, 2 for helmet, 3 for boots
|
||||
public int getArmourType(World world, int x, int y, int z)
|
||||
public int getArmourType(World world, BlockPos blockPos)
|
||||
{
|
||||
for (int i = 0; i <= 3; i++)
|
||||
{
|
||||
if (getDirectionForArmourType(world, x, y, z, i) != -1)
|
||||
if (getDirectionForArmourType(world, blockPos, i) != -1)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
@ -189,11 +188,11 @@ public class BlockArmourForge extends Block
|
|||
return -1;
|
||||
}
|
||||
|
||||
public int getDirectionForArmourType(World world, int x, int y, int z, int armourType)
|
||||
public int getDirectionForArmourType(World world, BlockPos blockPos, int armourType)
|
||||
{
|
||||
for (int i = 1; i <= 6; i++)
|
||||
{
|
||||
if (isParadigmValid(armourType, i, world, x, y, z))
|
||||
if (isParadigmValid(armourType, i, world, blockPos))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
@ -202,7 +201,7 @@ public class BlockArmourForge extends Block
|
|||
return -1;
|
||||
}
|
||||
|
||||
public boolean isParadigmValid(int armourType, int direction, World world, int x, int y, int z)
|
||||
public boolean isParadigmValid(int armourType, int direction, World world, BlockPos blockPos)
|
||||
{
|
||||
List<ArmourComponent> list = null;
|
||||
|
||||
|
@ -238,7 +237,7 @@ public class BlockArmourForge extends Block
|
|||
switch (direction)
|
||||
{
|
||||
case 1:
|
||||
if (!(world.getTileEntity(x + xOff, y, z - zOff) instanceof TESocket))
|
||||
if (!(world.getTileEntity(blockPos.add(xOff, 0, -zOff)) instanceof TESocket))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -246,7 +245,7 @@ public class BlockArmourForge extends Block
|
|||
break;
|
||||
|
||||
case 2:
|
||||
if (!(world.getTileEntity(x + zOff, y, z + xOff) instanceof TESocket))
|
||||
if (!(world.getTileEntity(blockPos.add(zOff, 0, xOff)) instanceof TESocket))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -254,7 +253,7 @@ public class BlockArmourForge extends Block
|
|||
break;
|
||||
|
||||
case 3:
|
||||
if (!(world.getTileEntity(x - xOff, y, z + zOff) instanceof TESocket))
|
||||
if (!(world.getTileEntity(blockPos.add(-xOff, 0, zOff)) instanceof TESocket))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -262,7 +261,7 @@ public class BlockArmourForge extends Block
|
|||
break;
|
||||
|
||||
case 4:
|
||||
if (!(world.getTileEntity(x - zOff, y, z - xOff) instanceof TESocket))
|
||||
if (!(world.getTileEntity(blockPos.add(-zOff, 0, -xOff)) instanceof TESocket))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -270,7 +269,7 @@ public class BlockArmourForge extends Block
|
|||
break;
|
||||
|
||||
case 5:
|
||||
if (!(world.getTileEntity(x + xOff, y + zOff, z) instanceof TESocket))
|
||||
if (!(world.getTileEntity(blockPos.add(xOff, zOff, 0)) instanceof TESocket))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -278,7 +277,7 @@ public class BlockArmourForge extends Block
|
|||
break;
|
||||
|
||||
case 6:
|
||||
if (!(world.getTileEntity(x, y + zOff, z + xOff) instanceof TESocket))
|
||||
if (!(world.getTileEntity(blockPos.add(0, zOff, xOff)) instanceof TESocket))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -3,8 +3,10 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -13,15 +15,15 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBelljar extends BlockContainer
|
||||
{
|
||||
|
@ -30,8 +32,6 @@ public class BlockBelljar extends BlockContainer
|
|||
super(Material.glass);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("crystalBelljar");
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,9 +73,9 @@ public class BlockBelljar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack)
|
||||
public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState blockState, EntityLivingBase entityLiving, ItemStack stack)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
|
||||
if (tile instanceof TEBellJar)
|
||||
{
|
||||
|
@ -93,12 +93,6 @@ public class BlockBelljar extends BlockContainer
|
|||
return new TEBellJar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -112,7 +106,7 @@ public class BlockBelljar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -124,9 +118,9 @@ public class BlockBelljar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
|
||||
public int getComparatorInputOverride(World world, BlockPos blockPos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TEBellJar)
|
||||
{
|
||||
return ((TEBellJar) tile).getRSPowerOutput();
|
||||
|
@ -135,18 +129,18 @@ public class BlockBelljar extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
public void onBlockHarvested(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player)
|
||||
{
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
this.dropBlockAsItem(world, blockPos, blockState, 0);
|
||||
super.onBlockHarvested(world, blockPos, blockState, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos blockPos, IBlockState blockState, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> list = new ArrayList();
|
||||
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
|
||||
if (tile instanceof TEBellJar)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -18,18 +18,10 @@ public class BlockBloodLightSource extends Block
|
|||
public BlockBloodLightSource()
|
||||
{
|
||||
super(Material.cloth);
|
||||
this.setBlockName("blockBloodLightSource");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlockBloodLight");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||
public int getLightValue(IBlockAccess world, BlockPos blockPos)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
|
@ -41,13 +33,7 @@ public class BlockBloodLightSource extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
public void randomDisplayTick(World world, BlockPos blockPos, IBlockState blockState, Random rand)
|
||||
{
|
||||
if (rand.nextInt(3) != 0)
|
||||
{
|
||||
|
@ -55,13 +41,12 @@ public class BlockBloodLightSource extends Block
|
|||
float f1 = f * 0.6F + 0.4F;
|
||||
float f2 = f * f * 0.7F - 0.5F;
|
||||
float f3 = f * f * 0.6F - 0.7F;
|
||||
world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 0.5D, z + 0.5D + rand.nextGaussian() / 8, f1, f2, f3);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, f1, f2, f3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
||||
public void addCollisionBoxesToList(World par1World, BlockPos blockPos, IBlockState blockState, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
||||
{
|
||||
this.setBlockBounds(0.40F, 0.40F, 0.40F, 0.60F, 0.60F, 0.60F);
|
||||
}
|
||||
|
|
|
@ -1,54 +1,26 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBloodRune extends Block
|
||||
{
|
||||
//private Icon bloodRuneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon altarCapacityRuneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon dislocationRuneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon orbCapacityRuneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon betterCapacityRuneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon accelerationRuneIcon;
|
||||
|
||||
public BlockBloodRune()
|
||||
{
|
||||
super(Material.iron);
|
||||
this.setBlockName("bloodRune");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankRune");
|
||||
this.altarCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AltarCapacityRune");
|
||||
this.dislocationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:DislocationRune");
|
||||
this.orbCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:OrbCapacityRune");
|
||||
this.betterCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:BetterCapacityRune");
|
||||
this.accelerationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AccelerationRune");
|
||||
}
|
||||
|
||||
public int getRuneEffect(int metaData)
|
||||
{
|
||||
switch (metaData)
|
||||
|
@ -75,6 +47,7 @@ public class BlockBloodRune extends Block
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
|
@ -97,36 +70,8 @@ public class BlockBloodRune extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
public int damageDropped(IBlockState blockState)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return blockIcon;
|
||||
|
||||
case 1:
|
||||
return altarCapacityRuneIcon;
|
||||
|
||||
case 2:
|
||||
return dislocationRuneIcon;
|
||||
|
||||
case 3:
|
||||
return this.orbCapacityRuneIcon;
|
||||
|
||||
case 4:
|
||||
return this.betterCapacityRuneIcon;
|
||||
|
||||
case 5:
|
||||
return this.accelerationRuneIcon;
|
||||
default:
|
||||
return blockIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
{
|
||||
return metadata;
|
||||
return blockState.getBlock().damageDropped(blockState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockBloodStoneBrick extends Block
|
||||
{
|
||||
|
@ -14,14 +10,5 @@ public class BlockBloodStoneBrick extends Block
|
|||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodStoneBrick");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodStoneBrick");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,9 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -16,7 +13,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -24,13 +22,6 @@ import java.util.Random;
|
|||
|
||||
public class BlockChemistrySet extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockChemistrySet()
|
||||
{
|
||||
super(Material.wood);
|
||||
|
@ -39,33 +30,9 @@ public class BlockChemistrySet extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:AlchemicChemistrySet");
|
||||
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float what, float these, float are)
|
||||
{
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -73,21 +40,21 @@ public class BlockChemistrySet extends BlockContainer
|
|||
}
|
||||
|
||||
//code to open gui explained later
|
||||
player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z);
|
||||
player.openGui(AlchemicalWizardry.instance, 0, world, blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -105,9 +72,7 @@ public class BlockChemistrySet extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world,
|
||||
x + rx, y + ry, z + rz,
|
||||
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
@ -130,12 +95,6 @@ public class BlockChemistrySet extends BlockContainer
|
|||
return new TEWritingTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -149,20 +108,21 @@ public class BlockChemistrySet extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.9375F, 0.5625F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBoundsForItemRender();
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
|
|
|
@ -1,61 +1,24 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockConduit extends BlockOrientable
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockConduit()
|
||||
{
|
||||
super();
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockConduit");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top");
|
||||
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
{
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,12 +27,6 @@ public class BlockConduit extends BlockOrientable
|
|||
return new TEConduit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -83,7 +40,7 @@ public class BlockConduit extends BlockOrientable
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,48 +1,28 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCrystal extends Block
|
||||
{
|
||||
//private Icon bloodRuneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon fullIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon brickIcon;
|
||||
|
||||
|
||||
public BlockCrystal()
|
||||
{
|
||||
super(Material.iron);
|
||||
this.setBlockName("crystalBlock");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankRune");
|
||||
this.fullIcon = iconRegister.registerIcon("AlchemicalWizardry:ShardCluster");
|
||||
this.brickIcon = iconRegister.registerIcon("AlchemicalWizardry:ShardClusterBrick");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
*/
|
||||
|
@ -59,25 +39,8 @@ public class BlockCrystal extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
public int damageDropped(IBlockState blockState)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return fullIcon;
|
||||
|
||||
case 1:
|
||||
return brickIcon;
|
||||
|
||||
default:
|
||||
return blockIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
{
|
||||
return metadata;
|
||||
return blockState.getBlock().damageDropped(blockState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
|
||||
public class BlockDemonPortal extends BlockContainer
|
||||
|
@ -18,27 +17,18 @@ public class BlockDemonPortal extends BlockContainer
|
|||
super(Material.rock);
|
||||
setHardness(1000);
|
||||
setResistance(10000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("demonPortal");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public void onBlockHarvested(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPortal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if(tile instanceof TEDemonPortal)
|
||||
{
|
||||
((TEDemonPortal) tile).notifyPortalOfBreak();
|
||||
}
|
||||
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
super.onBlockHarvested(world, blockPos, blockState, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,16 +38,16 @@ public class BlockDemonPortal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(x, y, z);
|
||||
TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(blockPos);
|
||||
|
||||
tileEntity.rightClickBlock(player, side);
|
||||
tileEntity.rightClickBlock(player, side.getIndex());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,28 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockEfficiencyRune extends BlockBloodRune
|
||||
{
|
||||
public BlockEfficiencyRune()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("efficiencyRune");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:EfficiencyRune");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRuneEffect(int metaData)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockEmptySocket extends Block
|
||||
{
|
||||
|
@ -14,8 +10,6 @@ public class BlockEmptySocket extends Block
|
|||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("emptySocket");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,11 +17,4 @@ public class BlockEmptySocket extends Block
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:EmptySocket");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,55 +4,22 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.omega.IEnchantmentGlyph;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon enchantability;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon enchantmentLevel;
|
||||
|
||||
public BlockEnchantmentGlyph()
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("enchantmentGlyph");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick");
|
||||
this.enchantability = iconRegister.registerIcon("AlchemicalWizardry:GlyphEnchantability");
|
||||
this.enchantmentLevel = iconRegister.registerIcon("AlchemicalWizardry:GlyphEnchantmentLevel");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return enchantability;
|
||||
case 1:
|
||||
return enchantmentLevel;
|
||||
default:
|
||||
return this.blockIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -92,7 +59,8 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
|
@ -101,10 +69,10 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
|
|||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState blockState)
|
||||
{
|
||||
return metadata;
|
||||
return blockState.getBlock().damageDropped(blockState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -18,7 +13,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
@ -71,16 +65,16 @@ public class BlockFilledSocket extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos blockPos, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -98,7 +92,7 @@ public class BlockFilledSocket extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockImperfectRitualStone extends Block
|
||||
|
@ -23,37 +22,28 @@ public class BlockImperfectRitualStone extends Block
|
|||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("imperfectRitualStone");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:ImperfectRitualStone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(SpellHelper.isFakePlayer(player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
{
|
||||
Block block = world.getBlock(x, y + 1, z);
|
||||
Block block = world.getBlockState(blockPos.add(0, 1, 0)).getBlock();
|
||||
|
||||
if (block == Blocks.water)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
SoulNetworkHandler.hurtPlayer(player, 5000);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ()));
|
||||
}
|
||||
|
||||
world.getWorldInfo().setRaining(true);
|
||||
|
@ -71,11 +61,11 @@ public class BlockImperfectRitualStone extends Block
|
|||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
SoulNetworkHandler.hurtPlayer(player, 5000);
|
||||
}
|
||||
|
||||
EntityZombie zomb = new EntityZombie(world);
|
||||
zomb.setPosition(x + 0.5, y + 2, z + 0.5);
|
||||
zomb.setPosition(blockPos.getX() + 0.5, blockPos.getY() + 2, blockPos.getZ() + 0.5);
|
||||
zomb.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2000));
|
||||
zomb.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20000, 7));
|
||||
zomb.addPotionEffect(new PotionEffect(Potion.resistance.id, 20000, 3));
|
||||
|
@ -83,7 +73,7 @@ public class BlockImperfectRitualStone extends Block
|
|||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(zomb);
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -91,24 +81,24 @@ public class BlockImperfectRitualStone extends Block
|
|||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
SoulNetworkHandler.hurtPlayer(player, 5000);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ()));
|
||||
world.setWorldTime((world.getWorldTime() / 24000) * 24000 + 13800);
|
||||
}
|
||||
} else if (block == Blocks.bedrock)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
SoulNetworkHandler.hurtPlayer(player, 5000);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ()));
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 1));
|
||||
|
|
|
@ -2,48 +2,36 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.sacrifice.IIncense;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TECrucible;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockIncenseCrucible extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockIncenseCrucible()
|
||||
{
|
||||
super(Material.anvil);
|
||||
this.setHardness(2.0f);
|
||||
this.setResistance(1.5f);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockCrucible");
|
||||
this.setBlockBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.625F, 0.6875F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TECrucible tileEntity = (TECrucible) world.getTileEntity(x, y, z);
|
||||
TECrucible tileEntity = (TECrucible) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -63,34 +51,10 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
// player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
// tileEntity.setInventorySlotContents(0, null);
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:Crucible_Top");
|
||||
this.sideIcon = iconRegister.registerIcon("AlchemicalWizardry:Crucible_Side");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:Crucible_Bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon;
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
// {
|
||||
|
@ -98,7 +62,7 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
// }
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos blockPos)
|
||||
{
|
||||
this.setBlockBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.625F, 0.6875F);
|
||||
}
|
||||
|
@ -108,12 +72,6 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
|
@ -122,20 +80,20 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
public void randomDisplayTick(World world, BlockPos blockPos, IBlockState blockState, Random rand)
|
||||
{
|
||||
if (rand.nextInt(3) != 0)
|
||||
{
|
||||
TECrucible tile = (TECrucible)world.getTileEntity(x, y, z);
|
||||
tile.spawnClientParticle(world, x, y, z, rand);
|
||||
TECrucible tile = (TECrucible)world.getTileEntity(blockPos);
|
||||
tile.spawnClientParticle(world, blockPos, rand);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,9 +103,9 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
|
||||
public int getComparatorInputOverride(World world, BlockPos blockPos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TECrucible)
|
||||
{
|
||||
return ((TECrucible) tile).getRSPowerOutput();
|
||||
|
@ -155,10 +113,10 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
return 15;
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -176,9 +134,7 @@ public class BlockIncenseCrucible extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world,
|
||||
x + rx, y + ry, z + rz,
|
||||
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockLargeBloodStoneBrick extends Block
|
||||
{
|
||||
|
@ -14,14 +10,5 @@ public class BlockLargeBloodStoneBrick extends Block
|
|||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("largeBloodStoneBrick");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
|
@ -16,34 +13,17 @@ public class BlockLifeEssence extends BlockFluidClassic
|
|||
{
|
||||
super(AlchemicalWizardry.lifeEssenceFluid, Material.water);
|
||||
AlchemicalWizardry.lifeEssenceFluid.setBlock(this);
|
||||
this.setBlockName("lifeEssenceFluidBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
public boolean canDisplace(IBlockAccess world, BlockPos blockPos)
|
||||
{
|
||||
return this.blockIcon;
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.canDisplace(world, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public boolean displaceIfPossible(World world, BlockPos blockPos)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:lifeEssenceStill");
|
||||
AlchemicalWizardry.lifeEssenceFluid.setFlowingIcon(blockIcon);
|
||||
AlchemicalWizardry.lifeEssenceFluid.setStillIcon(blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDisplace(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.canDisplace(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displaceIfPossible(World world, int x, int y, int z)
|
||||
{
|
||||
return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.displaceIfPossible(world, x, y, z);
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.displaceIfPossible(world, blockPos);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -22,34 +21,25 @@ public class BlockMasterStone extends BlockContainer
|
|||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockMasterStone");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public void onBlockHarvested(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterStone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TEMasterStone)
|
||||
{
|
||||
((TEMasterStone) tile).useOnRitualBroken();
|
||||
}
|
||||
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
super.onBlockHarvested(world, blockPos, blockState, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
|
||||
public void onBlockDestroyedByExplosion(World world, BlockPos blockPos, Explosion explosion)
|
||||
{
|
||||
super.onBlockDestroyedByExplosion(world, x, y, z, explosion);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
super.onBlockDestroyedByExplosion(world, blockPos, explosion);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TEMasterStone)
|
||||
{
|
||||
((TEMasterStone) tile).useOnRitualBrokenExplosion();
|
||||
|
@ -57,9 +47,9 @@ public class BlockMasterStone extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TEMasterStone tileEntity = (TEMasterStone) world.getTileEntity(x, y, z);
|
||||
TEMasterStone tileEntity = (TEMasterStone) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -82,8 +72,8 @@ public class BlockMasterStone extends BlockContainer
|
|||
|
||||
ActivationCrystal acItem = (ActivationCrystal) item;
|
||||
// tileEntity.setOwner(acItem.getOwnerName(playerItem));
|
||||
tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem), playerItem, player, acItem.getOwnerName(playerItem));
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem), playerItem, player, ActivationCrystal.getOwnerName(playerItem));
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,21 +5,19 @@ import java.util.Random;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMimicBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMimic extends BlockContainer
|
||||
{
|
||||
|
@ -28,15 +26,14 @@ public class BlockMimic extends BlockContainer
|
|||
super(Material.water);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setBlockName("blockMimic");
|
||||
// this.setBlockBounds(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, BlockPos blockPos, EnumFacing side)
|
||||
{
|
||||
TileEntity TE = world.getTileEntity(x, y, z);
|
||||
TileEntity TE = world.getTileEntity(blockPos);
|
||||
if(!(TE instanceof TEMimicBlock))
|
||||
{
|
||||
return true;
|
||||
|
@ -45,36 +42,16 @@ public class BlockMimic extends BlockContainer
|
|||
|
||||
Block block = mimic.getBlock();
|
||||
|
||||
return block == null || block.shouldSideBeRendered(world, x, y, z, side);
|
||||
return block == null || block.shouldSideBeRendered(world, blockPos, side);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCollideCheck(int meta, boolean bool)
|
||||
public boolean canCollideCheck(IBlockState blockState, boolean bool)
|
||||
{
|
||||
return meta == 1;
|
||||
return blockState.getBlock().getMetaFromState(blockState) == 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
/**
|
||||
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
||||
*/
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side)
|
||||
{
|
||||
TileEntity TE = blockAccess.getTileEntity(x, y, z);
|
||||
TEMimicBlock mimic = (TEMimicBlock)TE;
|
||||
Block block = mimic.getBlock();
|
||||
int meta = mimic.getMetaOfMimic();
|
||||
|
||||
return block != null ? block.getIcon(side, meta) : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
|
@ -87,21 +64,21 @@ public class BlockMimic extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata)
|
||||
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random random)
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockSolid(IBlockAccess world, int x, int y, int z, int meta)
|
||||
public boolean isBlockSolid(IBlockAccess world, BlockPos blockPos, EnumFacing side)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if(tile instanceof TEMimicBlock)
|
||||
{
|
||||
Block block = ((TEMimicBlock) tile).getBlock();
|
||||
|
@ -109,16 +86,16 @@ public class BlockMimic extends BlockContainer
|
|||
|
||||
if(block != null)
|
||||
{
|
||||
return block.isBlockSolid(world, x, y, z, mimicMeta);
|
||||
return block.isBlockSolid(world, blockPos, side); //side was mimicM
|
||||
}
|
||||
}
|
||||
return super.isBlockSolid(world, x, y, z, meta);
|
||||
return super.isBlockSolid(world, blockPos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(target.blockX, target.blockY, target.blockZ);
|
||||
TileEntity tile = world.getTileEntity(target.func_178782_a());
|
||||
|
||||
TEMimicBlock TE = (TEMimicBlock)tile;
|
||||
|
||||
|
@ -126,32 +103,33 @@ public class BlockMimic extends BlockContainer
|
|||
{
|
||||
Block block = TE.getBlock();
|
||||
|
||||
double xOffset = target.blockX + world.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinX();
|
||||
double yOffset = target.blockY + world.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinY();
|
||||
double zOffset = target.blockZ + world.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinZ();
|
||||
double xOffset = target.func_178782_a().getX() + world.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinX();
|
||||
double yOffset = target.func_178782_a().getY() + world.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinY();
|
||||
double zOffset = target.func_178782_a().getZ() + world.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinZ();
|
||||
|
||||
switch (target.sideHit) {
|
||||
switch (target.subHit)
|
||||
{
|
||||
case 0:
|
||||
yOffset = target.blockY + block.getBlockBoundsMinY() - 0.1D;
|
||||
yOffset = target.func_178782_a().getY() + block.getBlockBoundsMinY() - 0.1D;
|
||||
break;
|
||||
case 1:
|
||||
yOffset = target.blockY + block.getBlockBoundsMaxY() + 0.1D;
|
||||
yOffset = target.func_178782_a().getY() + block.getBlockBoundsMaxY() + 0.1D;
|
||||
break;
|
||||
case 2:
|
||||
zOffset = target.blockZ + block.getBlockBoundsMinZ() - 0.1D;
|
||||
zOffset = target.func_178782_a().getZ() + block.getBlockBoundsMinZ() - 0.1D;
|
||||
break;
|
||||
case 3:
|
||||
zOffset = target.blockZ + block.getBlockBoundsMaxZ() + 0.1D;
|
||||
zOffset = target.func_178782_a().getZ() + block.getBlockBoundsMaxZ() + 0.1D;
|
||||
break;
|
||||
case 4:
|
||||
xOffset = target.blockX + block.getBlockBoundsMinX() - 0.1D;
|
||||
xOffset = target.func_178782_a().getX() + block.getBlockBoundsMinX() - 0.1D;
|
||||
break;
|
||||
case 5:
|
||||
xOffset = target.blockX + block.getBlockBoundsMaxX() + 0.1D;
|
||||
xOffset = target.func_178782_a().getX() + block.getBlockBoundsMaxX() + 0.1D;
|
||||
break;
|
||||
}
|
||||
|
||||
BlockMimic.addHitEffect(TE, target, xOffset, yOffset, zOffset, null, effectRenderer);
|
||||
// BlockMimic.addHitEffect(TE, target, xOffset, yOffset, zOffset, null, effectRenderer);
|
||||
|
||||
return true;
|
||||
|
||||
|
@ -161,33 +139,33 @@ public class BlockMimic extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
TEMimicBlock tile = (TEMimicBlock)world.getTileEntity(x, y, z);
|
||||
TEMimicBlock tile = (TEMimicBlock)world.getTileEntity(blockPos);
|
||||
Block block = tile.getBlock();
|
||||
|
||||
return block != null ? block.getCollisionBoundingBoxFromPool(world, x, y, z) : super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
return block != null ? block.getCollisionBoundingBox(world, blockPos, blockState) : super.getCollisionBoundingBox(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z)
|
||||
public int colorMultiplier(IBlockAccess blockAccess, BlockPos blockPos, int renderPass)
|
||||
{
|
||||
TEMimicBlock TE = (TEMimicBlock)blockAccess.getTileEntity(x, y, z);
|
||||
TEMimicBlock TE = (TEMimicBlock)blockAccess.getTileEntity(blockPos);
|
||||
if (TE != null)
|
||||
{
|
||||
Block block = TE.getBlock();
|
||||
if(block != null)
|
||||
{
|
||||
return block.colorMultiplier(blockAccess, x, y, z);
|
||||
return block.colorMultiplier(blockAccess, blockPos);
|
||||
}
|
||||
}
|
||||
|
||||
return super.colorMultiplier(blockAccess, x, y, z);
|
||||
return super.colorMultiplier(blockAccess, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec)
|
||||
/* @Override
|
||||
public void velocityToAddToEntity(World world, BlockPos, Entity entity, Vec3 vec)
|
||||
{
|
||||
TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(x, y, z);
|
||||
if (TE != null)
|
||||
|
@ -199,20 +177,21 @@ public class BlockMimic extends BlockContainer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addHitEffect(TEMimicBlock TE, MovingObjectPosition target, double x, double y, double z, ItemStack itemStack, EffectRenderer effectRenderer)
|
||||
No longer in 1.8 apparently
|
||||
|
||||
public static void addHitEffect(TEMimicBlock TE, MovingObjectPosition target, double x, double y, double z, ItemStack itemStack, EffectRenderer effectRenderer)
|
||||
{
|
||||
EntityDiggingFX particle = new EntityDiggingFX(TE.getWorldObj(), x, y, z, 0.0D, 0.0D, 0.0D, TE.getBlock(), TE.getMetaOfMimic());
|
||||
effectRenderer.addEffect(particle.applyColourMultiplier(target.blockX, target.blockY, target.blockZ).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
|
||||
EntityDiggingFX particle = new EntityDiggingFX(TE.getWorld(), x, y, z, 0.0D, 0.0D, 0.0D, TE.getBlock(), TE.getMetaOfMimic());
|
||||
effectRenderer.addEffect(particle.func_174846_a(target.func_178782_a()).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
|
||||
}
|
||||
|
||||
*/
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos blockPos, Entity entity)
|
||||
{
|
||||
TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(x, y, z);
|
||||
TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(blockPos);
|
||||
if (TE != null)
|
||||
{
|
||||
if(TE.getBlockEffectWhileInside(entity, x, y, z))
|
||||
if(TE.getBlockEffectWhileInside(entity, blockPos))
|
||||
{
|
||||
return;
|
||||
}else
|
||||
|
@ -220,12 +199,12 @@ public class BlockMimic extends BlockContainer
|
|||
Block block = TE.getBlock();
|
||||
if(block != null)
|
||||
{
|
||||
block.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
block.onEntityCollidedWithBlock(world, blockPos, entity);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
super.onEntityCollidedWithBlock(world, blockPos, entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockOrientable extends BlockContainer
|
||||
{
|
||||
|
@ -16,7 +17,6 @@ public class BlockOrientable extends BlockContainer
|
|||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ public class BlockOrientable extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
//Right-click orients the output face. Shift-right-click orients the input face.
|
||||
if (world.isRemote)
|
||||
|
@ -34,20 +34,20 @@ public class BlockOrientable extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
|
||||
if (tile instanceof TEOrientable)
|
||||
{
|
||||
TEOrientable newTile = (TEOrientable) tile;
|
||||
if (player.isSneaking())
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection()) + 1;
|
||||
int nextSide = TEOrientable.getIntForEnumFacing(newTile.getInputDirection()) + 1;
|
||||
|
||||
if (nextSide > 5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if (ForgeDirection.getOrientation(nextSide) == newTile.getOutputDirection())
|
||||
if (EnumFacing.getFront(nextSide) == newTile.getOutputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if (nextSide > 5)
|
||||
|
@ -56,16 +56,16 @@ public class BlockOrientable extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
newTile.setInputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
newTile.setInputDirection(EnumFacing.getFront(nextSide));
|
||||
} else
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection()) + 1;
|
||||
int nextSide = TEOrientable.getIntForEnumFacing(newTile.getOutputDirection()) + 1;
|
||||
|
||||
if (nextSide > 5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if (ForgeDirection.getOrientation(nextSide) == newTile.getInputDirection())
|
||||
if (EnumFacing.getFront(nextSide) == newTile.getInputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if (nextSide > 5)
|
||||
|
@ -74,17 +74,17 @@ public class BlockOrientable extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
newTile.setOutputDirection(EnumFacing.getFront(nextSide));
|
||||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
public int damageDropped(IBlockState blockState)
|
||||
{
|
||||
return metadata;
|
||||
return blockState.getBlock().damageDropped(blockState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,71 +2,35 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPedestal extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockPedestal()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodPedestal");
|
||||
float f = 0.3125F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePedestal");
|
||||
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TEPedestal tileEntity = (TEPedestal) world.getTileEntity(x, y, z);
|
||||
TEPedestal tileEntity = (TEPedestal) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -87,21 +51,21 @@ public class BlockPedestal extends BlockContainer
|
|||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -119,7 +83,7 @@ public class BlockPedestal extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
@ -142,12 +106,6 @@ public class BlockPedestal extends BlockContainer
|
|||
return new TEPedestal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -161,7 +119,7 @@ public class BlockPedestal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,71 +2,35 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPlinth extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockPlinth()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodPlinth");
|
||||
float f = 0.0625F;
|
||||
this.setBlockBounds(f, 0.0F, f, 1.0f - f, 0.875f, 1.0f - f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePlinth");
|
||||
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TEPlinth tileEntity = (TEPlinth) world.getTileEntity(x, y, z);
|
||||
TEPlinth tileEntity = (TEPlinth) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -87,21 +51,21 @@ public class BlockPlinth extends BlockContainer
|
|||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
dropItems(world, blockPos);
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
private void dropItems(World world, BlockPos blockPos)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(blockPos);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
|
@ -119,7 +83,7 @@ public class BlockPlinth extends BlockContainer
|
|||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
|
@ -142,12 +106,6 @@ public class BlockPlinth extends BlockContainer
|
|||
return new TEPlinth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -161,7 +119,7 @@ public class BlockPlinth extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
public boolean hasTileEntity(IBlockState blockState)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,14 +2,13 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockReagentConduit extends BlockContainer
|
||||
{
|
||||
|
@ -18,15 +17,6 @@ public class BlockReagentConduit extends BlockContainer
|
|||
super(Material.cloth);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setBlockName("blockReagentConduit");
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleTransCircle");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,9 +32,9 @@ public class BlockReagentConduit extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
return super.onBlockActivated(world, blockPos, state, player, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,12 +43,6 @@ public class BlockReagentConduit extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
|
|
@ -1,66 +1,34 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
||||
import WayofTime.alchemicalWizardry.common.items.ScribeTool;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRitualStone extends Block implements IRitualStone
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blankIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon waterStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon fireStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon earthStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon airStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon duskStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon dawnStoneIcon;
|
||||
|
||||
public BlockRitualStone()
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setBlockName("ritualStone");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blankIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualStone");
|
||||
this.waterStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterRitualStone");
|
||||
this.fireStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:FireRitualStone");
|
||||
this.earthStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthRitualStone");
|
||||
this.airStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:AirRitualStone");
|
||||
this.duskStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskRitualStone");
|
||||
this.dawnStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:LightRitualStone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
public int damageDropped(IBlockState blockState)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
|
||||
|
@ -88,46 +56,14 @@ public class BlockRitualStone extends Block implements IRitualStone
|
|||
playerItem.setItemDamage(playerItem.getItemDamage() + 1);
|
||||
}
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, scribeTool.getType(), 3);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.setBlockState(blockPos, state.getBlock().getStateFromMeta(scribeTool.getType()), 3);
|
||||
world.markBlockForUpdate(blockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
switch (metadata)
|
||||
{
|
||||
case 0:
|
||||
return blankIcon;
|
||||
|
||||
case 1:
|
||||
return waterStoneIcon;
|
||||
|
||||
case 2:
|
||||
return fireStoneIcon;
|
||||
|
||||
case 3:
|
||||
return earthStoneIcon;
|
||||
|
||||
case 4:
|
||||
return airStoneIcon;
|
||||
|
||||
case 5:
|
||||
return duskStoneIcon;
|
||||
|
||||
case 6:
|
||||
return dawnStoneIcon;
|
||||
|
||||
default:
|
||||
return blankIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuneType(World world, int x, int y, int z, int meta, int runeType)
|
||||
public boolean isRuneType(World world, BlockPos blockPos, IBlockState blockState, int runeType)
|
||||
{
|
||||
return meta == runeType;
|
||||
return blockState.getBlock().getMetaFromState(blockState) == runeType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockRuneOfSacrifice extends BlockBloodRune
|
||||
{
|
||||
public BlockRuneOfSacrifice()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("runeOfSacrifice");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:RuneOfSacrifice");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRuneEffect(int metaData)
|
||||
{
|
||||
|
|
|
@ -1,28 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockRuneOfSelfSacrifice extends BlockBloodRune
|
||||
{
|
||||
public BlockRuneOfSelfSacrifice()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("runeOfSelfSacrifice");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:RuneOfSelfSacrifice");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRuneEffect(int metaData)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSchematicSaver extends BlockContainer
|
||||
|
@ -15,8 +17,6 @@ public class BlockSchematicSaver extends BlockContainer
|
|||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
// setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("schematicSaver");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,16 +26,16 @@ public class BlockSchematicSaver extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(x, y, z);
|
||||
TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(blockPos);
|
||||
|
||||
tileEntity.rightClickBlock(player, side);
|
||||
tileEntity.rightClickBlock(player, side.getIndex());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Facing;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -22,20 +23,11 @@ public class BlockSpectral extends BlockContainer
|
|||
public BlockSpectral()
|
||||
{
|
||||
super(Material.rock);
|
||||
this.setBlockName("spectralBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SpectralBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
Block d;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -45,12 +37,13 @@ public class BlockSpectral extends BlockContainer
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos blockPos, EnumFacing side)
|
||||
{
|
||||
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
||||
Block block = p_149646_1_.getBlockState(blockPos).getBlock();
|
||||
|
||||
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]))
|
||||
if (p_149646_1_.getBlockState(blockPos) != p_149646_1_.getBlockState(blockPos.add(-side.getFrontOffsetX(), -side.getFrontOffsetY(), -side.getFrontOffsetZ())))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -60,20 +53,11 @@ public class BlockSpectral extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
return block != this && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
/**
|
||||
* Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
||||
*/
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
return block != this && super.shouldSideBeRendered(p_149646_1_, blockPos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (player.isSneaking())
|
||||
{
|
||||
|
@ -86,7 +70,7 @@ public class BlockSpectral extends BlockContainer
|
|||
{
|
||||
if (playerItem.getItem() instanceof ItemBlock)
|
||||
{
|
||||
world.setBlock(x, y, z, ((ItemBlock) (playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3);
|
||||
world.addBlockEvent(blockPos, ((ItemBlock) playerItem.getItem()).getBlock(), playerItem.getItemDamage(), 3);
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -20,17 +19,9 @@ public class BlockSpectralContainer extends BlockContainer
|
|||
public BlockSpectralContainer()
|
||||
{
|
||||
super(Material.cloth);
|
||||
this.setBlockName("blockSpectralContainer");
|
||||
this.setBlockBounds(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlockBloodLight");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
|
@ -38,30 +29,22 @@ public class BlockSpectralContainer extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) {}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
||||
public boolean isReplaceable(World world, BlockPos blockPos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir(IBlockAccess world, int x, int y, int z)
|
||||
public boolean isAir(IBlockAccess world, BlockPos blockPos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,28 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BlockSpeedRune extends BlockBloodRune
|
||||
{
|
||||
public BlockSpeedRune()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("speedRune");
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SpeedRune");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRuneEffect(int metaData)
|
||||
{
|
||||
|
|
|
@ -2,23 +2,21 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class BlockSpellEffect extends BlockOrientable
|
||||
{
|
||||
public BlockSpellEffect()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellEffect");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,12 +25,6 @@ public class BlockSpellEffect extends BlockOrientable
|
|||
return new TESpellEffectBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -45,6 +37,7 @@ public class BlockSpellEffect extends BlockOrientable
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
|
|
|
@ -2,13 +2,13 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -17,7 +17,6 @@ public class BlockSpellEnhancement extends BlockOrientable
|
|||
public BlockSpellEnhancement()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellEnhancement");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,12 +25,6 @@ public class BlockSpellEnhancement extends BlockOrientable
|
|||
return new TESpellEnhancementBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -44,6 +37,7 @@ public class BlockSpellEnhancement extends BlockOrientable
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
|
|
|
@ -2,13 +2,13 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -17,7 +17,6 @@ public class BlockSpellModifier extends BlockOrientable
|
|||
public BlockSpellModifier()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellModifier");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +25,7 @@ public class BlockSpellModifier extends BlockOrientable
|
|||
return new TESpellModifierBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
|
@ -47,12 +47,6 @@ public class BlockSpellModifier extends BlockOrientable
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
|
|
@ -3,15 +3,18 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,7 +23,6 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
public BlockSpellParadigm()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellParadigm");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,8 +31,8 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
return new TESpellParadigmBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
*/
|
||||
|
@ -49,7 +51,7 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
|
@ -61,14 +63,14 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
}
|
||||
|
||||
NBTTagCompound itemTag = stack.getTagCompound();
|
||||
itemTag.setInteger("xCoord", x);
|
||||
itemTag.setInteger("yCoord", y);
|
||||
itemTag.setInteger("zCoord", z);
|
||||
itemTag.setInteger("xCoord", blockPos.getX());
|
||||
itemTag.setInteger("yCoord", blockPos.getY());
|
||||
itemTag.setInteger("zCoord", blockPos.getZ());
|
||||
itemTag.setInteger("dimensionId", world.provider.getDimensionId());
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
return super.onBlockActivated(world, blockPos, state, player, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,12 +79,6 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
|
|
|
@ -1,66 +1,31 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.BlankSpell;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSpellTable extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon;
|
||||
|
||||
public BlockSpellTable()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockHomHeart");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_top");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_bottom");
|
||||
this.sideIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TEHomHeart tileEntity = (TEHomHeart) world.getTileEntity(x, y, z);
|
||||
TEHomHeart tileEntity = (TEHomHeart) world.getTileEntity(blockPos);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -79,9 +44,9 @@ public class BlockSpellTable extends BlockContainer
|
|||
}
|
||||
|
||||
NBTTagCompound itemTag = playerItem.getTagCompound();
|
||||
itemTag.setInteger("xCoord", x);
|
||||
itemTag.setInteger("yCoord", y);
|
||||
itemTag.setInteger("zCoord", z);
|
||||
itemTag.setInteger("xCoord", blockPos.getX());
|
||||
itemTag.setInteger("yCoord", blockPos.getY());
|
||||
itemTag.setInteger("zCoord", blockPos.getZ());
|
||||
itemTag.setInteger("dimensionId", world.provider.getDimensionId());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,50 +4,21 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.omega.IStabilityGlyph;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockStabilityGlyph extends Block implements IStabilityGlyph
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon stability1;
|
||||
|
||||
public BlockStabilityGlyph()
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("stabilityGlyph");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick");
|
||||
this.stability1 = iconRegister.registerIcon("AlchemicalWizardry:GlyphStability1");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return stability1;
|
||||
default:
|
||||
return this.blockIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +33,7 @@ public class BlockStabilityGlyph extends Block implements IStabilityGlyph
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
|
|
|
@ -17,64 +17,27 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
//import net.minecraftforge.fml.common.Optional;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.event.TeleposeEvent;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import codechicken.multipart.MultipartHelper;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
//import codechicken.multipart.MultipartHelper;
|
||||
//import codechicken.multipart.TileMultipart;
|
||||
|
||||
public class BlockTeleposer extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockTeleposer()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setUnlocalizedName("bloodTeleposer");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerBlockIcons(IIconRegister iconRegister)
|
||||
// {
|
||||
// this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Top");
|
||||
// this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side");
|
||||
// this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon(int side, int meta)
|
||||
// {
|
||||
// switch (side)
|
||||
// {
|
||||
// case 0:
|
||||
// return bottomIcon;
|
||||
// case 1:
|
||||
// return topIcon;
|
||||
// default:
|
||||
// return sideIcon2;
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
|
@ -232,17 +195,17 @@ public class BlockTeleposer extends BlockContainer
|
|||
{
|
||||
TileEntity newTileEntityI = TileEntity.createAndLoadEntity(nbttag1);
|
||||
|
||||
if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI))
|
||||
// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI))
|
||||
{
|
||||
newTileEntityI = createMultipartFromNBT(worldF, nbttag1);
|
||||
// newTileEntityI = createMultipartFromNBT(worldF, nbttag1);
|
||||
}
|
||||
|
||||
worldF.setTileEntity(posf, newTileEntityI);
|
||||
|
||||
newTileEntityI.setPos(posf);
|
||||
if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI))
|
||||
// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI))
|
||||
{
|
||||
sendDescriptorOfTile(worldF, newTileEntityI);
|
||||
// sendDescriptorOfTile(worldF, newTileEntityI);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,30 +214,30 @@ public class BlockTeleposer extends BlockContainer
|
|||
if (tileEntityF != null)
|
||||
{
|
||||
TileEntity newTileEntityF = TileEntity.createAndLoadEntity(nbttag2);
|
||||
if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF))
|
||||
// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF))
|
||||
{
|
||||
newTileEntityF = createMultipartFromNBT(worldI, nbttag2);
|
||||
// newTileEntityF = createMultipartFromNBT(worldI, nbttag2);
|
||||
}
|
||||
|
||||
worldI.setTileEntity(posi, newTileEntityF);
|
||||
|
||||
newTileEntityF.setPos(posi);
|
||||
|
||||
if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF))
|
||||
// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF))
|
||||
{
|
||||
sendDescriptorOfTile(worldI, newTileEntityF);
|
||||
// sendDescriptorOfTile(worldI, newTileEntityF);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ForgeMultipart")
|
||||
/* @Optional.Method(modid = "ForgeMultipart")
|
||||
public static boolean isMultipart(TileEntity tile)
|
||||
{
|
||||
return tile instanceof TileMultipart;
|
||||
}
|
||||
|
||||
|
||||
@Optional.Method(modid = "ForgeMultipart")
|
||||
public static TileEntity createMultipartFromNBT(World world, NBTTagCompound tag)
|
||||
{
|
||||
|
@ -286,4 +249,5 @@ public class BlockTeleposer extends BlockContainer
|
|||
{
|
||||
MultipartHelper.sendDescPacket(world, tile);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Random;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
|
@ -132,7 +133,7 @@ public class OmegaParadigm
|
|||
|
||||
}
|
||||
|
||||
public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z)
|
||||
public boolean getBlockEffectWhileInside(Entity entity, BlockPos blockPos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -24,23 +24,21 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
|||
|
||||
public class TECrucible extends TEInventory implements IUpdatePlayerListBox
|
||||
{
|
||||
private int radius = 5;
|
||||
private float rColour;
|
||||
private float gColour;
|
||||
private float bColour;
|
||||
|
||||
private int ticksRemaining = 0;
|
||||
private int minValue = 0;
|
||||
private int maxValue = 0;
|
||||
private float incrementValue = 0;
|
||||
|
||||
public float rColour;
|
||||
public float gColour;
|
||||
public float bColour;
|
||||
|
||||
public int ticksRemaining = 0;
|
||||
public int minValue = 0;
|
||||
public int maxValue = 0;
|
||||
public float incrementValue = 0;
|
||||
|
||||
public int state = 0; //0 is when it gives off gray particles, 1 is when it gives off white particles (player can't use this incense anymore), 2 is the normal colour of the incense, 3 means no particles (it is out)
|
||||
private int state = 0; //0 is when it gives off gray particles, 1 is when it gives off white particles (player can't use this incense anymore), 2 is the normal colour of the incense, 3 means no particles (it is out)
|
||||
|
||||
public TECrucible()
|
||||
{
|
||||
super(1);
|
||||
float f = (float) 1.0F;
|
||||
float f = 1.0F;
|
||||
float f1 = f * 0.6F + 0.4F;
|
||||
float f2 = f * f * 0.7F - 0.5F;
|
||||
float f3 = f * f * 0.6F - 0.7F;
|
||||
|
@ -52,15 +50,16 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox
|
|||
@Override
|
||||
public void update()
|
||||
{
|
||||
if(worldObj.isRemote)
|
||||
return;
|
||||
|
||||
int radius = 5;
|
||||
|
||||
if (worldObj.isRemote) return;
|
||||
|
||||
boolean stateChanged = false;
|
||||
|
||||
if(ticksRemaining <= 0)
|
||||
if (ticksRemaining <= 0)
|
||||
{
|
||||
ItemStack stack = this.getStackInSlot(0);
|
||||
if(stack != null && stack.getItem() instanceof IIncense)
|
||||
if (stack != null && stack.getItem() instanceof IIncense)
|
||||
{
|
||||
IIncense incense = (IIncense)stack.getItem();
|
||||
|
||||
|
@ -152,21 +151,21 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox
|
|||
}
|
||||
}
|
||||
|
||||
public void spawnClientParticle(World world, int x, int y, int z, Random rand)
|
||||
public void spawnClientParticle(World world, BlockPos blockPos, Random rand)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case 0:
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, x + 0.5D + rand.nextGaussian() / 8, y + 0.7D, z + 0.5D + rand.nextGaussian() / 8, 0.15, 0.15, 0.15);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, 0.15, 0.15, 0.15);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, x + 0.5D + rand.nextGaussian() / 8, y + 0.7D, z + 0.5D + rand.nextGaussian() / 8, 1.0, 1.0, 1.0);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, 1.0, 1.0, 1.0);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, x + 0.5D + rand.nextGaussian() / 8, y + 0.7D, z + 0.5D + rand.nextGaussian() / 8, rColour, gColour, bColour);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, x + 0.5D + rand.nextGaussian() / 32, y + 0.7D, z + 0.5D + rand.nextGaussian() / 32, 0, 0.02, 0);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, rColour, gColour, bColour);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, blockPos.getX() + 0.5D + rand.nextGaussian() / 32, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 32, 0, 0.02, 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
|
|
@ -225,14 +225,14 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox
|
|||
return block.getStateFromMeta(getMetaOfMimic());
|
||||
}
|
||||
|
||||
public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z)
|
||||
public boolean getBlockEffectWhileInside(Entity entity, BlockPos blockPos)
|
||||
{
|
||||
if(reagent != null)
|
||||
{
|
||||
OmegaParadigm paradigm = OmegaRegistry.getParadigmForReagent(reagent);
|
||||
if(paradigm != null)
|
||||
{
|
||||
return paradigm.getBlockEffectWhileInside(entity, x, y, z);
|
||||
return paradigm.getBlockEffectWhileInside(entity, blockPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,73 +1,73 @@
|
|||
#Block Localization
|
||||
tile.bloodAltar.name=Blood Altar
|
||||
tile.bloodRune.blank.name=Blood Rune
|
||||
tile.bloodRune.fill.name=Rune of Augmented Capacity
|
||||
tile.bloodRune.empty.name=Rune of Dislocation
|
||||
tile.bloodRune.orb.name=Rune of the Orb
|
||||
tile.bloodRune.betterCapacity.name=Rune of Superior Capacity
|
||||
tile.bloodRune.acceleration.name=Rune of Acceleration
|
||||
tile.speedRune.name=Speed Rune
|
||||
tile.efficiencyRune.name=Efficiency Rune
|
||||
tile.runeOfSacrifice.name=Rune of Sacrifice
|
||||
tile.runeOfSelfSacrifice.name=Rune of Self-Sacrifice
|
||||
tile.ritualStone.name=Ritual Stone
|
||||
tile.blockMasterStone.name=Master Ritual Stone
|
||||
tile.bloodSocket.name=Filled Socket
|
||||
tile.imperfectRitualStone.name=Imperfect Ritual Stone
|
||||
tile.armourForge.name=Soul Armour Forge
|
||||
tile.emptySocket.name=Empty Socket
|
||||
tile.bloodStoneBrick.name=Bloodstone Brick
|
||||
tile.largeBloodStoneBrick.name=Large Bloodstone Brick
|
||||
tile.altar.name=Blood Altar
|
||||
tile.blood_rune.blank.name=Blood Rune
|
||||
tile.blood_rune.fill.name=Rune of Augmented Capacity
|
||||
tile.blood_rune.empty.name=Rune of Dislocation
|
||||
tile.blood_rune.orb.name=Rune of the Orb
|
||||
tile.blood_rune.betterCapacity.name=Rune of Superior Capacity
|
||||
tile.blood_rune.acceleration.name=Rune of Acceleration
|
||||
tile.speed_rune.name=Speed Rune
|
||||
tile.efficiency_rune.name=Efficiency Rune
|
||||
tile.sacrifice_rune.name=Rune of Sacrifice
|
||||
tile.self_sacrifice_rune.name=Rune of Self-Sacrifice
|
||||
tile.ritual_stone.name=Ritual Stone
|
||||
tile.master_ritual_stone.name=Master Ritual Stone
|
||||
tile.filled_socket.name=Filled Socket
|
||||
tile.imperfect_ritual_stone.name=Imperfect Ritual Stone
|
||||
tile.soul_armour_forge.name=Soul Armour Forge
|
||||
tile.empty_socket.name=Empty Socket
|
||||
tile.bloodstone_brick.name=Bloodstone Brick
|
||||
tile.large_bloodstone_brick.name=Large Bloodstone Brick
|
||||
tile.chemistry_set.name=Alchemical Chemistry Set
|
||||
tile.blockHomHeart.name=Spell Table
|
||||
tile.bloodPedestal.name=Arcane Pedestal
|
||||
tile.bloodPlinth.name=Arcane Plinth
|
||||
tile.bloodTeleposer.name=Teleposer
|
||||
tile.blockConduit.name=Spell Conduit
|
||||
tile.blockSpellParadigm.projectile.name=Particle Generator
|
||||
tile.blockSpellParadigm.self.name=Self Augmentator
|
||||
tile.blockSpellParadigm.melee.name=Melee Aggregator
|
||||
tile.blockSpellParadigm.tool.name=Tool Forger
|
||||
tile.blockSpellEnhancement.power1.name=Unstable Spell Empowerer
|
||||
tile.blockSpellEnhancement.power2.name=Standard Spell Empowerer
|
||||
tile.blockSpellEnhancement.power3.name=Reinforced Spell Empowerer
|
||||
tile.blockSpellEnhancement.power4.name=Imbued Spell Empowerer
|
||||
tile.blockSpellEnhancement.power5.name=Demonic Spell Empowerer
|
||||
tile.blockSpellEnhancement.cost1.name=Unstable Spell Dampener
|
||||
tile.blockSpellEnhancement.cost2.name=Standard Spell Dampener
|
||||
tile.blockSpellEnhancement.cost3.name=Reinforced Spell Dampener
|
||||
tile.blockSpellEnhancement.cost4.name=Imbued Spell Dampener
|
||||
tile.blockSpellEnhancement.cost5.name=Demonic Spell Dampener
|
||||
tile.blockSpellEnhancement.potency1.name=Unstable Spell Augmentor
|
||||
tile.blockSpellEnhancement.potency2.name=Standard Spell Augmentor
|
||||
tile.blockSpellEnhancement.potency3.name=Reinforced Spell Augmentor
|
||||
tile.blockSpellEnhancement.potency4.name=Imbued Spell Augmentor
|
||||
tile.blockSpellEnhancement.potency5.name=Demonic Spell Augmentor
|
||||
tile.blockSpellModifier.default.name=Default Spell Modifier
|
||||
tile.blockSpellModifier.offensive.name=Offensive Spell Modifier
|
||||
tile.blockSpellModifier.defensive.name=Defensive Spell Modifier
|
||||
tile.blockSpellModifier.environmental.name=Environmental Spell Modifier
|
||||
tile.blockSpellEffect.fire.name=Crucible of Fire
|
||||
tile.blockSpellEffect.ice.name=Ice Maker
|
||||
tile.blockSpellEffect.wind.name=Wind Generator
|
||||
tile.blockSpellEffect.earth.name=Earth Former
|
||||
tile.spell_table.name=Spell Table
|
||||
tile.pedestal.name=Arcane Pedestal
|
||||
tile.plinth.name=Arcane Plinth
|
||||
tile.teleposer.name=Teleposer
|
||||
tile.spell_conduit.name=Spell Conduit
|
||||
tile.spell_paradigm.projectile.name=Particle Generator
|
||||
tile.spell_paradigm.self.name=Self Augmentator
|
||||
tile.spell_paradigm.melee.name=Melee Aggregator
|
||||
tile.spell_paradigm.tool.name=Tool Forger
|
||||
tile.spell_enhancement.power1.name=Unstable Spell Empowerer
|
||||
tile.spell_enhancement.power2.name=Standard Spell Empowerer
|
||||
tile.spell_enhancement.power3.name=Reinforced Spell Empowerer
|
||||
tile.spell_enhancement.power4.name=Imbued Spell Empowerer
|
||||
tile.spell_enhancement.power5.name=Demonic Spell Empowerer
|
||||
tile.spell_enhancement.cost1.name=Unstable Spell Dampener
|
||||
tile.spell_enhancement.cost2.name=Standard Spell Dampener
|
||||
tile.spell_enhancement.cost3.name=Reinforced Spell Dampener
|
||||
tile.spell_enhancement.cost4.name=Imbued Spell Dampener
|
||||
tile.spell_enhancement.cost5.name=Demonic Spell Dampener
|
||||
tile.spell_enhancement.potency1.name=Unstable Spell Augmentor
|
||||
tile.spell_enhancement.potency2.name=Standard Spell Augmentor
|
||||
tile.spell_enhancement.potency3.name=Reinforced Spell Augmentor
|
||||
tile.spell_enhancement.potency4.name=Imbued Spell Augmentor
|
||||
tile.spell_enhancement.potency5.name=Demonic Spell Augmentor
|
||||
tile.spell_modifier.default.name=Default Spell Modifier
|
||||
tile.spell_modifier.offensive.name=Offensive Spell Modifier
|
||||
tile.spell_modifier.defensive.name=Defensive Spell Modifier
|
||||
tile.spell_modifier.environmental.name=Environmental Spell Modifier
|
||||
tile.spell_effect.fire.name=Crucible of Fire
|
||||
tile.spell_effect.ice.name=Ice Maker
|
||||
tile.spell_effect.wind.name=Wind Generator
|
||||
tile.spell_effect.earth.name=Earth Former
|
||||
tile.alchemical_calcinator.name=Alchemical Calcinator
|
||||
tile.crystalBelljar.name=Crystal Belljar
|
||||
tile.blockReagentConduit.name=Alchemy Relay
|
||||
tile.lifeEssenceFluidBlock.name=Life Essence
|
||||
tile.crystalBlock.fullCrystal.name=Crystal Cluster
|
||||
tile.crystalBlock.crystalBrick.name=Crystal Cluster Brick
|
||||
tile.demonPortal.name=Demon Portal
|
||||
tile.demonChest.name=Demon's Chest
|
||||
tile.enchantmentGlyph.enchantability.name=Glyph of the Adept Enchanter
|
||||
tile.enchantmentGlyph.enchantmentLevel.name=Glyph of Arcane Potential
|
||||
tile.stabilityGlyph.stability1.name=Glyph of Rigid Stability
|
||||
tile.schematicSaver.name=Schematic Saver
|
||||
tile.blockMimic.name=Mimic Block
|
||||
tile.blockSpectralContainer.name=Spectral Container
|
||||
tile.blockBloodLightSource.name=Blood Light
|
||||
tile.spectralBlock.name=Spectral Block
|
||||
tile.blockCrucible.name=Incense Crucible
|
||||
tile.crystal_belljar.name=Crystal Belljar
|
||||
tile.reagent_conduit.name=Alchemy Relay
|
||||
tile.life_essence.name=Life Essence
|
||||
tile.crystal_block.fullCrystal.name=Crystal Cluster
|
||||
tile.crystal_block.crystalBrick.name=Crystal Cluster Brick
|
||||
tile.demon_portal.name=Demon Portal
|
||||
tile.demon_chest.name=Demon's Chest
|
||||
tile.enchantment_glyph.enchantability.name=Glyph of the Adept Enchanter
|
||||
tile.enchantment_glyph.enchantmentLevel.name=Glyph of Arcane Potential
|
||||
tile.stability_glyph.stability1.name=Glyph of Rigid Stability
|
||||
tile.schematic_saver.name=Schematic Saver
|
||||
tile.mimic_block.name=Mimic Block
|
||||
tile.spectral_container.name=Spectral Container
|
||||
tile.blood_light.name=Blood Light
|
||||
tile.spectral_block.name=Spectral Block
|
||||
tile.incense_crucible.name=Incense Crucible
|
||||
|
||||
#Item Localization
|
||||
item.weakBloodOrb.name=Weak Blood Orb
|
||||
|
|
Loading…
Reference in a new issue