moving forward with method for creating tool and weapon parts

This commit is contained in:
Mohammad-Ali Minaie
2017-03-09 22:16:25 -05:00
parent 73511390d1
commit b1f9aa0f8a
14 changed files with 202 additions and 285 deletions

View File

@@ -1,24 +1,19 @@
To-Dos
*** Priority ***
- [x] Stone Anvil
- [x] Stone Anvil Inventory
- [x] Stone Anvil Tile
- [x] Stone Anvil Crafting
- [x] TESR Inventory Rendering for Anvil
- [x] Iron Chunk Item Model
- [x] Anvil Item Model
- [x] StoneTongs Iron Chunks
- [ ] Hammer Crafting
- [x] Iron Chunking
- [ ] Tool Rendering
- [ ] Toolhead Recipes
- [ ] WeaponHead recipes
- [ ] Add forgehammer to oreDict
Only modifiable bit is the tool head or weapon blade
The modifier is a product of the tagCompounds are the material type
the modifiers are transfered to the crafted item via NBT
*** Backlog ***
- [ ] Stone Anvil Bounding Box
@@ -34,6 +29,21 @@ To-Dos
- [ ] Forge Sound?
*** Completed ***
- [x] Stone Anvil
- [x] Stone Anvil Inventory
- [x] Stone Anvil Tile
- [x] Stone Anvil Crafting
- [x] TESR Inventory Rendering for Anvil
- [x] Iron Chunk Item Model
- [x] Anvil Item Model
- [x] StoneTongs Iron Chunks
- [x] Hammer Crafting
- [x] Iron Chunking
- [x] Forge Recipe Handler
- [x] Hot Iron Ingot Recipe

View File

