Just pushing my work so far

This commit is contained in:
Cricket committed 2014-12-23 20:16:31 -05:00
1 parent 8620d975ee
commit 3eb7d90c89
8 files changed
+117 -161

No files matched your search

@@ -1,12 +1,16 @@
package com.cricketcraft.chisel.block;
import java.util.Calendar;
import java.util.Iterator;
import java.util.Random;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.init.ModTabs;
import com.cricketcraft.chisel.inventory.InventoryLargePresent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockChest;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -20,38 +24,72 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.init.ModTabs;
import com.cricketcraft.chisel.inventory.InventoryLargePresent;
import java.util.Calendar;
import java.util.Iterator;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPresent extends BlockContainer implements ICarvable {
public class BlockPresent extends BlockChest implements ICarvable {
private final Random random = new Random();
private String textureLocation;
private int type;
public CarvableHelper carverHelper;
private boolean isChristmas = true;
public boolean isChristmas;
public BlockPresent() {
super(Material.wood);
public BlockPresent(int type) {
super(1);
this.type = type;
carverHelper = new CarvableHelper();
setCreativeTab(ModTabs.tabChiselBlocks);
setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0875F, 0.9365F);
Calendar calendar = Calendar.getInstance();
if (calendar.get(2) + 1 == 12 && calendar.get(5) >= 25 && calendar.get(5) <= 26) {
isChristmas = true;//<--- this would have been false before and it lasts for two days :)
if (calendar.get(2) + 1 == 12 || calendar.get(2) + 1 == 1) {
isChristmas = true;//The Christmas Season lasts for december and january
} else {
isChristmas = false;
}
}
public String getKindOfChest(int type){
switch (type){
case 0:
return isChristmas? "textures/blocks/present/presentChest0" : "textures/blocks/present/chest0";
case 1:
return isChristmas? "textures/blocks/present/presentChest1" : "textures/blocks/present/chest1";
case 2:
return isChristmas? "textures/blocks/present/presentChest2" : "textures/blocks/present/chest2";
case 3:
return isChristmas? "textures/blocks/present/presentChest3" : "textures/blocks/present/chest3";
case 4:
return isChristmas? "textures/blocks/present/presentChest4" : "textures/blocks/present/chest4";
case 5:
return isChristmas? "textures/blocks/present/presentChest5" : "textures/blocks/present/chest5";
case 6:
return isChristmas? "textures/blocks/present/presentChest6" : "textures/blocks/present/chest6";
case 7:
return isChristmas? "textures/blocks/present/presentChest7" : "textures/blocks/present/chest7";
case 8:
return isChristmas? "textures/blocks/present/presentChest8" : "textures/blocks/present/chest8";
case 9:
return isChristmas? "textures/blocks/present/presentChest9" : "textures/blocks/present/chest9";
case 10:
return isChristmas? "textures/blocks/present/presentChest10" : "textures/blocks/present/chest10";
case 11:
return isChristmas? "textures/blocks/present/presentChest11" : "textures/blocks/present/chest11";
case 12:
return isChristmas? "textures/blocks/present/presentChest12" : "textures/blocks/present/chest12";
case 13:
return isChristmas? "textures/blocks/present/presentChest13" : "textures/blocks/present/chest13";
case 14:
return isChristmas? "textures/blocks/present/presentChest14" : "textures/blocks/present/chest14";
case 15:
return isChristmas? "textures/blocks/present/presentChest15" : "textures/blocks/present/chest15";
default:
return null;
}
}
@@ -71,58 +109,6 @@ public class BlockPresent extends BlockContainer implements ICarvable {
return true;
}
public ResourceLocation getResourceSingle(int metadata) {
if (isChristmas) {
switch (metadata) {
case 0:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxBlack.png");
case 1:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxBlue.png");
case 2:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxCyan.png");
case 3:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxGreen.png");
case 4:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxOrange.png");
case 5:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxPink.png");
case 6:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxPurple.png");
case 7:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/giftboxYellow.png");
case 8:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/red.png");
default:
return null;
}
} else {
switch (metadata) {
case 1:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/crate.png");
default:
return null;
}
}
}
public ResourceLocation getResourceDouble(int metadata) {
if (isChristmas) {
switch (metadata) {
case 1:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/presentDouble/red.png");
default:
return null;
}
} else {
switch (metadata) {
case 1:
return new ResourceLocation(Chisel.MOD_ID, "textures/blocks/presentDouble/crate.png");
default:
return null;
}
}
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -380,7 +366,7 @@ public class BlockPresent extends BlockContainer implements ICarvable {
@Override
public TileEntity createNewTileEntity(World world, int par2) {
return new TileEntityPresent();
return new TileEntityPresent(type);
}
@Override