mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Nothing to see here
This commit is contained in:
1 parent
491132cbae
commit
4a2defb2b8
6 files changed
+114
-1
No files matched your search
@@ -949,6 +949,7 @@ manual.page.tool1=Crafting Parts
|
||||
|
||||
tool.glassarrows=Glass Arrows
|
||||
tool.glassarrows.lore=Crafted by a legendary Glassmaker
|
||||
tool.boneana.lore=It sounded like a good idea back then
|
||||
tool.baneofpigs=Bane of Pigs
|
||||
tool.infiminer=InfiMiner
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 386 B |
Binary file not shown.
|
After Width: | Height: | Size: 430 B |
@@ -44,6 +44,7 @@ import tconstruct.weaponry.ammo.ArrowAmmo;
|
||||
import tconstruct.weaponry.ammo.BoltAmmo;
|
||||
import tconstruct.library.tools.DualMaterialToolPart;
|
||||
import tconstruct.weaponry.entity.*;
|
||||
import tconstruct.weaponry.items.Boneana;
|
||||
import tconstruct.weaponry.items.GlassArrows;
|
||||
import tconstruct.weaponry.items.WeaponryPattern;
|
||||
import tconstruct.library.weaponry.AmmoItem;
|
||||
@@ -92,6 +93,10 @@ public class TinkerWeaponry {
|
||||
public static Pattern woodPattern;
|
||||
public static Pattern metalPattern;
|
||||
|
||||
// legendary weapons?
|
||||
public static GlassArrows glassArrows;
|
||||
public static Boneana boneana;
|
||||
|
||||
// other stuff
|
||||
public static Random random = new Random();
|
||||
|
||||
@@ -262,7 +267,11 @@ public class TinkerWeaponry {
|
||||
|
||||
private void registerLegendaries()
|
||||
{
|
||||
GameRegistry.registerItem(new GlassArrows(), "GlassArrows");
|
||||
glassArrows = new GlassArrows();
|
||||
boneana = new Boneana();
|
||||
|
||||
GameRegistry.registerItem(glassArrows, "GlassArrows");
|
||||
GameRegistry.registerItem(boneana, "Boneana");
|
||||
}
|
||||
|
||||
private void registerMaterials()
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package tconstruct.weaponry;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.armor.player.TPlayerStats;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.event.PartBuilderEvent;
|
||||
@@ -357,4 +363,56 @@ public class WeaponryHandler {
|
||||
if (TConstructRegistry.getBowMaterial(mat) == null)
|
||||
event.setResult(Event.Result.DENY);
|
||||
}
|
||||
|
||||
// high priority because we want to do these checks on unmodified stacks
|
||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void boneanaParts(ToolBuildEvent event) {
|
||||
if(event.headStack == null || event.handleStack == null || event.accessoryStack != null || event.extraStack != null)
|
||||
return;
|
||||
|
||||
// golden carrot + bone
|
||||
if(event.headStack.getItem() == Items.golden_carrot && event.handleStack.getItem() == Items.bone)
|
||||
{
|
||||
// golden carrot must be named banana
|
||||
if(!event.headStack.hasTagCompound() || !event.headStack.getTagCompound().hasKey("display") ||
|
||||
!event.headStack.getTagCompound().getCompoundTag("display").hasKey("Name") ||
|
||||
!event.headStack.getTagCompound().getCompoundTag("display").getString("Name").toLowerCase().equals("banana"))
|
||||
return;
|
||||
event.name = '\u2400' + "Bonæna"; // the \u2400 is a non-printable unicode character so you can't just type it
|
||||
event.headStack = new ItemStack(TinkerTools.swordBlade, 1, TinkerTools.MaterialID.Bone);
|
||||
event.handleStack = new ItemStack(TinkerTools.toolRod, 1, TinkerTools.MaterialID.Bone);
|
||||
event.accessoryStack = new ItemStack(TinkerTools.wideGuard, 1, TinkerTools.MaterialID.Bone);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void boneanaBuilding(ToolCraftEvent.NormalTool event) {
|
||||
// is it a boneana?
|
||||
if("\u00A7f\u2400Bonæna".equals(event.toolTag.getCompoundTag("display").getString("Name")))
|
||||
{
|
||||
// set correct name
|
||||
event.toolTag.getCompoundTag("display").setString("Name", EnumChatFormatting.YELLOW + "Bonæna");
|
||||
// lore!
|
||||
NBTTagList lore = new NBTTagList();
|
||||
lore.appendTag(new NBTTagString(StatCollector.translateToLocal("tool.boneana.lore")));
|
||||
event.toolTag.getCompoundTag("display").setTag("Lore", lore);
|
||||
|
||||
// let's polish it up a bit!
|
||||
NBTTagCompound tag = event.toolTag.getCompoundTag("InfiTool");
|
||||
tag.setBoolean("Special", true);
|
||||
tag.setInteger("Attack", 4);
|
||||
tag.setInteger("TotalDurability", 600);
|
||||
tag.setInteger("BaseDurability", 600);
|
||||
tag.setFloat("Shoddy", -2.0f);
|
||||
tag.setInteger("MiningSpeed", 1);
|
||||
tag.setInteger("HarvestLevel", 0);
|
||||
|
||||
tag.setInteger("Modifiers", 0);
|
||||
|
||||
ItemStack weapon = new ItemStack(TinkerWeaponry.boneana);
|
||||
weapon.setTagCompound(event.toolTag);
|
||||
event.overrideResult(weapon);
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package tconstruct.weaponry.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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;
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
itemIcon = iconRegister.registerIcon(Reference.resource("broadsword/boneana"));
|
||||
brokenIcon = iconRegister.registerIcon(Reference.resource("broadsword/boneana_split"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int renderPass) {
|
||||
if(!stack.hasTagCompound() || !stack.getTagCompound().hasKey("InfiTool"))
|
||||
return emptyIcon;
|
||||
|
||||
if(stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken"))
|
||||
return brokenIcon;
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedToolName() {
|
||||
return "Bonæna";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item id, CreativeTabs tab, List list) {
|
||||
// you are not welcome here >:C
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user