1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion.git synced 2025-04-14 05:15:42 +02:00

Yay for purplething!

This commit is contained in:
chylex 2014-10-25 19:30:37 +02:00
parent 31b4001c1a
commit aa4eccf5e5
23 changed files with 103 additions and 7 deletions

BIN
src/_/purplething.png Normal file

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

View File

@ -24,7 +24,7 @@ public class BlockEndstoneTerrain extends Block implements IBlockSubtypes{
public static final byte metaInfested = 0, metaBurned = 1, metaEnchanted = 2;
@SideOnly(Side.CLIENT)
private IIcon[] iconTop,iconSide;
private IIcon[] iconTop, iconSide;
public BlockEndstoneTerrain(){
super(Material.rock);

View File

@ -66,6 +66,7 @@ public final class BlockList{
public static Block ravaged_brick_fence;
public static Block dungeon_puzzle;
public static Block cinder;
public static Block purplething; // TODO temporary
// ORES
@ -129,6 +130,7 @@ public final class BlockList{
register("ravaged_brick_fence", ravaged_brick_fence = new BlockFence("hardcoreenderexpansion:ravaged_brick",Material.rock).setHardness(1.5F).setResistance(6F).setStepSound(Block.soundTypePiston).setBlockName("ravagedBrickFence"));
register("dungeon_puzzle", dungeon_puzzle = new BlockDungeonPuzzle().setBlockUnbreakable().setResistance(6000000F).setStepSound(Block.soundTypeMetal).setBlockName("dungeonPuzzle"));
register("cinder", cinder = new BlockBasic(Material.rock).setHardness(1F).setResistance(10F).setStepSound(Block.soundTypeStone).setBlockName("cinder").setBlockTextureName("hardcoreenderexpansion:cinder"));
register("purplething", purplething = new BlockPurplething().setHardness(4F).setResistance(0.2F).setStepSound(Block.soundTypeCloth).setBlockName("purplething").setBlockTextureName("hardcoreenderexpansion:purplething"));
register("end_powder_ore", end_powder_ore = new BlockEndPowderOre().setHardness(3F).setResistance(12F).setStepSound(Block.soundTypeStone).setBlockName("endPowderOre").setBlockTextureName("hardcoreenderexpansion:end_powder_ore"));
register("endium_ore", endium_ore = new BlockEndiumOre().setHardness(18F).setResistance(100F).setStepSound(Block.soundTypeStone).setBlockName("endiumOre").setBlockTextureName("hardcoreenderexpansion:endium_ore"));
@ -177,6 +179,7 @@ public final class BlockList{
setItemClass("ravaged_brick_slab", ItemBlockSlab.class);
setItemClass("dungeon_puzzle", ItemBlockWithSubtypes.class);
setItemClass("block_special_effects", ItemBlockWithSubtypes.class);
setItemClass("purplething", ItemBlockWithSubtypes.class);
}
public static void registerBlocks(){
@ -190,7 +193,8 @@ public final class BlockList{
end_powder_ore,endium_ore,stardust_ore,igneous_rock_ore,instability_orb_ore,energy_cluster,
endium_block,
sphalerite,end_terrain,spooky_log,spooky_leaves,
ravaged_brick,ravaged_brick_smooth,ravaged_brick_glow,ravaged_brick_slab,ravaged_brick_stairs,ravaged_brick_fence,dungeon_puzzle,cinder,
ravaged_brick,ravaged_brick_smooth,ravaged_brick_glow,ravaged_brick_slab,ravaged_brick_stairs,ravaged_brick_fence,
dungeon_puzzle,cinder,purplething,
crossed_decoration,death_flower
);

View File

@ -0,0 +1,97 @@
package chylex.hee.block;
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 chylex.hee.item.block.ItemBlockWithSubtypes.IBlockSubtypes;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPurplething extends Block implements IBlockSubtypes{
@SideOnly(Side.CLIENT)
private IIcon[] iconArray;
public BlockPurplething(){
super(Material.cloth);
}
@Override
public int damageDropped(int meta){
return meta;
}
@Override
public String getUnlocalizedName(ItemStack is){
return getUnlocalizedName();
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta){
return iconArray[Math.min(iconArray.length-1,Math.max(0,meta))];
}
@SuppressWarnings("unchecked")
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){
for(int a = 0; a < iconArray.length; a++)list.add(new ItemStack(item,1,a));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
iconArray = new IIcon[16];
iconArray[0] = iconRegister.registerIcon(textureName);
String tex = textureName+"_";
String[] names = new String[]{ "h", "v", "hl", "hr", "vb", "vt", "tl", "tr", "bl", "br", "trb", "trl", "tbl", "rbl", "x" };
for(int a = 1; a < 16; a++)iconArray[a] = iconRegister.registerIcon(tex+names[a-1]);
}
public static int getMeta(World world, int x, int y, int z){
boolean l = false, r = false, t = false, b = false;
if (world.getBlock(x,y-1,z) != BlockList.purplething || world.getBlock(x,y+1,z) != BlockList.purplething){ // xz plane
l = isConnectable(world,x-1,y,z);
r = isConnectable(world,x+1,y,z);
t = isConnectable(world,x,y,z-1);
b = isConnectable(world,x,y,z+1);
}
else if (world.getBlock(x-1,y,z) != BlockList.purplething || world.getBlock(x+1,y,z) != BlockList.purplething){ // yz plane
l = isConnectable(world,x,y,z+1);
r = isConnectable(world,x,y,z-1);
t = isConnectable(world,x,y+1,z);
b = isConnectable(world,x,y-1,z);
}
else if (world.getBlock(x,y,z-1) != BlockList.purplething || world.getBlock(x,y,z+1) != BlockList.purplething){ // xy plane
l = isConnectable(world,x+1,y,z);
r = isConnectable(world,x-1,y,z);
t = isConnectable(world,x,y+1,z);
b = isConnectable(world,x,y-1,z);
}
if (l && r && t && b)return 15;
else if (r && b && l)return 14;
else if (t && b && l)return 13;
else if (t && r && l)return 12;
else if (t && r && b)return 11;
else if (b && r)return 10;
else if (b && l)return 9;
else if (t && r)return 8;
else if (t && l)return 7;
else if (t && b)return 2;
else if (l && r)return 1;
else return 0;
}
public static boolean isConnectable(World world, int x, int y, int z){
return world.getBlockMetadata(x,y,z) != 0 && world.getBlock(x,y,z) == BlockList.purplething;
}
}

View File

@ -1,5 +0,0 @@
{
"animation": {
"frametime": 2
}
}

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB

Binary file not shown.

After

(image error) Size: 3.3 KiB