Skip to content

Commit

Permalink
Force Logs Rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
BURN447 committed Jan 3, 2019
1 parent bab8987 commit 853565c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
40 changes: 28 additions & 12 deletions src/main/java/burn447/dartcraftReloaded/blocks/BlockForceLog.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,55 @@
package burn447.dartcraftReloaded.blocks;

import burn447.dartcraftReloaded.dartcraftReloaded;
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

/**
* Created by BURN447 on 2/14/2018.
*/
public class BlockForceLog extends BlockBase {
public class BlockForceLog extends BlockRotatedPillar {

private String name;

public BlockForceLog(String name) {
super(Material.WOOD, name);
super(Material.WOOD);
setHardness(2.5f);
setResistance(12.5f);
this.setRegistryName(name);
this.setTranslationKey(name);
this.setSoundType(SoundType.WOOD);
}

public BlockForceLog(String name, String oreName) {
super(Material.WOOD, name);
super(Material.WOOD);
setHardness(2.5f);
setResistance(12.5f);
this.oreName = oreName;
this.name = name;
//this.oreName = oreName;
this.setRegistryName(name);
this.setTranslationKey(name);
super.initOreDict();
//super.initOreDict();
this.setSoundType(SoundType.WOOD);
}

public void registerItemModel(Item itemBlock) {
dartcraftReloaded.proxy.registerItemRenderer(itemBlock, 0, name);
}

public Item createItemBlock() {
return new ItemBlock(this).setRegistryName(getRegistryName());
}


@Override
public BlockForceLog setCreativeTab(CreativeTabs tab) {
super.setCreativeTab(tab);
Expand All @@ -52,17 +71,14 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
int i = 4;
int j = 5;

if (worldIn.isAreaLoaded(pos.add(-5, -5, -5), pos.add(5, 5, 5)))
{
for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-4, -4, -4), pos.add(4, 4, 4)))
{
if (worldIn.isAreaLoaded(pos.add(-5, -5, -5), pos.add(5, 5, 5))) {
for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-4, -4, -4), pos.add(4, 4, 4))) {
IBlockState iblockstate = worldIn.getBlockState(blockpos);

if (iblockstate.getBlock().isLeaves(iblockstate, worldIn, blockpos))
{
if (iblockstate.getBlock().isLeaves(iblockstate, worldIn, blockpos)) {
iblockstate.getBlock().beginLeavesDecay(iblockstate, worldIn, blockpos);
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ public static void registerNames() {

public static void registerOreDict() {
forcePlanks.initOreDict();
forceLog.initOreDict();
//forceLog.initOreDict();
}
}

0 comments on commit 853565c

Please sign in to comment.