fixed bugs

This commit is contained in:
Mohammad-Ali Minaie
2018-09-25 07:52:42 -04:00
parent 73a9bef667
commit 8fc8dd32c2
15 changed files with 451 additions and 293 deletions

View File

@@ -6,7 +6,7 @@ org.gradle.jvmargs=-Xmx3G
mod_group=nmd.primal.forgecraft mod_group=nmd.primal.forgecraft
mod_name=ForgeCraft mod_name=ForgeCraft
mod_version=1.6.10 mod_version=1.6.13
forge_version=14.23.4.2744 forge_version=14.23.4.2744
mcp_mappings=snapshot_20171003 mcp_mappings=snapshot_20171003
mc_version=1.12.2 mc_version=1.12.2

View File

@@ -11,44 +11,18 @@ make a copy of it somewhere, it doenst need to be instantiated or anything, the
for your setRecipeName include your mod id like .setRecipeName(KFC.MOD_ID, "soft_crucible")); for your setRecipeName include your mod id like .setRecipeName(KFC.MOD_ID, "soft_crucible"));
you'll need to update the annotation @GameRegistry.ObjectHolder(ModInfo.MOD_ID) with your mod id also you'll need to update the annotation @GameRegistry.ObjectHolder(ModInfo.MOD_ID) with your mod id also
- [x] Fix Plate Crafting
- [x] Longbow animation
- [x] Fix Forge Cool Down
- [x] Fix Forge StackTagCompound management
- [x] ForgeHammer Recipes
- [ ] Leather Helmet Inventory Model - [ ] Leather Helmet Inventory Model
- [ ] Config Usage - [ ] Config Usage
- [ ] Craft Tweaker Support - [ ] Craft Tweaker Support
- [ ] Apply Forge turn off logic to Bloomery - [ ] Apply Forge turn off logic to Bloomery
- [ ] Copper Tools - [ ] Copper Tools
- [ ] Config for lowering fortune multiplier - [ ] Config for lowering fortune multiplier
- [x] Bronze Plate Cast
- [x] JEI Support
- [x] Update SoftCrucible Model
- [x] Crucibles were returning input ingredients even after cooked
- [x] Hot Crucible doesn't have hot molten layer
- [x] Can't add upgrades to the anvil
- [x] Steel Plate Recipe #37
- [x] Damascus Recipes
- [x] Damascus Weapons
- [x] Need Recipe for Soft Crucible
- [x] Make Wootz Weapons
- [x] Crucible is not resetting after iron is removed.
- [x] Chunk and Ball stacking
- [x] Delete unused models, blockstates, and textures
- [x] Inventory version of balls have the same texture
- [x] Wootz Chunk Model
- [x] Casting Mud Texture
- [x] Adobe Bloomery Texture
- [x] Adobe Forge Texture
- [x] Update nbt Crucible Models with open top
- [x] Update all slotted tong models
- [x] Inventory model for nbtCrucible
- [x] Tongs hot Texture
- [x] Casting Block line 103
- [x] Bloomery rendering all messed up
- [x] Update Casting recipes to use new slotted tongs and nbtCrucible
- [x] NBT Crucible
- [x] NBT Crucible Recipes
- [x] Slotted Tongs
- [x] Item Crucible
- [x] NBTCrucible to ItemCrucible transformer
- [x] StoneTongs ItemCrucible to NBTCrucible transformer
## Feature Musket ## Feature Musket
- [ ] Create powder charge item (copper, charcoal, gunpowder) - [ ] Create powder charge item (copper, charcoal, gunpowder)
@@ -81,6 +55,38 @@ rename s/iron/steel/ iron*
``` ```
### Completed ### Completed
- [x] Bronze Plate Cast
- [x] JEI Support
- [x] Update SoftCrucible Model
- [x] Crucibles were returning input ingredients even after cooked
- [x] Hot Crucible doesn't have hot molten layer
- [x] Can't add upgrades to the anvil
- [x] Steel Plate Recipe #37
- [x] Damascus Recipes
- [x] Damascus Weapons
- [x] Need Recipe for Soft Crucible
- [x] Make Wootz Weapons
- [x] Crucible is not resetting after iron is removed.
- [x] Chunk and Ball stacking
- [x] Delete unused models, blockstates, and textures
- [x] Inventory version of balls have the same texture
- [x] Wootz Chunk Model
- [x] Casting Mud Texture
- [x] Adobe Bloomery Texture
- [x] Adobe Forge Texture
- [x] Update nbt Crucible Models with open top
- [x] Update all slotted tong models
- [x] Inventory model for nbtCrucible
- [x] Tongs hot Texture
- [x] Casting Block line 103
- [x] Bloomery rendering all messed up
- [x] Update Casting recipes to use new slotted tongs and nbtCrucible
- [x] NBT Crucible
- [x] NBT Crucible Recipes
- [x] Slotted Tongs
- [x] Item Crucible
- [x] NBTCrucible to ItemCrucible transformer
- [x] StoneTongs ItemCrucible to NBTCrucible transformer
- [x] BlockBreaker Support for copper dust and tin dust - [x] BlockBreaker Support for copper dust and tin dust
- [x] picking up raw bronze crucible returns some other shit - [x] picking up raw bronze crucible returns some other shit
- [x] Tool breaking should return tool head - [x] Tool breaking should return tool head

View File

