mirror of
https://github.com/GTNewHorizons/DummyCore.git
synced 2026-11-20 20:22:09 +00:00
1.5 Misc updates
This commit is contained in:
1 parent
a26de45a77
commit
248e9e1398
5 files changed
+92
-7
No files matched your search
@@ -33,14 +33,20 @@ public class MultiBlock extends Block{
|
||||
protected static List<String> blockTextures = new ArrayList();
|
||||
protected static int id = -1;
|
||||
public static int blockuid;
|
||||
public static Icon[] icon;
|
||||
public static Icon[] icon = new Icon[4096];
|
||||
protected static IDummyMultiBlock[] handler = new IDummyMultiBlock[1024];
|
||||
public static int blocks;
|
||||
public MultiBlock(int par1) {
|
||||
super(par1, Material.web);
|
||||
blockuid = par1;
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
public int tickRate(World par1World)
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
private static void addBlockName(int i, String name)
|
||||
{
|
||||
blockNames.add(i, name);
|
||||
@@ -175,12 +181,18 @@ public class MultiBlock extends Block{
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
for(int i = 0; i < 1024; ++i)
|
||||
{
|
||||
if(handler[i] != null && i == par2)
|
||||
return handler[i].getIcon(par1, par2);
|
||||
try {
|
||||
for(int i = 0; i < 1024; ++i)
|
||||
{
|
||||
if(handler[i] != null && i == par2)
|
||||
return handler[i].getIcon(par1, par2);
|
||||
}
|
||||
return this.icon[par2];
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return this.icon[par2];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -298,6 +310,31 @@ public class MultiBlock extends Block{
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
for(int i = 0; i < 1024; ++i)
|
||||
{
|
||||
if(handler[i] != null && i == metadata)
|
||||
{
|
||||
ArrayList<ItemStack> ret = handler[i].getBlockDropped(world, x, y, z, metadata, fortune);
|
||||
if(ret != null)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return super.getBlockDropped(world, x, y, z, metadata, fortune);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
for(int i = 0; i < 1024; ++i)
|
||||
{
|
||||
if(handler[i] != null && i == par4)
|
||||
handler[i].updateTick(par1World, par2, par3, par4, par5Random);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,9 @@ public class Coord2D {
|
||||
this(0,0);
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return x+","+z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class DummyPacketHandler implements IPacketHandler{
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
String gameData = "data";
|
||||
System.out.println("data");
|
||||
try {
|
||||
Side s = FMLCommonHandler.instance().getEffectiveSide();
|
||||
if(s == Side.CLIENT)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package DummyCore.Utils;
|
||||
|
||||
public enum EnumRarityColor {
|
||||
BROKEN("8","Broken"),
|
||||
COMMON("f","Common"),
|
||||
GOOD("a","Good"),
|
||||
UNCOMMON("2","Uncommon"),
|
||||
RARE("9","Rare"),
|
||||
UNIQUE("d","Unique"),
|
||||
EPIC("e","Epic"),
|
||||
LEGENDARY("6","Legendary"),
|
||||
EXCEPTIONAL("b","Exceptional"),
|
||||
PERFECT("3","Perfect"),
|
||||
ULTIMATE("c","Ultimate"),
|
||||
TURQUOISE("4","Turquoise"),
|
||||
;
|
||||
EnumRarityColor(String s, String s1)
|
||||
{
|
||||
value = s;
|
||||
name = s1;
|
||||
}
|
||||
|
||||
private String value;
|
||||
private String name;
|
||||
|
||||
public String getRarityColor()
|
||||
{
|
||||
String ret = new String();
|
||||
ret += "\247";
|
||||
ret+=value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package DummyCore.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -58,4 +59,8 @@ public interface IDummyMultiBlock {
|
||||
public Icon getIcon(int par1, int par2);
|
||||
|
||||
public int getRenderColor(int par1);
|
||||
|
||||
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune);
|
||||
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random);
|
||||
}
|
||||
Reference in new issue
Block a user