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.client.TechRebornCreativeTabMisc;
|
||||||
import techreborn.init.ModParts;
|
import techreborn.init.ModParts;
|
||||||
import techreborn.items.ItemParts;
|
import techreborn.items.ItemParts;
|
||||||
|
import techreborn.items.tools.ItemTreeTap;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -138,22 +139,24 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
|
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);
|
super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
|
||||||
if(state.getValue(HAS_SAP)){
|
if(playerIn.getCurrentEquippedItem() != null && playerIn.getCurrentEquippedItem().getItem() instanceof ItemTreeTap)
|
||||||
if(state.getValue(SAP_SIDE) == side){
|
if(state.getValue(HAS_SAP)){
|
||||||
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
|
if(state.getValue(SAP_SIDE) == side){
|
||||||
if(!worldIn.isRemote){
|
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||||
Random rand = new Random();
|
if(!worldIn.isRemote){
|
||||||
BlockPos itemPos = pos.offset(side);
|
Random rand = new Random();
|
||||||
EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
BlockPos itemPos = pos.offset(side);
|
||||||
float factor = 0.05F;
|
EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
||||||
item.motionX = rand.nextGaussian() * factor;
|
float factor = 0.05F;
|
||||||
item.motionY = rand.nextGaussian() * factor + 0.2F;
|
playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
|
||||||
item.motionZ = rand.nextGaussian() * factor;
|
item.motionX = rand.nextGaussian() * factor;
|
||||||
worldIn.spawnEntityInWorld(item);
|
item.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||||
|
item.motionZ = rand.nextGaussian() * factor;
|
||||||
|
worldIn.spawnEntityInWorld(item);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,12 @@ import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileGenerator;
|
import techreborn.tiles.generator.TileGenerator;
|
||||||
|
|
||||||
public class BlockGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockGenerator extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
public BlockGenerator() {
|
public BlockGenerator() {
|
||||||
super();
|
super();
|
||||||
|
@ -35,22 +36,27 @@ public class BlockGenerator extends BlockMachineBase implements IAdvancedRotatio
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFrontOff() {
|
||||||
return prefix + "machine_side";
|
return prefix + "industrial_blast_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getFrontOn() {
|
||||||
|
return prefix + "industrial_blast_furnace_front_on";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSide() {
|
||||||
return prefix + "machine_side" ;
|
return prefix + "machine_side" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop() {
|
||||||
return prefix + "diesel_generator_top_off";
|
return prefix + "diesel_generator_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom() {
|
||||||
return prefix + "machine_bottom";
|
return prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,12 +36,12 @@ public class BlockCompressor extends BlockMachineBase implements IRotationTextur
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "machine_side";
|
return prefix + "implosion_compressor_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "machine_side";
|
return prefix + "implosion_compressor_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -36,26 +36,26 @@ public class BlockElectricFurnace extends BlockMachineBase implements IRotationT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "machine_side";
|
return prefix + "industrial_blast_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "machine_side";
|
return prefix + "industrial_blast_furnace_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "machine_side";
|
return prefix + "machine_side" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "machine_side";
|
return prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
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 bucketTritium;
|
||||||
public static Item bucketWolframium;
|
public static Item bucketWolframium;
|
||||||
public static Item reBattery;
|
public static Item reBattery;
|
||||||
|
public static Item treeTap;
|
||||||
|
|
||||||
public static Item upgrades;
|
public static Item upgrades;
|
||||||
|
|
||||||
|
@ -125,6 +126,8 @@ public class ModItems {
|
||||||
GameRegistry.registerItem(uuMatter, "uumatter");
|
GameRegistry.registerItem(uuMatter, "uumatter");
|
||||||
reBattery = PoweredItem.createItem(ItemReBattery.class);
|
reBattery = PoweredItem.createItem(ItemReBattery.class);
|
||||||
GameRegistry.registerItem(reBattery, "rebattery");
|
GameRegistry.registerItem(reBattery, "rebattery");
|
||||||
|
treeTap = new ItemTreeTap();
|
||||||
|
GameRegistry.registerItem(treeTap, "treetap");
|
||||||
|
|
||||||
// upgrades = new ItemUpgrade();
|
// upgrades = new ItemUpgrade();
|
||||||
// GameRegistry.registerItem(upgrades, "upgrades");
|
// 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.IInventory;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
|
@ -15,24 +16,20 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{
|
public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{
|
||||||
|
|
||||||
public Inventory inventory = new Inventory(6, "TileElectricFurnace", 64, this);
|
public Inventory inventory = new Inventory(6, "TileElectricFurnace", 64, this);
|
||||||
// public RecipeCrafter crafter;
|
|
||||||
public int capacity = 1000;
|
public int capacity = 1000;
|
||||||
|
|
||||||
public TileElectricFurnace() {
|
public TileElectricFurnace() {
|
||||||
super(1);
|
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
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity()
|
||||||
|
{
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
// crafter.updateEntity();
|
if(!worldObj.isRemote)
|
||||||
// upgrades.tick();
|
{
|
||||||
charge(3);
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -386,6 +386,7 @@ item.techreborn.cell.tritium.name=Tritium Cell
|
||||||
item.techreborn.cell.wolframium.name=Wolframium Cell
|
item.techreborn.cell.wolframium.name=Wolframium Cell
|
||||||
item.techreborn.cell.empty.name=Empty Cell
|
item.techreborn.cell.empty.name=Empty Cell
|
||||||
item.techreborn.rebattery.name=Battery
|
item.techreborn.rebattery.name=Battery
|
||||||
|
item.techreborn.treetap.name=Tree Tap
|
||||||
|
|
||||||
#Gems
|
#Gems
|
||||||
item.techreborn.gem.ruby.name=Ruby
|
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