mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-27 23:45:48 +00:00
manual merge of master branch changes up to commit 1387bc6
This commit is contained in:
1 parent
2d99d5dba2
commit
14d357ccf6
23 files changed
+317
-172
No files matched your search
@@ -16,7 +16,7 @@ public class ArmorPattern extends CraftingItem implements ItemBlocklike
|
||||
|
||||
private Icon baseIcon;
|
||||
|
||||
public ArmorPattern(int id, String partType, String patternType, String folder)
|
||||
public ArmorPattern(int id, String patternType, String folder)
|
||||
{
|
||||
super(id, patternName, getPatternNames(patternType), folder);
|
||||
this.setHasSubtypes(true);
|
||||
@@ -50,10 +50,10 @@ public class ArmorPattern extends CraftingItem implements ItemBlocklike
|
||||
|
||||
public void getSubItems (int id, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
/*for (int i = 0; i < patternName.length; i++)
|
||||
{
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import net.minecraft.item.ItemStack;
|
||||
public class MetalPattern extends Pattern
|
||||
{
|
||||
|
||||
public MetalPattern(int id, String partType, String patternType, String folder)
|
||||
public MetalPattern(int id, String patternType, String folder)
|
||||
{
|
||||
super(id, partType, patternType, folder);
|
||||
super(id, patternName, getPatternNames(patternType), folder);
|
||||
}
|
||||
|
||||
protected static String[] getPatternNames (String partType)
|
||||
@@ -19,11 +19,13 @@ public class MetalPattern extends Pattern
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
if (!(patternName[i].equals("")))
|
||||
names[i] = partType + patternName[i];
|
||||
else
|
||||
names[i] = "";
|
||||
return names;
|
||||
}
|
||||
|
||||
private static final String[] patternName = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "", "", "arrowhead" };
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "", "", "arrowhead", "gem" };
|
||||
|
||||
public void getSubItems (int id, CreativeTabs tab, List list)
|
||||
{
|
||||
|
||||
@@ -11,9 +11,14 @@ import tconstruct.library.util.IPattern;
|
||||
|
||||
public class Pattern extends CraftingItem implements IPattern
|
||||
{
|
||||
public Pattern(int id, String partType, String patternType, String folder)
|
||||
public Pattern(int id, String patternType, String folder)
|
||||
{
|
||||
super(id, patternName, getPatternNames(patternType), folder);
|
||||
this(id, patternName, getPatternNames(patternType), folder);
|
||||
}
|
||||
|
||||
public Pattern(int id, String[] names, String[] patternTypes, String folder)
|
||||
{
|
||||
super(id, names, patternTypes, folder);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setContainerItem(this);
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.world.World;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.entity.BlueSlime;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -26,10 +27,10 @@ public class TitleIcon extends Item
|
||||
int[] primaryColor = { 0x66BBE8, 0x66BBE8 };
|
||||
int[] secondaryColor = { 0x1567BF, 0xFFEC6E };
|
||||
String[] mobNames = { "TConstruct.EdibleSlime", "TConstruct.KingSlime" };
|
||||
|
||||
String[] achievementIconNames = new String[] {"tinkerer", "preparedFight", "proTinkerer", "enemySlayer", "dualConvenience"};
|
||||
|
||||
String[] achievementIconNames = new String[] { "tinkerer", "preparedFight", "proTinkerer", "enemySlayer", "dualConvenience" };
|
||||
Icon[] achievementIcons = new Icon[achievementIconNames.length];
|
||||
|
||||
|
||||
public TitleIcon(int par1)
|
||||
{
|
||||
super(par1);
|
||||
@@ -42,8 +43,9 @@ public class TitleIcon extends Item
|
||||
ToolCore.blankSprite = iconRegister.registerIcon("tinker:blanksprite");
|
||||
TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball");
|
||||
itemIcon = iconRegister.registerIcon("tinker:tparts");
|
||||
for(int i = 0; i < achievementIcons.length; i++){
|
||||
achievementIcons[i] = iconRegister.registerIcon("tinker:achievementIcons/" + (i < achievementIconNames.length ? achievementIconNames[i] : ""));
|
||||
for (int i = 0; i < achievementIcons.length; i++)
|
||||
{
|
||||
achievementIcons[i] = iconRegister.registerIcon("tinker:achievementIcons/" + (i < achievementIconNames.length ? achievementIconNames[i] : ""));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,23 +60,26 @@ public class TitleIcon extends Item
|
||||
{
|
||||
if (par1 == 255)
|
||||
return itemIcon;
|
||||
if (par1 >= 4096){
|
||||
return getIconFromDamage(par1);
|
||||
if (par1 >= 4096)
|
||||
{
|
||||
return getIconFromDamage(par1);
|
||||
}
|
||||
return Item.monsterPlacer.getIconFromDamageForRenderPass(par1, par2);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage (int par1)
|
||||
{
|
||||
if(par1 >= 4096){
|
||||
int index = par1 - 4096;
|
||||
if(index < achievementIcons.length){
|
||||
return achievementIcons[index];
|
||||
}
|
||||
}
|
||||
//Not returning null to prevent crashes
|
||||
return itemIcon;
|
||||
if (par1 >= 4096)
|
||||
{
|
||||
int index = par1 - 4096;
|
||||
if (index < achievementIcons.length)
|
||||
{
|
||||
return achievementIcons[index];
|
||||
}
|
||||
}
|
||||
//Not returning null to prevent crashes
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,7 +110,7 @@ public class TitleIcon extends Item
|
||||
if (damage == 255)
|
||||
return 0xffffff;
|
||||
if (damage >= 4096)
|
||||
return 0xffffff;
|
||||
return 0xffffff;
|
||||
return pass == 0 ? primaryColor[damage] : secondaryColor[damage];
|
||||
}
|
||||
|
||||
@@ -186,7 +191,8 @@ public class TitleIcon extends Item
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
entity.setAngles(player.cameraYaw, player.cameraYaw);
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
entity.setAngles(player.cameraYaw, player.cameraYaw);
|
||||
((EntityLiving) entity).onSpawnWithEgg((EntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user