@@ -18,7 +18,7 @@ public class ModInfo {
//public static final String MOD_PREFIX = MOD_ID + ":"; //public static final String MOD_PREFIX = MOD_ID + ":";
public static final String MOD_CHANNEL = MOD_ID; public static final String MOD_CHANNEL = MOD_ID;
public static final String MOD_VERSION = "1.6.10"; public static final String MOD_VERSION = "1.6.13";
public static final String MC_VERSIONS = "[1.12.0, 1.13.0)"; public static final String MC_VERSIONS = "[1.12.0, 1.13.0)";
public static final String DEPENDENCIES = "required-after:forge@[14.21.1.2400,);" + "required-after:primal@[0.6.69,);"; public static final String DEPENDENCIES = "required-after:forge@[14.21.1.2400,);" + "required-after:primal@[0.6.69,);";

View File

@@ -202,6 +202,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
ItemStack slotStack = inventory.getStackInSlot(0).copy(); ItemStack slotStack = inventory.getStackInSlot(0).copy();
SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem();
//SlottedTongs temp = (SlottedTongs) pItem.getItem(); //SlottedTongs temp = (SlottedTongs) pItem.getItem();
if (!pItem.isEmpty() && tile.isItemValidForSlot(1, slotStack)) { if (!pItem.isEmpty() && tile.isItemValidForSlot(1, slotStack)) {
@@ -212,8 +213,8 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
ItemStack place_stack = slotStack.copy(); ItemStack place_stack = slotStack.copy();
//if (tile.putStack(slot, place_stack)) //if (tile.putStack(slot, place_stack))
tile.setSlotStack(1, place_stack); tile.setSlotStack(1, inventory.extractItem(0, 1, false));
inventory.insertItem(0, ItemStack.EMPTY, false); itemstackItem.markDirty(pItem);
return true; return true;
} }
} }
@@ -223,6 +224,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
ItemStack slotStack = inventory.getStackInSlot(0).copy(); ItemStack slotStack = inventory.getStackInSlot(0).copy();
SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem();
//SlottedTongs temp = (SlottedTongs) pItem.getItem(); //SlottedTongs temp = (SlottedTongs) pItem.getItem();
@@ -235,6 +237,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
if(inventory.getStackInSlot(0).isEmpty()){ if(inventory.getStackInSlot(0).isEmpty()){
inventory.insertItem(0, place_stack, false); inventory.insertItem(0, place_stack, false);
tile.setSlotStack(1, ItemStack.EMPTY); tile.setSlotStack(1, ItemStack.EMPTY);
itemstackItem.markDirty(pItem);
return true; return true;
} }
} }

View File

@@ -255,7 +255,7 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider,
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{ {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2); worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
System.out.println(placer.getHorizontalFacing()); //System.out.println(placer.getHorizontalFacing());
} }
@Override @Override

View File

@@ -277,6 +277,18 @@ public class ModCrafting{
1100, 1100,
800); 800);
CrucibleCrafting.addRecipe(
Ingredient.fromStacks(new ItemStack(ModItems.brokenwroughtirontool, 1)),
Ingredient.EMPTY,
Ingredient.EMPTY,
Ingredient.EMPTY,
Ingredient.EMPTY,
new ItemStack(PrimalAPI.Items.SLAG, 1),
new ItemStack(ModItems.ironingotball, 1),
1250,
1100,
800);
CrucibleCrafting.addRecipe( CrucibleCrafting.addRecipe(
new OreIngredient("dustIron"), new OreIngredient("dustIron"),
Ingredient.fromStacks(new ItemStack(PrimalAPI.Items.CARBONATE_SLACK, 1)), Ingredient.fromStacks(new ItemStack(PrimalAPI.Items.CARBONATE_SLACK, 1)),
@@ -289,6 +301,18 @@ public class ModCrafting{
1200, 1200,
800); 800);
CrucibleCrafting.addRecipe(
Ingredient.fromStacks(new ItemStack(ModItems.brokencleanirontool, 1)),
new OreIngredient("nuggetIron"),
Ingredient.EMPTY,
Ingredient.EMPTY,
Ingredient.EMPTY,
new ItemStack(PrimalAPI.Items.SLAG, 1),
new ItemStack(ModItems.ironcleaningotball, 1),
1550,
1200,
800);
CrucibleCrafting.addRecipe( CrucibleCrafting.addRecipe(
Ingredient.fromStacks(new ItemStack(ModItems.ironcleaningotball, 1)), Ingredient.fromStacks(new ItemStack(ModItems.ironcleaningotball, 1)),
Ingredient.fromStacks(new ItemStack(PrimalAPI.Items.CHARCOAL_HIGH, 1)), Ingredient.fromStacks(new ItemStack(PrimalAPI.Items.CHARCOAL_HIGH, 1)),
@@ -301,6 +325,18 @@ public class ModCrafting{
1500, 1500,
1000); 1000);
CrucibleCrafting.addRecipe(
Ingredient.fromStacks(new ItemStack(ModItems.brokensteeltool, 1)),
new OreIngredient("nuggetSteel"),
Ingredient.EMPTY,
Ingredient.EMPTY,
Ingredient.EMPTY,
new ItemStack(PrimalAPI.Items.SLAG, 1),
new ItemStack(ModItems.steelingotball, 1),
2100,
1500,
1000);
CrucibleCrafting.addRecipe( CrucibleCrafting.addRecipe(
new OreIngredient("dustMagnetite"), new OreIngredient("dustMagnetite"),
Ingredient.fromStacks(new ItemStack(Blocks.LEAVES, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())), Ingredient.fromStacks(new ItemStack(Blocks.LEAVES, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())),
@@ -325,6 +361,19 @@ public class ModCrafting{
1800, 1800,
1500); 1500);
CrucibleCrafting.addRecipe(
Ingredient.fromStacks(new ItemStack(ModItems.brokenwootztool, 1)),
new OreIngredient("nuggetWootz"),
Ingredient.EMPTY,
Ingredient.EMPTY,
Ingredient.EMPTY,
new ItemStack(PrimalAPI.Items.SLAG, 1),
new ItemStack(ModItems.wootzingotball, 1),
2100,
1800,
1500);
//TODO change plate recipe
NBTTagCompound tagBronzeDefault = new NBTTagCompound(); NBTTagCompound tagBronzeDefault = new NBTTagCompound();
tagBronzeDefault.setString("upgrades", ""); tagBronzeDefault.setString("upgrades", "");
@@ -1064,9 +1113,9 @@ public class ModCrafting{
new ItemStack(ModItems.bronzeingotball, 1), new ItemStack(ModItems.bronzeingotball, 1),
new Item[] { new Item[] {
muddd,muddd,muddd,muddd,muddd, muddd,muddd,muddd,muddd,muddd,
muddd,muddd,muddd,muddd,muddd, muddd,empty,empty,empty,muddd,
muddd,empty,empty,muddd,muddd, muddd,empty,empty,empty,muddd,
muddd,empty,empty,muddd,muddd, muddd,empty,empty,empty,muddd,
muddd,muddd,muddd,muddd,muddd }, muddd,muddd,muddd,muddd,muddd },
new ItemStack(PrimalAPI.Items.BRONZE_PLATE, 1) new ItemStack(PrimalAPI.Items.BRONZE_PLATE, 1)
); );
@@ -1080,7 +1129,7 @@ public class ModCrafting{
ModItems.ironingotball, ModItems.ironingotball,
//800, 200 //800, 200
hotIronIngot, hotIronIngot,
100, 800,
100, 100,
500, 500,
1.0f, 1.0f,
@@ -1355,6 +1404,42 @@ public class ModCrafting{
"null" "null"
); );
/*** ForgeHammer ***/
AnvilCrafting.addRecipe(
new ItemStack [] {
emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir,
emptyAir,hotCleanChunk,hotCleanChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir },
new ItemStack(ModItems.forgehammer, 1),
"null"
);
/*** ForgeHammer ***/
AnvilCrafting.addRecipe(
new ItemStack [] {
emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir,
emptyAir,hotSteelChunk,hotSteelChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotSteelChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotSteelChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotSteelChunk,emptyAir,emptyAir },
new ItemStack(ModItems.forgehammer, 1),
"null"
);
/*** ForgeHammer ***/
AnvilCrafting.addRecipe(
new ItemStack [] {
emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir,
emptyAir,hotWootzChunk,hotWootzChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotWootzChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotWootzChunk,emptyAir,emptyAir,
emptyAir,emptyAir,hotWootzChunk,emptyAir,emptyAir },
new ItemStack(ModItems.forgehammer, 1),
"null"
);
/*** Bucket ***/ /*** Bucket ***/
AnvilCrafting.addRecipe( AnvilCrafting.addRecipe(
new ItemStack [] { new ItemStack [] {
@@ -1371,9 +1456,21 @@ public class ModCrafting{
AnvilCrafting.addRecipe( AnvilCrafting.addRecipe(
new ItemStack [] { new ItemStack [] {
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir,
emptyAir,hotChunk,hotChunk,hotChunk,emptyAir,
emptyAir,hotChunk,hotChunk,hotChunk,emptyAir,
emptyAir,hotChunk,hotChunk,hotChunk,emptyAir,
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir },
new ItemStack(PrimalAPI.Items.IRON_PLATE, 1),
"null"
);
/*** Primal Plate ***/
AnvilCrafting.addRecipe(
new ItemStack [] {
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir,
emptyAir,hotChunk,hotChunk,emptyAir,emptyAir, emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir,
emptyAir,hotChunk,hotChunk,emptyAir,emptyAir, emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir,
emptyAir,hotCleanChunk,hotCleanChunk,hotCleanChunk,emptyAir,
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir },
new ItemStack(PrimalAPI.Items.IRON_PLATE, 1), new ItemStack(PrimalAPI.Items.IRON_PLATE, 1),
"null" "null"
@@ -1383,9 +1480,23 @@ public class ModCrafting{
AnvilCrafting.addRecipe( AnvilCrafting.addRecipe(
new ItemStack [] { new ItemStack [] {
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir,
emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir,
emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir,
emptyAir,hotSteelChunk,hotSteelChunk,hotSteelChunk,emptyAir,
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir },
new ItemStack(PrimalAPI.Items.STEEL_PLATE, 1),
"null"
);
/*** Steel Plate ***/
AnvilCrafting.addRecipe(
new ItemStack [] {
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir,
emptyAir,hotSteelChunk,hotSteelChunk,emptyAir,emptyAir, emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir,
emptyAir,hotSteelChunk,hotSteelChunk,emptyAir,emptyAir, emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir,
emptyAir,hotWootzChunk,hotWootzChunk,hotWootzChunk,emptyAir,
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir },
new ItemStack(PrimalAPI.Items.STEEL_PLATE, 1), new ItemStack(PrimalAPI.Items.STEEL_PLATE, 1),
"null" "null"
@@ -1865,7 +1976,7 @@ public class ModCrafting{
AnvilCrafting.addRecipe( AnvilCrafting.addRecipe(
new ItemStack [] { new ItemStack [] {
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir,
emptyAir,emptyAir,hotChunk,emptyAir,emptyAir, emptyAir,emptyAir,hotCleanChunk,emptyAir,emptyAir,
emptyAir,emptyAir,cleanaxehead,emptyAir,emptyAir, emptyAir,emptyAir,cleanaxehead,emptyAir,emptyAir,
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir,
emptyAir,emptyAir,emptyAir,emptyAir,emptyAir }, emptyAir,emptyAir,emptyAir,emptyAir,emptyAir },

View File

@@ -189,7 +189,7 @@ public class BaseMultiItem extends BaseItem {
if (stack.getTagCompound().getBoolean("hot")) { if (stack.getTagCompound().getBoolean("hot")) {
player.setFire(1); player.setFire(1);
} }
if (PrimalAPI.randomCheck(50)) { if (PrimalAPI.randomCheck(10)) {
stack.getTagCompound().setBoolean("hot", false); stack.getTagCompound().setBoolean("hot", false);
player.getEntityWorld().playSound(null, player.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); player.getEntityWorld().playSound(null, player.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
} }
@@ -200,22 +200,32 @@ public class BaseMultiItem extends BaseItem {
@Override @Override
public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem) public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem)
{ {
if(entityItem.isWet()){ if(!entityItem.getEntityWorld().isRemote) {
if(entityItem.getItem().hasTagCompound()) { if (entityItem.getItem().hasTagCompound()) {
if(entityItem.getItem().getTagCompound().getBoolean("hot")){ if (entityItem.isWet()) {
if (entityItem.getItem().getTagCompound().getBoolean("hot")) {
entityItem.getItem().getTagCompound().setBoolean("hot", false);
entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
return true;
}
}
/*
if (!entityItem.isWet()) {
if (entityItem.getItem().getTagCompound().getBoolean("hot")) {
FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition());
return true;
}
}
*/
if (PrimalAPI.randomCheck(10)) {
if (entityItem.getItem().getTagCompound().getBoolean("hot")) {
entityItem.getItem().getTagCompound().setBoolean("hot", false); entityItem.getItem().getTagCompound().setBoolean("hot", false);
entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
return true; return true;
} }
} }
} }
if(!entityItem.isWet()){
if(entityItem.getItem().getTagCompound().getBoolean("hot")) {
FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition());
return true;
} }
}
return false; return false;
} }

View File

@@ -1,20 +1,18 @@
package nmd.primal.forgecraft.items; package nmd.primal.forgecraft.items;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//TODO remove wildcard import
import net.minecraft.util.*; import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -25,7 +23,6 @@ import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.ItemStackHandler;
import nmd.primal.core.api.PrimalAPI; import nmd.primal.core.api.PrimalAPI;
@@ -43,7 +40,6 @@ import nmd.primal.forgecraft.items.blocks.ItemNBTCrucible;
import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileNBTCrucible; import nmd.primal.forgecraft.tiles.TileNBTCrucible;
import nmd.primal.forgecraft.util.AnvilHandler; import nmd.primal.forgecraft.util.AnvilHandler;
import org.lwjgl.Sys;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;
@@ -57,7 +53,6 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
@CapabilityInject(IItemHandler.class) @CapabilityInject(IItemHandler.class)
public static Capability<IItemHandler> ITEM_HANDLER; public static Capability<IItemHandler> ITEM_HANDLER;
//public static CapabilityItemHandler ITEM_HANDLER;
public SlottedTongs(String unlocalizedName) { public SlottedTongs(String unlocalizedName) {
this.setUnlocalizedName(unlocalizedName); this.setUnlocalizedName(unlocalizedName);
@@ -70,155 +65,151 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
{ {
NonNullList<ItemStack> renderList = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null);
ItemStack slotStack = inventory.getStackInSlot(0);
if(stack.getTagCompound() != null){ if(stack.getTagCompound() != null){
System.out.println(slotStack);
} ItemStackHelper.loadAllItems(stack.getTagCompound(), renderList);
//System.out.println(slotStack); ItemStack slotStack = renderList.get(0);
if (stack.getItem() instanceof SlottedTongs) { if (stack.getItem() instanceof SlottedTongs) {
if (slotStack.getItem() instanceof ItemNBTCrucible) { if (slotStack.getItem() instanceof ItemNBTCrucible) {
/***Render Empty Crucible***/ /***Render Empty Crucible***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 0){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 0) {
return 0.99f; return 0.99f;
} }
/***Render Level 1***/ /***Render Level 1***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 1){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 1) {
return 0.011f; return 0.011f;
} }
/***Render Level 2***/ /***Render Level 2***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 2){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 2) {
return 0.012f; return 0.012f;
} }
/***Render Level 3***/ /***Render Level 3***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 3){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 3) {
return 0.013f; return 0.013f;
} }
/***Render Level 4***/ /***Render Level 4***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 4){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 4) {
return 0.014f; return 0.014f;
} }
/***Render Level 5***/ /***Render Level 5***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 5){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 5) {
return 0.015f; return 0.015f;
} }
/***Render Level Cooked***/ /***Render Level Cooked***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 6){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 6) {
return 0.016f; return 0.016f;
} }
/***Render Failed***/ /***Render Failed***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 7){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 7) {
return 0.017f; return 0.017f;
} }
/***Render Hot***/ /***Render Hot***/
if(inventory.getStackInSlot(0).getSubCompound("BlockEntityTag").getInteger("hot") == 15){ if (slotStack.getSubCompound("BlockEntityTag").getInteger("hot") == 15) {
return 0.025f; return 0.025f;
} }
} }
if(slotStack.getItem() instanceof ToolPart){ if (slotStack.getItem() instanceof ToolPart) {
ToolPart toolPart = (ToolPart) inventory.getStackInSlot(0).getItem(); ToolPart toolPart = (ToolPart) slotStack.getItem();
if(toolPart.getID() == "pickaxe"){ if (toolPart.getID() == "pickaxe") {
if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { if (slotStack.getSubCompound("tags") != null) {
if (slotStack.getSubCompound("tags").getBoolean("hot")) { if (slotStack.getSubCompound("tags").getBoolean("hot")) {
return 0.03f; return 0.03f;
} }
if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { if (!slotStack.getSubCompound("tags").getBoolean("hot")) {
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) {
return 0.04f; return 0.04f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) {
return 0.05f; return 0.05f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) {
return 0.06f; return 0.06f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) {
return 0.07f; return 0.07f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) {
return 0.08f; return 0.08f;
} }
} }
} }
} }
if(toolPart.getID() == "axe"){ if (toolPart.getID() == "axe") {
if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { if (slotStack.getSubCompound("tags") != null) {
if (slotStack.getSubCompound("tags").getBoolean("hot")) { if (slotStack.getSubCompound("tags").getBoolean("hot")) {
return 0.09f; return 0.09f;
} }
if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { if (!slotStack.getSubCompound("tags").getBoolean("hot")) {
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) {
return 0.10f; return 0.10f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) {
return 0.11f; return 0.11f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) {
return 0.12f; return 0.12f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) {
return 0.13f; return 0.13f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) {
return 0.14f; return 0.14f;
} }
} }
} }
} }
if(toolPart.getID() == "shovel"){ if (toolPart.getID() == "shovel") {
if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { if (slotStack.getSubCompound("tags") != null) {
if (slotStack.getSubCompound("tags").getBoolean("hot")) { if (slotStack.getSubCompound("tags").getBoolean("hot")) {
return 0.15f; return 0.15f;
} }
if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { if (!slotStack.getSubCompound("tags").getBoolean("hot")) {
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) {
return 0.16f; return 0.16f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) {
return 0.17f; return 0.17f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) {
return 0.18f; return 0.18f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) {
return 0.19f; return 0.19f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) {
return 0.20f; return 0.20f;
} }
} }
} }
} }
if(toolPart.getID() == "hoe"){ if (toolPart.getID() == "hoe") {
if (inventory.getStackInSlot(0).getSubCompound("tags") != null) { if (slotStack.getSubCompound("tags") != null) {
if (slotStack.getSubCompound("tags").getBoolean("hot")) { if (slotStack.getSubCompound("tags").getBoolean("hot")) {
return 0.21f; return 0.21f;
} }
if (!inventory.getStackInSlot(0).getSubCompound("tags").getBoolean("hot")) { if (!slotStack.getSubCompound("tags").getBoolean("hot")) {
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON) {
return 0.22f; return 0.22f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON) {
return 0.23f; return 0.23f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL) {
return 0.24f; return 0.24f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL) {
return 0.25f; return 0.25f;
} }
if(toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE){ if (toolPart.getMaterial() == PrimalAPI.ToolMaterials.TOOL_BRONZE) {
return 0.26f; return 0.26f;
} }
} }
} }
} }
} }
if(slotStack.getItem() instanceof BaseMultiItem){ if (slotStack.getItem() instanceof BaseMultiItem) {
Item slotItem = slotStack.getItem(); Item slotItem = slotStack.getItem();
if (slotStack.getTagCompound() != null) { if (slotStack.getTagCompound() != null) {
if (!slotStack.getTagCompound().getBoolean("hot")) { if (!slotStack.getTagCompound().getBoolean("hot")) {
@@ -288,6 +279,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
} }
} }
} }
}
return 0.0F; return 0.0F;
} }
}); });
@@ -349,6 +341,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
ItemStack tempStack = slotStack; ItemStack tempStack = slotStack;
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
itemstackItem.markDirty(itemstack);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
@@ -367,6 +360,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
ItemStack tempStack = slotStack.copy(); ItemStack tempStack = slotStack.copy();
tempStack.getTagCompound().setBoolean("hot", false); tempStack.getTagCompound().setBoolean("hot", false);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
itemstackItem.markDirty(itemstack);
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
world.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); world.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
@@ -379,12 +373,11 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
DROPS the Ingots into the World DROPS the Ingots into the World
*****/ *****/
if (!slotStack.isEmpty()) { if (!slotStack.isEmpty()) {
System.out.println("Tongs isn't empty");
if (slotStack.getItem() instanceof BaseMultiItem) { if (slotStack.getItem() instanceof BaseMultiItem) {
ItemStack tempStack = slotStack.copy(); ItemStack tempStack = slotStack.copy();
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
System.out.println(inventory.getStackInSlot(0)); itemstackItem.markDirty(itemstack);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
if (!(slotStack.getItem() instanceof BaseMultiItem)) { if (!(slotStack.getItem() instanceof BaseMultiItem)) {
@@ -392,25 +385,28 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
ItemStack tempStack = slotStack.copy(); ItemStack tempStack = slotStack.copy();
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
itemstackItem.markDirty(itemstack);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
if (RecipeHelper.isOreName(slotStack.getItem(), "nuggetIron")) { if (RecipeHelper.isOreName(slotStack.getItem(), "nuggetIron")) {
ItemStack tempStack = slotStack.copy(); ItemStack tempStack = slotStack.copy();
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
itemstackItem.markDirty(itemstack);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
if (RecipeHelper.isOreName(slotStack.getItem(), "ingotSteel")) { if (RecipeHelper.isOreName(slotStack.getItem(), "ingotSteel")) {
ItemStack tempStack = slotStack.copy(); ItemStack tempStack = slotStack.copy();
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
itemstackItem.markDirty(itemstack);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
if (RecipeHelper.isOreName(slotStack.getItem(), "nuggetSteel")) { if (RecipeHelper.isOreName(slotStack.getItem(), "nuggetSteel")) {
ItemStack tempStack = slotStack.copy(); ItemStack tempStack = slotStack.copy();
PlayerHelper.spawnItemOnGround(world, pos, tempStack); PlayerHelper.spawnItemOnGround(world, pos, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
//inventory.insertItem(0, ItemStack.EMPTY, false); itemstackItem.markDirty(itemstack);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
} }
@@ -524,8 +520,6 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
@Override @Override
public NBTTagCompound getNBTShareTag(ItemStack stack) public NBTTagCompound getNBTShareTag(ItemStack stack)
{ {
System.out.println("Does getNBT ever run");
ItemStackHandler h = (ItemStackHandler)stack.getCapability(ITEM_HANDLER, null); ItemStackHandler h = (ItemStackHandler)stack.getCapability(ITEM_HANDLER, null);
if(stack.getTagCompound() != null) { if(stack.getTagCompound() != null) {
NBTTagCompound tag = stack.getTagCompound().copy(); NBTTagCompound tag = stack.getTagCompound().copy();
@@ -542,7 +536,6 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
@Override @Override
public void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt) public void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt)
{ {
System.out.println("Does readNBT ever run");
if (nbt != null) if (nbt != null)
{ {
ItemStackHandler h = (ItemStackHandler)stack.getCapability(ITEM_HANDLER, null); ItemStackHandler h = (ItemStackHandler)stack.getCapability(ITEM_HANDLER, null);
@@ -558,21 +551,28 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
@Override @Override
public boolean getShareTag() public boolean getShareTag()
{ {
System.out.println("Getting share tag");
return true; return true;
} }
@Override @Override
public boolean updateItemStackNBT(NBTTagCompound nbt) public boolean updateItemStackNBT(NBTTagCompound nbt)
{ {
System.out.println("Update NBT");
return true; return true;
} }
public void markDirty(ItemStack stack){ public void markDirty(ItemStack stack) {
NBTTagCompound tag = stack.getTagCompound(); NBTTagCompound tag = stack.getTagCompound();
tag.setInteger("changeNumber", tag.getInteger("changeNumber") + 1); IItemHandler inventory = stack.getCapability(ITEM_HANDLER, null);
NonNullList<ItemStack> sendList = NonNullList.<ItemStack>withSize(1, inventory.getStackInSlot(0));
if (stack.getTagCompound() != null) {
stack.getTagCompound().setInteger("changeNumber", tag.getInteger("changeNumber") + 1);
ItemStackHelper.saveAllItems(stack.getTagCompound(), sendList);
} else {
NBTTagCompound tagCompound = new NBTTagCompound();
tagCompound.setInteger("changeNumber", 0);
ItemStackHelper.saveAllItems(tagCompound, sendList);
stack.setTagCompound(tagCompound);
}
} }
} }

View File

@@ -278,7 +278,7 @@ public class ToolPart extends Item implements ToolNBT{
if (item.hasTagCompound()) { if (item.hasTagCompound()) {
if (item.getSubCompound("tags").getBoolean("hot")) { if (item.getSubCompound("tags").getBoolean("hot")) {
player.setFire(1); player.setFire(1);
if (PrimalAPI.randomCheck(50)) { if (PrimalAPI.randomCheck(10)) {
item.getSubCompound("tags").setBoolean("hot", false); item.getSubCompound("tags").setBoolean("hot", false);
player.getEntityWorld().playSound(null, player.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); player.getEntityWorld().playSound(null, player.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
} }
@@ -290,20 +290,31 @@ public class ToolPart extends Item implements ToolNBT{
@Override @Override
public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem) public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem)
{ {
if(entityItem.isWet()){ if(!entityItem.getEntityWorld().isRemote) {
if(entityItem.getItem().hasTagCompound()) { if (entityItem.getItem().hasTagCompound()) {
if(entityItem.getItem().getTagCompound().getBoolean("hot")){ if (entityItem.isWet()) {
if (entityItem.getItem().getTagCompound().getBoolean("hot")) {
entityItem.getItem().getTagCompound().setBoolean("hot", false); entityItem.getItem().getTagCompound().setBoolean("hot", false);
entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F); entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
return true; return true;
} }
} }
} /*
if(!entityItem.isWet()){ if (!entityItem.isWet()) {
if(entityItem.getItem().getTagCompound().getBoolean("hot")) { if (entityItem.getItem().getTagCompound().getBoolean("hot")) {
FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition()); FireHelper.setFire(entityItem.getEntityWorld(), entityItem.getPosition());
return true; return true;
} }
}*/
if (PrimalAPI.randomCheck(10)) {
if (entityItem.getItem().getTagCompound().getBoolean("hot")) {
entityItem.getItem().getSubCompound("tags").setBoolean("hot", false);
entityItem.getEntityWorld().playSound(null, entityItem.getPosition(), SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 1.0F, PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F);
return true;
}
}
}
} }
return false; return false;

View File

@@ -27,7 +27,7 @@ import javax.annotation.Nullable;
*/ */
public class Longbow extends BaseItem { public class Longbow extends BaseItem {
int mod=5; int mod=15;
int time=0; int time=0;
public Longbow(String name) { public Longbow(String name) {

View File

@@ -85,12 +85,15 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
if(randomCheck(1000)) { if(randomCheck(1000)) {
makeSmoke(world, pos); makeSmoke(world, pos);
} }
this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos);
}
}
//slotZeroManager(world); //slotZeroManager(world);
craftingManager(); craftingManager();
} }
if(this.iteration == 299){
this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos);
}
} }
} }
@@ -194,7 +197,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
ForgeCrafting recipe = ForgeCrafting.getRecipe(stack.getItem()); ForgeCrafting recipe = ForgeCrafting.getRecipe(stack.getItem());
if (recipe != null) { if (recipe != null) {
NBTTagCompound stackCompound = null; NBTTagCompound stackCompound = new NBTTagCompound();
if(stack.hasTagCompound()){ if(stack.hasTagCompound()){
stackCompound=stack.getTagCompound().copy(); stackCompound=stack.getTagCompound().copy();
} }
@@ -207,9 +210,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
} }
if (cookCounter2 >= recipe.getIdealTime()) { if (cookCounter2 >= recipe.getIdealTime()) {
ItemStack outputStack = recipe.getOutput().copy(); ItemStack outputStack = recipe.getOutput().copy();
if(stack.hasTagCompound()){
outputStack.setItemDamage(stack.getItemDamage()); outputStack.setItemDamage(stack.getItemDamage());
outputStack.setTagCompound(stackCompound); outputStack.setTagCompound(stackCompound);
outputStack.getSubCompound("tags").setBoolean("hot", true); outputStack.getSubCompound("tags").setBoolean("hot", true);
}
this.setSlotStack(i, outputStack); this.setSlotStack(i, outputStack);
cookCounter2 = 0; cookCounter2 = 0;
} }
@@ -223,9 +228,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
} }
if (cookCounter3 >= recipe.getIdealTime()) { if (cookCounter3 >= recipe.getIdealTime()) {
ItemStack outputStack = recipe.getOutput().copy(); ItemStack outputStack = recipe.getOutput().copy();
if(stack.hasTagCompound()){
outputStack.setItemDamage(stack.getItemDamage()); outputStack.setItemDamage(stack.getItemDamage());
outputStack.setTagCompound(stackCompound); outputStack.setTagCompound(stackCompound);
outputStack.getSubCompound("tags").setBoolean("hot", true); outputStack.getSubCompound("tags").setBoolean("hot", true);
}
this.setSlotStack(i, outputStack); this.setSlotStack(i, outputStack);
cookCounter3 = 0; cookCounter3 = 0;
@@ -240,9 +247,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
} }
if (cookCounter4 >= recipe.getIdealTime()) { if (cookCounter4 >= recipe.getIdealTime()) {
ItemStack outputStack = recipe.getOutput().copy(); ItemStack outputStack = recipe.getOutput().copy();
if(stack.hasTagCompound()){
outputStack.setItemDamage(stack.getItemDamage()); outputStack.setItemDamage(stack.getItemDamage());
outputStack.setTagCompound(stackCompound); outputStack.setTagCompound(stackCompound);
outputStack.getSubCompound("tags").setBoolean("hot", true); outputStack.getSubCompound("tags").setBoolean("hot", true);
}
this.setSlotStack(i, outputStack); this.setSlotStack(i, outputStack);
cookCounter4 = 0; cookCounter4 = 0;
} }
@@ -256,9 +265,11 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
} }
if (cookCounter5 >= recipe.getIdealTime()) { if (cookCounter5 >= recipe.getIdealTime()) {
ItemStack outputStack = recipe.getOutput().copy(); ItemStack outputStack = recipe.getOutput().copy();
if(stack.hasTagCompound()){
outputStack.setItemDamage(stack.getItemDamage()); outputStack.setItemDamage(stack.getItemDamage());
outputStack.setTagCompound(stackCompound); outputStack.setTagCompound(stackCompound);
outputStack.getSubCompound("tags").setBoolean("hot", true); outputStack.getSubCompound("tags").setBoolean("hot", true);
}
this.setSlotStack(i, outputStack); this.setSlotStack(i, outputStack);
cookCounter5 = 0; cookCounter5 = 0;
} }

View File

@@ -18,6 +18,7 @@ import nmd.primal.forgecraft.crafting.AnvilCrafting;
import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.BaseMultiItem; import nmd.primal.forgecraft.items.BaseMultiItem;
import nmd.primal.forgecraft.items.ForgeHammer; import nmd.primal.forgecraft.items.ForgeHammer;
import nmd.primal.forgecraft.items.SlottedTongs;
import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileAnvil; import nmd.primal.forgecraft.tiles.TileAnvil;
@@ -70,8 +71,6 @@ public interface AnvilHandler {
if (recipe.getOutput().getItem() instanceof ToolPart) { if (recipe.getOutput().getItem() instanceof ToolPart) {
System.out.println(tile.getSlotStack(12).getTagCompound());
if (!tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem()) ) { if (!tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem()) ) {
ItemStack tempStack = recipe.getOutput(); ItemStack tempStack = recipe.getOutput();
@@ -243,21 +242,22 @@ public interface AnvilHandler {
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
ItemStack tongStack = inventory.getStackInSlot(0).copy(); ItemStack tongStack = inventory.getStackInSlot(0).copy();
SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem();
if (tongStack.isEmpty()) { if (tongStack.isEmpty()) {
if (!tile.getSlotStack(counter).isEmpty()) { if (!tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tile.getSlotStack(counter).copy(); ItemStack tempStack = tile.getSlotStack(counter).copy();
inventory.insertItem(0,tempStack, false); inventory.insertItem(0,tempStack, false);
tile.setSlotStack(counter, ItemStack.EMPTY); tile.setSlotStack(counter, ItemStack.EMPTY);
itemstackItem.markDirty(pItem);
return true; return true;
} }
} }
if (!tongStack.isEmpty()) { if (!tongStack.isEmpty()) {
if (tile.getSlotStack(counter).isEmpty()) { if (tile.getSlotStack(counter).isEmpty()) {
//ItemStack tempStack = tongStack.copy();
tile.setSlotStack(counter, inventory.extractItem(0, 1, false)); tile.setSlotStack(counter, inventory.extractItem(0, 1, false));
//System.out.println(tile.getSlotStack(counter).getTagCompound()); itemstackItem.markDirty(pItem);
return true; return true;
} }
} }

View File

@@ -10,6 +10,7 @@ import net.minecraftforge.items.IItemHandler;
import nmd.primal.core.common.helper.RecipeHelper; import nmd.primal.core.common.helper.RecipeHelper;
import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.BaseMultiItem; import nmd.primal.forgecraft.items.BaseMultiItem;
import nmd.primal.forgecraft.items.SlottedTongs;
import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileForge; import nmd.primal.forgecraft.tiles.TileForge;
@@ -109,12 +110,14 @@ public interface ForgeHandler {
if (pItem.getItem().equals(ModItems.slottedtongs)) { if (pItem.getItem().equals(ModItems.slottedtongs)) {
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null); IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
ItemStack tongsStack = inventory.getStackInSlot(0).copy(); ItemStack tongsStack = inventory.getStackInSlot(0).copy();
SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem();
if (tongsStack.isEmpty()) { if (tongsStack.isEmpty()) {
if (!tile.getSlotStack(counter).isEmpty()) { if (!tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tile.getSlotStack(counter).copy(); ItemStack tempStack = tile.getSlotStack(counter).copy();
inventory.insertItem(0, tempStack, false); inventory.insertItem(0, tempStack, false);
tile.setSlotStack(counter, ItemStack.EMPTY); tile.setSlotStack(counter, ItemStack.EMPTY);
itemstackItem.markDirty(pItem);
return true; return true;
} }
} }
@@ -124,6 +127,7 @@ public interface ForgeHandler {
ItemStack tempStack = tongsStack.copy(); ItemStack tempStack = tongsStack.copy();
tile.setSlotStack(counter, tempStack); tile.setSlotStack(counter, tempStack);
inventory.extractItem(0, 1, false); inventory.extractItem(0, 1, false);
itemstackItem.markDirty(pItem);
return true; return true;
} }
} }

View File

@@ -654,6 +654,8 @@
"scale": [ 0.5, 0.875, 0.75 ] "scale": [ 0.5, 0.875, 0.75 ]
}, },
"firstperson_righthand": { "firstperson_righthand": {
"rotation": [ 13, 3, 5 ],
"translation": [ -2, 0, 0 ],
"scale": [ 0.5, 0.875, 0.75 ] "scale": [ 0.5, 0.875, 0.75 ]
}, },
"firstperson_lefthand": { "firstperson_lefthand": {

View File

@@ -2,7 +2,7 @@
"modid": "forgecraft", "modid": "forgecraft",
"name": "Kitsu's Forgecraft", "name": "Kitsu's Forgecraft",
"description": "Forged with sweat and blood", "description": "Forged with sweat and blood",
"version": "1.6.10", "version": "1.6.13",
"mcversion": "1.12.2", "mcversion": "1.12.2",
"url": "", "url": "",
"updateUrl": "", "updateUrl": "",