tried to add primal version 0.2.26

This commit is contained in:
Mohammad-Ali Minaie
2017-02-27 20:10:16 -05:00
parent b651e88732
commit 4e32b406b1
5 changed files with 22 additions and 14 deletions

View File

@@ -26,10 +26,10 @@ repositories {
url "http://mobiusstrip.eu/maven" url "http://mobiusstrip.eu/maven"
} }
//maven { maven {
// name = "primal" name = "primal"
// url "http://maven.nmd.so" url "http://maven.nmd.so"
//} }
} }
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'
@@ -90,7 +90,7 @@ dependencies {
//deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api" //deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api"
//runtime "mezz.jei:jei_${mc_version}:${jei_version}" //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}" //runtime "nmd.primal.core:PrimalCore:${primal_version}"
} }

View File

@@ -10,7 +10,7 @@ forge_version=13.20.0.2226
mcp_mappings=snapshot_20161220 mcp_mappings=snapshot_20161220
mc_version=1.11.2 mc_version=1.11.2
primal_version=0.2.11 primal_version=0.2.26
jei_version=4.0+ jei_version=4.0+
waila_version=1.7.0-B3 waila_version=1.7.0-B3
apple_version=2.1+ apple_version=2.1+

View File

@@ -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)) { 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); world.setBlockState(pos, state.withProperty(ACTIVE, true), 2);
tile.setHeat(100);
tile.markDirty(); tile.markDirty();
tile.updateBlock(); tile.updateBlock();
return true; return true;

View File

@@ -98,6 +98,8 @@ public class ForgeCrafting {
return this.input; return this.input;
} }
public IBlockState getStartState() {return this.start_state;}
public IBlockState getOutput() public IBlockState getOutput()
{ {
return this.end_state; return this.end_state;

View File

@@ -13,7 +13,9 @@ import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import nmd.primal.forgecraft.blocks.Forge; import nmd.primal.forgecraft.blocks.Forge;
import nmd.primal.forgecraft.blocks.IngotBall;
import nmd.primal.forgecraft.crafting.ForgeCrafting; import nmd.primal.forgecraft.crafting.ForgeCrafting;
import org.omg.PortableInterceptor.ACTIVE;
import static nmd.primal.forgecraft.CommonUtils.getVanillaItemBurnTime; import static nmd.primal.forgecraft.CommonUtils.getVanillaItemBurnTime;
@@ -36,6 +38,7 @@ public class TileForge extends TileBaseSlot implements ITickable {
this.iteration ++; this.iteration ++;
IBlockState state = world.getBlockState(this.pos); IBlockState state = world.getBlockState(this.pos);
BlockPos abovePos = new BlockPos(this.getPos().getX(), this.getPos().getY()+1, this.getPos().getZ()); 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(); Block block = world.getBlockState(abovePos).getBlock();
if(this.iteration == 300 ) { if(this.iteration == 300 ) {
this.iteration = 0; this.iteration = 0;
@@ -62,14 +65,10 @@ public class TileForge extends TileBaseSlot implements ITickable {
} }
this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos); 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){ private void furnaceManager(BlockPos abovePos){
if(world.getBlockState(abovePos).getBlock() instanceof BlockFurnace){ if(world.getBlockState(abovePos).getBlock() instanceof BlockFurnace){
TileEntityFurnace tileFurnace = (TileEntityFurnace) world.getTileEntity(abovePos); 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); ForgeCrafting recipe = ForgeCrafting.getRecipe(block);
if(recipe != null){ if(recipe != null){
if(this.getHeat() >= recipe.getHeatThreshold()){ if(this.getHeat() >= recipe.getHeatThreshold() && recipe.getStartState().equals(state) ){
cookCounter++; cookCounter++;
} }
if(this.getHeat() < recipe.getHeatThreshold() && cookCounter > 0){ if(this.getHeat() < recipe.getHeatThreshold() && cookCounter > 0){
cookCounter--; cookCounter--;
} }
if(cookCounter >= recipe.getIdealTime() ){ if(cookCounter >= recipe.getIdealTime() ){
world.setBlockState(pos, recipe.getCoolOutput(), 3); world.setBlockState(pos, recipe.getOutput(), 3);
cookCounter = 0; 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("========");
*/
} }
} }