From c21ca30137305b17f58474fa02e3e3c6ee7d891d Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Thu, 22 Jun 2017 22:45:28 -0400 Subject: [PATCH] maded assets for pickcast added crafting handler and drying state --- .../primal/forgecraft/blocks/CastingForm.java | 23 +- .../crafting/CastingformCrafting.java | 6 +- .../primal/forgecraft/init/ModCrafting.java | 19 +- .../forgecraft/util/CastingFormHandler.java | 16 +- .../forgecraft/models/item/cast_pickaxe.json | 238 ++++++++++++++++++ .../forgecraft/models/item/e_particle.png | Bin 0 -> 159 bytes .../forgecraft/textures/blocks/castingmud.png | Bin 0 -> 921 bytes 7 files changed, 289 insertions(+), 13 deletions(-) create mode 100644 1.11/src/main/resources/assets/forgecraft/models/item/cast_pickaxe.json create mode 100644 1.11/src/main/resources/assets/forgecraft/models/item/e_particle.png create mode 100644 1.11/src/main/resources/assets/forgecraft/textures/blocks/castingmud.png diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java index e8afd2b2..ce8c6d49 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java @@ -17,6 +17,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import nmd.primal.core.common.helper.CommonUtils; import nmd.primal.core.common.items.tools.WorkMallet; import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.init.ModItems; @@ -24,6 +25,7 @@ import nmd.primal.forgecraft.tiles.TileCastingForm; import nmd.primal.forgecraft.util.CastingFormHandler; import javax.annotation.Nullable; +import java.util.Random; /** * Created by mminaie on 6/19/17. @@ -36,6 +38,7 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan super(material, registryName); setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); setCreativeTab(ModInfo.TAB_FORGECRAFT); + this.setTickRandomly(true); } @@ -46,11 +49,6 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan TileCastingForm tile = (TileCastingForm) world.getTileEntity(pos); ItemStack pItem = player.inventory.getCurrentItem(); doInventoryManager(pItem, world, tile, pos, hitx, hity, hitz, state, player); - String[] tempArray = new String[25]; - for (int i = 0; i < 25; i++) { - tempArray[i] = tile.getSlotStack(i).getItem().getRegistryName().toString(); - } - doCraftingformCrafting(pItem, tempArray, world, tile, pos, player); return false; } @@ -58,7 +56,20 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan } - + @Override + public void updateTick(World world, BlockPos pos, IBlockState state, Random random) + { + if (!world.isRemote) { + if(CommonUtils.randomCheck(10)) { + TileCastingForm tile = (TileCastingForm) world.getTileEntity(pos); + String[] tempArray = new String[25]; + for (int i = 0; i < 25; i++) { + tempArray[i] = tile.getSlotStack(i).getItem().getRegistryName().toString(); + } + doCraftingformCrafting(tempArray, world, tile, pos); + } + } + } @Override diff --git a/1.11/src/main/java/nmd/primal/forgecraft/crafting/CastingformCrafting.java b/1.11/src/main/java/nmd/primal/forgecraft/crafting/CastingformCrafting.java index ebacffc4..3f3c329a 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/crafting/CastingformCrafting.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/crafting/CastingformCrafting.java @@ -20,7 +20,7 @@ public class CastingformCrafting { private ItemStack output; - public CastingformCrafting(String[] input, ItemStack output, String upgrade){ + public CastingformCrafting(String[] input, ItemStack output){ this.input = input; this.output = output; @@ -31,9 +31,9 @@ public class CastingformCrafting { // Recipe Methods // ***************************************************************************** // - public static void addRecipe(String[] input, ItemStack output, String upgrade) + public static void addRecipe(String[] input, ItemStack output) { - castingRecipes.add(new CastingformCrafting(input, output, upgrade)); + castingRecipes.add(new CastingformCrafting(input, output)); } public static boolean isRecipe(String[] array) diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java index 6cfee3c0..0b2ca94a 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java @@ -11,6 +11,7 @@ import nmd.primal.core.api.PrimalItems; import nmd.primal.core.common.helper.CommonUtils; import nmd.primal.forgecraft.crafting.AnvilCrafting; import nmd.primal.forgecraft.crafting.BloomeryCrafting; +import nmd.primal.forgecraft.crafting.CastingformCrafting; import nmd.primal.forgecraft.crafting.ForgeCrafting; import java.util.Random; @@ -321,6 +322,22 @@ public class ModCrafting { //TODO PLACE HOLDER FOR WOOTZ + /****************************************************************************** + CASTING + ******************************************************************************/ + + String empty = ItemStack.EMPTY.getItem().getRegistryName().toString(); + String muddd = ModItems.castingmud.getRegistryName().toString(); + + CastingformCrafting.addRecipe( + new String[] { + muddd,muddd,muddd,muddd,muddd, + muddd,empty,empty,empty,muddd, + empty,muddd,muddd,muddd,empty, + muddd,muddd,muddd,muddd,muddd, + muddd,muddd,muddd,muddd,muddd }, + new ItemStack(Items.STICK, 1) + ); /****************************************************************************** FORGING @@ -534,7 +551,7 @@ public class ModCrafting { ANVILING ******************************************************************************/ - String empty = ItemStack.EMPTY.getItem().getRegistryName().toString(); + //String empty = ItemStack.EMPTY.getItem().getRegistryName().toString(); String hotChunk = ModItems.ironchunkhot.getRegistryName().toString(); String hotCleanChunk = ModItems.ironcleanchunkhot.getRegistryName().toString(); String hotSteelChunk = ModItems.steelchunkhot.getRegistryName().toString(); diff --git a/1.11/src/main/java/nmd/primal/forgecraft/util/CastingFormHandler.java b/1.11/src/main/java/nmd/primal/forgecraft/util/CastingFormHandler.java index 5e5e800f..fc329998 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/util/CastingFormHandler.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/util/CastingFormHandler.java @@ -7,6 +7,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import nmd.primal.core.common.helper.PlayerHelper; +import nmd.primal.forgecraft.CommonUtils; +import nmd.primal.forgecraft.crafting.CastingformCrafting; import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.tiles.TileCastingForm; @@ -198,9 +200,17 @@ public interface CastingFormHandler { return false; } - default boolean doCraftingformCrafting(ItemStack pItem, String[] tempArray, World world, TileCastingForm tile, BlockPos pos, EntityPlayer player){ - - return false; + default void doCraftingformCrafting(String[] tempArray, World world, TileCastingForm tile, BlockPos pos){ + CastingformCrafting recipe = CastingformCrafting.getRecipe(tempArray); + if (recipe != null) { + CommonUtils.spawnItemEntityFromWorld(world, pos, recipe.getOutput()); + } + //world.playEvent(1031, pos, 0); + for (int i = 0; i < tile.getSlotListSize(); i++) { + if (!tile.getSlotStack(i).isEmpty()) { + tile.setSlotStack(i, ItemStack.EMPTY); + } + } } } diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/cast_pickaxe.json b/1.11/src/main/resources/assets/forgecraft/models/item/cast_pickaxe.json new file mode 100644 index 00000000..f1251f70 --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/models/item/cast_pickaxe.json @@ -0,0 +1,238 @@ +{ + "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "blocks/e_particle", + "texture": "blocks/castingmud" + }, + "elements": [ + { + "__comment": "Box29", + "from": [ 0, 0, 0 ], + "to": [ 16, 2, 3 ], + "faces": { + "down": { "uv": [ 0, 13, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 3 ], "texture": "#texture" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 14, 3, 16 ], "texture": "#texture" }, + "east": { "uv": [ 13, 14, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box29", + "from": [ 0, 0, 13 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 3 ], "texture": "#texture" }, + "up": { "uv": [ 0, 13, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture" }, + "west": { "uv": [ 13, 14, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 14, 3, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box31", + "from": [ 0, 0, 3 ], + "to": [ 3, 2, 13 ], + "faces": { + "down": { "uv": [ 0, 3, 3, 13 ], "texture": "#texture" }, + "up": { "uv": [ 0, 3, 3, 13 ], "texture": "#texture" }, + "west": { "uv": [ 3, 14, 13, 16 ], "texture": "#texture" }, + "east": { "uv": [ 3, 14, 13, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box31", + "from": [ 13, 0, 3 ], + "to": [ 16, 2, 13 ], + "faces": { + "down": { "uv": [ 13, 3, 16, 13 ], "texture": "#texture" }, + "up": { "uv": [ 13, 3, 16, 13 ], "texture": "#texture" }, + "west": { "uv": [ 3, 14, 13, 16 ], "texture": "#texture" }, + "east": { "uv": [ 3, 14, 13, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 5, 0, 3 ], + "to": [ 7, 2, 5 ], + "faces": { + "down": { "uv": [ 5, 11, 7, 13 ], "texture": "#texture" }, + "up": { "uv": [ 5, 3, 7, 5 ], "texture": "#texture" }, + "south": { "uv": [ 5, 14, 7, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 3, 0, 3 ], + "to": [ 5, 2, 5 ], + "faces": { + "down": { "uv": [ 3, 11, 5, 13 ], "texture": "#texture" }, + "up": { "uv": [ 3, 3, 5, 5 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 7, 0, 3 ], + "to": [ 9, 2, 5 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 9, 0, 3 ], + "to": [ 11, 2, 5 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 11, 0, 3 ], + "to": [ 13, 2, 5 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 5, 0, 7 ], + "to": [ 7, 2, 9 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 3, 0, 5 ], + "to": [ 5, 2, 7 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 7, 0, 7 ], + "to": [ 9, 2, 9 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 9, 0, 7 ], + "to": [ 11, 2, 9 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 11, 0, 5 ], + "to": [ 13, 2, 7 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 3, 0, 9 ], + "to": [ 5, 2, 11 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 5, 0, 9 ], + "to": [ 7, 2, 11 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 7, 0, 9 ], + "to": [ 9, 2, 11 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 9, 0, 9 ], + "to": [ 11, 2, 11 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 11, 0, 9 ], + "to": [ 13, 2, 11 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 3, 0, 11 ], + "to": [ 5, 2, 13 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 5, 0, 11 ], + "to": [ 7, 2, 13 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 7, 0, 11 ], + "to": [ 9, 2, 13 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 9, 0, 11 ], + "to": [ 11, 2, 13 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box33", + "from": [ 11, 0, 11 ], + "to": [ 13, 2, 13 ], + "faces": { + "down": { "uv": [ 11, 3, 13, 5 ], "texture": "#texture" }, + "up": { "uv": [ 11, 11, 13, 13 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/e_particle.png b/1.11/src/main/resources/assets/forgecraft/models/item/e_particle.png new file mode 100644 index 0000000000000000000000000000000000000000..e557878f9b0081df0e6c571ed915f4780bf1a2fc GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|X`U{QAsV7vCj@daC~~-LPd)$i z?$?xTj^-IIp9ACFK7V={aJAiXe!J@v0mIGT4Z3dBCY+nlAN}mLRowa~J3GYg{eRVX zXUUaN&3PXSznt{pUt?*oMTj?KX|GSjMcIr5t;EiVqsx9UI;{|T9DHPlG0;W^Pgg&e IbxsLQ03WwL?f?J) literal 0 HcmV?d00001 diff --git a/1.11/src/main/resources/assets/forgecraft/textures/blocks/castingmud.png b/1.11/src/main/resources/assets/forgecraft/textures/blocks/castingmud.png new file mode 100644 index 0000000000000000000000000000000000000000..05117cd21dad079dfc76cd40a2d74770840eebc7 GIT binary patch literal 921 zcmV;K17`e*P)WFU8GbZ8()Nlj2>E@cM*00R9?hkzUK96?wi+77}uH8mTiOO;S z9H)c^oO`juI~N!D;JsD;Z^ZTQ)>*ndkLx&8%cB^kMCFPsSNwi^pG(WP0J!?)NdWR( zLD9!6j{=~bKX%wF^aaZx2mKMw}8; zPrCfM7SM|mmM+h;^8LmmS&X3@wAvxH%8-vH5j)K$wR)8_O_5UP-gb-j;gI<4wL4sR za~8`o>GuaDX-eHI6U7N=k`F&B&?m>o*x7Aj8v5h1l}ee0=aDMKPe1-m6vtG?VgLqR zhicj7+2`AUi~joC6Tk!jpMUlTCA&n!^T>-nQWq?qpXU0?FU(9g0Jyte&<=;fufMX9 z?cLI+^QV0_w-UTM9GNspLW6wJ2VnKi4sk~kt2V*5g*!UJ!V4iQKS=yW9qpy(&K7yD z(4}DRv`28)AW;gHDFED&VX#g&!gg!`RHoPs_Lx38fe-@nexEm%=Ga(G5JD2{wJ=PB zsM{q@6T+y2?bxU^B~+UvNrvZ^QE7^H=H%0bWttQec&H#o4`wsy3HfDGb1lX2E zFHQllOp~bB8@{qT;@~&xJTWsxbHBy?hXI$~Kf=u$lAAXque{|m;rlFKIZgo-K-i7Y zbsf88B5L(2wq>##?Bh@6gq>kwQ(IbeMGb@2Dw7@2N=4+f04aP1%R;IW9Ila>uWWHN;915766muV^sWY78cw1euHY+ vWz;F5>jpwf!YCq>Ym~}=(QQ3Nqw4W59ZNe*XFQ5100000NkvXXu0mjf0*s%< literal 0 HcmV?d00001