Added some textures
Added Tree Tap Added Tree Tap logic
This commit is contained in:
parent
0cf477dd89
commit
0522e9539f
10 changed files with 92 additions and 37 deletions
|
@ -19,6 +19,7 @@ import reborncore.RebornCore;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModParts;
|
||||
import techreborn.items.ItemParts;
|
||||
import techreborn.items.tools.ItemTreeTap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
@ -138,22 +139,24 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
|
||||
if(state.getValue(HAS_SAP)){
|
||||
if(state.getValue(SAP_SIDE) == side){
|
||||
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||
if(!worldIn.isRemote){
|
||||
Random rand = new Random();
|
||||
BlockPos itemPos = pos.offset(side);
|
||||
EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
||||
float factor = 0.05F;
|
||||
item.motionX = rand.nextGaussian() * factor;
|
||||
item.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
item.motionZ = rand.nextGaussian() * factor;
|
||||
worldIn.spawnEntityInWorld(item);
|
||||
if(playerIn.getCurrentEquippedItem() != null && playerIn.getCurrentEquippedItem().getItem() instanceof ItemTreeTap)
|
||||
if(state.getValue(HAS_SAP)){
|
||||
if(state.getValue(SAP_SIDE) == side){
|
||||
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||
if(!worldIn.isRemote){
|
||||
Random rand = new Random();
|
||||
BlockPos itemPos = pos.offset(side);
|
||||
EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
||||
float factor = 0.05F;
|
||||
playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
|
||||
item.motionX = rand.nextGaussian() * factor;
|
||||
item.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
item.motionZ = rand.nextGaussian() * factor;
|
||||
worldIn.spawnEntityInWorld(item);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,12 @@ import net.minecraft.world.World;
|
|||
import techreborn.Core;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
public class BlockGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockGenerator extends BlockMachineBase implements IRotationTexture {
|
||||
|
||||
public BlockGenerator() {
|
||||
super();
|
||||
|
@ -35,22 +36,27 @@ public class BlockGenerator extends BlockMachineBase implements IAdvancedRotatio
|
|||
private final String prefix = "techreborn:blocks/machine/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "machine_side";
|
||||
public String getFrontOff() {
|
||||
return prefix + "industrial_blast_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
public String getFrontOn() {
|
||||
return prefix + "industrial_blast_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "machine_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
public String getTop() {
|
||||
return prefix + "diesel_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
public String getBottom() {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,12 +36,12 @@ public class BlockCompressor extends BlockMachineBase implements IRotationTextur
|
|||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "implosion_compressor_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "implosion_compressor_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -36,26 +36,26 @@ public class BlockElectricFurnace extends BlockMachineBase implements IRotationT
|
|||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "industrial_blast_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "industrial_blast_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "machine_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "machine_side";
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue