mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Auto chisel prep, done with #44
This commit is contained in:
1 parent
3fbf5a8ae2
commit
75bb82a84e
18 files changed
+41
-15
No files matched your search
@@ -4,6 +4,8 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.init.ModBlocks;
|
||||
import info.jbcs.minecraft.chisel.init.ModItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -46,8 +48,26 @@ public class BlockAutoChisel extends BlockContainer{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (world.isRemote)
|
||||
return true;
|
||||
if (tile != null && tile instanceof TileEntityAutoChisel)
|
||||
|
||||
if (tile != null && tile instanceof TileEntityAutoChisel && !player.isSneaking()){
|
||||
player.openGui(Chisel.instance, 1, world, x, y, z);
|
||||
}
|
||||
|
||||
if(player.isSneaking() && tile!= null && tile instanceof TileEntityAutoChisel){
|
||||
TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile;
|
||||
System.out.println(player.getHeldItem());
|
||||
if(player.getItemInUse() == new ItemStack(ModItems.upgrade, 1, 0)){
|
||||
//If they are using the speed upgrade
|
||||
world.setBlock(x, y, z, ModBlocks.autoChisel, 1, 3);
|
||||
} else if(player.getItemInUse() == new ItemStack(ModItems.upgrade, 1, 1)){
|
||||
//If they are using the automation upgrade
|
||||
world.setBlock(x, y, z, ModBlocks.autoChisel, 2, 3);
|
||||
} else if(player.getItemInUse() == new ItemStack(ModItems.upgrade, 1, 2)){
|
||||
//If they are using the stack upgrade
|
||||
world.setBlock(x, y, z, ModBlocks.autoChisel, 3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -798,16 +798,13 @@ public class ModBlocks {
|
||||
planks[i].carverHelper.addVariation(u + " wood crate", 10, "planks-" + n + "/crate");
|
||||
planks[i].carverHelper.addVariation("Fancy " + n + " wood crate", 11, "planks-" + n + "/crate-fancy");
|
||||
planks[i].carverHelper.addVariation("Large long " + n + " wood planks", 13, "planks-" + n + "/large");
|
||||
if(i < 4)
|
||||
{
|
||||
planks[i].carverHelper.addVariation("Vertical " + n + " wood planks", 3, "planks-" + n + "/vertical");
|
||||
planks[i].carverHelper.addVariation("Vertical uneven " + n + " wood planks", 4, "planks-" + n + "/vertical-uneven");
|
||||
planks[i].carverHelper.addVariation(u + " wood parquet", 5, "planks-" + n + "/parquet");
|
||||
planks[i].carverHelper.addVariation(u + " wood plank blinds", 7, "planks-" + n + "/blinds");
|
||||
planks[i].carverHelper.addVariation(u + " wood scaffold", 12, "planks-" + n + "/crateex");
|
||||
planks[i].carverHelper.addVariation(u + " wood planks in disarray", 14, "planks-" + n + "/chaotic-hor");
|
||||
planks[i].carverHelper.addVariation("Vertical " + n + " wood planks in disarray", 15, "planks-" + n + "/chaotic");
|
||||
}
|
||||
planks[i].carverHelper.addVariation("Vertical " + n + " wood planks", 3, "planks-" + n + "/vertical");
|
||||
planks[i].carverHelper.addVariation("Vertical uneven " + n + " wood planks", 4, "planks-" + n + "/vertical-uneven");
|
||||
planks[i].carverHelper.addVariation(u + " wood parquet", 5, "planks-" + n + "/parquet");
|
||||
planks[i].carverHelper.addVariation(u + " wood plank blinds", 7, "planks-" + n + "/blinds");
|
||||
planks[i].carverHelper.addVariation(u + " wood scaffold", 12, "planks-" + n + "/crateex");
|
||||
planks[i].carverHelper.addVariation(u + " wood planks in disarray", 14, "planks-" + n + "/chaotic-hor");
|
||||
planks[i].carverHelper.addVariation("Vertical " + n + " wood planks in disarray", 15, "planks-" + n + "/chaotic");
|
||||
planks[i].carverHelper.register(planks[i], orename);
|
||||
Carving.chisel.addVariation(orename, Blocks.planks, i, 0);
|
||||
planks[i].setHarvestLevel("axe", 0);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package info.jbcs.minecraft.chisel.item;
|
||||
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
@@ -23,9 +25,16 @@ public class ItemUpgrade extends Item{
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player){
|
||||
System.out.println(this.getIconFromDamage(itemStack.getItemDamage()));
|
||||
return itemStack;
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int size, float hitX, float hitY, float hitZ){
|
||||
if(world.isRemote) return false;
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntityAutoChisel autoChisel;
|
||||
|
||||
if(tile != null && tile instanceof TileEntityAutoChisel){
|
||||
TileEntityAutoChisel autoChisel1 = (TileEntityAutoChisel) tile;
|
||||
//TODO: Finish the switch with upgrade
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user