diff options
| author | Lance5057 <Lance5057@gmail.com> | 2017-06-30 00:31:52 -0500 |
|---|---|---|
| committer | Lance5057 <Lance5057@gmail.com> | 2017-06-30 00:31:52 -0500 |
| commit | 18e5d45b4d530cc60e59d78cc436877a152b567c (patch) | |
| tree | 7c81ead0d846063f6f66599854b4078ca6932358 /src | |
| parent | c757aeb7db1ff0c08ae7f3277ccb2620d5b55600 (diff) | |
Added new metal fluids.
Added special interaction for:
Vile Fluid - Changes various mobs to alternative forms.
Vibrant Fluid - Grows grass on dirt blocks.
Diffstat (limited to 'src')
178 files changed, 2559 insertions, 1188 deletions
diff --git a/src/main/java/lance5057/tDefense/TD_Commands.java b/src/main/java/lance5057/tDefense/TD_Commands.java index e97f303..4e89780 100644 --- a/src/main/java/lance5057/tDefense/TD_Commands.java +++ b/src/main/java/lance5057/tDefense/TD_Commands.java @@ -3,11 +3,14 @@ package lance5057.tDefense; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; + import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentString; import net.minecraft.world.World; @@ -121,11 +124,11 @@ public class TD_Commands extends CommandBase implements ICommand // return true; // } // -// @Override -// public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) -// { -// return commands; -// } + @Override + public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) + { + return commands; + } @Override public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) diff --git a/src/main/java/lance5057/tDefense/TinkersDefense.java b/src/main/java/lance5057/tDefense/TinkersDefense.java index b57de06..c7fc37b 100644 --- a/src/main/java/lance5057/tDefense/TinkersDefense.java +++ b/src/main/java/lance5057/tDefense/TinkersDefense.java @@ -3,10 +3,10 @@ package lance5057.tDefense; import java.util.Iterator; import java.util.List; -import lance5057.tDefense.armor.ArmorBase; import lance5057.tDefense.baubles.BaublesBase; import lance5057.tDefense.core.CoreBase; import lance5057.tDefense.core.materials.TDMaterials; +import lance5057.tDefense.core.parts.TDParts; import lance5057.tDefense.core.tools.TDTools; import lance5057.tDefense.holiday.HolidayBase; import lance5057.tDefense.proxy.CommonProxy; @@ -33,6 +33,7 @@ public class TinkersDefense { public static final int GUI_CREST_INV = modGuiIndex++; //public static final int GUI_ANVIL_INV = modGuiIndex++; //public static final int GUI_GUIDEBOOK = modGuiIndex++; + public static final int GUI_STRAPS_INV = modGuiIndex++; @Instance(Reference.MOD_ID) public static TinkersDefense instance = new TinkersDefense(); @@ -42,7 +43,7 @@ public class TinkersDefense { HolidayBase holiday; ModuleBase core; ModuleBase baubles; - ModuleBase armor; + //ModuleBase armor; // public static TDEventHandler TDevents; @@ -54,7 +55,7 @@ public class TinkersDefense { public static Modifiers mods; // public static Item item_Guidebook; - + TDParts parts; TDTools tools; TDMaterials mats; @@ -121,12 +122,15 @@ public class TinkersDefense { @EventHandler public void preInit(FMLPreInitializationEvent e) { + NetworkRegistry.INSTANCE.registerGuiHandler(TinkersDefense.instance, new CommonProxy()); + core = new CoreBase(); holiday = new HolidayBase(); baubles = new BaublesBase(); - armor = new ArmorBase(); + //armor = new ArmorBase(); mats = new TDMaterials(); + parts = new TDParts(); tools = new TDTools(); config = new TD_Config(e); // mods = new Modifiers(); @@ -325,9 +329,10 @@ public class TinkersDefense { // proxy.registerRenderers(); core.preInit(e); - armor.preInit(e); + //armor.preInit(e); holiday.preInit(e); mats.registerMaterials(); + parts.preInit(e); tools.preInit(e); baubles.preInit(e); proxy.preInit(); @@ -345,9 +350,10 @@ public class TinkersDefense { } core.init(e); - armor.init(e); + //armor.init(e); holiday.init(e); mats.setupMaterials(e); + parts.init(e); tools.init(e); baubles.init(e); proxy.init(); @@ -362,7 +368,8 @@ public class TinkersDefense { // { // ArmorAddon.postInit(e); // } - armor.postInit(e); + parts.postInit(e); + //armor.postInit(e); tools.postInit(e); } diff --git a/src/main/java/lance5057/tDefense/armor/ArmorBase.java b/src/main/java/lance5057/tDefense/armor/ArmorBase.java index f89a96a..2066f59 100644 --- a/src/main/java/lance5057/tDefense/armor/ArmorBase.java +++ b/src/main/java/lance5057/tDefense/armor/ArmorBase.java @@ -1,298 +1,206 @@ -package lance5057.tDefense.armor; - -import java.util.List; -import java.util.Locale; - -import com.google.common.collect.Lists; -import org.apache.commons.lang3.tuple.Pair; - -import lance5057.tDefense.Reference; -import lance5057.tDefense.armor.items.cloth.TinkersHood; -import lance5057.tDefense.armor.materials.MaterialArmor; -import lance5057.tDefense.armor.materials.MaterialCloth; -import lance5057.tDefense.core.materials.ShieldMaterialStats; -import lance5057.tDefense.util.Color16Util; -import lance5057.tDefense.util.ModuleBase; -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.registry.GameRegistry; -import slimeknights.tconstruct.library.TinkerRegistry; -import slimeknights.tconstruct.library.materials.Material; -import slimeknights.tconstruct.library.modifiers.IModifier; -import slimeknights.tconstruct.library.tinkering.PartMaterialType; -import slimeknights.tconstruct.library.tools.IPattern; -import slimeknights.tconstruct.library.tools.Pattern; -import slimeknights.tconstruct.library.tools.ToolCore; -import slimeknights.tconstruct.library.tools.ToolPart; -import slimeknights.tconstruct.tools.TinkerMaterials; -import slimeknights.tconstruct.tools.TinkerTools; - -public class ArmorBase extends ModuleBase { - public static CreativeTabs tabName; - - private static List<Item> tools = Lists.newLinkedList(); - private static List<ToolPart> toolParts = Lists.newLinkedList(); - private static List<IModifier> modifiers = Lists.newLinkedList(); - private static List<Pair<Item, ToolPart>> toolPartPatterns = Lists.newLinkedList(); - - public static ToolPart armorPlate; - public static ToolPart chainmail; - public static ToolPart cloth; - public static ToolPart rivets; - public static ToolPart clasp; - - public static Material black; - public static Material red; - public static Material green; - public static Material brown; - public static Material blue; - public static Material purple; - public static Material cyan; - public static Material lightgray; - public static Material gray; - public static Material pink; - public static Material lime; - public static Material yellow; - public static Material lightblue; - public static Material magenta; - public static Material orange; - public static Material white; - - public static ArmorCore armor_TinkerHood; - public static ToolCore armor_TinkerShawl; - public static ToolCore armor_TinkerRobe; - public static ToolCore armor_TinkerShoes; - - public static ToolCore armor_TinkerCoif; - public static ToolCore armor_TinkerHauberk; - public static ToolCore armor_TinkerChausses; - public static ToolCore armor_TinkerBoots; - - public static ToolCore armor_TinkerHelm; - public static ToolCore armor_TinkerBreastplate; - public static ToolCore armor_TinkerGrieves; - public static ToolCore armor_TinkerSabatons; - - public static Block block_Unstable; - public static Block block_GlowCrumbs; - - // private static Material mat(String name, int color) { - // Material mat = new Material(name, color); - // materials.add(mat); - // return mat; - // } - - @Override - public void preInit(FMLPreInitializationEvent e) { - armorPlate = registerToolPart(new ToolPart(Material.VALUE_Ingot * 4), "armor_plate"); - chainmail = registerToolPart(new ToolPart(Material.VALUE_Ingot * 3), "chainmail"); - cloth = registerToolPart(new ToolPart(Material.VALUE_Ingot * 3), "cloth"); - rivets = registerToolPart(new ToolPart(Material.VALUE_Ingot * 1), "rivets"); - clasp = registerToolPart(new ToolPart(Material.VALUE_Ingot * 1), "clasp"); - - registerMaterials(); - registerClothMaterials(); - - for (Pair<Item, ToolPart> toolPartPattern : toolPartPatterns) { - registerStencil(toolPartPattern.getLeft(), toolPartPattern.getRight()); - } - - //regTool(armor_TinkerHood, "tinkerhood"); - registerTools(); - } - - @Override - public void init(FMLInitializationEvent e) { - regToolBuilding(); - } - - @Override - public void postInit(FMLPostInitializationEvent e) { - // TODO Auto-generated method stub - - } - - private void regTool(ToolCore tool, String name) { - tool.setRegistryName(new ResourceLocation("tinkersdefense:" + name)); - TinkerRegistry.registerTool(tool); - GameRegistry.register(tool); - } - - private void registerMaterials() { - Material.UNKNOWN.addStats(new MaterialArmor(35, 1F)); - - TinkerRegistry.addMaterialStats(TinkerMaterials.wood, new MaterialArmor(35, 0.5f)); - // TinkerMaterials.wood.addTrait(axelover, SHIELD); - - TinkerRegistry.addMaterialStats(TinkerMaterials.stone, new MaterialArmor(120, 0.6F)); - // TinkerRegistry.addMaterialTrait(TinkerMaterials.stone, dulling, - // SHIELD); - // TinkerMaterials.stone.addTrait(dulling, SHIELD); - - TinkerRegistry.addMaterialStats(TinkerMaterials.flint, new MaterialArmor(150, 0.5F)); - // TinkerRegistry.addMaterialTrait(TinkerMaterials.flint, firestarter, - // SHIELD); - - TinkerRegistry.addMaterialStats(TinkerMaterials.cactus, new MaterialArmor(210, 0.3F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.bone, new MaterialArmor(200, 0.75F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.obsidian, new MaterialArmor(139, 0.6F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.prismarine, new MaterialArmor(430, 0.6F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.endstone, new MaterialArmor(420, 0.8F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.paper, new MaterialArmor(12, 0.1F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.sponge, new MaterialArmor(550, 0.2F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.firewood, new MaterialArmor(550, 1F)); - - // Slime - TinkerRegistry.addMaterialStats(TinkerMaterials.slime, new MaterialArmor(1000, 0.9F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.blueslime, new MaterialArmor(780, 0.9F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.knightslime, new MaterialArmor(850, 1.1F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.magmaslime, new MaterialArmor(600, 0.9F)); - - // Nether - TinkerRegistry.addMaterialStats(TinkerMaterials.netherrack, new MaterialArmor(270, 0.5F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.cobalt, new MaterialArmor(780, 1.4F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.ardite, new MaterialArmor(990, 1.3F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.manyullyn, new MaterialArmor(820, 1.5F)); - - // Metals - TinkerRegistry.addMaterialStats(TinkerMaterials.iron, new MaterialArmor(204, 1F)); - TinkerRegistry.addMaterialStats(TinkerMaterials.pigiron, new MaterialArmor(380, 1.1F)); - - // Mod Integration - TinkerRegistry.addMaterialStats(TinkerMaterials.copper, new MaterialArmor(210, 0.9F)); - - TinkerRegistry.addMaterialStats(TinkerMaterials.bronze, new MaterialArmor(430, 1F)); - - TinkerRegistry.addMaterialStats(TinkerMaterials.lead, new MaterialArmor(334, 1F)); - - TinkerRegistry.addMaterialStats(TinkerMaterials.silver, new MaterialArmor(250, 0.8F)); - - TinkerRegistry.addMaterialStats(TinkerMaterials.electrum, new MaterialArmor(50, 0.8F)); - - TinkerRegistry.addMaterialStats(TinkerMaterials.steel, new MaterialArmor(540, 1.3F)); - } - - private void registerClothMaterials() { - black = new Material("blackCloth", 0xDDDDDD); - red = new Material("redCloth", 0xDB7D3E); - green = new Material("greeCloth", 0xB350BC); - brown = new Material("brownCloth", 0x6B8AC9); - blue = new Material("blueCloth", 0xB1A627); - purple = new Material("purpleCloth", 0x41AE38); - cyan = new Material("cyanCloth", 0xD08499); - lightgray = new Material("lightgrayCloth", 0x404040); - gray = new Material("grayCloth", 0x9AA1A1); - pink = new Material("pinkCloth", 0x2E6E89); - lime = new Material("limeCloth", 0x7E3DB5); - yellow = new Material("yellowCloth", 0x2E388D); - lightblue = new Material("lightblueCloth", 0x4F321F); - magenta = new Material("magentaCloth", 0x35461B); - orange = new Material("orangeCloth", 0x963430); - white = new Material("whiteCloth", 0x191616); - - Material.UNKNOWN.addStats(new MaterialCloth(100)); - - TinkerRegistry.addMaterial(black); - TinkerRegistry.addMaterial(red); - TinkerRegistry.addMaterial(green); - TinkerRegistry.addMaterial(brown); - TinkerRegistry.addMaterial(blue); - TinkerRegistry.addMaterial(purple); - TinkerRegistry.addMaterial(cyan); - TinkerRegistry.addMaterial(lightgray); - TinkerRegistry.addMaterial(gray); - TinkerRegistry.addMaterial(pink); - TinkerRegistry.addMaterial(lime); - TinkerRegistry.addMaterial(yellow); - TinkerRegistry.addMaterial(lightblue); - TinkerRegistry.addMaterial(magenta); - TinkerRegistry.addMaterial(orange); - TinkerRegistry.addMaterial(white); - - TinkerRegistry.addMaterialStats(black, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(red, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(green, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(brown, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(blue, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(purple, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(cyan, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(lightgray, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(gray, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(pink, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(lime, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(yellow, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(lightblue, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(magenta, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(orange, new MaterialCloth(100)); - TinkerRegistry.addMaterialStats(white, new MaterialCloth(100)); - } - - private void registerTools() - { - armor_TinkerHood = new TinkersHood(); - regTool(armor_TinkerHood, "tinkerhood"); - //TinkerRegistry.registerToolCrafting(armor_TinkerHood); - } - - private void regToolBuilding() { - TinkerRegistry.registerToolCrafting(armor_TinkerHood); - } - - private static <T extends Item> T registerTool(T item, String name) { - tools.add(item); - return registerItem(item, name); - } - - private static ToolPart registerToolPart(ToolPart part, String name) { - return registerToolPart(part, name, TinkerTools.pattern); - } - - private static <T extends Item & IPattern> ToolPart registerToolPart(ToolPart part, String name, T pattern) { - ToolPart ret = registerItem(part, name); - - if (pattern != null) { - toolPartPatterns.add(Pair.of(pattern, ret)); - } - - toolParts.add(ret); - - return ret; - } - - private static void registerStencil(Item pattern, ToolPart toolPart) { - for (ToolCore toolCore : TinkerRegistry.getTools()) { - for (PartMaterialType partMaterialType : toolCore.getRequiredComponents()) { - if (partMaterialType.getPossibleParts().contains(toolPart)) { - ItemStack stencil = new ItemStack(pattern); - Pattern.setTagForPart(stencil, toolPart); - TinkerRegistry.registerStencilTableCrafting(stencil); - return; - } - } - } - } - - private static <T extends Item> T registerItem(T item, String name) { - if (!name.equals(name.toLowerCase(Locale.US))) { - throw new IllegalArgumentException( - String.format("Unlocalized names need to be all lowercase! Item: %s", name)); - } - - item.setUnlocalizedName(name); - item.setRegistryName(new ResourceLocation(Reference.MOD_ID, name)); - GameRegistry.register(item); - return item; - } - - private static <T extends IModifier> T registerModifier(T modifier) { - TinkerRegistry.registerModifier(modifier); - modifiers.add(modifier); - return modifier; - } -} +//package lance5057.tDefense.armor; +// +//import java.util.List; +//import java.util.Locale; +// +//import com.google.common.collect.Lists; +//import org.apache.commons.lang3.tuple.Pair; +// +//import lance5057.tDefense.Reference; +//import lance5057.tDefense.armor.items.cloth.TinkersHood; +//import lance5057.tDefense.armor.materials.MaterialArmor; +//import lance5057.tDefense.armor.materials.MaterialCloth; +//import lance5057.tDefense.core.materials.ShieldMaterialStats; +//import lance5057.tDefense.util.Color16Util; +//import lance5057.tDefense.util.ModuleBase; +//import net.minecraft.block.Block; +//import net.minecraft.creativetab.CreativeTabs; +//import net.minecraft.item.Item; +//import net.minecraft.item.ItemStack; +//import net.minecraft.util.ResourceLocation; +//import net.minecraftforge.fml.common.event.FMLInitializationEvent; +//import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +//import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +//import net.minecraftforge.fml.common.registry.GameRegistry; +//import slimeknights.tconstruct.library.TinkerRegistry; +//import slimeknights.tconstruct.library.materials.Material; +//import slimeknights.tconstruct.library.modifiers.IModifier; +//import slimeknights.tconstruct.library.tinkering.PartMaterialType; +//import slimeknights.tconstruct.library.tools.IPattern; +//import slimeknights.tconstruct.library.tools.Pattern; +//import slimeknights.tconstruct.library.tools.ToolCore; +//import slimeknights.tconstruct.library.tools.ToolPart; +//import slimeknights.tconstruct.tools.TinkerMaterials; +//import slimeknights.tconstruct.tools.TinkerTools; +// +//public class ArmorBase extends ModuleBase +//{ +// public static CreativeTabs tabName; +// +// private static List<Item> tools = Lists.newLinkedList(); +// private static List<ToolPart> toolParts = Lists.newLinkedList(); +// private static List<IModifier> modifiers = Lists.newLinkedList(); +// private static List<Pair<Item, ToolPart>> toolPartPatterns = Lists.newLinkedList(); +// +// +// +// public static Block block_Unstable; +// public static Block block_GlowCrumbs; +// +// // private static Material mat(String name, int color) { +// // Material mat = new Material(name, color); +// // materials.add(mat); +// // return mat; +// // } +// +// @Override +// public void preInit(FMLPreInitializationEvent e) { +// +// +// registerMaterials(); +// +// +// for (Pair<Item, ToolPart> toolPartPattern : toolPartPatterns) { +// registerStencil(toolPartPattern.getLeft(), toolPartPattern.getRight()); +// } +// +// //regTool(armor_TinkerHood, "tinkerhood"); +// registerTools(); +// } +// +// @Override +// public void init(FMLInitializationEvent e) { +// regToolBuilding(); +// } +// +// @Override +// public void postInit(FMLPostInitializationEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// private void regTool(ToolCore tool, String name) { +// tool.setRegistryName(new ResourceLocation("tinkersdefense:" + name)); +// TinkerRegistry.registerTool(tool); +// GameRegistry.register(tool); +// } +// +// private void registerMaterials() { +// Material.UNKNOWN.addStats(new MaterialArmor(35, 1F)); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.wood, new MaterialArmor(35, 0.5f)); +// // TinkerMaterials.wood.addTrait(axelover, SHIELD); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.stone, new MaterialArmor(120, 0.6F)); +// // TinkerRegistry.addMaterialTrait(TinkerMaterials.stone, dulling, +// // SHIELD); +// // TinkerMaterials.stone.addTrait(dulling, SHIELD); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.flint, new MaterialArmor(150, 0.5F)); +// // TinkerRegistry.addMaterialTrait(TinkerMaterials.flint, firestarter, +// // SHIELD); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.cactus, new MaterialArmor(210, 0.3F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.bone, new MaterialArmor(200, 0.75F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.obsidian, new MaterialArmor(139, 0.6F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.prismarine, new MaterialArmor(430, 0.6F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.endstone, new MaterialArmor(420, 0.8F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.paper, new MaterialArmor(12, 0.1F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.sponge, new MaterialArmor(550, 0.2F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.firewood, new MaterialArmor(550, 1F)); +// +// // Slime +// TinkerRegistry.addMaterialStats(TinkerMaterials.slime, new MaterialArmor(1000, 0.9F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.blueslime, new MaterialArmor(780, 0.9F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.knightslime, new MaterialArmor(850, 1.1F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.magmaslime, new MaterialArmor(600, 0.9F)); +// +// // Nether +// TinkerRegistry.addMaterialStats(TinkerMaterials.netherrack, new MaterialArmor(270, 0.5F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.cobalt, new MaterialArmor(780, 1.4F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.ardite, new MaterialArmor(990, 1.3F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.manyullyn, new MaterialArmor(820, 1.5F)); +// +// // Metals +// TinkerRegistry.addMaterialStats(TinkerMaterials.iron, new MaterialArmor(204, 1F)); +// TinkerRegistry.addMaterialStats(TinkerMaterials.pigiron, new MaterialArmor(380, 1.1F)); +// +// // Mod Integration +// TinkerRegistry.addMaterialStats(TinkerMaterials.copper, new MaterialArmor(210, 0.9F)); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.bronze, new MaterialArmor(430, 1F)); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.lead, new MaterialArmor(334, 1F)); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.silver, new MaterialArmor(250, 0.8F)); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.electrum, new MaterialArmor(50, 0.8F)); +// +// TinkerRegistry.addMaterialStats(TinkerMaterials.steel, new MaterialArmor(540, 1.3F)); +// } +// +// +// +// private void registerTools() +// { +// armor_TinkerHood = new TinkersHood(); +// regTool(armor_TinkerHood, "tinkerhood"); +// //TinkerRegistry.registerToolCrafting(armor_TinkerHood); +// } +// +// private void regToolBuilding() { +// TinkerRegistry.registerToolCrafting(armor_TinkerHood); +// } +// +// private static <T extends Item> T registerTool(T item, String name) { +// tools.add(item); +// return registerItem(item, name); +// } +// +// private static ToolPart registerToolPart(ToolPart part, String name) { +// return registerToolPart(part, name, TinkerTools.pattern); +// } +// +// private static <T extends Item & IPattern> ToolPart registerToolPart(ToolPart part, String name, T pattern) { +// ToolPart ret = registerItem(part, name); +// +// if (pattern != null) { +// toolPartPatterns.add(Pair.of(pattern, ret)); +// } +// +// toolParts.add(ret); +// +// return ret; +// } +// +// private static void registerStencil(Item pattern, ToolPart toolPart) { +// for (ToolCore toolCore : TinkerRegistry.getTools()) { +// for (PartMaterialType partMaterialType : toolCore.getRequiredComponents()) { +// if (partMaterialType.getPossibleParts().contains(toolPart)) { +// ItemStack stencil = new ItemStack(pattern); +// Pattern.setTagForPart(stencil, toolPart); +// TinkerRegistry.registerStencilTableCrafting(stencil); +// return; +// } +// } +// } +// } +// +// private static <T extends Item> T registerItem(T item, String name) { +// if (!name.equals(name.toLowerCase(Locale.US))) { +// throw new IllegalArgumentException( +// String.format("Unlocalized names need to be all lowercase! Item: %s", name)); +// } +// +// item.setUnlocalizedName(name); +// item.setRegistryName(new ResourceLocation(Reference.MOD_ID, name)); +// GameRegistry.register(item); +// return item; +// } +// +// private static <T extends IModifier> T registerModifier(T modifier) { +// TinkerRegistry.registerModifier(modifier); +// modifiers.add(modifier); +// return modifier; +// } +//} diff --git a/src/main/java/lance5057/tDefense/armor/ArmorCore.java b/src/main/java/lance5057/tDefense/armor/ArmorCore.java index 6feb85b..0af81d8 100644 --- a/src/main/java/lance5057/tDefense/armor/ArmorCore.java +++ b/src/main/java/lance5057/tDefense/armor/ArmorCore.java @@ -63,13 +63,6 @@ public abstract class ArmorCore extends ToolCore { public float reductionPercent = 0f; public int maxReduction = 100; - - protected static PartMaterialType ArmorplateMat = new PartMaterialType(ArmorBase.armorPlate, MaterialArmor.TYPE); - protected static PartMaterialType ChainmailMat = new PartMaterialType(ArmorBase.chainmail, MaterialArmor.TYPE); - protected static PartMaterialType RivetMat = new PartMaterialType(ArmorBase.rivets, MaterialArmor.TYPE); - protected static PartMaterialType ClaspMat = new PartMaterialType(ArmorBase.clasp, MaterialArmor.TYPE); - - protected static PartMaterialType ClothMat = new PartMaterialType(ArmorBase.cloth, MaterialCloth.TYPE); public ArmorCore(PartMaterialType... rc) { super(rc); diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java index 5ae23e0..03f5202 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java @@ -1,16 +1,10 @@ package lance5057.tDefense.armor.items.cloth; -import java.util.List; - import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.core.parts.TDParts; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import slimeknights.tconstruct.library.materials.Material; public class TinkersHood extends ArmorCore { @@ -19,9 +13,9 @@ public class TinkersHood extends ArmorCore public TinkersHood() { - super(ClothMat, - ClothMat, - RivetMat); + super(TDParts.ClothMat, + TDParts.ClothMat, + TDParts.RivetMat); setUnlocalizedName("tinkerhood"); } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java index c0c0df4..905e415 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java @@ -1,148 +1,42 @@ -//package lance5057.tDefense.armor.items.cloth; -// -//import lance5057.tDefense.TinkersDefense; -//import lance5057.tDefense.armor.ArmorCore; -//import lance5057.tDefense.armor.renderers.ArmorRenderer; -//import lance5057.tDefense.proxy.ClientProxy; -//import net.minecraft.entity.Entity; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import thaumcraft.api.IVisDiscountGear; -//import thaumcraft.api.aspects.Aspect; -//import vazkii.botania.api.mana.IManaDiscountArmor; -//import cpw.mods.fml.common.Optional; -// -//@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) -//public class TinkersRobe extends ArmorCore implements IVisDiscountGear, IManaDiscountArmor -//{ -// public TinkersRobe() -// { -// super(0, 2); -// setUnlocalizedName("tinkerrobe"); -// } -// -// @Override -// public Item getHeadItem() -// { -// return TinkersDefense.partCloth; -// } -// -// @Override -// public Item getHandleItem() -// { -// return TinkersDefense.partClasp; -// } -// -// @Override -// public Item getAccessoryItem() -// { -// return TinkersDefense.partCloth; -// } -// -// @Override -// public int durabilityTypeAccessory() -// { -// return 1; -// } -// -// @Override -// public float getRepairCost() -// { -// return 1.0f; -// } -// -// @Override -// public float getDurabilityModifier() -// { -// return 1f; -// } -// -// @Override -// public float getDamageModifier() -// { -// return 1f; -// } -// -// @Override -// public int getPartAmount() -// { -// return 3; -// } -// -// @Override -// public String getIconSuffix(int partType) -// { -// switch(partType) -// { -// case 0: -// return "_robe_cloth"; -// case 1: -// return "_robe_cloth_broken"; -// case 2: -// return "_robe_metal"; -// case 3: -// return "_robe_trim"; -// default: -// return ""; -// } -// } -// -// @Override -// public String getEffectSuffix() -// { -// return "_robe_effect"; -// } -// -// @Override -// public String getDefaultFolder() -// { -// return "armor/robe"; -// } -// -// // @Override -// // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// // boolean par5) { -// // super.onUpdate(stack, world, entity, par4, par5); -// // -// // } -// -// @Override -// public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) -// { -// return "tinkersdefense:textures/armor/TinkersRobe.png"; -// } -// -// @Override -// public String[] getTraits() -// { -// return new String[] {"armor", "pants", "robe", "cloth"}; -// } -// -// @Override -// public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) -// { -// return 0; -// } -// -// @Override -// @Optional.Method(modid = "Thaumcraft") -// public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) -// { -// final int vis = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); -// return vis; -// } -// -// @Override -// public ArmorRenderer getRenderer() -// { -// return ClientProxy.robe; -// } -// -// @Override -// public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) -// { -// final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; -// return i; -// } -//} +package lance5057.tDefense.armor.items.cloth; + +import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.core.parts.TDParts; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class TinkersRobe extends ArmorCore +{ + int induceDamage = 0; + + + public TinkersRobe() + { + super(TDParts.ClothMat, + TDParts.ClothMat, + TDParts.ClaspMat); + setUnlocalizedName("tinkerrobe"); + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) + { + super.onUpdate(stack, world, entity, par4, par5); + + } + + @Override + public float damagePotential() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double attackSpeed() { + // TODO Auto-generated method stub + return 0; + } + + +} diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java index bb913a2..47bbd7c 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java @@ -1,150 +1,42 @@ -//package lance5057.tDefense.armor.items.cloth; -// -//import lance5057.tDefense.TinkersDefense; -//import lance5057.tDefense.armor.ArmorCore; -//import lance5057.tDefense.armor.renderers.ArmorRenderer; -//import lance5057.tDefense.proxy.ClientProxy; -//import net.minecraft.entity.Entity; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import thaumcraft.api.IVisDiscountGear; -//import thaumcraft.api.aspects.Aspect; -//import vazkii.botania.api.mana.IManaDiscountArmor; -//import cpw.mods.fml.common.Optional; -// -//@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) -//public class TinkersShawl extends ArmorCore implements IVisDiscountGear, IManaDiscountArmor -//{ -// public TinkersShawl() -// { -// super(0, 1); -// setUnlocalizedName("tinkersshawl"); -// } -// -// @Override -// public Item getHeadItem() -// { -// return TinkersDefense.partCloth; -// } -// -// @Override -// public Item getHandleItem() -// { -// return TinkersDefense.partArmorplate; -// } -// -// @Override -// public Item getAccessoryItem() -// { -// return TinkersDefense.partCloth; -// -// } -// -// @Override -// public int durabilityTypeAccessory() -// { -// return 1; -// } -// -// @Override -// public float getRepairCost() -// { -// return 1f; -// } -// -// @Override -// public float getDurabilityModifier() -// { -// return 1f; -// } -// -// @Override -// public float getDamageModifier() -// { -// return 1f; -// } -// -// @Override -// public int getPartAmount() -// { -// return 3; -// } -// -// @Override -// public String getIconSuffix(int partType) -// { -// switch(partType) -// { -// case 0: -// return "_shawl_cloth"; -// case 1: -// return "_shawl_cloth_broken"; -// case 2: -// return "_shawl_metal"; -// case 3: -// return "_shawl_trim"; -// default: -// return ""; -// } -// } -// -// @Override -// public String getEffectSuffix() -// { -// return "_shawl_effect"; -// } -// -// @Override -// public String getDefaultFolder() -// { -// return "armor/shawl"; -// } -// -// // @Override -// // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// // boolean par5) { -// // super.onUpdate(stack, world, entity, par4, par5); -// // -// // } -// -// @Override -// public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) -// { -// return "tinkersdefense:textures/armor/TinkersShawl.png"; -// } -// -// @Override -// public String[] getTraits() -// { -// return new String[] {"armor", "chest", "shawl", "cloth"}; -// } -// -// @Override -// public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) -// { -// return 0; -// } -// -// @Override -// @Optional.Method(modid = "Thaumcraft") -// public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) -// { -// final int test = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); -// return test; -// } -// -// @Override -// public ArmorRenderer getRenderer() -// { -// // TODO Auto-generated method stub -// return ClientProxy.shawl; -// } -// -// @Override -// public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) -// { -// final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; -// return i; -// } -//} +package lance5057.tDefense.armor.items.cloth; + +import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.core.parts.TDParts; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class TinkersShawl extends ArmorCore +{ + int induceDamage = 0; + + + public TinkersShawl() + { + super(TDParts.ClothMat, + TDParts.ClothMat, + TDParts.ArmorplateMat); + setUnlocalizedName("tinkershawl"); + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) + { + super.onUpdate(stack, world, entity, par4, par5); + + } + + @Override + public float damagePotential() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double attackSpeed() { + // TODO Auto-generated method stub + return 0; + } + + +} diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java index 742af0e..b0ff8e5 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java @@ -1,147 +1,42 @@ -//package lance5057.tDefense.armor.items.cloth; -// -//import lance5057.tDefense.TinkersDefense; -//import lance5057.tDefense.armor.ArmorCore; -//import lance5057.tDefense.armor.renderers.ArmorRenderer; -//import lance5057.tDefense.proxy.ClientProxy; -//import net.minecraft.entity.Entity; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import thaumcraft.api.IVisDiscountGear; -//import thaumcraft.api.aspects.Aspect; -//import vazkii.botania.api.mana.IManaDiscountArmor; -//import cpw.mods.fml.common.Optional; -// -//@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) -//public class TinkersShoes extends ArmorCore implements IVisDiscountGear, IManaDiscountArmor -//{ -// public TinkersShoes() -// { -// super(0, 3); -// setUnlocalizedName("tinkersshoes"); -// } -// -// @Override -// public Item getHeadItem() -// { -// return TinkersDefense.partCloth; -// } -// -// @Override -// public Item getHandleItem() -// { -// return TinkersDefense.partRivet; -// } -// -// @Override -// public Item getAccessoryItem() -// { -// return TinkersDefense.partCloth; -// } -// -// @Override -// public int durabilityTypeAccessory() -// { -// return 1; -// } -// -// @Override -// public float getRepairCost() -// { -// return 1.0f; -// } -// -// @Override -// public float getDurabilityModifier() -// { -// return 1f; -// } -// -// @Override -// public float getDamageModifier() -// { -// return 1f; -// } -// -// @Override -// public int getPartAmount() -// { -// return 3; -// } -// -// @Override -// public String getIconSuffix(int partType) -// { -// switch(partType) -// { -// case 0: -// return "_shoes_cloth"; -// case 1: -// return "_shoes_cloth_broken"; -// case 2: -// return "_shoes_metal"; -// case 3: -// return "_shoes_sole"; -// default: -// return ""; -// } -// } -// -// @Override -// public String getEffectSuffix() -// { -// return "_shoes_effect"; -// } -// -// @Override -// public String getDefaultFolder() -// { -// return "armor/shoes"; -// } -// -// // @Override -// // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// // boolean par5) { -// // super.onUpdate(stack, world, entity, par4, par5); -// // -// // } -// -// @Override -// public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) -// { -// return "tinkersdefense:textures/armor/TinkersShoes.png"; -// } -// -// @Override -// public String[] getTraits() -// { -// return new String[] {"armor", "feet", "shoes", "cloth"}; -// } -// -// @Override -// public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) -// { -// return 0; -// } -// -// @Override -// @Optional.Method(modid = "Thaumcraft") -// public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) -// { -// return stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); -// } -// -// @Override -// public ArmorRenderer getRenderer() -// { -// return ClientProxy.shoes; -// } -// -// @Override -// public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) -// { -// final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; -// return i; -// } -//} +package lance5057.tDefense.armor.items.cloth; + +import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.core.parts.TDParts; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class TinkersShoes extends ArmorCore +{ + int induceDamage = 0; + + + public TinkersShoes() + { + super(TDParts.ClothMat, + TDParts.ArmorplateMat, + TDParts.ClaspMat); + setUnlocalizedName("tinkershoes"); + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) + { + super.onUpdate(stack, world, entity, par4, par5); + + } + + @Override + public float damagePotential() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double attackSpeed() { + // TODO Auto-generated method stub + return 0; + } + + +} diff --git a/src/main/java/lance5057/tDefense/armor/items/straps/ItemStraps.java b/src/main/java/lance5057/tDefense/armor/items/straps/ItemStraps.java new file mode 100644 index 0000000..84f7d69 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/items/straps/ItemStraps.java @@ -0,0 +1,44 @@ +package lance5057.tDefense.armor.items.straps; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.CoreBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.world.World; + +public class ItemStraps extends ItemArmor +{ + public ItemStraps() + { + super(ArmorMaterial.LEATHER, 0, EntityEquipmentSlot.HEAD); + // ItemStacks that store an NBT Tag Compound are limited to stack size of 1 + setMaxStackSize(1); + // you'll want to set a creative tab as well, so you can get your item + setCreativeTab(CoreBase.tab); + } + + // Without this method, your inventory will NOT work!!! + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 1; // return any value greater than zero + } + + @Override + public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) + { + if (!world.isRemote) + { + // If player not sneaking, open the inventory gui + if (!player.isSneaking()) { + player.openGui(TinkersDefense.instance, TinkersDefense.GUI_STRAPS_INV, world, 0, 0, 0); + } + } + + return new ActionResult(EnumActionResult.PASS, itemStack); + } +}
\ No newline at end of file diff --git a/src/main/java/lance5057/tDefense/armor/items/straps/ItemStrapsInv.java b/src/main/java/lance5057/tDefense/armor/items/straps/ItemStrapsInv.java new file mode 100644 index 0000000..fc71353 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/items/straps/ItemStrapsInv.java @@ -0,0 +1,206 @@ +package lance5057.tDefense.armor.items.straps; + +import lance5057.tDefense.armor.ArmorCore; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentString; +import net.minecraftforge.common.ISpecialArmor.ArmorProperties; + +public class ItemStrapsInv implements IInventory { + + private final ItemStack invItem; + public static final int INVSIZE = 1; + private final String name = "ArmorHolder"; + + private ItemStack[] inventory = new ItemStack[INVSIZE]; + + public ItemStrapsInv(ItemStack stack) { + invItem = stack; + + if (!stack.hasTagCompound()) { + stack.setTagCompound(new NBTTagCompound()); + } + + readFromNBT(stack.getTagCompound()); + } + + /** + * A custom method to read our inventory from an ItemStack's NBT compound + */ + public void readFromNBT(NBTTagCompound compound) { + // Gets the custom taglist we wrote to this compound, if any + // 1.7.2+ change to compound.getTagList("ItemInventory", + // Constants.NBT.TAG_COMPOUND); + NBTTagList items = compound.getTagList("ItemInventory", 9); + + for (int i = 0; i < items.tagCount(); ++i) { + // 1.7.2+ change to items.getCompoundTagAt(i) + NBTTagCompound item = (NBTTagCompound) items.getCompoundTagAt(i); + int slot = item.getInteger("Slot"); + + // Just double-checking that the saved slot index is within our + // inventory array bounds + if (slot >= 0 && slot < getSizeInventory()) { + inventory[slot] = ItemStack.loadItemStackFromNBT(item); + } + } + } + + /** + * A custom method to write our inventory to an ItemStack's NBT compound + */ + public void writeToNBT(NBTTagCompound tagcompound) { + // Create a new NBT Tag List to store itemstacks as NBT Tags + NBTTagList items = new NBTTagList(); + + for (int i = 0; i < getSizeInventory(); ++i) { + // Only write stacks that contain items + if (getStackInSlot(i) != null) { + // Make a new NBT Tag Compound to write the itemstack and slot + // index to + NBTTagCompound item = new NBTTagCompound(); + item.setInteger("Slot", i); + // Writes the itemstack in slot(i) to the Tag Compound we just + // made + getStackInSlot(i).writeToNBT(item); + + // add the tag compound to our tag list + items.appendTag(item); + } + } + // Add the TagList to the ItemStack's Tag Compound with the name + // "ItemInventory" + tagcompound.setTag("ItemInventory", items); + } + + @Override + public String getName() { + return name; + } + + @Override + public boolean hasCustomName() { + return true; + } + + @Override + public ITextComponent getDisplayName() { + return new TextComponentString(name); + } + + @Override + public int getSizeInventory() { + // TODO Auto-generated method stub + return INVSIZE; + } + + @Override + public ItemStack getStackInSlot(int index) { + return inventory[index]; + } + + @Override + public ItemStack decrStackSize(int index, int count) { + ItemStack stack = getStackInSlot(index); + if (stack != null) { + if (stack.stackSize > count) { + stack = stack.splitStack(count); + // Don't forget this line or your inventory will not be saved! + markDirty(); + } else { + // this method also calls onInventoryChanged, so we don't need + // to call it again + setInventorySlotContents(index, null); + } + } + return stack; + } + + @Override + public ItemStack removeStackFromSlot(int index) { + ItemStack stack = getStackInSlot(index); + setInventorySlotContents(index, null); + return stack; + } + + @Override + public void setInventorySlotContents(int index, ItemStack stack) { + inventory[index] = stack; + + if (stack != null && stack.stackSize > getInventoryStackLimit()) { + stack.stackSize = getInventoryStackLimit(); + } + + // Don't forget this line or your inventory will not be saved! + markDirty(); + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public void markDirty() { + for (int i = 0; i < getSizeInventory(); ++i) { + if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) { + inventory[i] = null; + } + } + + // This line here does the work: + writeToNBT(invItem.getTagCompound()); + } + + @Override + public boolean isUsableByPlayer(EntityPlayer player) { + return true; + } + + @Override + public void openInventory(EntityPlayer player) { + + } + + @Override + public void closeInventory(EntityPlayer player) { + + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) { + return (stack.getItem() instanceof ArmorCore); + } + + @Override + public int getField(int id) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setField(int id, int value) { + // TODO Auto-generated method stub + + } + + @Override + public int getFieldCount() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void clear() { + // TODO Auto-generated method stub + + } +} diff --git a/src/main/java/lance5057/tDefense/armor/items/straps/StrapsContainer.java b/src/main/java/lance5057/tDefense/armor/items/straps/StrapsContainer.java new file mode 100644 index 0000000..7d5b408 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/items/straps/StrapsContainer.java @@ -0,0 +1,206 @@ +package lance5057.tDefense.armor.items.straps; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; + +public class StrapsContainer extends Container +{ + /** The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer */ + public final ItemStrapsInv inventory; + + /** Using these will make transferStackInSlot easier to understand and implement + * INV_START is the index of the first slot in the Player's Inventory, so our + * InventoryItem's number of slots (e.g. 5 slots is array indices 0-4, so start at 5) + * Notice how we don't have to remember how many slots we made? We can just use + * InventoryItem.INV_SIZE and if we ever change it, the Container updates automatically. */ + private static final int INV_START = ItemStrapsInv.INVSIZE, INV_END = INV_START+26, + HOTBAR_START = INV_END+1, HOTBAR_END = HOTBAR_START+8; + + // If you're planning to add armor slots, put those first like this: + // ARMOR_START = InventoryItem.INV_SIZE, ARMOR_END = ARMOR_START+3, + // INV_START = ARMOR_END+1, and then carry on like above. + + public StrapsContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, ItemStrapsInv inventoryItem) + { + this.inventory = inventoryItem; + + int i; + + // ITEM INVENTORY - you'll need to adjust the slot locations to match your texture file + // I have them set vertically in columns of 4 to the right of the player model + for (i = 0; i < ItemStrapsInv.INVSIZE; ++i) + { + // You can make a custom Slot if you need different behavior, + // such as only certain item types can be put into this slot + // We made a custom slot to prevent our inventory-storing item + // from being stored within itself, but if you want to allow that and + // you followed my advice at the end of the above step, then you + // could get away with using the vanilla Slot class + this.addSlotToContainer(new Slot(this.inventory, i, 80 + (18 * (int)(i/4)), 8 + (18*(i%4)))); + } + + // If you want, you can add ARMOR SLOTS here as well, but you need to + // make a public version of SlotArmor. I won't be doing that in this tutorial. + /* + for (i = 0; i < 4; ++i) + { + // These are the standard positions for survival inventory layout + this.addSlotToContainer(new SlotArmor(this.player, inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18, i)); + } + */ + + // PLAYER INVENTORY - uses default locations for standard inventory texture file + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + // PLAYER ACTION BAR - uses default locations for standard action bar texture file + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) + { + // be sure to return the inventory's isUseableByPlayer method + // if you defined special behavior there: + return inventory.isUsableByPlayer(entityplayer); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + // If item is in our custom Inventory or armor slot + if (index < INV_START) + { + // try to place in player inventory / action bar + if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END+1, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + // Item is in inventory / hotbar, try to place in custom inventory or armor slots + else + { + /* + If your inventory only stores certain instances of Items, + you can implement shift-clicking to your inventory like this: + + // Check that the item is the right type + if (itemstack1.getItem() instanceof ItemCustom) + { + // Try to merge into your custom inventory slots + // We use 'InventoryItem.INV_SIZE' instead of INV_START just in case + // you also add armor or other custom slots + if (!this.mergeItemStack(itemstack1, 0, InventoryItem.INV_SIZE, false)) + { + return null; + } + } + // If you added armor slots, check them here as well: + // Item being shift-clicked is armor - try to put in armor slot + if (itemstack1.getItem() instanceof ItemArmor) + { + int type = ((ItemArmor) itemstack1.getItem()).armorType; + if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1, false)) + { + return null; + } + } + Otherwise, you have basically 2 choices: + 1. shift-clicking between player inventory and custom inventory + 2. shift-clicking between action bar and inventory + + Be sure to choose only ONE of the following implementations!!! + */ + /** + * Implementation number 1: Shift-click into your custom inventory + */ + if (index >= INV_START) + { + // place in custom inventory + if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) + { + return null; + } + } + + /** + * Implementation number 2: Shift-click items between action bar and inventory + */ + // item is in player's inventory, but not in action bar + if (index >= INV_START && index < HOTBAR_START) + { + // place in action bar + if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END+1, false)) + { + return null; + } + } + // item in action bar - place in player inventory + else if (index >= HOTBAR_START && index < HOTBAR_END+1) + { + if (!this.mergeItemStack(itemstack1, INV_START, INV_END+1, false)) + { + return null; + } + } + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(par1EntityPlayer, itemstack1); + } + + return itemstack; + } + + /** + * You should override this method to prevent the player from moving the stack that + * opened the inventory, otherwise if the player moves it, the inventory will not + * be able to save properly + */ + @Override + public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) { + // this will prevent the player from interacting with the item that opened the inventory: + if (slotId >= 0 && getSlot(slotId) != null && (getSlot(slotId).getStack() == player.getHeldItem(EnumHand.MAIN_HAND) || getSlot(slotId).getStack() == player.getHeldItem(EnumHand.OFF_HAND))) { + return null; + } + return super.slotClick(slotId, dragType, clickTypeIn, player); + } +}
\ No newline at end of file diff --git a/src/main/java/lance5057/tDefense/armor/items/straps/StrapsGui.java b/src/main/java/lance5057/tDefense/armor/items/straps/StrapsGui.java new file mode 100644 index 0000000..acd6868 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/items/straps/StrapsGui.java @@ -0,0 +1,111 @@ +package lance5057.tDefense.armor.items.straps; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.translation.I18n; + +public class StrapsGui extends GuiContainer +{ + /** x and y size of the inventory window in pixels. Defined as float, passed as int + * These are used for drawing the player model. */ + private float xSize_lo; + private float ySize_lo; + + /** ResourceLocation takes 2 parameters: ModId, path to texture at the location: + * "src/minecraft/assets/modid/" + * + * I have provided a sample texture file that works with this tutorial. Download it + * from Forge_Tutorials/textures/gui/ + */ + private static final ResourceLocation iconLocation = new ResourceLocation("inventoryitemmod", "textures/gui/inventoryitem.png"); + + /** The inventory to render on screen */ + private final ItemStrapsInv inventory; + + public StrapsGui(StrapsContainer containerItem) + { + super(containerItem); + this.inventory = containerItem.inventory; + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int par1, int par2, float par3) + { + super.drawScreen(par1, par2, par3); + this.xSize_lo = (float)par1; + this.ySize_lo = (float)par2; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int par1, int par2) + { +// String s = this.inventory.isInvNameLocalized() ? this.inventory.getName() : I18n.getString(this.inventory.getName()); +// this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 0, 4210752); +// this.fontRendererObj.drawString(I18n.getString("container.inventory"), 26, this.ySize - 96 + 4, 4210752); + } + + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(iconLocation); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + int i1; + //drawPlayerModel(k + 51, l + 75, 30, (float)(k + 51) - this.xSize_lo, (float)(l + 75 - 50) - this.ySize_lo, this.mc.player); + } + +// /** +// * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can +// * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code) +// */ +// public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) { +// GL11.glEnable(GL11.GL_COLOR_MATERIAL); +// GL11.glPushMatrix(); +// GL11.glTranslatef(x, y, 50.0F); +// GL11.glScalef(-scale, scale, scale); +// GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); +// float f2 = entity.renderYawOffset; +// float f3 = entity.rotationYaw; +// float f4 = entity.rotationPitch; +// float f5 = entity.prevRotationYawHead; +// float f6 = entity.rotationYawHead; +// GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); +// RenderHelper.enableStandardItemLighting(); +// GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); +// GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F); +// entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F; +// entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F; +// entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F; +// entity.rotationYawHead = entity.rotationYaw; +// entity.prevRotationYawHead = entity.rotationYaw; +// GL11.glTranslated(0.0F, entity.getYOffset(), 0.0F); +// RenderManager.instance.playerViewY = 180.0F; +// RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); +// entity.renderYawOffset = f2; +// entity.rotationYaw = f3; +// entity.rotationPitch = f4; +// entity.prevRotationYawHead = f5; +// entity.rotationYawHead = f6; +// GL11.glPopMatrix(); +// RenderHelper.disableStandardItemLighting(); +// GL11.glDisable(GL12.GL_RESCALE_NORMAL); +// OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); +// GL11.glDisable(GL11.GL_TEXTURE_2D); +// OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); +// } +}
\ No newline at end of file diff --git a/src/main/java/lance5057/tDefense/core/CoreBlocks.java b/src/main/java/lance5057/tDefense/core/CoreBlocks.java index 58d4ed0..62a3139 100644 --- a/src/main/java/lance5057/tDefense/core/CoreBlocks.java +++ b/src/main/java/lance5057/tDefense/core/CoreBlocks.java @@ -1,68 +1,75 @@ package lance5057.tDefense.core; +import lance5057.tDefense.Reference; +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.blocks.TDMetalBlock; +import lance5057.tDefense.core.blocks.TDMetalItemBlock; import lance5057.tDefense.core.blocks.crestMount.CrestMount; import lance5057.tDefense.util.BlocksBase; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Items; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; -public class CoreBlocks extends BlocksBase -{ +public class CoreBlocks extends BlocksBase { + public static TDMetalBlock metalBlocks; + public static TDMetalItemBlock metalItemBlock; - public static Block aeonsteelBlock; - public static Block dogbeariumBlock; - public static Block queensgoldBlock; - public static Block greencandyBlock; - public static Block redcandyBlock; - - public static ItemBlock aeonsteelItemBlock; - public static ItemBlock dogbeariumItemBlock; - public static ItemBlock queensgoldItemBlock; - public static ItemBlock greencandyItemBlock; - public static ItemBlock redcandyItemBlock; - public static CrestMount crestMount; - + @Override public void preInit(FMLPreInitializationEvent e) { - aeonsteelBlock = register("aeonsteelblock", CoreBase.tab, 5); - dogbeariumBlock = register("dogbeariumblock", CoreBase.tab, 5); - queensgoldBlock = register("queensgoldblock", CoreBase.tab, 5); - greencandyBlock = register("greencandyblock", CoreBase.tab, 5); - redcandyBlock = register("redcandyblock", CoreBase.tab, 5); + // aeonsteelBlock = register("aeonsteelblock", CoreBase.tab, 5); + // dogbeariumBlock = register("dogbeariumblock", CoreBase.tab, 5); + // queensgoldBlock = register("queensgoldblock", CoreBase.tab, 5); + // greencandyBlock = register("greencandyblock", CoreBase.tab, 5); + // redcandyBlock = register("redcandyblock", CoreBase.tab, 5); crestMount = new CrestMount(); crestMount.setCreativeTab(CoreBase.tab); + + metalBlocks = (TDMetalBlock) (new TDMetalBlock().setUnlocalizedName("metalblock")); + metalBlocks.setRegistryName("metalblock"); + GameRegistry.register(metalBlocks); + + // We also need to create and register an ItemBlock for this block + // otherwise it won't appear in the inventory + metalItemBlock = new TDMetalItemBlock(metalBlocks); + metalItemBlock.setRegistryName(metalBlocks.getRegistryName()); + GameRegistry.register(metalItemBlock); + - aeonsteelItemBlock = register("aeonsteelblock", 64, CoreBase.tab, aeonsteelBlock); - dogbeariumItemBlock = register("dogbeariumblock", 64, CoreBase.tab, dogbeariumBlock); - queensgoldItemBlock = register("queensgoldblock", 64, CoreBase.tab, queensgoldBlock); - greencandyItemBlock = register("greencandyblock", 64, CoreBase.tab, greencandyBlock); - redcandyItemBlock = register("redcandyblock", 64, CoreBase.tab, redcandyBlock); - -// GameRegistry.register(aeonsteelBlock); -// GameRegistry.register(dogbeariumBlock); -// GameRegistry.register(queensgoldBlock); -// GameRegistry.register(greencandyBlock); -// GameRegistry.register(redcandyBlock); + + // aeonsteelItemBlock = register("aeonsteelblock", 64, CoreBase.tab, + // aeonsteelBlock); + // dogbeariumItemBlock = register("dogbeariumblock", 64, CoreBase.tab, + // dogbeariumBlock); + // queensgoldItemBlock = register("queensgoldblock", 64, CoreBase.tab, + // queensgoldBlock); + // greencandyItemBlock = register("greencandyblock", 64, CoreBase.tab, + // greencandyBlock); + // redcandyItemBlock = register("redcandyblock", 64, CoreBase.tab, + // redcandyBlock); + // + // GameRegistry.register(aeonsteelBlock); + // GameRegistry.register(dogbeariumBlock); + // GameRegistry.register(queensgoldBlock); + // GameRegistry.register(greencandyBlock); + // GameRegistry.register(redcandyBlock); } @Override public void init(FMLInitializationEvent e) { // TODO Auto-generated method stub - + TinkersDefense.proxy.registerItemBlockRenderer(metalBlocks, 0, "aeonsteel"); + TinkersDefense.proxy.registerItemBlockRenderer(metalBlocks, 1, "queensgold"); + TinkersDefense.proxy.registerItemBlockRenderer(metalBlocks, 2, "dogbearium"); } @Override public void postInit(FMLPostInitializationEvent e) { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/lance5057/tDefense/core/CoreItems.java b/src/main/java/lance5057/tDefense/core/CoreItems.java index 85da32d..aa5dede 100644 --- a/src/main/java/lance5057/tDefense/core/CoreItems.java +++ b/src/main/java/lance5057/tDefense/core/CoreItems.java @@ -1,12 +1,13 @@ package lance5057.tDefense.core; +import lance5057.tDefense.Reference; +import lance5057.tDefense.armor.items.straps.ItemStraps; import lance5057.tDefense.util.ItemsBase; -import net.minecraft.init.Items; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; public class CoreItems extends ItemsBase { @@ -16,6 +17,8 @@ public class CoreItems extends ItemsBase public static Item item_queensgoldIngot; public static Item item_dogbeariumIngot; + public static Item item_straps; + public CoreItems() { @@ -32,6 +35,9 @@ public class CoreItems extends ItemsBase item_aeonsteelIngot = register("aeonsteelingot", 64, CoreBase.tab); item_queensgoldIngot = register("queensgoldingot", 64, CoreBase.tab); item_dogbeariumIngot = register("dogbeariumingot", 64, CoreBase.tab); + + item_straps = new ItemStraps().setMaxStackSize(1).setUnlocalizedName("straps").setRegistryName(Reference.MOD_ID, "straps"); + GameRegistry.register(item_straps); } @Override diff --git a/src/main/java/lance5057/tDefense/core/blocks/TDMetalBlock.java b/src/main/java/lance5057/tDefense/core/blocks/TDMetalBlock.java new file mode 100644 index 0000000..07ad86b --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/blocks/TDMetalBlock.java @@ -0,0 +1,112 @@ +package lance5057.tDefense.core.blocks; + +import java.util.List; + +import lance5057.tDefense.core.CoreBase; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class TDMetalBlock extends Block { + public static final PropertyEnum METAL = PropertyEnum.create("metal", TDMetalBlock.EnumMetal.class); + + public TDMetalBlock() { + super(Material.IRON); + this.setCreativeTab(CoreBase.tab); + this.setHardness(5); + this.setResistance(30); + this.setDefaultState(this.blockState.getBaseState().withProperty(METAL, EnumMetal.AEONSTEEL)); + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { METAL }); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + EnumMetal colour = EnumMetal.byMetadata(meta); + return this.getDefaultState().withProperty(METAL, colour); + } + + @Override + public int getMetaFromState(IBlockState state) { + EnumMetal type = (EnumMetal) state.getValue(METAL); + return type.getID(); + } + + @Override + public int damageDropped(IBlockState state) { + return getMetaFromState(state); + } + + @Override + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { + EnumMetal[] all = EnumMetal.values(); + for (EnumMetal block : all) { + list.add(new ItemStack(itemIn, 1, block.getID())); + } + } + + public enum EnumMetal implements IStringSerializable { + AEONSTEEL(0, "aeonsteel"), + QUEENSGOLD(1, "queensgold"), + DOGBEARIUM(2, "dogbearium"), + REDCANDY(3, "redcandy"), + GREENCANDY(4, "greencandy"), + SINISTERIUM(5, "sinisterium"), + NIHILITE(6, "nihilite"), + ORICHALCUM(7, "orichalcum"), + PANDORIUM(8, "pandorium"), + ROSEGOLD(9, "rosegold"), + PLATINUM(10, "platinum"), + BRASS(11, "brass"), + SILVER(12, "silver"), + CHEESE(13, "cheese"); + + private int ID; + private String name; + + private EnumMetal(int ID, String name) { + this.ID = ID; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + public int getID() { + return ID; + } + + @Override + public String toString() { + return getName(); + } + + public static EnumMetal byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + private static final EnumMetal[] META_LOOKUP = new EnumMetal[values().length]; + + static { + for (EnumMetal colour : values()) { + META_LOOKUP[colour.getID()] = colour; + } + } + } +} diff --git a/src/main/java/lance5057/tDefense/core/blocks/TDMetalItemBlock.java b/src/main/java/lance5057/tDefense/core/blocks/TDMetalItemBlock.java new file mode 100644 index 0000000..3ed79b8 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/blocks/TDMetalItemBlock.java @@ -0,0 +1,28 @@ +package lance5057.tDefense.core.blocks; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class TDMetalItemBlock extends ItemBlock { + public TDMetalItemBlock(Block block) + { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int metadata) + { + return metadata; + } + + // create a unique unlocalised name for each colour, so that we can give each one a unique name + @Override + public String getUnlocalizedName(ItemStack stack) + { + TDMetalBlock.EnumMetal metal = TDMetalBlock.EnumMetal.byMetadata(stack.getMetadata()); + return super.getUnlocalizedName() + "." + metal.toString(); + } +} diff --git a/src/main/java/lance5057/tDefense/core/blocks/fluid/TDFluid.java b/src/main/java/lance5057/tDefense/core/blocks/fluid/TDFluid.java new file mode 100644 index 0000000..966756d --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/blocks/fluid/TDFluid.java @@ -0,0 +1,29 @@ +package lance5057.tDefense.core.blocks.fluid; + +import lance5057.tDefense.Reference; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import slimeknights.tconstruct.library.fluid.FluidMolten; + +public class TDFluid extends FluidMolten +{ + + public TDFluid(String fluidName, int color, int temp, int lumen, int visk, int dense) { + super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation("tconstruct:blocks/fluids/molten_metal_flow")); + this.setUnlocalizedName(Reference.MOD_ID + "." + fluidName); + this.setTemperature(temp); + this.setLuminosity(lumen); + this.setViscosity(visk); + this.setDensity(dense); + } + + public TDFluid(String fluidName, int color, int temp, int lumen, int visk, int dense, ResourceLocation source, ResourceLocation flow) { + super(fluidName, color, source, flow); + this.setUnlocalizedName(Reference.MOD_ID + "." + fluidName); + this.setTemperature(temp); + this.setLuminosity(lumen); + this.setViscosity(visk); + this.setDensity(dense); + } +} diff --git a/src/main/java/lance5057/tDefense/core/blocks/fluid/VibrantFluid.java b/src/main/java/lance5057/tDefense/core/blocks/fluid/VibrantFluid.java new file mode 100644 index 0000000..051651a --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/blocks/fluid/VibrantFluid.java @@ -0,0 +1,46 @@ +package lance5057.tDefense.core.blocks.fluid; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidClassic; +import net.minecraftforge.fluids.Fluid; + +public class VibrantFluid extends BlockFluidClassic { + + public VibrantFluid(Fluid fluid) { + super(fluid, Material.WATER); + // TODO Auto-generated constructor stub + } + + @Override + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { + super.onBlockAdded(worldIn, pos, state); + dirtToGrass(state, worldIn, pos); + } + + @Override + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { + super.neighborChanged(state, worldIn, pos, blockIn); + dirtToGrass(state, worldIn, pos); + } + + private void dirtToGrass(IBlockState state, World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == Blocks.DIRT) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() != this.getBlockState().getBlock()) + { + worldIn.setBlockState(pos.offset(enumfacing), Blocks.GRASS.getDefaultState()); + break; + } + } +} + } +} diff --git a/src/main/java/lance5057/tDefense/core/blocks/fluid/VileFluid.java b/src/main/java/lance5057/tDefense/core/blocks/fluid/VileFluid.java new file mode 100644 index 0000000..6de4129 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/blocks/fluid/VileFluid.java @@ -0,0 +1,46 @@ +package lance5057.tDefense.core.blocks.fluid; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.SkeletonType; +import net.minecraft.entity.monster.ZombieType; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.HorseType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidClassic; +import net.minecraftforge.fluids.Fluid; + +public class VileFluid extends BlockFluidClassic { + public VileFluid(Fluid fluid) { + super(fluid, Material.WATER); + // TODO Auto-generated constructor stub + } + + @Override + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { + if (entity instanceof EntitySkeleton) { + ((EntitySkeleton) entity).setSkeletonType(SkeletonType.WITHER); + } + if (entity instanceof EntityZombie) { + ((EntityZombie) entity).setZombieType(ZombieType.HUSK); + } + if (entity instanceof EntityHorse) { + if (world.rand.nextInt(2) == 0 && !(((EntityHorse) entity).getType() != HorseType.SKELETON || ((EntityHorse) entity).getType() != HorseType.ZOMBIE)) + ((EntityHorse) entity).setType(HorseType.SKELETON); + else + ((EntityHorse) entity).setType(HorseType.ZOMBIE); + } + if (entity instanceof EntityPig) { + EntityPigZombie pig = new EntityPigZombie(world); + pig.setPosition(entity.posX, entity.posY, entity.posZ); + world.spawnEntity(pig); + entity.setDead(); + } + } +} diff --git a/src/main/java/lance5057/tDefense/core/materials/FluidColor.java b/src/main/java/lance5057/tDefense/core/materials/FluidColor.java deleted file mode 100644 index 0ade854..0000000 --- a/src/main/java/lance5057/tDefense/core/materials/FluidColor.java +++ /dev/null @@ -1,20 +0,0 @@ -package lance5057.tDefense.core.materials; - -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.Fluid; - -public class FluidColor extends Fluid -{ - - int color; - public FluidColor(String fluidName, ResourceLocation still, ResourceLocation flowing, int color) { - super(fluidName, still, flowing); - this.color = color; - } - - @Override - public int getColor() - { - return color; - } -} diff --git a/src/main/java/lance5057/tDefense/core/materials/TDMaterials.java b/src/main/java/lance5057/tDefense/core/materials/TDMaterials.java index a92a2c3..9873631 100644 --- a/src/main/java/lance5057/tDefense/core/materials/TDMaterials.java +++ b/src/main/java/lance5057/tDefense/core/materials/TDMaterials.java @@ -9,19 +9,20 @@ import com.google.common.collect.Lists; import com.google.common.eventbus.Subscribe; import lance5057.tDefense.Reference; -import lance5057.tDefense.core.CoreBase; +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.materials.MaterialCloth; +import lance5057.tDefense.core.blocks.fluid.TDFluid; +import lance5057.tDefense.core.blocks.fluid.VibrantFluid; +import lance5057.tDefense.core.blocks.fluid.VileFluid; import lance5057.tDefense.core.materials.traits.TraitAxeLover; import lance5057.tDefense.core.materials.traits.TraitDulling; import lance5057.tDefense.core.materials.traits.TraitFirestarter; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.BlockFluidClassic; -import net.minecraftforge.fluids.Fluid; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.registry.GameRegistry; import slimeknights.tconstruct.library.TinkerRegistry; import slimeknights.tconstruct.library.materials.ExtraMaterialStats; @@ -31,6 +32,7 @@ import slimeknights.tconstruct.library.materials.Material; //import slimeknights.tconstruct.library.materials.Material; import slimeknights.tconstruct.library.materials.MaterialTypes; import slimeknights.tconstruct.library.traits.AbstractTrait; +import slimeknights.tconstruct.smeltery.block.BlockMolten; import slimeknights.tconstruct.tools.TinkerMaterials; public class TDMaterials { @@ -42,8 +44,42 @@ public class TDMaterials { public static final Material aeonsteel = mat("aeonsteel", 0xd200d1); public static final Material queensgold = mat("queensgold", 0xdede00); public static final Material dogbearium = mat("dogbearium", 0x604933); + + public static Material black; + public static Material red; + public static Material green; + public static Material brown; + public static Material blue; + public static Material purple; + public static Material cyan; + public static Material lightgray; + public static Material gray; + public static Material pink; + public static Material lime; + public static Material yellow; + public static Material lightblue; + public static Material magenta; + public static Material orange; + public static Material white; - public static FluidColor fluid_aeonsteel; + public static TDFluid fluidAeonsteel = new TDFluid("aeonsteel_fluid", 0xd200d1, 1300, 15, 3000, 6000); + public static TDFluid fluidQueensGold = new TDFluid("queensgold_fluid", 0xdcff00, 1300, 15, 3000, 6000); + public static TDFluid fluidDogbearium = new TDFluid("dogbearium_fluid", 0x6d3300, 1300, 15, 3000, 6000); + public static TDFluid fluidRedCandy = new TDFluid("redcandy_fluid", 0xff0000, 1300, 15, 3000, 6000); + public static TDFluid fluidGreenCandy = new TDFluid("greencandy_fluid", 0x00ff00, 1300, 15, 3000, 6000); + public static TDFluid fluidVile = new TDFluid("vile_fluid", 0x111111, 1300, 0, 6000, 600); + public static TDFluid fluidSinisterium = new TDFluid("sinisterium_fluid", 0x210000, 1300, 0, 3000, 600); + public static TDFluid fluidNihilite = new TDFluid("nihilite_fluid", 0x000021, 1300, 0, 3000, 600); + public static TDFluid fluidVibrant = new TDFluid("vibrant_fluid", 0x76ff00, 1300, 15, 6000, 6000); + public static TDFluid fluidOrichalcum = new TDFluid("orichalcum_fluid", 0xffc700, 1300, 15, 3000, 6000); + public static TDFluid fluidPandorium = new TDFluid("pandorium_fluid", 0x7f6a00, 1300, 15, 3000, 6000); + public static TDFluid fluidChorusJuice = new TDFluid("chorusjuice_fluid", 0xd982ff, 0, 0, 3000, 6000); + public static TDFluid fluidDragonsBreath = new TDFluid("dragonsbreath_fluid", 0x7f00b7, 0, 8, 3000, 6000); + public static TDFluid fluidRoseGold = new TDFluid("rosegold_fluid", 0xff9b84, 1300, 15, 3000, 6000); + public static TDFluid fluidPlatinum = new TDFluid("platinum_fluid", 0xe8e8e8, 1300, 15, 3000, 6000); + public static TDFluid fluidBrass = new TDFluid("brass_fluid", 0xdbb332, 1300, 15, 3000, 6000); + public static TDFluid fluidSilver = new TDFluid("silver_fluid", 0x9e9e9e, 1300, 15, 3000, 6000); + public static TDFluid fluidCheese = new TDFluid("cheese_fluid", 0xffe731, 750, 0, 6000, 6000); public static final AbstractTrait axelover = new TraitAxeLover(); public static final AbstractTrait dulling = new TraitDulling(); @@ -54,100 +90,99 @@ public class TDMaterials { materials.add(mat); return mat; } - - public void registerMaterials() - { - addMat("aeonsteel", fluid_aeonsteel, 0xd200d1); + + public void registerMaterials() { + + addMat("aeonsteel", fluidAeonsteel); + addMat("queensgold", fluidQueensGold); + addMat("dogbearium", fluidDogbearium); + addMat("redcandy", fluidRedCandy); + addMat("greencandy", fluidGreenCandy); + + addMat("sinisterium", fluidSinisterium); + addMat("nihilite", fluidNihilite); + + addMat("orichalcum", fluidOrichalcum); + addMat("pandorium", fluidPandorium); + addMat("chorusjuice", fluidChorusJuice); + addMat("dragonsbreath", fluidDragonsBreath); + addMat("rosegold", fluidRoseGold); + addMat("platinum", fluidPlatinum); + addMat("brass", fluidBrass); + addMat("silver", fluidSilver); + addMat("cheese", fluidCheese); + + FluidRegistry.registerFluid(fluidVibrant); + FluidRegistry.addBucketForFluid(fluidVibrant); + addMat("vibrantfluid", fluidVibrant, new VibrantFluid(fluidVibrant)); + + FluidRegistry.registerFluid(fluidVile); + FluidRegistry.addBucketForFluid(fluidVile); + addMat("vilefluid", fluidVile, new VileFluid(fluidVile)); + + registerClothMaterials(); } @Subscribe public void setupMaterials(FMLInitializationEvent event) { Material.UNKNOWN.addStats(new ShieldMaterialStats(35, 33)); - -// TinkerRegistry.addMaterialStats(Material.UNKNOWN, -// new ShieldMaterialStats(35, 33)); - + + // TinkerRegistry.addMaterialStats(Material.UNKNOWN, + // new ShieldMaterialStats(35, 33)); + // TinkerRegistry.addMaterialStats(Material.UNKNOWN, // new ShieldMaterialStats(35, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.wood, - new ShieldMaterialStats(35, 33)); - TinkerMaterials.wood.addTrait(axelover, SHIELD); + TinkerRegistry.addMaterialStats(TinkerMaterials.wood, new ShieldMaterialStats(35, 33)); + TinkerMaterials.wood.addTrait(axelover, SHIELD); - TinkerRegistry.addMaterialStats(TinkerMaterials.stone, - new ShieldMaterialStats(120, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.stone, new ShieldMaterialStats(120, 33)); // TinkerRegistry.addMaterialTrait(TinkerMaterials.stone, dulling, // SHIELD); TinkerMaterials.stone.addTrait(dulling, SHIELD); - TinkerRegistry.addMaterialStats(TinkerMaterials.flint, - new ShieldMaterialStats(150, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.flint, new ShieldMaterialStats(150, 33)); TinkerRegistry.addMaterialTrait(TinkerMaterials.flint, firestarter, SHIELD); - - TinkerRegistry.addMaterialStats(TinkerMaterials.cactus, - new ShieldMaterialStats(210, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.bone, - new ShieldMaterialStats(200, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.obsidian, - new ShieldMaterialStats(139, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.prismarine, - new ShieldMaterialStats(430, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.endstone, - new ShieldMaterialStats(420, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.paper, - new ShieldMaterialStats(12, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.sponge, - new ShieldMaterialStats(550, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.firewood, - new ShieldMaterialStats(550, 33)); + + TinkerRegistry.addMaterialStats(TinkerMaterials.cactus, new ShieldMaterialStats(210, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.bone, new ShieldMaterialStats(200, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.obsidian, new ShieldMaterialStats(139, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.prismarine, new ShieldMaterialStats(430, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.endstone, new ShieldMaterialStats(420, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.paper, new ShieldMaterialStats(12, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.sponge, new ShieldMaterialStats(550, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.firewood, new ShieldMaterialStats(550, 33)); // Slime - TinkerRegistry.addMaterialStats(TinkerMaterials.slime, - new ShieldMaterialStats(1000, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.blueslime, - new ShieldMaterialStats(780, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.knightslime, - new ShieldMaterialStats(850, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.magmaslime, - new ShieldMaterialStats(600, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.slime, new ShieldMaterialStats(1000, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.blueslime, new ShieldMaterialStats(780, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.knightslime, new ShieldMaterialStats(850, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.magmaslime, new ShieldMaterialStats(600, 33)); // Nether - TinkerRegistry.addMaterialStats(TinkerMaterials.netherrack, - new ShieldMaterialStats(270, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.cobalt, - new ShieldMaterialStats(780, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.ardite, - new ShieldMaterialStats(990, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.manyullyn, - new ShieldMaterialStats(820, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.netherrack, new ShieldMaterialStats(270, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.cobalt, new ShieldMaterialStats(780, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.ardite, new ShieldMaterialStats(990, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.manyullyn, new ShieldMaterialStats(820, 33)); // Metals - TinkerRegistry.addMaterialStats(TinkerMaterials.iron, - new ShieldMaterialStats(204, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.pigiron, - new ShieldMaterialStats(380, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.iron, new ShieldMaterialStats(204, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.pigiron, new ShieldMaterialStats(380, 33)); // Mod Integration - TinkerRegistry.addMaterialStats(TinkerMaterials.copper, - new ShieldMaterialStats(210, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.copper, new ShieldMaterialStats(210, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.bronze, - new ShieldMaterialStats(430, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.bronze, new ShieldMaterialStats(430, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.lead, - new ShieldMaterialStats(334, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.lead, new ShieldMaterialStats(334, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.silver, - new ShieldMaterialStats(250, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.silver, new ShieldMaterialStats(250, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.electrum, - new ShieldMaterialStats(50, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.electrum, new ShieldMaterialStats(50, 33)); - TinkerRegistry.addMaterialStats(TinkerMaterials.steel, - new ShieldMaterialStats(540, 33)); + TinkerRegistry.addMaterialStats(TinkerMaterials.steel, new ShieldMaterialStats(540, 33)); - TinkerRegistry.addMaterialStats(aeonsteel, new HeadMaterialStats(1000, - 4.0f, 3.00f, COBALT), new HandleMaterialStats(1.10f, 200), - new ExtraMaterialStats(500)); + TinkerRegistry.addMaterialStats(aeonsteel, new HeadMaterialStats(1000, 4.0f, 3.00f, COBALT), + new HandleMaterialStats(1.10f, 200), new ExtraMaterialStats(500)); // iron.addItemIngot("ingotIron"); // iron.setRepresentativeItem(Items.field_151042_j); // iron.addTrait(magnetic2, HEAD); @@ -155,47 +190,131 @@ public class TDMaterials { // TinkerMaterials.stone.addTrait(TinkerMaterials.cheapskate, // ShieldMaterialStats.TYPE); - - //TAIGA TEST + + // TAIGA TEST Collection<Material> mats = TinkerRegistry.getAllMaterials(); for (Material i : mats) { - if(!i.hasStats(SHIELD)) - { - if(i.hasStats(MaterialTypes.HEAD)) - { - int dur = ((HeadMaterialStats)i.getStats(MaterialTypes.HEAD)).durability; + if (!i.hasStats(SHIELD)) { + if (i.hasStats(MaterialTypes.HEAD)) { + int dur = ((HeadMaterialStats) i.getStats(MaterialTypes.HEAD)).durability; i.addStats(new ShieldMaterialStats(dur, 33)); } } } } + + void addMat(String name, TDFluid fluid) { + FluidRegistry.registerFluid(fluid); + FluidRegistry.addBucketForFluid(fluid); + + BlockMolten block = new BlockMolten(fluid); + // Sets names + block.setUnlocalizedName("molten_" + fluid.getName()); + block.setRegistryName(Reference.MOD_ID, "molten_" + fluid.getName()); + // Registers the fluid in its block form and its corresponding item (block/fluid as item in inventory) + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); + // Registers the fluid's model but only on the client side + TinkersDefense.proxy.registerFluidModels(fluid); + } - void addMat(String name, FluidColor myFluid, int color) - { - // create fluid. - // You don't need to add textures for the fluid, just create a Fluid Class that overwrites getColor - // and pass the following as still and flowing ResourceLocation: - // still: "tconstruct:blocks/fluids/molten_metal" - // flowing: "tconstruct:blocks/fluids/molten_metal_flow" - myFluid = new FluidColor(name, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation("tconstruct:blocks/fluids/molten_metal_flow"), color); - //myFluid.setColor(color); - FluidRegistry.registerFluid(myFluid); // fluid has to be registered - FluidRegistry.addBucketForFluid(myFluid); // add a bucket for the fluid - - // add block for fluid (if desired) - ResourceLocation rc = new ResourceLocation(Reference.MOD_ID, "fluid_aeonsteel"); - Block fluidBlock = new BlockFluidClassic(myFluid, net.minecraft.block.material.Material.LAVA).setRegistryName(rc).setUnlocalizedName(rc.toString()).setCreativeTab(CoreBase.tab); - // <register block regularly> - GameRegistry.register(new ItemBlock(fluidBlock), fluidBlock.getRegistryName()); - - // create NBT for the IMC - NBTTagCompound tag = new NBTTagCompound(); - tag.setString("fluid", myFluid.getName()); // name of the fluid - tag.setString("ore", name); // ore-suffix: ingotFoo, blockFoo, oreFoo,... - tag.setBoolean("toolforge", true); // if set to true, blockFoo can be used to build a toolforge - //tag.setTag("alloy", alloysTagList); // you can also send an alloy with the registration (see below) - - // send the NBT to TCon - FMLInterModComms.sendMessage("tconstruct", "integrateSmeltery", tag); + void addMat(String name, TDFluid fluid, Block fluidBlock) { + + // Sets names + fluidBlock.setUnlocalizedName("molten_" + fluid.getName()); + fluidBlock.setRegistryName(Reference.MOD_ID, "molten_" + fluid.getName()); + // Registers the fluid in its block form and its corresponding item (block/fluid as item in inventory) + GameRegistry.register(fluidBlock); + GameRegistry.register(new ItemBlock(fluidBlock).setRegistryName(fluidBlock.getRegistryName())); + // Registers the fluid's model but only on the client side + TinkersDefense.proxy.registerFluidModels(fluid); + } + + private void registerClothMaterials() { + black = new Material("blackCloth", 0x191616); + red = new Material("redCloth", 0x963430); + green = new Material("greeCloth", 0x35461B); + brown = new Material("brownCloth", 0x4F321F); + blue = new Material("blueCloth", 0x2E388D); + purple = new Material("purpleCloth", 0x7E3DB5); + cyan = new Material("cyanCloth", 0x2E6E89); + lightgray = new Material("lightgrayCloth", 0x9AA1A1); + gray = new Material("grayCloth", 0x404040); + pink = new Material("pinkCloth", 0xD08499); + lime = new Material("limeCloth", 0x41AE38); + yellow = new Material("yellowCloth", 0xB1A627); + lightblue = new Material("lightblueCloth", 0x6B8AC9); + magenta = new Material("magentaCloth", 0xB350BC); + orange = new Material("orangeCloth", 0xDB7D3E); + white = new Material("whiteCloth", 0xDDDDDD); + + Material.UNKNOWN.addStats(new MaterialCloth(100)); + black.addItem(new ItemStack(Blocks.WOOL,15), 1, Material.VALUE_Ingot); + red.addItem(new ItemStack(Blocks.WOOL,14), 1, Material.VALUE_Ingot); + green.addItem(new ItemStack(Blocks.WOOL,13), 1, Material.VALUE_Ingot); + brown.addItem(new ItemStack(Blocks.WOOL,12), 1, Material.VALUE_Ingot); + blue.addItem(new ItemStack(Blocks.WOOL,11), 1, Material.VALUE_Ingot); + purple.addItem(new ItemStack(Blocks.WOOL,10), 1, Material.VALUE_Ingot); + cyan.addItem(new ItemStack(Blocks.WOOL,9), 1, Material.VALUE_Ingot); + lightgray.addItem(new ItemStack(Blocks.WOOL,8), 1, Material.VALUE_Ingot); + gray.addItem(new ItemStack(Blocks.WOOL,7), 1, Material.VALUE_Ingot); + pink.addItem(new ItemStack(Blocks.WOOL,6), 1, Material.VALUE_Ingot); + lime.addItem(new ItemStack(Blocks.WOOL,5), 1, Material.VALUE_Ingot); + yellow.addItem(new ItemStack(Blocks.WOOL,4), 1, Material.VALUE_Ingot); + lightblue.addItem(new ItemStack(Blocks.WOOL,3), 1, Material.VALUE_Ingot); + magenta.addItem(new ItemStack(Blocks.WOOL,2), 1, Material.VALUE_Ingot); + orange.addItem(new ItemStack(Blocks.WOOL,1), 1, Material.VALUE_Ingot); + white.addItem(new ItemStack(Blocks.WOOL,0), 1, Material.VALUE_Ingot); + + black.setRepresentativeItem(new ItemStack(Blocks.WOOL,15)); + red.setRepresentativeItem(new ItemStack(Blocks.WOOL,14)); + green.setRepresentativeItem(new ItemStack(Blocks.WOOL,13)); + brown.setRepresentativeItem(new ItemStack(Blocks.WOOL,12)); + blue.setRepresentativeItem(new ItemStack(Blocks.WOOL,11)); + purple.setRepresentativeItem(new ItemStack(Blocks.WOOL,10)); + cyan.setRepresentativeItem(new ItemStack(Blocks.WOOL,9)); + lightgray.setRepresentativeItem(new ItemStack(Blocks.WOOL,8)); + gray.setRepresentativeItem(new ItemStack(Blocks.WOOL,7)); + pink.setRepresentativeItem(new ItemStack(Blocks.WOOL,6)); + lime.setRepresentativeItem(new ItemStack(Blocks.WOOL,5)); + yellow.setRepresentativeItem(new ItemStack(Blocks.WOOL,4)); + lightblue.setRepresentativeItem(new ItemStack(Blocks.WOOL,3)); + magenta.setRepresentativeItem(new ItemStack(Blocks.WOOL,2)); + orange.setRepresentativeItem(new ItemStack(Blocks.WOOL,1)); + white.setRepresentativeItem(new ItemStack(Blocks.WOOL,0)); + + TinkerRegistry.addMaterial(black); + TinkerRegistry.addMaterial(red); + TinkerRegistry.addMaterial(green); + TinkerRegistry.addMaterial(brown); + TinkerRegistry.addMaterial(blue); + TinkerRegistry.addMaterial(purple); + TinkerRegistry.addMaterial(cyan); + TinkerRegistry.addMaterial(lightgray); + TinkerRegistry.addMaterial(gray); + TinkerRegistry.addMaterial(pink); + TinkerRegistry.addMaterial(lime); + TinkerRegistry.addMaterial(yellow); + TinkerRegistry.addMaterial(lightblue); + TinkerRegistry.addMaterial(magenta); + TinkerRegistry.addMaterial(orange); + TinkerRegistry.addMaterial(white); + + TinkerRegistry.addMaterialStats(black, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(red, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(green, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(brown, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(blue, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(purple, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(cyan, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(lightgray, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(gray, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(pink, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(lime, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(yellow, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(lightblue, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(magenta, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(orange, new MaterialCloth(100)); + TinkerRegistry.addMaterialStats(white, new MaterialCloth(100)); } } diff --git a/src/main/java/lance5057/tDefense/core/parts/TDParts.java b/src/main/java/lance5057/tDefense/core/parts/TDParts.java new file mode 100644 index 0000000..ade6805 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/parts/TDParts.java @@ -0,0 +1,87 @@ +package lance5057.tDefense.core.parts; + +import lance5057.tDefense.armor.materials.MaterialArmor; +import lance5057.tDefense.armor.materials.MaterialCloth; +import lance5057.tDefense.core.materials.ShieldMaterialStats; +import lance5057.tDefense.util.ModuleBase; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; +import slimeknights.tconstruct.library.TinkerRegistry; +import slimeknights.tconstruct.library.materials.Material; +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.tinkering.PartMaterialType; +import slimeknights.tconstruct.library.tools.Pattern; +import slimeknights.tconstruct.library.tools.ToolPart; +import slimeknights.tconstruct.tools.TinkerMaterials; +import slimeknights.tconstruct.tools.TinkerTools; + +public class TDParts extends ModuleBase +{ + public static PartMaterialType ShieldMat; + + public static PartMaterialType ArmorplateMat; + public static PartMaterialType ChainmailMat; + public static PartMaterialType RivetMat; + public static PartMaterialType ClaspMat; + public static PartMaterialType ClothMat; + + public static ToolPart armorPlate; + public static ToolPart chainmail; + public static ToolPart cloth; + public static ToolPart rivets; + public static ToolPart clasp; + + public static ToolPart ringShank; + public static ToolPart setting; + public static ToolPart wire; + public static ToolPart filigree; + + + @Override + public void preInit(FMLPreInitializationEvent e) { + armorPlate = regToolPart(Material.VALUE_Ingot * 4, "armor_plate"); + chainmail = regToolPart(Material.VALUE_Ingot * 3, "chainmail"); + cloth = regToolPart(Material.VALUE_Ingot * 3, "cloth"); + rivets = regToolPart(Material.VALUE_Ingot * 1, "rivets"); + clasp = regToolPart(Material.VALUE_Ingot * 1, "clasp"); + + ringShank = regToolPart(Material.VALUE_Ingot * 2, "ringShank"); + setting = regToolPart(Material.VALUE_Ingot * 1, "setting"); + wire = regToolPart(Material.VALUE_Ingot * 1, "wire"); + filigree = regToolPart(Material.VALUE_Ingot * 1, "filigree"); + + ShieldMat = new PartMaterialType(armorPlate, ShieldMaterialStats.TYPE); + ArmorplateMat = new PartMaterialType(armorPlate, MaterialArmor.TYPE); + ChainmailMat = new PartMaterialType(chainmail, MaterialArmor.TYPE); + RivetMat = new PartMaterialType(rivets, MaterialTypes.EXTRA); + ClaspMat = new PartMaterialType(clasp, MaterialTypes.EXTRA); + ClothMat = new PartMaterialType(cloth, MaterialCloth.TYPE); + } + + @Override + public void init(FMLInitializationEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void postInit(FMLPostInitializationEvent e) { + // TODO Auto-generated method stub + + } + + private ToolPart regToolPart(int castVolume, String name) + { + ToolPart part = new ToolPart(castVolume); + part.setUnlocalizedName(name).setRegistryName("tinkersdefense:"+name); + GameRegistry.register(part); + TinkerRegistry.registerStencilTableCrafting(Pattern.setTagForPart(new ItemStack(TinkerTools.pattern), part)); + + return part; + } + + +} diff --git a/src/main/java/lance5057/tDefense/core/tools/FishingRod.java b/src/main/java/lance5057/tDefense/core/tools/FishingRod.java new file mode 100644 index 0000000..3159b3c --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/FishingRod.java @@ -0,0 +1,45 @@ +package lance5057.tDefense.core.tools; + +import java.util.List; + +import lance5057.tDefense.core.parts.TDParts; +import net.minecraft.nbt.NBTTagCompound; +import slimeknights.tconstruct.library.materials.Material; +import slimeknights.tconstruct.library.tinkering.PartMaterialType; +import slimeknights.tconstruct.library.tools.ToolCore; +import slimeknights.tconstruct.library.tools.ToolNBT; +import slimeknights.tconstruct.tools.TinkerTools; + +public class FishingRod extends ToolCore { + + public static final float DURABILITY_MODIFIER = 1.0f; + + public FishingRod() { + super(PartMaterialType.head(TinkerTools.toughToolRod), PartMaterialType.bowstring(TinkerTools.bowString), + PartMaterialType.handle(TDParts.rivets)); + + setUnlocalizedName("fishingRod"); + } + + @Override + public float damagePotential() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double attackSpeed() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public NBTTagCompound buildTag(List<Material> materials) { + ToolNBT data = buildDefaultTag(materials); + // 2 base damage, like vanilla swords + data.attack += 1f; + data.durability *= DURABILITY_MODIFIER; + return data.get(); + } + +} diff --git a/src/main/java/lance5057/tDefense/core/tools/HeaterShield.java b/src/main/java/lance5057/tDefense/core/tools/HeaterShield.java index 34606c2..827aaf0 100644 --- a/src/main/java/lance5057/tDefense/core/tools/HeaterShield.java +++ b/src/main/java/lance5057/tDefense/core/tools/HeaterShield.java @@ -1,10 +1,6 @@ package lance5057.tDefense.core.tools; -import lance5057.tDefense.TinkersDefense; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; +import lance5057.tDefense.core.parts.TDParts; import slimeknights.tconstruct.library.tinkering.PartMaterialType; import slimeknights.tconstruct.tools.TinkerTools; @@ -15,9 +11,9 @@ public class HeaterShield extends Shield public HeaterShield() { super(PartMaterialType.handle(TinkerTools.toughToolRod), - ShieldMat, - ShieldMat, - PartMaterialType.extra(TinkerTools.toughBinding)); + TDParts.ShieldMat, + TDParts.ShieldMat, + TDParts.RivetMat); setUnlocalizedName("heatershield"); } diff --git a/src/main/java/lance5057/tDefense/core/tools/RoundShield.java b/src/main/java/lance5057/tDefense/core/tools/RoundShield.java index bf0c2e6..94720b1 100644 --- a/src/main/java/lance5057/tDefense/core/tools/RoundShield.java +++ b/src/main/java/lance5057/tDefense/core/tools/RoundShield.java @@ -1,6 +1,7 @@ package lance5057.tDefense.core.tools; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.parts.TDParts; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -15,7 +16,7 @@ public class RoundShield extends Shield public RoundShield() { super(PartMaterialType.handle(TinkerTools.toolRod), - ShieldMat, + TDParts.ShieldMat, PartMaterialType.head(TinkerTools.panHead)); setUnlocalizedName("roundshield"); } diff --git a/src/main/java/lance5057/tDefense/core/tools/Shears.java b/src/main/java/lance5057/tDefense/core/tools/Shears.java new file mode 100644 index 0000000..cda9f1b --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/Shears.java @@ -0,0 +1,146 @@ +package lance5057.tDefense.core.tools; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import slimeknights.tconstruct.library.materials.Material; +import slimeknights.tconstruct.library.tinkering.PartMaterialType; +import slimeknights.tconstruct.library.tools.ToolCore; +import slimeknights.tconstruct.library.tools.ToolNBT; +import slimeknights.tconstruct.tools.TinkerTools; + +public class Shears extends ToolCore { + + public static final float DURABILITY_MODIFIER = 1.0f; + + public Shears() { + super(PartMaterialType.head(TinkerTools.knifeBlade), PartMaterialType.head(TinkerTools.knifeBlade), + PartMaterialType.handle(TinkerTools.binding)); + + setUnlocalizedName("shears"); + } + + @Override + public float damagePotential() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double attackSpeed() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public NBTTagCompound buildTag(List<Material> materials) { + ToolNBT data = buildDefaultTag(materials); + // 2 base damage, like vanilla swords + data.attack += 1f; + data.durability *= DURABILITY_MODIFIER; + return data.get(); + } + + /** + * Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic. + */ + public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving) + { + stack.damageItem(1, entityLiving); + Block block = state.getBlock(); + return state.getMaterial() != net.minecraft.block.material.Material.LEAVES && block != Blocks.WEB && block != Blocks.TALLGRASS && block != Blocks.VINE && block != Blocks.TRIPWIRE && block != Blocks.WOOL && !(state instanceof net.minecraftforge.common.IShearable) ? super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving) : true; + } + + /** + * Check whether this Item can harvest the given Block + */ + public boolean canHarvestBlock(IBlockState blockIn) + { + Block block = blockIn.getBlock(); + return block == Blocks.WEB || block == Blocks.REDSTONE_WIRE || block == Blocks.TRIPWIRE; + } + + public float getStrVsBlock(ItemStack stack, IBlockState state) + { + Block block = state.getBlock(); + return block != Blocks.WEB && state.getMaterial() != net.minecraft.block.material.Material.LEAVES ? (block == Blocks.WOOL ? 5.0F : super.getStrVsBlock(stack, state)) : 15.0F; + } + + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + @Override + public boolean itemInteractionForEntity(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity, net.minecraft.util.EnumHand hand) + { + if (entity.world.isRemote) + { + return false; + } + if (entity instanceof net.minecraftforge.common.IShearable) + { + net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)entity; + BlockPos pos = new BlockPos(entity.posX, entity.posY, entity.posZ); + if (target.isShearable(itemstack, entity.world, pos)) + { + java.util.List<ItemStack> drops = target.onSheared(itemstack, entity.world, pos, + net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.FORTUNE, itemstack)); + + java.util.Random rand = new java.util.Random(); + for(ItemStack stack : drops) + { + net.minecraft.entity.item.EntityItem ent = entity.entityDropItem(stack, 1.0F); + ent.motionY += rand.nextFloat() * 0.05F; + ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; + ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; + } + itemstack.damageItem(1, entity); + } + return true; + } + return false; + } + + @Override + public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, net.minecraft.entity.player.EntityPlayer player) + { + if (player.world.isRemote || player.capabilities.isCreativeMode) + { + return false; + } + Block block = player.world.getBlockState(pos).getBlock(); + if (block instanceof net.minecraftforge.common.IShearable) + { + net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)block; + if (target.isShearable(itemstack, player.world, pos)) + { + java.util.List<ItemStack> drops = target.onSheared(itemstack, player.world, pos, + net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.FORTUNE, itemstack)); + java.util.Random rand = new java.util.Random(); + + for(ItemStack stack : drops) + { + float f = 0.7F; + double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + net.minecraft.entity.item.EntityItem entityitem = new net.minecraft.entity.item.EntityItem(player.world, (double)pos.getX() + d, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack); + entityitem.setDefaultPickupDelay(); + player.world.spawnEntity(entityitem); + } + + itemstack.damageItem(1, player); + player.addStat(net.minecraft.stats.StatList.getBlockStats(block)); + } + } + return false; + } + +} diff --git a/src/main/java/lance5057/tDefense/core/tools/Shield.java b/src/main/java/lance5057/tDefense/core/tools/Shield.java index fc88e7b..2bc8987 100644 --- a/src/main/java/lance5057/tDefense/core/tools/Shield.java +++ b/src/main/java/lance5057/tDefense/core/tools/Shield.java @@ -38,8 +38,6 @@ import slimeknights.tconstruct.tools.TinkerTools; //@Optional.InterfaceList({@Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.ISheathed"), @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.shield.IArrowCatcher"), @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.shield.IArrowDisplay"), @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.shield.IShield")}) public class Shield extends ToolCore //implements IShield, ISheathed, IArrowCatcher, IArrowDisplay { - protected static PartMaterialType ShieldMat = new PartMaterialType(TinkerTools.largePlate, ShieldMaterialStats.TYPE); - public Shield(PartMaterialType... requiredComponents) { super(requiredComponents); diff --git a/src/main/java/lance5057/tDefense/core/tools/TDTools.java b/src/main/java/lance5057/tDefense/core/tools/TDTools.java index ead016c..ae8a47f 100644 --- a/src/main/java/lance5057/tDefense/core/tools/TDTools.java +++ b/src/main/java/lance5057/tDefense/core/tools/TDTools.java @@ -1,106 +1,144 @@ package lance5057.tDefense.core.tools; +import com.google.common.eventbus.Subscribe; + +import lance5057.tDefense.armor.items.cloth.TinkersHood; +import lance5057.tDefense.armor.items.cloth.TinkersRobe; +import lance5057.tDefense.armor.items.cloth.TinkersShawl; +import lance5057.tDefense.armor.items.cloth.TinkersShoes; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; -import slimeknights.tconstruct.common.CommonProxy; import slimeknights.tconstruct.library.TinkerRegistry; import slimeknights.tconstruct.library.tools.ToolCore; -import com.google.common.eventbus.Subscribe; - //@Pulse(id = TDTools.PulseId, description = "All the tools and everything related to it.") -public class TDTools -{ +public class TDTools { TDToolEvents events = new TDToolEvents(); - // Tools - public static ToolCore roundshield = new RoundShield(); - public static ToolCore heatershield = new HeaterShield(); - public static ToolCore zweihander = new Zweihander(); - - // Tool Parts - - // Modifiers - - // Helper stuff -// static List<ToolCore> tools = Lists.newLinkedList(); // contains all tools registered in this pulse -// static List<ToolPart> toolparts = Lists.newLinkedList(); // ^ all toolparts -// static List<IModifier> modifiers = Lists.newLinkedList(); // ^ all modifiers - - // PRE-INITIALIZATION - @Subscribe - public void preInit(FMLPreInitializationEvent event) { - // register items - MinecraftForge.EVENT_BUS.register(events); - - regToolParts(); - regTools(); - registerModifiers(); - - // register blocks - - // register entities - - //proxy.preInit(); - } - - private void regToolParts() { - // The order the items are registered in represents the order in the stencil table GUI too - - } - - private void regTools() { - - regTool(roundshield, "roundshield"); - regTool(heatershield, "heatershield"); - regTool(zweihander, "zweihander"); - -// TinkerRegistry.registerToolStationCrafting(roundshield); -// TinkerRegistry.registerToolForgeCrafting(heatershield); -// TinkerRegistry.registerToolForgeCrafting(zweihander); - } - - private void regTool(ToolCore tool, String name) - { - tool.setRegistryName(new ResourceLocation("tinkersdefense:" + name)); - TinkerRegistry.registerTool(tool); - GameRegistry.register(tool); - } - - private void registerModifiers() { - - } - - // INITIALIZATION - @Subscribe - public void init(FMLInitializationEvent event) { - regToolBuilding(); - regRecipies(); - - //proxy.init(); - } - - private void regToolBuilding() { - TinkerRegistry.registerToolCrafting(roundshield); - TinkerRegistry.registerToolForgeCrafting(heatershield); - TinkerRegistry.registerToolForgeCrafting(zweihander); - } - - private void regRecipies() { - - } - - // POST-INITIALIZATION - @Subscribe - public void postInit(FMLPostInitializationEvent event) { - //proxy.postInit(); - } - - + // Tools + public static ToolCore roundshield; + public static ToolCore heatershield; + public static ToolCore zweihander; + public static ToolCore shears; + public static ToolCore fishingRod; + + public static ToolCore hood; + public static ToolCore shawl; + public static ToolCore robe; + public static ToolCore shoes; + + public static ToolCore coif; + public static ToolCore hauberk; + public static ToolCore chausses; + public static ToolCore boots; + + public static ToolCore helm; + public static ToolCore breastplate; + public static ToolCore grieves; + public static ToolCore sabatons; + + // Tool Parts + + // Modifiers + + // Helper stuff + // static List<ToolCore> tools = Lists.newLinkedList(); // contains all + // tools registered in this pulse + // static List<ToolPart> toolparts = Lists.newLinkedList(); // ^ all + // toolparts + // static List<IModifier> modifiers = Lists.newLinkedList(); // ^ all + // modifiers + + // PRE-INITIALIZATION + @Subscribe + public void preInit(FMLPreInitializationEvent event) { + // register items + roundshield = new RoundShield(); + heatershield = new HeaterShield(); + zweihander = new Zweihander(); + shears = new Shears(); + fishingRod = new FishingRod(); + + hood = new TinkersHood(); + shawl = new TinkersShawl(); + robe = new TinkersRobe(); + shoes = new TinkersShoes(); + + MinecraftForge.EVENT_BUS.register(events); + + regTools(); + registerModifiers(); + + // register blocks + + // register entities + + // proxy.preInit(); + } + + private void regTools() { + + regTool(roundshield, "roundshield"); + regTool(heatershield, "heatershield"); + regTool(zweihander, "zweihander"); + regTool(shears, "shears"); + regTool(fishingRod, "fishingRod"); + + regTool(hood, "hood"); + regTool(shawl, "shawl"); + regTool(robe, "robe"); + regTool(shoes, "shoes"); + + // TinkerRegistry.registerToolStationCrafting(roundshield); + // TinkerRegistry.registerToolForgeCrafting(heatershield); + // TinkerRegistry.registerToolForgeCrafting(zweihander); + } + + private void regTool(ToolCore tool, String name) { + tool.setRegistryName(new ResourceLocation("tinkersdefense:" + name)); + TinkerRegistry.registerTool(tool); + GameRegistry.register(tool); + } + + private void registerModifiers() { + + } + + // INITIALIZATION + @Subscribe + public void init(FMLInitializationEvent event) { + regToolBuilding(); + regRecipies(); + + // proxy.init(); + } + + private void regToolBuilding() { + TinkerRegistry.registerToolCrafting(roundshield); + TinkerRegistry.registerToolForgeCrafting(heatershield); + TinkerRegistry.registerToolForgeCrafting(zweihander); + TinkerRegistry.registerToolCrafting(shears); + TinkerRegistry.registerToolCrafting(fishingRod); + + TinkerRegistry.registerToolCrafting(hood); + TinkerRegistry.registerToolCrafting(shawl); + TinkerRegistry.registerToolCrafting(robe); + TinkerRegistry.registerToolCrafting(shoes); + } + + private void regRecipies() { + + } + + // POST-INITIALIZATION + @Subscribe + public void postInit(FMLPostInitializationEvent event) { + // proxy.postInit(); + } + } diff --git a/src/main/java/lance5057/tDefense/core/tools/Zweihander.java b/src/main/java/lance5057/tDefense/core/tools/Zweihander.java index 9446bac..76b3050 100644 --- a/src/main/java/lance5057/tDefense/core/tools/Zweihander.java +++ b/src/main/java/lance5057/tDefense/core/tools/Zweihander.java @@ -1,5 +1,7 @@ package lance5057.tDefense.core.tools; +import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -7,9 +9,6 @@ import net.minecraft.init.MobEffects; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.util.math.MathHelper; - -import java.util.List; - import slimeknights.tconstruct.library.materials.Material; import slimeknights.tconstruct.library.tinkering.Category; import slimeknights.tconstruct.library.tinkering.PartMaterialType; @@ -20,71 +19,78 @@ import slimeknights.tconstruct.tools.TinkerTools; public class Zweihander extends SwordCore { - public static final float DURABILITY_MODIFIER = 1.1f; + public static final float DURABILITY_MODIFIER = 1.1f; + + public Zweihander() { + super(PartMaterialType.head(TinkerTools.largeSwordBlade), PartMaterialType.head(TinkerTools.swordBlade), + PartMaterialType.handle(TinkerTools.toughToolRod), PartMaterialType.extra(TinkerTools.toughBinding)); + + setUnlocalizedName("zweihander"); + addCategory(Category.WEAPON); + } - public Zweihander() { - super(PartMaterialType.head(TinkerTools.largeSwordBlade), - PartMaterialType.head(TinkerTools.swordBlade), - PartMaterialType.handle(TinkerTools.toughToolRod), - PartMaterialType.extra(TinkerTools.toughBinding)); + @Override + public float damagePotential() { + return 1.0f; + } - addCategory(Category.WEAPON); - } + @Override + public double attackSpeed() { + return 1.0d; + } - @Override - public float damagePotential() { - return 1.0f; - } + // sword sweep attack + @Override + public boolean dealDamage(ItemStack stack, EntityLivingBase player, Entity entity, float damage) { + // deal damage first + boolean hit = super.dealDamage(stack, player, entity, damage); + // and then sweep + if (hit && !ToolHelper.isBroken(stack)) { + // sweep code from EntityPlayer#attackTargetEntityWithCurrentItem() + // basically: no crit, no sprinting and has to stand on the ground + // for sweep. Also has to move regularly slowly + double d0 = (double) (player.distanceWalkedModified - player.prevDistanceWalkedModified); + boolean flag = true; + if (player instanceof EntityPlayer) { + flag = ((EntityPlayer) player).getCooledAttackStrength(0.5F) > 0.9f; + } + boolean flag2 = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() + && !player.isInWater() && !player.isPotionActive(MobEffects.BLINDNESS) && !player.isRiding(); + if (flag && !player.isSprinting() && !flag2 && player.onGround && d0 < (double) player.getAIMoveSpeed()) { + for (EntityLivingBase entitylivingbase : player.getEntityWorld().getEntitiesWithinAABB( + EntityLivingBase.class, entity.getEntityBoundingBox().expand(2.0D, 0.25D, 2.0D))) { + if (entitylivingbase != player && entitylivingbase != entity + && !player.isOnSameTeam(entitylivingbase) + && player.getDistanceSqToEntity(entitylivingbase) < 9.0D) { + entitylivingbase.knockBack(player, 0.4F, + (double) MathHelper.sin(player.rotationYaw * 0.017453292F), + (double) (-MathHelper.cos(player.rotationYaw * 0.017453292F))); + super.dealDamage(stack, player, entitylivingbase, damage/2); + } + } - @Override - public double attackSpeed() { - return 1.0d; - } + player.getEntityWorld().playSound(null, player.posX, player.posY, player.posZ, + SoundEvents.ENTITY_PLAYER_ATTACK_SWEEP, player.getSoundCategory(), 1.0F, 1.0F); + if (player instanceof EntityPlayer) { + ((EntityPlayer) player).spawnSweepParticles(); + } + } + } -// // sword sweep attack -// @Override -// public boolean dealDamage(ItemStack stack, EntityLivingBase player, Entity entity, float damage) { -// // deal damage first -// boolean hit = super.dealDamage(stack, player, entity, damage); -// // and then sweep -// if(hit && !ToolHelper.isBroken(stack)) { -// // sweep code from EntityPlayer#attackTargetEntityWithCurrentItem() -// // basically: no crit, no sprinting and has to stand on the ground for sweep. Also has to move regularly slowly -// double d0 = (double) (player.field_70140_Q - player.field_70141_P); -// boolean flag = true; -// if(player instanceof EntityPlayer) { -// flag = ((EntityPlayer) player).func_184825_o(0.5F) > 0.9f; -// } -// boolean flag2 = player.field_70143_R > 0.0F && !player.field_70122_E && !player.func_70617_f_() && !player.func_70090_H() && !player.func_70644_a(MobEffects.field_76440_q) && !player.func_184218_aH(); -// if(flag && !player.func_70051_ag() && !flag2 && player.field_70122_E && d0 < (double) player.func_70689_ay()) { -// for(EntityLivingBase entitylivingbase : player.func_130014_f_().func_72872_a(EntityLivingBase.class, entity.func_174813_aQ().func_72314_b(1.0D, 0.25D, 1.0D))) { -// if(entitylivingbase != player && entitylivingbase != entity && !player.func_184191_r(entitylivingbase) && player.func_70068_e(entitylivingbase) < 9.0D) { -// entitylivingbase.func_70653_a(player, 0.4F, (double) MathHelper.func_76126_a(player.field_70177_z * 0.017453292F), (double) (-MathHelper.func_76134_b(player.field_70177_z * 0.017453292F))); -// super.dealDamage(stack, player, entitylivingbase, 1f); -// } -// } -// -// player.func_130014_f_().func_184148_a(null, player.field_70165_t, player.field_70163_u, player.field_70161_v, SoundEvents.field_187730_dW, player.func_184176_by(), 1.0F, 1.0F); -// if(player instanceof EntityPlayer) { -// ((EntityPlayer) player).func_184810_cG(); -// } -// } -// } -// -// return hit; -// } + return hit; + } - @Override - public float getRepairModifierForPart(int index) { - return DURABILITY_MODIFIER; - } + @Override + public float getRepairModifierForPart(int index) { + return DURABILITY_MODIFIER; + } - @Override - public ToolNBT buildTagData(List<Material> materials) { - ToolNBT data = buildDefaultTag(materials); - // 2 base damage, like vanilla swords - data.attack += 1f; - data.durability *= DURABILITY_MODIFIER; - return data; - } + @Override + public ToolNBT buildTagData(List<Material> materials) { + ToolNBT data = buildDefaultTag(materials); + // 2 base damage, like vanilla swords + data.attack += 1f; + data.durability *= DURABILITY_MODIFIER; + return data; + } } diff --git a/src/main/java/lance5057/tDefense/proxy/ClientProxy.java b/src/main/java/lance5057/tDefense/proxy/ClientProxy.java index 41018a6..9443435 100644 --- a/src/main/java/lance5057/tDefense/proxy/ClientProxy.java +++ b/src/main/java/lance5057/tDefense/proxy/ClientProxy.java @@ -1,157 +1,293 @@ package lance5057.tDefense.proxy; +import javax.annotation.Nonnull; + import lance5057.tDefense.Reference; import lance5057.tDefense.TD_Commands; import lance5057.tDefense.baubles.BaublesClientProxy; +import lance5057.tDefense.core.CoreBlocks; import lance5057.tDefense.core.CoreClientProxy; import lance5057.tDefense.core.CoreItems; +import lance5057.tDefense.core.blocks.TDMetalBlock; import lance5057.tDefense.core.tools.TDTools; import lance5057.tDefense.holiday.HolidayClientProxy; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fluids.Fluid; import slimeknights.tconstruct.common.ModelRegisterUtil; import slimeknights.tconstruct.library.TinkerRegistryClient; import slimeknights.tconstruct.library.client.ToolBuildGuiInfo; //import lance5057.tDefense.core.renderer.TestSkinChanger; -public class ClientProxy extends CommonProxy -{ - //static final ToolModelLoader toolmodel = new ToolModelLoader(); - //public static final ModelSheath sheath = new ModelSheath(); - //ModifierSoulHandler SoulHandler; - -// public static ModelTinkersTabard sheath; -// -// public static ModelTinkersHelm helm; -// public static ModelTinkersBreastplate breastplate; -// public static ModelTinkersGrieves grieves; -// public static ModelTinkersSabatons sabatons; -// public static ModelTinkersGauntlets gauntlets; -// -// public static ModelTinkersHood hood; -// public static ModelTinkersShawl shawl; -// public static ModelTinkersRobe robe; -// public static ModelTinkersShoes shoes; -// -// public static ModelTinkersCoif coif; -// public static ModelTinkersHauberk hauberk; -// public static ModelTinkersChausses chausses; -// public static ModelTinkersBoots boots; - +public class ClientProxy extends CommonProxy { + // static final ToolModelLoader toolmodel = new ToolModelLoader(); + // public static final ModelSheath sheath = new ModelSheath(); + // ModifierSoulHandler SoulHandler; + + // public static ModelTinkersTabard sheath; + public static BaublesClientProxy baubles = new BaublesClientProxy(); - + ToolBuildGuiInfo roundshieldGUI; ToolBuildGuiInfo heatershieldGUI; - + ToolBuildGuiInfo zweihanderGUI; - + ToolBuildGuiInfo shearsGUI; + ToolBuildGuiInfo fishingRodGUI; + + ToolBuildGuiInfo hoodGUI; + ToolBuildGuiInfo shawlGUI; + ToolBuildGuiInfo robeGUI; + ToolBuildGuiInfo shoesGUI; + + ToolBuildGuiInfo coifGUI; + ToolBuildGuiInfo hauberkGUI; + ToolBuildGuiInfo chaussesGUI; + ToolBuildGuiInfo bootsGUI; + + ToolBuildGuiInfo helmGUI; + ToolBuildGuiInfo breastplateGUI; + ToolBuildGuiInfo grievesGUI; + ToolBuildGuiInfo sabatonsGUI; + public static CoreClientProxy coreProxy = new CoreClientProxy(); public static HolidayClientProxy holiProxy = new HolidayClientProxy(); - //public static ArmorClientProxy armorProxy = new ArmorClientProxy(); - + // public static ArmorClientProxy armorProxy = new ArmorClientProxy(); + @Override - public void preInit() - { + public void preInit() { ClientCommandHandler.instance.registerCommand(new TD_Commands()); registerToolRenderers(); - + coreProxy.preInit(); - //armorProxy.preInit(); + // armorProxy.preInit(); baubles.preInit(); } - + @Override - public void init() - { -// Minecraft.getMinecraft().getRenderItem().getItemModelMesher() -// .register(TDTools.heatershield, 0, new ModelResourceLocation("modid:itemname", "inventory")); -// - + public void init() { + // Minecraft.getMinecraft().getRenderItem().getItemModelMesher() + // .register(TDTools.heatershield, 0, new + // ModelResourceLocation("modid:itemname", "inventory")); + // + createToolGuis(); - setupToolGuis(); + setToolGuis(); registerToolGuis(); + registerItemRenderer(CoreBlocks.metalItemBlock, TDMetalBlock.EnumMetal.AEONSTEEL.getID(), "aeonsteelblock"); + registerItemRenderer(CoreBlocks.metalItemBlock, TDMetalBlock.EnumMetal.QUEENSGOLD.getID(), "queensgoldblock"); + registerItemRenderer(CoreBlocks.metalItemBlock, TDMetalBlock.EnumMetal.DOGBEARIUM.getID(), "dogbeariumblock"); + registerItemRenderer(CoreItems.item_aeonsteelIngot, 0, CoreItems.item_aeonsteelIngot.getUnlocalizedName()); registerItemRenderer(CoreItems.item_dogbeariumIngot, 0, CoreItems.item_dogbeariumIngot.getUnlocalizedName()); registerItemRenderer(CoreItems.item_queensgoldIngot, 0, CoreItems.item_queensgoldIngot.getUnlocalizedName()); - + coreProxy.init(); - //armorProxy.init(); + // armorProxy.init(); holiProxy.Init(); baubles.init(); } - - public void registerToolRenderers() - { + + public void registerToolRenderers() { ModelRegisterUtil.registerToolModel(TDTools.roundshield); ModelRegisterUtil.registerToolModel(TDTools.heatershield); ModelRegisterUtil.registerToolModel(TDTools.zweihander); - + ModelRegisterUtil.registerToolModel(TDTools.shears); + ModelRegisterUtil.registerToolModel(TDTools.fishingRod); + + ModelRegisterUtil.registerToolModel(TDTools.hood); + ModelRegisterUtil.registerToolModel(TDTools.shawl); + ModelRegisterUtil.registerToolModel(TDTools.robe); + ModelRegisterUtil.registerToolModel(TDTools.shoes); + } - - public void createToolGuis() - { + + public void createToolGuis() { roundshieldGUI = new ToolBuildGuiInfo(TDTools.roundshield); heatershieldGUI = new ToolBuildGuiInfo(TDTools.heatershield); zweihanderGUI = new ToolBuildGuiInfo(TDTools.zweihander); + shearsGUI = new ToolBuildGuiInfo(TDTools.shears); + fishingRodGUI = new ToolBuildGuiInfo(TDTools.fishingRod); + + hoodGUI = new ToolBuildGuiInfo(TDTools.hood); + shawlGUI = new ToolBuildGuiInfo(TDTools.shawl); + robeGUI = new ToolBuildGuiInfo(TDTools.robe); + shoesGUI = new ToolBuildGuiInfo(TDTools.shoes); } - - public void setupToolGuis() - { - roundshieldGUI.addSlotPosition(34, 15+8); - roundshieldGUI.addSlotPosition(34, 33+8); - roundshieldGUI.addSlotPosition(34, 51+8); - - heatershieldGUI.addSlotPosition(34, 15+8); - heatershieldGUI.addSlotPosition(25, 33+8); - heatershieldGUI.addSlotPosition(43, 33+8); - heatershieldGUI.addSlotPosition(34, 51+8); - - zweihanderGUI.addSlotPosition(34, 15+8); - zweihanderGUI.addSlotPosition(25, 33+8); - zweihanderGUI.addSlotPosition(43, 33+8); - zweihanderGUI.addSlotPosition(34, 51+8); + + public void setupToolGuis() { + roundshieldGUI.addSlotPosition(34, 15 + 8); + roundshieldGUI.addSlotPosition(34, 33 + 8); + roundshieldGUI.addSlotPosition(34, 51 + 8); + + heatershieldGUI.addSlotPosition(34, 15 + 8); + heatershieldGUI.addSlotPosition(25, 33 + 8); + heatershieldGUI.addSlotPosition(43, 33 + 8); + heatershieldGUI.addSlotPosition(34, 51 + 8); + + zweihanderGUI.addSlotPosition(34, 15 + 8); + zweihanderGUI.addSlotPosition(25, 33 + 8); + zweihanderGUI.addSlotPosition(43, 33 + 8); + zweihanderGUI.addSlotPosition(34, 51 + 8); + + hoodGUI.addSlotPosition(34, 15 + 8); + hoodGUI.addSlotPosition(43, 33 + 8); + hoodGUI.addSlotPosition(34, 51 + 8); + + shawlGUI.addSlotPosition(34, 15 + 8); + shawlGUI.addSlotPosition(43, 33 + 8); + shawlGUI.addSlotPosition(34, 51 + 8); + + robeGUI.addSlotPosition(34, 15 + 8); + robeGUI.addSlotPosition(43, 33 + 8); + robeGUI.addSlotPosition(34, 51 + 8); + + shoesGUI.addSlotPosition(34, 15 + 8); + shoesGUI.addSlotPosition(43, 33 + 8); + shoesGUI.addSlotPosition(34, 51 + 8); + + shearsGUI.addSlotPosition(34, 15 + 8); + shearsGUI.addSlotPosition(43, 33 + 8); + shearsGUI.addSlotPosition(34, 51 + 8); } - - public void registerToolGuis() - { + + public void registerToolGuis() { TinkerRegistryClient.addToolBuilding(roundshieldGUI); TinkerRegistryClient.addToolBuilding(heatershieldGUI); TinkerRegistryClient.addToolBuilding(zweihanderGUI); + TinkerRegistryClient.addToolBuilding(shearsGUI); + TinkerRegistryClient.addToolBuilding(fishingRodGUI); + + TinkerRegistryClient.addToolBuilding(hoodGUI); + TinkerRegistryClient.addToolBuilding(shawlGUI); + TinkerRegistryClient.addToolBuilding(robeGUI); + TinkerRegistryClient.addToolBuilding(shoesGUI); + } - + @Override - public void reloadRenderers() - { + public void reloadRenderers() { setToolGuis(); - + baubles.reloadRenderers(); } - - public void setToolGuis() - { + + public void setToolGuis() { roundshieldGUI.positions.clear(); roundshieldGUI.addSlotPosition(34, 15); roundshieldGUI.addSlotPosition(34, 33); roundshieldGUI.addSlotPosition(34, 51); - + heatershieldGUI.positions.clear(); heatershieldGUI.addSlotPosition(34, 15); heatershieldGUI.addSlotPosition(25, 33); heatershieldGUI.addSlotPosition(43, 33); heatershieldGUI.addSlotPosition(34, 51); - + zweihanderGUI.positions.clear(); zweihanderGUI.addSlotPosition(34, 15); zweihanderGUI.addSlotPosition(25, 33); zweihanderGUI.addSlotPosition(43, 33); zweihanderGUI.addSlotPosition(34, 51); + + hoodGUI.positions.clear(); + hoodGUI.addSlotPosition(34, 15 + 8); + hoodGUI.addSlotPosition(43, 33 + 8); + hoodGUI.addSlotPosition(34, 51 + 8); + + shawlGUI.positions.clear(); + shawlGUI.addSlotPosition(34, 15 + 8); + shawlGUI.addSlotPosition(43, 33 + 8); + shawlGUI.addSlotPosition(34, 51 + 8); + + robeGUI.positions.clear(); + robeGUI.addSlotPosition(34, 15 + 8); + robeGUI.addSlotPosition(43, 33 + 8); + robeGUI.addSlotPosition(34, 51 + 8); + + shoesGUI.positions.clear(); + shoesGUI.addSlotPosition(34, 15 + 8); + shoesGUI.addSlotPosition(43, 33 + 8); + shoesGUI.addSlotPosition(34, 51 + 8); + + shearsGUI.positions.clear(); + shearsGUI.addSlotPosition(34, 15 + 8); + shearsGUI.addSlotPosition(43, 33 + 8); + shearsGUI.addSlotPosition(34, 51 + 8); + + fishingRodGUI.positions.clear(); + fishingRodGUI.addSlotPosition(34, 15 + 8); + fishingRodGUI.addSlotPosition(43, 33 + 8); + fishingRodGUI.addSlotPosition(34, 51 + 8); + } + + @Override + public void registerItemRenderer(Item item, int meta, String id) { + ModelLoader.setCustomModelResourceLocation(item, meta, + new ModelResourceLocation(Reference.MOD_ID + ":" + id, "inventory")); + } + + @Override + public void registerFluidModels(Fluid fluid) { + if (fluid == null) { + return; + } + + Block block = fluid.getBlock(); + if (block != null) { + Item item = Item.getItemFromBlock(block); + FluidStateMapper mapper = new FluidStateMapper(fluid); + + // item-model + if (item != null) { + ModelLoader.registerItemVariants(item); + ModelLoader.setCustomMeshDefinition(item, mapper); + } + // block-model + ModelLoader.setCustomStateMapper(block, mapper); + } } - public static void registerItemRenderer(Item item, int meta, String id) { - ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(Reference.MOD_ID + ":" + id, "inventory")); - } + @Override + public void registerItemBlockRenderer(Block block, int meta, String file) { + Minecraft.getMinecraft().getRenderItem().getItemModelMesher() + .register(Item.getItemFromBlock(block), meta, new ModelResourceLocation(Reference.MOD_ID + ":" + file, "inventory")); + } + + + public static class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition { + + public final Fluid fluid; + public final ModelResourceLocation location; + + public FluidStateMapper(Fluid fluid) { + this.fluid = fluid; + + // have each block hold its fluid per nbt? hm + this.location = new ModelResourceLocation(new ResourceLocation(Reference.MOD_ID, "fluid_block"), fluid.getName()); + } + + @Nonnull + @Override + protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state) { + return location; + } + + @Nonnull + @Override + public ModelResourceLocation getModelLocation(@Nonnull ItemStack stack) { + return location; + } +} } diff --git a/src/main/java/lance5057/tDefense/proxy/CommonProxy.java b/src/main/java/lance5057/tDefense/proxy/CommonProxy.java index 8ae3d90..407080d 100644 --- a/src/main/java/lance5057/tDefense/proxy/CommonProxy.java +++ b/src/main/java/lance5057/tDefense/proxy/CommonProxy.java @@ -1,12 +1,19 @@ package lance5057.tDefense.proxy; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.items.straps.ItemStrapsInv; +import lance5057.tDefense.armor.items.straps.StrapsContainer; +import lance5057.tDefense.armor.items.straps.StrapsGui; import lance5057.tDefense.core.blocks.crestMount.Container_CrestMount; import lance5057.tDefense.core.blocks.crestMount.Gui_CrestMount; import lance5057.tDefense.core.blocks.crestMount.TileEntity_CrestMount; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraftforge.fml.common.network.NetworkRegistry; @@ -21,7 +28,7 @@ public class CommonProxy implements IGuiHandler public void init() { - NetworkRegistry.INSTANCE.registerGuiHandler(TinkersDefense.instance, this); + } public void registerTileEntitySpecialRenderer() @@ -63,6 +70,8 @@ public class CommonProxy implements IGuiHandler // if(ID == TinkersDefense.GUI_ANVIL_INV) // return new Container_FinishingAnvil(player.inventory, // (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); + if(ID == TinkersDefense.GUI_STRAPS_INV) + return new StrapsContainer(player, player.inventory, new ItemStrapsInv(player.getHeldItem(EnumHand.MAIN_HAND))); return null; } @@ -76,6 +85,23 @@ public class CommonProxy implements IGuiHandler // if(ID == TinkersDefense.GUI_ANVIL_INV) // return new Gui_FinishingAnvil(player.inventory, // (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); + if(ID == TinkersDefense.GUI_STRAPS_INV) + return new StrapsGui((StrapsContainer) new StrapsContainer(player, player.inventory, new ItemStrapsInv(player.getHeldItem(EnumHand.MAIN_HAND)))); return null; } + + public void registerItemRenderer(Item item, int meta, String id) + { + + } + + public void registerFluidModels(Fluid fluid) + { + + } + + public void registerItemBlockRenderer(Block block, int meta, String file) + { + + } } diff --git a/src/main/java/lance5057/tDefense/util/BlocksBase.java b/src/main/java/lance5057/tDefense/util/BlocksBase.java index 5cd3ac6..d8ff0ab 100644 --- a/src/main/java/lance5057/tDefense/util/BlocksBase.java +++ b/src/main/java/lance5057/tDefense/util/BlocksBase.java @@ -3,6 +3,8 @@ package lance5057.tDefense.util; import lance5057.tDefense.Reference; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; @@ -24,20 +26,22 @@ public abstract class BlocksBase { public abstract void postInit(FMLPostInitializationEvent e); - protected Block register(String name, CreativeTabs tabName, float hardness) + protected Block setupRegister(String name, CreativeTabs tabName, float hardness) { Block block = new Block(Material.IRON).setCreativeTab(tabName).setUnlocalizedName(name).setRegistryName(Reference.MOD_ID, name).setHardness(hardness); GameRegistry.register(block); return block; } - protected ItemBlock register(String name, int size, CreativeTabs tabName, Block block) + protected ItemBlock setupRegister(String name, int size, CreativeTabs tabName, Block block) { ItemBlock item = new ItemBlock(block); item.setCreativeTab(tabName).setMaxStackSize(size).setUnlocalizedName(name).setRegistryName(Reference.MOD_ID, name).setCreativeTab(tabName); GameRegistry.register(item); return item; } + + } // protected MetaItem registerMeta(String name, String[] names,int size) diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/wood_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/_cloth.png Binary files differindex 17e9ba8..17e9ba8 100644 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/wood_hood_cloth.png +++ b/src/main/resources/assets/tinker/textures/items/armor/hood/_cloth.png diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_metal.png b/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_metal.png Binary files differdeleted file mode 100644 index db5a3de..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_metal.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_rivet.png b/src/main/resources/assets/tinker/textures/items/armor/hood/_rivet.png Binary files differindex fa36c37..fa36c37 100644 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_rivet.png +++ b/src/main/resources/assets/tinker/textures/items/armor/hood/_rivet.png diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/wood_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/_trim.png Binary files differindex 1c61bf0..1c61bf0 100644 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/wood_hood_trim.png +++ b/src/main/resources/assets/tinker/textures/items/armor/hood/_trim.png diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/alumite_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/alumite_hood_cloth.png Binary files differdeleted file mode 100644 index 4dd184d..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/alumite_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/alumite_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/alumite_hood_trim.png Binary files differdeleted file mode 100644 index 7046455..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/alumite_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/ardite_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/ardite_hood_cloth.png Binary files differdeleted file mode 100644 index 99719c8..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/ardite_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/ardite_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/ardite_hood_trim.png Binary files differdeleted file mode 100644 index ae10d47..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/ardite_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/bone_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/bone_hood_cloth.png Binary files differdeleted file mode 100644 index 3be70ae..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/bone_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/bone_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/bone_hood_trim.png Binary files differdeleted file mode 100644 index b452f4d..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/bone_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/bronze_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/bronze_hood_cloth.png Binary files differdeleted file mode 100644 index 20b70ef..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/bronze_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/bronze_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/bronze_hood_trim.png Binary files differdeleted file mode 100644 index a0635b4..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/bronze_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/cactus_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/cactus_hood_cloth.png Binary files differdeleted file mode 100644 index 364ecee..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/cactus_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/cactus_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/cactus_hood_trim.png Binary files differdeleted file mode 100644 index d000038..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/cactus_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/char.png b/src/main/resources/assets/tinker/textures/items/armor/hood/char.png Binary files differdeleted file mode 100644 index 91194ea..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/char.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/cobalt_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/cobalt_hood_cloth.png Binary files differdeleted file mode 100644 index 6c8849b..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/cobalt_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/cobalt_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/cobalt_hood_trim.png Binary files differdeleted file mode 100644 index a756139..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/cobalt_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/copper_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/copper_hood_cloth.png Binary files differdeleted file mode 100644 index 548135a..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/copper_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/copper_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/copper_hood_trim.png Binary files differdeleted file mode 100644 index b2d5cf1..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/copper_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/flint_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/flint_hood_cloth.png Binary files differdeleted file mode 100644 index bf09d18..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/flint_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/flint_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/flint_hood_trim.png Binary files differdeleted file mode 100644 index 225d633..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/flint_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/iron_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/iron_hood_cloth.png Binary files differdeleted file mode 100644 index f3144fa..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/iron_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/iron_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/iron_hood_trim.png Binary files differdeleted file mode 100644 index a0c1ef7..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/iron_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/manyullyn_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/manyullyn_hood_cloth.png Binary files differdeleted file mode 100644 index 8bfa4f3..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/manyullyn_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/manyullyn_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/manyullyn_hood_trim.png Binary files differdeleted file mode 100644 index 9dc6f90..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/manyullyn_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/model_cloth.png Binary files differindex fb9ef80..fb9ef80 100644 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_cloth.png +++ b/src/main/resources/assets/tinker/textures/items/armor/hood/model_cloth.png diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/model_trim.png Binary files differindex 2949796..2949796 100644 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/_hood_trim.png +++ b/src/main/resources/assets/tinker/textures/items/armor/hood/model_trim.png diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/netherrack_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/netherrack_hood_cloth.png Binary files differdeleted file mode 100644 index 1ca0101..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/netherrack_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/netherrack_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/netherrack_hood_trim.png Binary files differdeleted file mode 100644 index a85f76e..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/netherrack_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/obsidian_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/obsidian_hood_cloth.png Binary files differdeleted file mode 100644 index 703a392..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/obsidian_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/obsidian_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/obsidian_hood_trim.png Binary files differdeleted file mode 100644 index 84c7608..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/obsidian_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/paper_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/paper_hood_cloth.png Binary files differdeleted file mode 100644 index 8484389..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/paper_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/paper_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/paper_hood_trim.png Binary files differdeleted file mode 100644 index cafce87..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/paper_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/slime_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/slime_hood_cloth.png Binary files differdeleted file mode 100644 index 42188bf..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/slime_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/slime_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/slime_hood_trim.png Binary files differdeleted file mode 100644 index bb9db61..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/slime_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/stone_hood_cloth.png b/src/main/resources/assets/tinker/textures/items/armor/hood/stone_hood_cloth.png Binary files differdeleted file mode 100644 index 8379675..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/stone_hood_cloth.png +++ /dev/null diff --git a/src/main/resources/assets/tinker/textures/items/armor/hood/stone_hood_trim.png b/src/main/resources/assets/tinker/textures/items/armor/hood/stone_hood_trim.png Binary files differdeleted file mode 100644 index d38fb96..0000000 --- a/src/main/resources/assets/tinker/textures/items/armor/hood/stone_hood_trim.png +++ /dev/null diff --git a/src/main/resources/assets/tinkersdefense/blockstates/fluid_block.json b/src/main/resources/assets/tinkersdefense/blockstates/fluid_block.json new file mode 100644 index 0000000..a6a3b4e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/blockstates/fluid_block.json @@ -0,0 +1,134 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "forge:fluid" + }, + "variants": { + "aeonsteel_fluid": [ + { + "custom": { + "fluid": "aeonsteel_fluid" + } + } + ], + "queensgold_fluid": [ + { + "custom": { + "fluid": "queensgold_fluid" + } + } + ], + "dogbearium_fluid": [ + { + "custom": { + "fluid": "dogbearium_fluid" + } + } + ], + "vile_fluid": [ + { + "custom": { + "fluid": "vile_fluid" + } + } + ], + "redcandy_fluid": [ + { + "custom": { + "fluid": "redcandy_fluid" + } + } + ], + "greencandy_fluid": [ + { + "custom": { + "fluid": "greencandy_fluid" + } + } + ], + "sinisterium_fluid": [ + { + "custom": { + "fluid": "sinisterium_fluid" + } + } + ], + "nihilite_fluid": [ + { + "custom": { + "fluid": "nihilite_fluid" + } + } + ], + "vibrant_fluid": [ + { + "custom": { + "fluid": "vibrant_fluid" + } + } + ], + "orichalcum_fluid": [ + { + "custom": { + "fluid": "orichalcum_fluid" + } + } + ], + "pandorium_fluid": [ + { + "custom": { + "fluid": "pandorium_fluid" + } + } + ], + "chorusjuice_fluid": [ + { + "custom": { + "fluid": "chorusjuice_fluid" + } + } + ], + "dragonsbreath_fluid": [ + { + "custom": { + "fluid": "dragonsbreath_fluid" + } + } + ], + "rosegold_fluid": [ + { + "custom": { + "fluid": "rosegold_fluid" + } + } + ], + "platinum_fluid": [ + { + "custom": { + "fluid": "platinum_fluid" + } + } + ], + "brass_fluid": [ + { + "custom": { + "fluid": "brass_fluid" + } + } + ], + "silver_fluid": [ + { + "custom": { + "fluid": "silver_fluid" + } + } + ], + "cheese_fluid": [ + { + "custom": { + "fluid": "cheese_fluid" + } + } + ] + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/tinkersdefense/blockstates/metalblock.json b/src/main/resources/assets/tinkersdefense/blockstates/metalblock.json new file mode 100644 index 0000000..cc02bb0 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/blockstates/metalblock.json @@ -0,0 +1,7 @@ +{ + "variants": { + "type=aeonsteel": { "model":"tinkersdefense:blocks/aeonsteelblock" }, + "type=queensgold": { "model":"tutorial:block_properties_black" } + "type=dogbearium": { "model":"tutorial:block_properties_black" } + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/tinkersdefense/models/block/aeonsteelblock.json b/src/main/resources/assets/tinkersdefense/models/block/aeonsteelblock.json new file mode 100644 index 0000000..46c122e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/block/aeonsteelblock.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cube_all", + "textures": { + "all": "tinkersdefense:blocks/aeonsteelblock" + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/tinkersdefense/models/item/tools/fishingrod.tcon.json b/src/main/resources/assets/tinkersdefense/models/item/tools/fishingrod.tcon.json new file mode 100644 index 0000000..5f34dde --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/item/tools/fishingrod.tcon.json @@ -0,0 +1,35 @@ +{ + "textures": { + "layer0": "tinkersdefense:items/fishingrod/_rod", + "layer1": "tinkersdefense:items/fishingrod/_string", + "layer2": "tinkersdefense:items/fishingrod/_hook", + "broken1": "tinkersdefense:items/fishingrod/broken" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 4, 0 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 4, 0 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 4, 0 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 4, 0 ], + "scale": [ 1, 1, 1 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + } + } +} diff --git a/src/main/resources/assets/tinkersdefense/models/item/tools/hood.tcon.json b/src/main/resources/assets/tinkersdefense/models/item/tools/hood.tcon.json new file mode 100644 index 0000000..e8f6988 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/item/tools/hood.tcon.json @@ -0,0 +1,35 @@ +{ + "textures": { + "layer0": "tinkersdefense:items/armor/hood/_cloth", + "layer1": "tinkersdefense:items/armor/hood/_trim", + "layer2": "tinkersdefense:items/armor/hood/_rivet", + "broken1": "tinkersdefense:items/armor/hood/_broken" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + } + } +} diff --git a/src/main/resources/assets/tinkersdefense/models/item/tools/robe.tcon.json b/src/main/resources/assets/tinkersdefense/models/item/tools/robe.tcon.json new file mode 100644 index 0000000..d2bf7e2 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/item/tools/robe.tcon.json @@ -0,0 +1,35 @@ +{ + "textures": { + "layer0": "tinkersdefense:items/armor/robe/_cloth", + "layer1": "tinkersdefense:items/armor/robe/_trim", + "layer2": "tinkersdefense:items/armor/robe/_plate", + "broken1": "tinkersdefense:items/armor/robe/_broken" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + } + } +} diff --git a/src/main/resources/assets/tinkersdefense/models/item/tools/shawl.tcon.json b/src/main/resources/assets/tinkersdefense/models/item/tools/shawl.tcon.json new file mode 100644 index 0000000..85a6162 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/item/tools/shawl.tcon.json @@ -0,0 +1,35 @@ +{ + "textures": { + "layer0": "tinkersdefense:items/armor/shawl/_cloth", + "layer1": "tinkersdefense:items/armor/shawl/_trim", + "layer2": "tinkersdefense:items/armor/shawl/_clasp", + "broken1": "tinkersdefense:items/armor/shawl/_broken" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + } + } +} diff --git a/src/main/resources/assets/tinkersdefense/models/item/tools/shears.tcon.json b/src/main/resources/assets/tinkersdefense/models/item/tools/shears.tcon.json new file mode 100644 index 0000000..5a03b6d --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/item/tools/shears.tcon.json @@ -0,0 +1,35 @@ +{ + "textures": { + "layer0": "tinkersdefense:items/shears/_top", + "layer1": "tinkersdefense:items/shears/_bottom", + "layer2": "tinkersdefense:items/shears/_binding", + "broken1": "tinkersdefense:items/shears/_broken" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + } + } +} diff --git a/src/main/resources/assets/tinkersdefense/models/item/tools/shoes.tcon.json b/src/main/resources/assets/tinkersdefense/models/item/tools/shoes.tcon.json new file mode 100644 index 0000000..a69cf82 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/models/item/tools/shoes.tcon.json @@ -0,0 +1,35 @@ +{ + "textures": { + "layer0": "tinkersdefense:items/armor/shoes/_cloth", + "layer1": "tinkersdefense:items/armor/shoes/_sole", + "layer2": "tinkersdefense:items/armor/shoes/_clasp", + "broken1": "tinkersdefense:items/armor/shoes/_broken" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, 45 ], + "translation": [ 0, 8, 0 ], + "scale": [ 1.5, 1.5, 1 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + } + } +} diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_chain.png Binary files differnew file mode 100644 index 0000000..2315c6f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_cloth.png Binary files differnew file mode 100644 index 0000000..40cc82a --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_rivet.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_rivet.png Binary files differnew file mode 100644 index 0000000..1883d37 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/boots/_boots_rivet.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_chain.png Binary files differnew file mode 100644 index 0000000..5b242c1 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_plate.png Binary files differnew file mode 100644 index 0000000..624403e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_smallplate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_smallplate.png Binary files differnew file mode 100644 index 0000000..9d8aa6b --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_smallplate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_trim.png Binary files differnew file mode 100644 index 0000000..5eea928 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/_breastplate_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/blastprotection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/blastprotection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..062bf61 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/blastprotection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/fireprotection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/fireprotection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..f45cb6f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/fireprotection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/projprotection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/projprotection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..4fb0442 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/projprotection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/protection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/protection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..9667d71 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/breastplate/protection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_chain.png Binary files differnew file mode 100644 index 0000000..ec2c137 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_cloth.png Binary files differnew file mode 100644 index 0000000..5eee054 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_plate.png Binary files differnew file mode 100644 index 0000000..77c4a0c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/chausses/_chausses_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_chain.png Binary files differnew file mode 100644 index 0000000..250ea54 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_circlet.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_circlet.png Binary files differnew file mode 100644 index 0000000..d1aa716 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_circlet.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_cloth.png Binary files differnew file mode 100644 index 0000000..35ee80f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/_coif_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/rebreather_coif_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/rebreather_coif_effect.png Binary files differnew file mode 100644 index 0000000..bf253bf --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/rebreather_coif_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/revealing_coif_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/revealing_coif_effect.png Binary files differnew file mode 100644 index 0000000..e502cf4 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/coif/revealing_coif_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_plate.png Binary files differnew file mode 100644 index 0000000..748c7b9 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_rivet.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_rivet.png Binary files differnew file mode 100644 index 0000000..46e68d4 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_rivet.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_trim.png Binary files differnew file mode 100644 index 0000000..2cae42c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_gauntlet_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_guantlet_rivet.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_guantlet_rivet.png Binary files differnew file mode 100644 index 0000000..00f2fce --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_guantlet_rivet.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_guantlet_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_guantlet_trim.png Binary files differnew file mode 100644 index 0000000..e455443 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/gauntlets/_guantlet_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/ModelBiped-texturemap.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/ModelBiped-texturemap.png Binary files differnew file mode 100644 index 0000000..361f889 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/ModelBiped-texturemap.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_chain.png Binary files differnew file mode 100644 index 0000000..0f84905 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_plate.png Binary files differnew file mode 100644 index 0000000..d021871 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_smallplate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_smallplate.png Binary files differnew file mode 100644 index 0000000..345412e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_smallplate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_trim.png Binary files differnew file mode 100644 index 0000000..ec8eff9 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_breastplate_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_chain.png Binary files differnew file mode 100644 index 0000000..8f7789a --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_cloth.png Binary files differnew file mode 100644 index 0000000..32985ad --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_cod.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_cod.png Binary files differnew file mode 100644 index 0000000..a32b425 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_cod.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_plate.png Binary files differnew file mode 100644 index 0000000..2bc04d2 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_trim.png Binary files differnew file mode 100644 index 0000000..f24bcf8 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/_grieves_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/blastprotection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/blastprotection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..3ba28ec --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/blastprotection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/char.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/char.png Binary files differnew file mode 100644 index 0000000..e925635 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/char.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/fireprotection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/fireprotection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..696957c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/fireprotection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/healthboost_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/healthboost_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..3e0b0f4 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/healthboost_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/projprotection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/projprotection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..b031458 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/projprotection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/protection_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/protection_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..a29232f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/protection_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/runicshielding_breastplate_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/runicshielding_breastplate_effect.png Binary files differnew file mode 100644 index 0000000..b13c9df --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/grieves/runicshielding_breastplate_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_chain.png Binary files differnew file mode 100644 index 0000000..91dac92 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_cloth.png Binary files differnew file mode 100644 index 0000000..eaa4529 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_plate.png Binary files differnew file mode 100644 index 0000000..3bbf73e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hauberk/_hauberk_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_chain.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_chain.png Binary files differnew file mode 100644 index 0000000..13b051f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_chain.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_plate.png Binary files differnew file mode 100644 index 0000000..a20421c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_top.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_top.png Binary files differnew file mode 100644 index 0000000..061027c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_top.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_visor.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_visor.png Binary files differnew file mode 100644 index 0000000..6b89cd0 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/_helm_visor.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/rebreather_helm_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/rebreather_helm_effect.png Binary files differnew file mode 100644 index 0000000..bf253bf --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/rebreather_helm_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/revealing_helm_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/revealing_helm_effect.png Binary files differnew file mode 100644 index 0000000..b7eb4e5 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/helm/revealing_helm_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/TinkersHood-texturemap.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/TinkersHood-texturemap.png Binary files differnew file mode 100644 index 0000000..0775bce --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/TinkersHood-texturemap.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_cloth.png Binary files differnew file mode 100644 index 0000000..17e9ba8 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_rivet.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_rivet.png Binary files differnew file mode 100644 index 0000000..fa36c37 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_rivet.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_trim.png Binary files differnew file mode 100644 index 0000000..1c61bf0 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/model_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/model_cloth.png Binary files differnew file mode 100644 index 0000000..fb9ef80 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/model_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/model_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/model_trim.png Binary files differnew file mode 100644 index 0000000..2949796 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/model_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/rebreather_helm_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/rebreather_helm_effect.png Binary files differnew file mode 100644 index 0000000..bf253bf --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/rebreather_helm_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/rebreather_hood_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/rebreather_hood_effect.png Binary files differnew file mode 100644 index 0000000..dbea83d --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/rebreather_hood_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/revealing_hood_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/revealing_hood_effect.png Binary files differnew file mode 100644 index 0000000..689c9c9 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/revealing_hood_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/vis_hood_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/vis_hood_effect.png Binary files differnew file mode 100644 index 0000000..f0e40e6 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/vis_hood_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/visembroidery_hood_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/visembroidery_hood_effect.png Binary files differnew file mode 100644 index 0000000..f0e40e6 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/hood/visembroidery_hood_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_cloth.png Binary files differnew file mode 100644 index 0000000..0a6a661 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_plate.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_plate.png Binary files differnew file mode 100644 index 0000000..7c33840 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_plate.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_trim.png Binary files differnew file mode 100644 index 0000000..3919c8e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/vis_robe_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/vis_robe_effect.png Binary files differnew file mode 100644 index 0000000..c7f7c01 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/vis_robe_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/visembroidery_robe_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/visembroidery_robe_effect.png Binary files differnew file mode 100644 index 0000000..c7f7c01 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/robe/visembroidery_robe_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_caps.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_caps.png Binary files differnew file mode 100644 index 0000000..8225f2f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_caps.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_plates.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_plates.png Binary files differnew file mode 100644 index 0000000..a841231 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_plates.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_soles.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_soles.png Binary files differnew file mode 100644 index 0000000..4bf2a87 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_soles.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_trim.png Binary files differnew file mode 100644 index 0000000..54ac3e9 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/_sabatons_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/blastprotection_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/blastprotection_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..60a2638 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/blastprotection_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/depthstrider_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/depthstrider_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..4ce2437 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/depthstrider_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/featherfall_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/featherfall_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..5e9f2f1 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/featherfall_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/fireprotection_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/fireprotection_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..db5a7f0 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/fireprotection_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/firewalk_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/firewalk_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..ce914a7 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/firewalk_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/frostwalk_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/frostwalk_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..8a85b87 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/frostwalk_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/glowstep_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/glowstep_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..b7ab1cb --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/glowstep_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/projprotection_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/projprotection_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..a563a2c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/projprotection_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/protection_sabatons_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/protection_sabatons_effect.png Binary files differnew file mode 100644 index 0000000..60a4577 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/sabatons/protection_sabatons_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_clasp.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_clasp.png Binary files differnew file mode 100644 index 0000000..5e4bc9b --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_clasp.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_cloth.png Binary files differnew file mode 100644 index 0000000..ad0d542 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_trim.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_trim.png Binary files differnew file mode 100644 index 0000000..fe5529e --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/_trim.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/vis_shawl_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/vis_shawl_effect.png Binary files differnew file mode 100644 index 0000000..1b141c3 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/vis_shawl_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/visembroidery_shawl_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/visembroidery_shawl_effect.png Binary files differnew file mode 100644 index 0000000..3dd7490 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shawl/visembroidery_shawl_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_clasp.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_clasp.png Binary files differnew file mode 100644 index 0000000..d2b5efc --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_clasp.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_cloth.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_cloth.png Binary files differnew file mode 100644 index 0000000..622477f --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_cloth.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_sole.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_sole.png Binary files differnew file mode 100644 index 0000000..05b1871 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/_sole.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/vis_shoes_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/vis_shoes_effect.png Binary files differnew file mode 100644 index 0000000..902b94c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/vis_shoes_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/visembroidery_shoes_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/visembroidery_shoes_effect.png Binary files differnew file mode 100644 index 0000000..902b94c --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/armor/shoes/visembroidery_shoes_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_hook.png b/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_hook.png Binary files differnew file mode 100644 index 0000000..50cc224 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_hook.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_rod.png b/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_rod.png Binary files differnew file mode 100644 index 0000000..ea5d20d --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_rod.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_string.png b/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_string.png Binary files differnew file mode 100644 index 0000000..36638cd --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/fishingrod/_string.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/_binding.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/_binding.png Binary files differnew file mode 100644 index 0000000..c83bc70 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/_binding.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/_bottom.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/_bottom.png Binary files differnew file mode 100644 index 0000000..bb558bf --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/_bottom.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/_broken.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/_broken.png Binary files differnew file mode 100644 index 0000000..1c33216 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/_broken.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/_top.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/_top.png Binary files differnew file mode 100644 index 0000000..021b69a --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/_top.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/item_rainbowgem.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/item_rainbowgem.png Binary files differnew file mode 100644 index 0000000..1012835 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/item_rainbowgem.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/lapis_shears_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/lapis_shears_effect.png Binary files differnew file mode 100644 index 0000000..1d53857 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/lapis_shears_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/rainbow_shears_effect.png b/src/main/resources/assets/tinkersdefense/textures/items/shears/rainbow_shears_effect.png Binary files differnew file mode 100644 index 0000000..1012835 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/rainbow_shears_effect.png diff --git a/src/main/resources/assets/tinkersdefense/textures/items/shears/rainbow_shears_effect.png.mcmeta b/src/main/resources/assets/tinkersdefense/textures/items/shears/rainbow_shears_effect.png.mcmeta new file mode 100644 index 0000000..4a650b1 --- /dev/null +++ b/src/main/resources/assets/tinkersdefense/textures/items/shears/rainbow_shears_effect.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 5 + } +} |
