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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ public class ModItems {
|
|||
public static Item bucketTritium;
|
||||
public static Item bucketWolframium;
|
||||
public static Item reBattery;
|
||||
public static Item treeTap;
|
||||
|
||||
public static Item upgrades;
|
||||
|
||||
|
@ -125,6 +126,8 @@ public class ModItems {
|
|||
GameRegistry.registerItem(uuMatter, "uumatter");
|
||||
reBattery = PoweredItem.createItem(ItemReBattery.class);
|
||||
GameRegistry.registerItem(reBattery, "rebattery");
|
||||
treeTap = new ItemTreeTap();
|
||||
GameRegistry.registerItem(treeTap, "treetap");
|
||||
|
||||
// upgrades = new ItemUpgrade();
|
||||
// GameRegistry.registerItem(upgrades, "upgrades");
|
||||
|
|
45
src/main/java/techreborn/items/tools/ItemTreeTap.java
Normal file
45
src/main/java/techreborn/items/tools/ItemTreeTap.java
Normal file
|
@ -0,0 +1,45 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.RebornCore;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
|
||||
public class ItemTreeTap extends Item implements ITexturedItem {
|
||||
|
||||
public ItemTreeTap() {
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(20);
|
||||
setUnlocalizedName("techreborn.treetap");
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
|
||||
return super.onItemRightClick(itemStackIn, worldIn, playerIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/rockcutter";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
@ -15,24 +16,20 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{
|
||||
|
||||
public Inventory inventory = new Inventory(6, "TileElectricFurnace", 64, this);
|
||||
// public RecipeCrafter crafter;
|
||||
public int capacity = 1000;
|
||||
|
||||
public TileElectricFurnace() {
|
||||
super(1);
|
||||
int[] inputs = new int[1];
|
||||
inputs[0] = 0;
|
||||
int[] outputs = new int[1];
|
||||
outputs[0] = 1;
|
||||
// crafter = new RecipeCrafter(Reference.grinderRecipe, this, 2, 1, inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
// crafter.updateEntity();
|
||||
// upgrades.tick();
|
||||
charge(3);
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -386,6 +386,7 @@ item.techreborn.cell.tritium.name=Tritium Cell
|
|||
item.techreborn.cell.wolframium.name=Wolframium Cell
|
||||
item.techreborn.cell.empty.name=Empty Cell
|
||||
item.techreborn.rebattery.name=Battery
|
||||
item.techreborn.treetap.name=Tree Tap
|
||||
|
||||
#Gems
|
||||
item.techreborn.gem.ruby.name=Ruby
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 215 B |
Binary file not shown.
After Width: | Height: | Size: 460 B |
Loading…
Reference in a new issue