@@ -28,7 +28,7 @@ public class ModInfo {
//public static final String UPDATE_JSON = "";
public enum ForgecraftItems {
TEST("test", "ItemTest"),
TEST("test", "itemtest"),
BELLOWSHANDLE("bellowshandle", "bellowshandle"),
STONETONGS("stonetongs", "stonetongs"),
SOFTCRUCIBLE("softcrucible", "softcrucible"),

View File

@@ -30,11 +30,11 @@ import nmd.primal.forgecraft.items.blocks.ItemBlockIngotBall;
*/
public class ModItems {
public static Item test;
public static Item pistonbellows;
public static Item forgehammer = new ForgeHammer("forgehammer");
public static Item softcrucible;
public static Item stonetongs;
//public static Item ironingotballcool;
public static Item ironingotballhot;
public static Item ironchunkhot;
//public static Item forgingmanual;
@@ -45,6 +45,7 @@ public class ModItems {
softcrucible = new ItemSoftCrucible();
stonetongs = new ItemStoneTongs("stonetongs");
//ironingotballcool = new BaseMultiItem("ironingotcool") {};
test = new ItemTest();
ironingotballhot = new BaseMultiItem("ironingothot") {
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if(!world.isRemote) {
@@ -87,6 +88,7 @@ public class ModItems {
GameRegistry.register(forgehammer);
GameRegistry.register(ironingotballhot);
GameRegistry.register(ironchunkhot);
GameRegistry.register(test);
//GameRegistry.register(forgingmanual);
}
@@ -97,6 +99,7 @@ public class ModItems {
registerRender(forgehammer);
registerRender(ironingotballhot);
registerRender(ironchunkhot);
registerRender(test);
//registerRender(forgingmanual);
}

View File

@@ -1,7 +1,19 @@
package nmd.primal.forgecraft.items;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemFishingRod;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import javax.annotation.Nullable;
/**
* Created by kitsu on 11/26/2016.
*/
@@ -10,6 +22,22 @@ public class ItemTest extends BaseItem {
public ItemTest() {
setUnlocalizedName(ModInfo.ForgecraftItems.TEST.getUnlocalizedName());
setRegistryName(ModInfo.ForgecraftItems.TEST.getRegistryName());
this.addPropertyOverride(new ResourceLocation("test"), new IItemPropertyGetter()
{
@SideOnly(Side.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
{
if (entityIn == null)
{
return 0.0F;
}
else
{
return 1.0F;
}
}
});
}
}

View File

@@ -0,0 +1,59 @@
package nmd.primal.forgecraft.items.toolparts;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by mminaie on 3/9/17.
*/
public abstract class ToolPart extends Item {
public ToolPart(String name) {
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
}
public static boolean isHidden()
{
return false;
}
@Override
public void onCreated(ItemStack item, World worldIn, EntityPlayer playerIn) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
//this.setDamage(item, 1000);
item.getTagCompound().setBoolean("silk_touch", false);
item.getTagCompound().setInteger("durability", 50);
item.getTagCompound().setFloat("speed", 1.0F);
item.getTagCompound().setFloat("fortune", 1.0F);
item.getTagCompound().setInteger("modifiers", 0);
this.setMaxDamage(item.getTagCompound().getInteger("durability"));
}
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
item.getTagCompound().setBoolean("silk_touch", false);
item.getTagCompound().setInteger("durability", 50);
item.getTagCompound().setFloat("speed", 1.0F);
item.getTagCompound().setFloat("fortune", 1.0F);
item.getTagCompound().setInteger("modifiers", 0);
this.setMaxDamage(item.getTagCompound().getInteger("durability"));
}
}
}

View File

@@ -0,0 +1,30 @@
package nmd.primal.forgecraft.items.tools;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by mminaie on 3/9/17.
*/
public abstract class CustomTool extends Item {
public CustomTool(String name) {
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
}
@Override
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability(ItemStack stack)
{
return 0;
}
}

View File

@@ -0,0 +1,48 @@
package nmd.primal.forgecraft.renders.items;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.IModelCustomData;
import net.minecraftforge.common.model.IModelState;
import java.util.Collection;
/**
* Created by mminaie on 3/8/17.
*/
public class ModelPickaxe implements IModel, IModelCustomData {
public static final IModel MODEL = new ModelPickaxe();
//private final ResourceLocation resourceHead;
//private final ResourceLocation resourceHandle;
@Override
public IModel process(ImmutableMap<String, String> customData) {
return null;
}
@Override
public Collection<ResourceLocation> getDependencies() {
return null;
}
@Override
public Collection<ResourceLocation> getTextures() {
return null;
}
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
return null;
}
@Override
public IModelState getDefaultState() {
return null;
}
}

View File

@@ -2,5 +2,13 @@
"parent": "item/generated",
"textures": {
"layer0": "forgecraft:items/test"
},
"overrides": [
{
"predicate": {
"test": 1
},
"model": "forgecraft:item/softcrucible"
}
]
}

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

View File

@@ -1,269 +0,0 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "blocks/e_particle",
"texture": "blocks/checker_test"
},
"elements": [
{
"__comment": "wall4",
"from": [ 3, 0, 0 ],
"to": [ 13, 1, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 13, 16 ], "texture": "#texture" },
"up": { "uv": [ 3, 0, 13, 14 ], "texture": "#texture" },
"north": { "uv": [ 3, 15, 13, 16 ], "texture": "#texture" },
"south": { "uv": [ 3, 15, 13, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 15, 14, 16 ], "texture": "#texture" },
"east": { "uv": [ 2, 15, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "wall_flap2",
"from": [ 3, 1, 0 ],
"to": [ 13, 11, 1 ],
"faces": {
"down": { "uv": [ 3, 15, 13, 16 ], "texture": "#texture" },
"up": { "uv": [ 3, 0, 13, 1 ], "texture": "#texture" },
"north": { "uv": [ 3, 5, 13, 15 ], "texture": "#texture" },
"south": { "uv": [ 3, 5, 13, 15 ], "texture": "#texture" },
"west": { "uv": [ 0, 5, 1, 15 ], "texture": "#texture" },
"east": { "uv": [ 15, 5, 16, 15 ], "texture": "#texture" }
}
},
{
"__comment": "piston_arm",
"from": [ 7.5, 3, 2 ],
"to": [ 8.5, 4, 15 ],
"faces": {
"down": { "uv": [ 7.5, 1, 8.5, 14 ], "texture": "#texture" },
"up": { "uv": [ 7.5, 2, 8.5, 15 ], "texture": "#texture" },
"north": { "uv": [ 7.5, 12, 8.5, 13 ], "texture": "#texture" },
"south": { "uv": [ 7.5, 12, 8.5, 13 ], "texture": "#texture" },
"west": { "uv": [ 2, 12, 15, 13 ], "texture": "#texture" },
"east": { "uv": [ 1, 12, 14, 13 ], "texture": "#texture" }
}
},
{
"__comment": "piston_arm1",
"from": [ 7.5, 8, 2 ],
"to": [ 8.5, 9, 15 ],
"faces": {
"down": { "uv": [ 7.5, 1, 8.5, 14 ], "texture": "#texture" },
"up": { "uv": [ 7.5, 2, 8.5, 15 ], "texture": "#texture" },
"north": { "uv": [ 7.5, 11, 8.5, 12 ], "texture": "#texture" },
"south": { "uv": [ 7.5, 11, 8.5, 12 ], "texture": "#texture" },
"west": { "uv": [ 2, 11, 15, 12 ], "texture": "#texture" },
"east": { "uv": [ 1, 11, 14, 12 ], "texture": "#texture" }
}
},
{
"__comment": "wall",
"from": [ 3, 3, 13 ],
"to": [ 7.5, 4, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 7.5, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 7.5, 14 ], "texture": "#texture" },
"north": { "uv": [ 8.5, 12, 13, 13 ], "texture": "#texture" },
"south": { "uv": [ 3, 12, 7.5, 13 ], "texture": "#texture" },
"west": { "uv": [ 13, 12, 14, 13 ], "texture": "#texture" },
"east": { "uv": [ 2, 12, 3, 13 ], "texture": "#texture" }
}
},
{
"__comment": "wall1",
"from": [ 8.5, 3, 13 ],
"to": [ 13, 4, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 7.5, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 7.5, 14 ], "texture": "#texture" },
"north": { "uv": [ 8, 10, 12.5, 11 ], "texture": "#texture" },
"south": { "uv": [ 2.5, 10, 7, 11 ], "texture": "#texture" },
"west": { "uv": [ 13, 10, 14, 11 ], "texture": "#texture" },
"east": { "uv": [ 2, 10, 3, 11 ], "texture": "#texture" }
}
},
{
"__comment": "wall2",
"from": [ 3, 11, 0 ],
"to": [ 13, 12, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 13, 16 ], "texture": "#texture" },
"up": { "uv": [ 3, 0, 13, 14 ], "texture": "#texture" },
"north": { "uv": [ 3, 4, 13, 5 ], "texture": "#texture" },
"south": { "uv": [ 3, 4, 13, 5 ], "texture": "#texture" },
"west": { "uv": [ 0, 4, 14, 5 ], "texture": "#texture" },
"east": { "uv": [ 2, 4, 16, 5 ], "texture": "#texture" }
}
},
{
"__comment": "wall3",
"from": [ 3, 1, 13 ],
"to": [ 13, 3, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 13, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 13, 14 ], "texture": "#texture" },
"north": { "uv": [ 3, 13, 13, 15 ], "texture": "#texture" },
"south": { "uv": [ 3, 13, 13, 15 ], "texture": "#texture" },
"west": { "uv": [ 13, 13, 14, 15 ], "texture": "#texture" },
"east": { "uv": [ 2, 13, 3, 15 ], "texture": "#texture" }
}
},
{
"__comment": "wall_flap1",
"from": [ 3, 4, 13 ],
"to": [ 13, 8, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 13, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 13, 14 ], "texture": "#texture" },
"north": { "uv": [ 3, 8, 13, 12 ], "texture": "#texture" },
"south": { "uv": [ 3, 8, 13, 12 ], "texture": "#texture" },
"west": { "uv": [ 13, 8, 14, 12 ], "texture": "#texture" },
"east": { "uv": [ 2, 8, 3, 12 ], "texture": "#texture" }
}
},
{
"__comment": "wall5",
"from": [ 3, 8, 13 ],
"to": [ 7.5, 9, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 7.5, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 7.5, 14 ], "texture": "#texture" },
"north": { "uv": [ 8.5, 12, 13, 13 ], "texture": "#texture" },
"south": { "uv": [ 2, 12, 6.5, 13 ], "texture": "#texture" },
"west": { "uv": [ 13, 12, 14, 13 ], "texture": "#texture" },
"east": { "uv": [ 2, 12, 3, 13 ], "texture": "#texture" }
}
},
{
"__comment": "wall6",
"from": [ 8.5, 8, 13 ],
"to": [ 13, 9, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 7.5, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 7.5, 14 ], "texture": "#texture" },
"north": { "uv": [ 8.5, 12, 13, 13 ], "texture": "#texture" },
"south": { "uv": [ 2, 12, 6.5, 13 ], "texture": "#texture" },
"west": { "uv": [ 13, 12, 14, 13 ], "texture": "#texture" },
"east": { "uv": [ 2, 12, 3, 13 ], "texture": "#texture" }
}
},
{
"__comment": "wall7",
"from": [ 3, 9, 13 ],
"to": [ 13, 11, 14 ],
"faces": {
"down": { "uv": [ 3, 2, 13, 3 ], "texture": "#texture" },
"up": { "uv": [ 3, 13, 13, 14 ], "texture": "#texture" },
"north": { "uv": [ 3, 13, 13, 15 ], "texture": "#texture" },
"south": { "uv": [ 3, 13, 13, 15 ], "texture": "#texture" },
"west": { "uv": [ 13, 13, 14, 15 ], "texture": "#texture" },
"east": { "uv": [ 2, 13, 3, 15 ], "texture": "#texture" }
}
},
{
"__comment": "piston_arm2",
"from": [ 7.5, 2, 15 ],
"to": [ 8.5, 10, 16 ],
"faces": {
"down": { "uv": [ 7.5, 0, 8.5, 1 ], "texture": "#texture" },
"up": { "uv": [ 7.5, 15, 8.5, 16 ], "texture": "#texture" },
"north": { "uv": [ 7.5, 6, 8.5, 14 ], "texture": "#texture" },
"south": { "uv": [ 7.5, 6, 8.5, 14 ], "texture": "#texture" },
"west": { "uv": [ 15, 6, 16, 14 ], "texture": "#texture" },
"east": { "uv": [ 0, 6, 1, 14 ], "texture": "#texture" }
}
},
{
"__comment": "wall8",
"from": [ 3, 1, 1 ],
"to": [ 4, 11, 13 ],
"faces": {
"down": { "uv": [ 3, 3, 4, 15 ], "texture": "#texture" },
"up": { "uv": [ 3, 1, 4, 13 ], "texture": "#texture" },
"north": { "uv": [ 12, 5, 13, 15 ], "texture": "#texture" },
"south": { "uv": [ 3, 5, 4, 15 ], "texture": "#texture" },
"west": { "uv": [ 1, 5, 13, 15 ], "texture": "#texture" },
"east": { "uv": [ 3, 5, 15, 15 ], "texture": "#texture" }
}
},
{
"__comment": "wall9",
"from": [ 12, 1, 1 ],
"to": [ 13, 11, 13 ],
"faces": {
"down": { "uv": [ 3, 3, 4, 15 ], "texture": "#texture" },
"up": { "uv": [ 3, 1, 4, 13 ], "texture": "#texture" },
"north": { "uv": [ 12, 5, 13, 15 ], "texture": "#texture" },
"south": { "uv": [ 3, 5, 4, 15 ], "texture": "#texture" },
"west": { "uv": [ 1, 5, 13, 15 ], "texture": "#texture" },
"east": { "uv": [ 3, 5, 15, 15 ], "texture": "#texture" }
}
},
{
"__comment": "outlet",
"from": [ 15, 1, 5 ],
"to": [ 16, 8, 11 ],
"faces": {
"down": { "uv": [ 15, 5, 16, 11 ], "texture": "#texture" },
"up": { "uv": [ 15, 5, 16, 11 ], "texture": "#texture" },
"north": { "uv": [ 0, 8, 1, 15 ], "texture": "#texture" },
"south": { "uv": [ 15, 8, 16, 15 ], "texture": "#texture" },
"west": { "uv": [ 5, 8, 11, 15 ], "texture": "#texture" },
"east": { "uv": [ 5, 8, 11, 15 ], "texture": "#texture" }
}
},
{
"__comment": "outlet1",
"from": [ 13, 0, 4 ],
"to": [ 16, 1, 12 ],
"faces": {
"down": { "uv": [ 13, 4, 16, 12 ], "texture": "#texture" },
"up": { "uv": [ 13, 4, 16, 12 ], "texture": "#texture" },
"north": { "uv": [ 0, 15, 3, 16 ], "texture": "#texture" },
"south": { "uv": [ 13, 15, 16, 16 ], "texture": "#texture" },
"west": { "uv": [ 4, 15, 12, 16 ], "texture": "#texture" },
"east": { "uv": [ 4, 15, 12, 16 ], "texture": "#texture" }
}
},
{
"__comment": "outlet2",
"from": [ 13, 11, 4 ],
"to": [ 16, 12, 12 ],
"faces": {
"down": { "uv": [ 13, 4, 16, 12 ], "texture": "#texture" },
"up": { "uv": [ 13, 4, 16, 12 ], "texture": "#texture" },
"north": { "uv": [ 0, 4, 3, 5 ], "texture": "#texture" },
"south": { "uv": [ 13, 4, 16, 5 ], "texture": "#texture" },
"west": { "uv": [ 4, 4, 12, 5 ], "texture": "#texture" },
"east": { "uv": [ 4, 4, 12, 5 ], "texture": "#texture" }
}
},
{
"__comment": "outlet3",
"from": [ 13, 1, 11 ],
"to": [ 16, 11, 12 ],
"faces": {
"down": { "uv": [ 13, 4, 16, 5 ], "texture": "#texture" },
"up": { "uv": [ 13, 11, 16, 12 ], "texture": "#texture" },
"north": { "uv": [ 0, 5, 3, 15 ], "texture": "#texture" },
"south": { "uv": [ 13, 5, 16, 15 ], "texture": "#texture" },
"west": { "uv": [ 11, 5, 12, 15 ], "texture": "#texture" },
"east": { "uv": [ 4, 5, 5, 15 ], "texture": "#texture" }
}
},
{
"__comment": "outlet4",
"from": [ 13, 1, 4 ],
"to": [ 16, 11, 5 ],
"faces": {
"down": { "uv": [ 13, 4, 16, 5 ], "texture": "#texture" },
"up": { "uv": [ 13, 11, 16, 12 ], "texture": "#texture" },
"north": { "uv": [ 0, 5, 3, 15 ], "texture": "#texture" },
"south": { "uv": [ 13, 5, 16, 15 ], "texture": "#texture" },
"west": { "uv": [ 11, 5, 12, 15 ], "texture": "#texture" },
"east": { "uv": [ 4, 5, 5, 15 ], "texture": "#texture" }
}
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B