mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 20:22:36 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -2,17 +2,15 @@ package tconstruct.weaponry.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
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 tconstruct.items.tools.Broadsword;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.util.Reference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Boneana extends Broadsword {
|
||||
private IIcon brokenIcon;
|
||||
|
||||
@@ -25,11 +23,9 @@ public class Boneana extends Broadsword {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int renderPass) {
|
||||
if(!stack.hasTagCompound() || !stack.getTagCompound().hasKey("InfiTool"))
|
||||
return emptyIcon;
|
||||
if (!stack.hasTagCompound() || !stack.getTagCompound().hasKey("InfiTool")) return emptyIcon;
|
||||
|
||||
if(stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken"))
|
||||
return brokenIcon;
|
||||
if (stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) return brokenIcon;
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package tconstruct.weaponry.items;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.library.client.TConstructClientRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.util.Reference;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
import tconstruct.weaponry.ammo.ArrowAmmo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GlassArrows extends ArrowAmmo {
|
||||
public GlassArrows() {
|
||||
super();
|
||||
@@ -35,13 +29,11 @@ public class GlassArrows extends ArrowAmmo {
|
||||
ItemStack handleStack = new ItemStack(getHandleItem(), 1, 0); // wooden shaft
|
||||
ItemStack accessoryStack = new ItemStack(getAccessoryItem(), 1, 0); // feather fletchling
|
||||
|
||||
ItemStack tool = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, null, this.getLocalizedToolName());
|
||||
if (tool != null)
|
||||
{
|
||||
ItemStack tool = ToolBuilder.instance.buildTool(
|
||||
headStack, handleStack, accessoryStack, null, this.getLocalizedToolName());
|
||||
if (tool != null) {
|
||||
tool.getTagCompound().getCompoundTag("InfiTool").setBoolean("Built", true);
|
||||
}
|
||||
else
|
||||
return;
|
||||
} else return;
|
||||
|
||||
// now turn it into legendary glass arrows!
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package tconstruct.weaponry.items;
|
||||
|
||||
import tconstruct.util.Reference;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.tools.items.Pattern;
|
||||
|
||||
import java.util.List;
|
||||
import tconstruct.util.Reference;
|
||||
|
||||
public class WeaponryPattern extends Pattern {
|
||||
private static final String[] patternName = new String[] { "shuriken", "crossbowlimb", "crossbowbody", "bowlimb" };
|
||||
private static final String[] patternName = new String[] {"shuriken", "crossbowlimb", "crossbowbody", "bowlimb"};
|
||||
|
||||
public WeaponryPattern(String patternType, String name) {
|
||||
super(patternName, getPatternNames(patternName, patternType), "patterns/");
|
||||
@@ -17,19 +16,15 @@ public class WeaponryPattern extends Pattern {
|
||||
this.setUnlocalizedName(Reference.prefix(name));
|
||||
}
|
||||
|
||||
public static String[] getPatternNames (String[] patternName, String partType)
|
||||
{
|
||||
public static String[] getPatternNames(String[] patternName, String partType) {
|
||||
String[] names = new String[patternName.length];
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
names[i] = partType + patternName[i];
|
||||
for (int i = 0; i < patternName.length; i++) names[i] = partType + patternName[i];
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
{
|
||||
public void getSubItems(Item b, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < patternName.length; i++) {
|
||||
// if (i != 23)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
@@ -37,12 +32,15 @@ public class WeaponryPattern extends Pattern {
|
||||
|
||||
@Override
|
||||
public int getPatternCost(ItemStack pattern) {
|
||||
switch(pattern.getItemDamage())
|
||||
{
|
||||
case 0: return 1; // shuriken
|
||||
case 1: return 8; // crossbow limb
|
||||
case 2: return 10; // crossbow body
|
||||
case 3: return 3; // bowlimb
|
||||
switch (pattern.getItemDamage()) {
|
||||
case 0:
|
||||
return 1; // shuriken
|
||||
case 1:
|
||||
return 8; // crossbow limb
|
||||
case 2:
|
||||
return 10; // crossbow body
|
||||
case 3:
|
||||
return 3; // bowlimb
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package tconstruct.weaponry.items;
|
||||
|
||||
import tconstruct.util.Reference;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.tools.items.Pattern;
|
||||
|
||||
import java.util.List;
|
||||
import tconstruct.util.Reference;
|
||||
|
||||
public class WeaponryPatternClay extends Pattern {
|
||||
private static final String[] patternName = new String[] { "", "", "", "bowlimb" };
|
||||
private static final String[] patternName = new String[] {"", "", "", "bowlimb"};
|
||||
|
||||
public WeaponryPatternClay(String patternType, String name) {
|
||||
super(patternName, getPatternNames(patternName, patternType), "patterns/");
|
||||
@@ -17,37 +16,33 @@ public class WeaponryPatternClay extends Pattern {
|
||||
this.setUnlocalizedName(Reference.prefix(name));
|
||||
}
|
||||
|
||||
public static String[] getPatternNames (String[] patternName, String partType)
|
||||
{
|
||||
public static String[] getPatternNames(String[] patternName, String partType) {
|
||||
String[] names = new String[patternName.length];
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
if (!(patternName[i].equals("")))
|
||||
names[i] = partType + patternName[i];
|
||||
else
|
||||
names[i] = "";
|
||||
if (!(patternName[i].equals(""))) names[i] = partType + patternName[i];
|
||||
else names[i] = "";
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
{
|
||||
public void getSubItems(Item b, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < patternName.length; i++) {
|
||||
// if (i != 23)
|
||||
if (!(patternName[i].equals("")))
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
if (!(patternName[i].equals(""))) list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPatternCost(ItemStack pattern) {
|
||||
switch(pattern.getItemDamage())
|
||||
{
|
||||
case 0: return 1; // shuriken
|
||||
case 1: return 8; // crossbow limb
|
||||
case 2: return 10; // crossbow body
|
||||
case 3: return 3; // bowlimb
|
||||
switch (pattern.getItemDamage()) {
|
||||
case 0:
|
||||
return 1; // shuriken
|
||||
case 1:
|
||||
return 8; // crossbow limb
|
||||
case 2:
|
||||
return 10; // crossbow body
|
||||
case 3:
|
||||
return 3; // bowlimb
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user