Created
May 3, 2011 22:18
-
-
Save BlockAfterBlock/954385 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.minecraft.src; | |
| public class BlockCarpet extends Block | |
| { | |
| public BlockCarpet() | |
| { | |
| super(120, 0, Material.cloth); | |
| setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.075F, 1.0F); | |
| } | |
| /*public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l) | |
| { | |
| if(l == 0) | |
| { | |
| EntityItem entityitem = new EntityItem(world, i, j, k, new ItemStack(mod_Carpets.BlockCarpet, 1, 0)); | |
| } | |
| if(l == 1) | |
| { | |
| EntityItem entityitem = new EntityItem(world, i, j, k, new ItemStack(mod_Carpets.BlockCarpet, 1, 1)); | |
| } | |
| }*/ | |
| protected int damageDropped(int i) | |
| { | |
| return i; | |
| } | |
| public int getBlockTextureFromSideAndMetadata(int i, int j) | |
| { | |
| if(j == 0) | |
| { | |
| return mod_Carpets.WhiteCarpet; | |
| } | |
| if(j == 1) | |
| { | |
| return mod_Carpets.BlackCarpet; | |
| } | |
| if(j == 2) | |
| { | |
| return mod_Carpets.BlueCarpet; | |
| } | |
| if(j == 3) | |
| { | |
| return mod_Carpets.BrownCarpet; | |
| } | |
| if(j == 4) | |
| { | |
| return mod_Carpets.GrayCarpet; | |
| } | |
| if(j == 5) | |
| { | |
| return mod_Carpets.GreenCarpet; | |
| } | |
| if(j == 6) | |
| { | |
| return mod_Carpets.OrangeCarpet; | |
| } | |
| if(j == 7) | |
| { | |
| return mod_Carpets.PinkCarpet; | |
| } | |
| if(j == 8) | |
| { | |
| return mod_Carpets.PurpleCarpet; | |
| } | |
| if(j == 9) | |
| { | |
| return mod_Carpets.RedCarpet; | |
| } | |
| if(j == 10) | |
| { | |
| return mod_Carpets.TealCarpet; | |
| } | |
| if(j == 11) | |
| { | |
| return mod_Carpets.YellowCarpet; | |
| } | |
| return 1; | |
| } | |
| public boolean isOpaqueCube() | |
| { | |
| return false; | |
| } | |
| public boolean renderAsNormalBlock() | |
| { | |
| return false; | |
| } | |
| public boolean canPlaceBlockAt(World world, int i, int j, int k) | |
| { | |
| int l = world.getBlockId(i, j - 1, k); | |
| if(l == 0 || !Block.blocksList[l].isOpaqueCube()) | |
| { | |
| return false; | |
| } else | |
| { | |
| return world.getBlockMaterial(i, j - 1, k).getIsSolid(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment