FoR changes
Added a metaData block to FoR, meta 1 acts like permafabric but can be pushed with pistons. Fixed a bug where permafabric could be pushed by pistons.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -13,27 +17,58 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDimWall extends Block
|
||||
{
|
||||
|
||||
private Icon[] blockIcon= new Icon[2];
|
||||
public BlockDimWall(int i, int j, Material par2Material)
|
||||
{
|
||||
super(i, Material.ground);
|
||||
setTickRandomly(true);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
|
||||
|
||||
|
||||
super(i, Material.ground);
|
||||
setTickRandomly(true);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
}
|
||||
|
||||
public float getBlockHardness(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if(par1World.getBlockMetadata(par2, par3, par4)==0)
|
||||
{
|
||||
return this.blockHardness;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 10000000000000F;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"perm");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
return blockIcon[par2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped (int metadata)
|
||||
{
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int unknown, CreativeTabs tab, List subItems)
|
||||
{
|
||||
for (int ix = 0; ix < 2; ix++)
|
||||
{
|
||||
subItems.add(new ItemStack(this, 1, ix));
|
||||
}
|
||||
}
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
@@ -43,10 +78,7 @@ public class BlockDimWall extends Block
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,10 +128,6 @@ public class BlockDimWall extends Block
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,21 +29,21 @@ public class BlockDimWallPerm extends Block
|
||||
{
|
||||
super(i, Material.ground);
|
||||
setTickRandomly(true);
|
||||
// this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
if (properties == null)
|
||||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2().replace("perm", ""));
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
/**
|
||||
@@ -70,8 +70,6 @@ public class BlockDimWallPerm extends Block
|
||||
|
||||
if(dimHelper.getWorld(0)!=null&&par5Entity instanceof EntityPlayerMP)
|
||||
{
|
||||
|
||||
|
||||
int x = (link.destXCoord + rand.nextInt(properties.LimboReturnRange)-properties.LimboReturnRange/2);
|
||||
int z = (link.destZCoord + rand.nextInt(properties.LimboReturnRange)-properties.LimboReturnRange/2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user