mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Release!
This commit is contained in:
1 parent
4a39801e95
commit
ff75da1bcf
7 files changed
+68
-82
No files matched your search
@@ -121,9 +121,9 @@ public class Chisel
|
||||
Configurations.config.load();
|
||||
Configurations.refreshConfig();
|
||||
|
||||
ModItems.load();
|
||||
ModTabs.load();
|
||||
ModBlocks.load();
|
||||
ModItems.load();
|
||||
proxy.preInit();
|
||||
}
|
||||
|
||||
|
||||
@@ -60,10 +60,10 @@ public class Crafting
|
||||
|
||||
if(Configurations.chiselRecipe)
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.chisel, 1), new Object[]{" YY", " YY", "X ", 'X', Items.stick, 'Y', Items.iron_ingot});
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1), new Object[]{" YY", " YY", "X ", 'X', Items.stick, 'Y', Items.iron_ingot}));
|
||||
} else
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.chisel, 1), new Object[]{" Y", "X ", 'X', Items.stick, 'Y', Items.iron_ingot});
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1), new Object[]{" Y", "X ", 'X', Items.stick, 'Y', Items.iron_ingot}));
|
||||
}
|
||||
|
||||
if(Configurations.featureEnabled("ballOfMoss"))
|
||||
@@ -89,5 +89,6 @@ public class Crafting
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.laboratory, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.quartz, 1)});
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.autoChisel, 1),new Object[]{"XXX", "XYX", "XXX", Character.valueOf('X'), "plankWood", Character.valueOf('Y'), ModItems.chisel}));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,48 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import net.minecraft.block.BlockPumpkin;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockCarvablePumpkin extends BlockCarvable
|
||||
{
|
||||
public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable{
|
||||
public CarvableHelper carverHelper;
|
||||
|
||||
public BlockCarvablePumpkin()
|
||||
{
|
||||
super();
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon top;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon face;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon side;
|
||||
private int sideVal, faceVal;
|
||||
|
||||
public BlockCarvablePumpkin(boolean isOn, int sideTexture, int faceTexture) {
|
||||
super(isOn);
|
||||
sideVal = sideTexture;
|
||||
faceVal = faceTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world_, int x, int y, int z_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
{
|
||||
return p_149660_9_;
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
//if(side != 0 || side != 1){
|
||||
// if(side == ForgeDirection.)
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister icon){
|
||||
top = icon.registerIcon(this.getTextureName() + "_top_" + sideVal);
|
||||
side = icon.registerIcon(this.getTextureName() + "_side_" + sideVal);
|
||||
face = icon.registerIcon(this.getTextureName() + "_face_" + faceVal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata) {
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package info.jbcs.minecraft.chisel.block.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TilePumpkin extends TileEntity
|
||||
{
|
||||
|
||||
public int pos;
|
||||
|
||||
public TilePumpkin()
|
||||
{
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTagCompound)
|
||||
{
|
||||
super.writeToNBT(nbtTagCompound);
|
||||
nbtTagCompound.setInteger("pos", pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTagCompound)
|
||||
{
|
||||
super.readFromNBT(nbtTagCompound);
|
||||
pos = nbtTagCompound.getInteger("pos");
|
||||
}
|
||||
|
||||
}
|
||||
+17
-33
@@ -1,12 +1,9 @@
|
||||
package info.jbcs.minecraft.chisel.block.tileentity;
|
||||
|
||||
import info.jbcs.minecraft.chisel.block.BlockAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.block.BlockCarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.Carving;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -68,37 +65,38 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory{
|
||||
|
||||
@Override
|
||||
public void updateEntity(){
|
||||
if(!worldObj.isRemote){
|
||||
if(!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) {
|
||||
|
||||
ItemStack[] stacksInSlots = new ItemStack[inventory.length];
|
||||
|
||||
for(int c = 0; c < getSizeInventory(); c++) {
|
||||
for (int c = 0; c < getSizeInventory(); c++) {
|
||||
stacksInSlots[c] = getStackInSlot(c);
|
||||
}
|
||||
|
||||
ItemStack input = stacksInSlots[0];
|
||||
ItemStack target = stacksInSlots[2];
|
||||
ItemStack target = stacksInSlots[1];
|
||||
|
||||
ItemStack output = stacksInSlots[1];
|
||||
ItemStack output = stacksInSlots[2];
|
||||
|
||||
if(input != null && target != null){
|
||||
if (input != null && target != null) {
|
||||
|
||||
if(carving.getGroup(Block.getBlockFromItem(input.getItem()), input.getItemDamage()) == carving.getGroup(Block.getBlockFromItem(target.getItem()), target.getItemDamage())){
|
||||
if (carving.getGroup(Block.getBlockFromItem(input.getItem()), input.getItemDamage()) == carving.getGroup(Block.getBlockFromItem(target.getItem()), target.getItemDamage())) {
|
||||
equal = true;
|
||||
}
|
||||
|
||||
if(equal){
|
||||
if(output == null) {
|
||||
setInventorySlotContents(1, new ItemStack(Block.getBlockFromItem(input.getItem())));
|
||||
if (equal) {
|
||||
if (output == null) {
|
||||
setInventorySlotContents(2, new ItemStack(Block.getBlockFromItem(target.getItem()), 1, target.getItemDamage()));
|
||||
} else {
|
||||
output.stackSize++;
|
||||
input.stackSize--;
|
||||
if (input.stackSize != 0 || output.stackSize < getInventoryStackLimit()) {
|
||||
decrStackSize(0, 1);
|
||||
output.stackSize++;
|
||||
} else {
|
||||
inventory[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
markDirty();
|
||||
@@ -207,7 +205,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory{
|
||||
return false;
|
||||
}
|
||||
} else if(side == 0){
|
||||
if(slot == 2){
|
||||
if(slot == 1){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -219,21 +217,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory{
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack itemStack, int side){
|
||||
if(side != 0){
|
||||
if(slot == 1){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if(side == 0){
|
||||
if(slot == 2){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,6 @@ import info.jbcs.minecraft.chisel.item.ItemCarvable;
|
||||
import info.jbcs.minecraft.chisel.item.ItemMarbleSlab;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -66,8 +65,8 @@ public class ModBlocks {
|
||||
public static BlockCarvablePane paperWall;
|
||||
public static BlockCarvable woolenClay;
|
||||
public static BlockCarvable laboratory;
|
||||
public static BlockCarvablePumpkin pumpkinOn;
|
||||
public static BlockCarvablePumpkin pumpkinOff;
|
||||
public static BlockCarvable pumpkin;
|
||||
public static BlockCarvable jackOLantern;
|
||||
public static Block autoChisel;
|
||||
public static BlockSnakestone snakestone;
|
||||
public static BlockSnakestone sandSnakestone;
|
||||
@@ -1256,7 +1255,9 @@ public class ModBlocks {
|
||||
|
||||
if(Configurations.featureEnabled("pumpkin"))
|
||||
{
|
||||
//TODO
|
||||
pumpkin = (BlockCarvable) new BlockCarvable().setHardness(2.0F).setResistance(5F).setStepSound(Block.soundTypeStone);
|
||||
Carving.chisel.addVariation("pumpkin", Blocks.pumpkin, 0, 0);
|
||||
//pumpkin.carverHelper.addVariation("chisel.title.pumpkin.1.desc", 1, "pumpkin/1");
|
||||
}
|
||||
|
||||
Blocks.stone.setHarvestLevel("chisel", 0, 0);
|
||||
|
||||
@@ -18,8 +18,8 @@ public class ContainerAutoChisel extends Container {
|
||||
autoChisel = tileEntityAutoChisel;
|
||||
|
||||
addSlotToContainer(new Slot(tileEntityAutoChisel, 0, 53, 15));
|
||||
addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 103, 15));
|
||||
addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 78, 51));
|
||||
addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 78, 51));
|
||||
addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 103, 15));
|
||||
|
||||
bindPlayerInventory(player);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class ContainerAutoChisel extends Container {
|
||||
ItemStack stackInSlot = slotObject.getStack();
|
||||
stack = stackInSlot.copy();
|
||||
|
||||
if(slot == 2){
|
||||
if(slot == 1){
|
||||
if(!this.mergeItemStack(stackInSlot, 3, 39, true)){
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user