Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.plaguewolf.wolfeconomy.blocks.bank;
- import com.plaguewolf.wolfeconomy.ModObjects;
- import com.plaguewolf.wolfeconomy.Strings;
- import cpw.mods.fml.common.registry.GameRegistry;
- 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.entity.EntityLivingBase;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.IIcon;
- import net.minecraft.util.MathHelper;
- import net.minecraft.world.World;
- public class ATMBlock extends Block {
- @SideOnly(Side.CLIENT)
- public static IIcon faces;
- @SideOnly(Side.CLIENT)
- public static IIcon front;
- @SideOnly(Side.CLIENT)
- public static void registerIcons(IIconRegister iconRegister){
- faces = iconRegister.registerIcon(ModObjects.atmBlock.unlocalisedName + ":atmFaces");
- front = iconRegister.registerIcon(ModObjects.atmBlock.unlocalisedName + ":atmFront");
- }
- protected void init() {
- GameRegistry.registerBlock(this, ModObjects.atmBlock.unlocalisedName);
- }
- static ATMBlock atmBlock = new ATMBlock();
- public static ATMBlock create() {
- ATMBlock result = new ATMBlock();
- result.init();
- return result;
- }
- protected ATMBlock() {
- super();
- setHardness(5.0F);
- setStepSound(soundTypeAnvil);
- setResistance(2000.0F);
- this.setBlockName(ModObjects.atmBlock.unlocalisedName);
- this.setBlockTextureName(Strings.MODID + ":" + ModObjects.atmBlock.unlocalisedName);
- }
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int side, int metadata){
- if (side == 1) return faces;
- else if (side == 0) return faces;
- else if (metadata == 2 && side == 2) return front;
- else if (metadata == 3 && side == 5) return faces;
- else if (metadata == 0 && side == 3) return faces;
- else if (metadata == 1 && side == 4) return faces;
- else return this.blockIcon;
- }
- public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack stack)
- {
- int whichDirectionFacing = MathHelper.floor_double((double)(entityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
- world.setBlockMetadataWithNotify(x, y, z, whichDirectionFacing, 2);
- System.out.println("faces is: " + faces);
- System.out.println("front is: " + front);
- System.out.println("icon is: " + ModObjects.atmBlock.unlocalisedName + ":atmFaces");
- System.out.println("metadata for block: " + world.getBlockMetadata(x, y, z));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment