diff --git a/1.11/build.gradle b/1.11/build.gradle index 91f321f5..697e32a5 100644 --- a/1.11/build.gradle +++ b/1.11/build.gradle @@ -26,10 +26,10 @@ repositories { url "http://mobiusstrip.eu/maven" } - //maven { - // name = "primal" - // url "http://maven.nmd.so" - //} + maven { + name = "primal" + url "http://maven.nmd.so" + } } apply plugin: 'net.minecraftforge.gradle.forge' @@ -90,7 +90,7 @@ dependencies { //deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api" //runtime "mezz.jei:jei_${mc_version}:${jei_version}" -//deobfCompile "nmd.primal.core:PrimalCore:${primal_version}:dev" +deobfCompile "nmd.primal.core:PrimalCore:${primal_version}:dev" //runtime "nmd.primal.core:PrimalCore:${primal_version}" } diff --git a/1.11/gradle.properties b/1.11/gradle.properties index ccbe68f2..85894e0c 100644 --- a/1.11/gradle.properties +++ b/1.11/gradle.properties @@ -10,7 +10,7 @@ forge_version=13.20.0.2226 mcp_mappings=snapshot_20161220 mc_version=1.11.2 -primal_version=0.2.11 +primal_version=0.2.26 jei_version=4.0+ waila_version=1.7.0-B3 apple_version=2.1+ \ No newline at end of file diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Forge.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/Forge.java index cb363d26..242a17ab 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Forge.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/Forge.java @@ -102,6 +102,7 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider/ } if((pItem.getItem() == Items.FLINT_AND_STEEL) /*|| (pItem.getItem() == PrimalItems.FIRE_BOW)*/ || pItem.getItem() == Item.getItemFromBlock(Blocks.TORCH)) { world.setBlockState(pos, state.withProperty(ACTIVE, true), 2); + tile.setHeat(100); tile.markDirty(); tile.updateBlock(); return true; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/crafting/ForgeCrafting.java b/1.11/src/main/java/nmd/primal/forgecraft/crafting/ForgeCrafting.java index 51337f08..ec0619c3 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/crafting/ForgeCrafting.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/crafting/ForgeCrafting.java @@ -98,6 +98,8 @@ public class ForgeCrafting { return this.input; } + public IBlockState getStartState() {return this.start_state;} + public IBlockState getOutput() { return this.end_state; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java b/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java index 856b8007..dfb2fbd9 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java @@ -13,7 +13,9 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import nmd.primal.forgecraft.blocks.Forge; +import nmd.primal.forgecraft.blocks.IngotBall; import nmd.primal.forgecraft.crafting.ForgeCrafting; +import org.omg.PortableInterceptor.ACTIVE; import static nmd.primal.forgecraft.CommonUtils.getVanillaItemBurnTime; @@ -36,6 +38,7 @@ public class TileForge extends TileBaseSlot implements ITickable { this.iteration ++; IBlockState state = world.getBlockState(this.pos); BlockPos abovePos = new BlockPos(this.getPos().getX(), this.getPos().getY()+1, this.getPos().getZ()); + IBlockState aboveState = world.getBlockState(abovePos); Block block = world.getBlockState(abovePos).getBlock(); if(this.iteration == 300 ) { this.iteration = 0; @@ -62,14 +65,10 @@ public class TileForge extends TileBaseSlot implements ITickable { } this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos); } - craftingManager(block, world, abovePos); + craftingManager(block, world, abovePos, aboveState); } } - private void forgeRecipeManager(){ - - } - private void furnaceManager(BlockPos abovePos){ if(world.getBlockState(abovePos).getBlock() instanceof BlockFurnace){ TileEntityFurnace tileFurnace = (TileEntityFurnace) world.getTileEntity(abovePos); @@ -110,19 +109,25 @@ public class TileForge extends TileBaseSlot implements ITickable { } - private void craftingManager(Block block, World world, BlockPos pos){ + private void craftingManager(Block block, World world, BlockPos pos, IBlockState state){ ForgeCrafting recipe = ForgeCrafting.getRecipe(block); if(recipe != null){ - if(this.getHeat() >= recipe.getHeatThreshold()){ + if(this.getHeat() >= recipe.getHeatThreshold() && recipe.getStartState().equals(state) ){ cookCounter++; } if(this.getHeat() < recipe.getHeatThreshold() && cookCounter > 0){ cookCounter--; } if(cookCounter >= recipe.getIdealTime() ){ - world.setBlockState(pos, recipe.getCoolOutput(), 3); + world.setBlockState(pos, recipe.getOutput(), 3); cookCounter = 0; } + /* + System.out.println(state.getValue(IngotBall.ACTIVE) + " : " + recipe.getStartState()); + System.out.println(cookCounter + " : " + recipe.getIdealTime()); + System.out.println(this.heat + " : " + recipe.getHeatThreshold()); + System.out.println("========"); + */ } }