update feature branch

This commit is contained in:
Mohammad-Ali Minaie
2018-12-16 17:15:16 -05:00
parent 9a8fe16df4
commit f7c27289b7
8 changed files with 132 additions and 16 deletions

View File

@@ -10,8 +10,15 @@
- [ ] Grinding wheel rotate
## Current Feature
- [ ] Recipe Handler for saw
- [ ] Sound for block break
- [x] Test Redstone Engine drops
- [x] Figure out tile update for crucible after cooking.
- [ ] Item Render for engine
- [ ] Item Render for Saw Block
- [ ] Machine Chassis Recipe
- [ ] Redstone Engine Recipe
- [ ] Gear recipes
- [ ] Gearbox recipe
- [ ] Saw Recipe
## Feature Optimizations
- [ ] Untick Bloomery and Forge
@@ -56,6 +63,8 @@ rename s/iron/steel/ iron*
```
### Completed
- [x] Recipe Handler for saw
- [x] Sound for block break
- [x] Redstone Engine Model
- [x] Engine Refactor
- [x] Slots for Engines

View File

@@ -8,6 +8,7 @@ import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
@@ -16,7 +17,9 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalAPI;
import nmd.primal.core.common.helper.PlayerHelper;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.tiles.TileBaseSlot;
/**
* Created by kitsu on 12/3/2016.

View File

@@ -97,6 +97,40 @@ public class MachineSaw extends CustomContainerFacingActive {
return new TileMachineSaw();
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
{
this.onBlockHarvested(world, pos, state, player);
return this.destroyBlock(world, pos, state, EnumFacing.UP, player);
}
public boolean destroyBlock(World world, BlockPos pos, IBlockState state, EnumFacing face, EntityPlayer player)
{
if (!world.isRemote) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileRedstoneEngine) {
//PlayerHelper.playerTakeItem(world, pos, EnumFacing.DOWN, player, player.getActiveHand(), this.getCrucibleItem(world, pos, state, player));
ItemStack dropStack = new ItemStack(ModBlocks.redstoneengine, 1);
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
//world.setBlockState(pos, this.getReplacementBlock(world, pos, state));
world.setBlockToAir(pos);
world.markTileEntityForRemoval(tile);
return true;
}
}
return false;
}
@Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player)
{
if (!world.isRemote) {
TileRedstoneEngine tile = (TileRedstoneEngine) world.getTileEntity(pos);
PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotList());
}
}
private void sawThings(World world, BlockPos pos, IBlockState state, TileMachineSaw tile, BlockPos fromPos){
if(state.getValue(PrimalAPI.States.ACTIVE) && tile.getTransfer() ){
if(fromPos.equals(pos.up())) {

View File

@@ -19,6 +19,7 @@ import nmd.primal.core.api.PrimalAPI;
import nmd.primal.core.common.helper.PlayerHelper;
import nmd.primal.core.common.helper.RecipeHelper;
import nmd.primal.forgecraft.blocks.CustomContainerFacingActive;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.tiles.TileRedstoneEngine;
import javax.annotation.Nullable;
@@ -106,6 +107,39 @@ public class RedstoneEngine extends CustomContainerFacingActive {
}
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
{
this.onBlockHarvested(world, pos, state, player);
return this.destroyBlock(world, pos, state, EnumFacing.UP, player);
}
public boolean destroyBlock(World world, BlockPos pos, IBlockState state, EnumFacing face, EntityPlayer player)
{
if (!world.isRemote) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileRedstoneEngine) {
//PlayerHelper.playerTakeItem(world, pos, EnumFacing.DOWN, player, player.getActiveHand(), this.getCrucibleItem(world, pos, state, player));
ItemStack dropStack = new ItemStack(ModBlocks.redstoneengine, 1);
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
//world.setBlockState(pos, this.getReplacementBlock(world, pos, state));
world.setBlockToAir(pos);
world.markTileEntityForRemoval(tile);
return true;
}
}
return false;
}
@Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player)
{
if (!world.isRemote) {
TileRedstoneEngine tile = (TileRedstoneEngine) world.getTileEntity(pos);
PlayerHelper.spawnItemOnPlayer(world, player, tile.getSlotList());
}
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{

View File

@@ -36,41 +36,61 @@ public final class RecipesMachineSaw {
recipes.register(new MachineSawCrafting(
new OreIngredient("logOak"),
RecipeHelper.buildList((new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 0)),
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 0)),
(new ItemStack(PrimalAPI.Items.BARK_OAK, 4)),
sticks))
.setRecipeName("oakPlanks"));
.setRecipeName("planksOak"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logSpruce"),
RecipeHelper.buildList((new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 1)),
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 1)),
(new ItemStack(PrimalAPI.Items.BARK_SPRUCE, 4)),
sticks))
.setRecipeName("sprucePlanks"));
.setRecipeName("planksSpruce"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logBirch"),
RecipeHelper.buildList( (new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 2)),
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 2)),
(new ItemStack(PrimalAPI.Items.BARK_BIRCH, 4)),
sticks))
.setRecipeName("birchPlanks"));
.setRecipeName("planksBirch"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logJungle"),
RecipeHelper.buildList(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 3)))
.setRecipeName("junglePlanks"));
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 3)),
(new ItemStack(PrimalAPI.Items.BARK_JUNGLE, 4)),
sticks))
.setRecipeName("planksJungle"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logAcacia"),
RecipeHelper.buildList(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 0)))
.setRecipeName("acaciaPlanks"));
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(Blocks.PLANKS), 4, 0)),
(new ItemStack(PrimalAPI.Items.BARK_ACACIA, 4)),
sticks))
.setRecipeName("planksAcacia"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logIronwood"),
RecipeHelper.buildList(new ItemStack(Item.getItemFromBlock(PrimalAPI.Blocks.PLANKS), 4, 0)))
.setRecipeName("ironwoodPlanks"));
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(PrimalAPI.Blocks.PLANKS), 4, 0)),
(new ItemStack(PrimalAPI.Items.BARK_IRONWOOD, 4)),
(new ItemStack(PrimalAPI.Items.IRONWOOD_STICK, 2))
))
.setRecipeName("planksIronwood"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logYew"),
RecipeHelper.buildList(new ItemStack(Item.getItemFromBlock(PrimalAPI.Blocks.PLANKS), 4, 1)))
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(PrimalAPI.Blocks.PLANKS), 4, 1)),
(new ItemStack(PrimalAPI.Items.BARK_YEW, 4)),
(new ItemStack(PrimalAPI.Items.YEW_STICK, 2))
))
.setRecipeName("yewPlanks"));
recipes.register(new MachineSawCrafting(
new OreIngredient("logCorypha"),
RecipeHelper.buildList(new ItemStack(Item.getItemFromBlock(PrimalAPI.Blocks.PLANKS), 4, 3)))
RecipeHelper.buildList(
(new ItemStack(Item.getItemFromBlock(PrimalAPI.Blocks.PLANKS), 4, 3)),
(new ItemStack(PrimalAPI.Items.BARK_CORYPHA, 4)),
(new ItemStack(PrimalAPI.Items.CORYPHA_STICK, 2))))
.setRecipeName("coryphaPlanks"));
recipes.register(new MachineSawCrafting(

View File

@@ -79,8 +79,12 @@ public class TileNBTCrucible extends BaseTile implements ITickable {
if(recipe!=null){
if( (this.getHot() == 15) && (this.getStatus()) ){
this.setDrops(recipe.getDropsCooked());
this.updateBlock();
this.markDirty();
} else if ((this.getHot() == 15) && (!this.getStatus())){
this.setDrops(recipe.getDropsRaw());
this.updateBlock();
this.markDirty();
}
}
}
@@ -91,6 +95,8 @@ public class TileNBTCrucible extends BaseTile implements ITickable {
if(this.getHeat() > 0){
this.setHeat( this.getHeat() - 1);
world.setBlockState(pos, state.withProperty(PrimalAPI.States.LAYERS, 15), 2);
this.updateBlock();
this.markDirty();
}
if(this.getHeat() == 0){
this.setHot(6);

View File

@@ -0,0 +1,10 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "blocks/planks_oak",
"texture": "blocks/planks_oak"
}
},
"parent": "forgecraft:block/redstone_engine_model"
}